summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Muszytowski <sebastian@muszytowski.net>2016-01-24 22:33:26 +0100
committerSebastian Muszytowski <sebastian@muszytowski.net>2016-01-24 22:33:26 +0100
commit55da79c69f302cd86f0776e127daae0a12f557d4 (patch)
tree952d9b9ce31341fd91914ed82a103c79ff6e1504 /src
parentd6b2c7707b92f6daada2577dac51ba226f7b5046 (diff)
some documentation to ease my understanding in the future
Diffstat (limited to 'src')
-rw-r--r--src/i2c.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/i2c.cc b/src/i2c.cc
index 37af104..cc10b19 100644
--- a/src/i2c.cc
+++ b/src/i2c.cc
@@ -21,6 +21,14 @@ void I2C::enable()
// TODO Everything[tm] (error handling and generic code)
// Also TODO: Use interrupts instead of polling
+/*
+ * This method encapsules both, transmit and read into one function.
+ * Although it could be split into read/write, all reads require a transmit.
+ * Hence this approach reduces code duplication.
+ *
+ * num_tx, num_rx = number of byte to transmit/receive
+ * txbuf, rxbuf = pointer to the uint8_t array for tx/rx
+ */
void I2C::xmit(int num_tx, int num_rx, uint8_t *txbuf, uint8_t *rxbuf)
{
int i;