From 55da79c69f302cd86f0776e127daae0a12f557d4 Mon Sep 17 00:00:00 2001 From: Sebastian Muszytowski Date: Sun, 24 Jan 2016 22:33:26 +0100 Subject: some documentation to ease my understanding in the future --- src/i2c.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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; -- cgit v1.2.3