aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/i2c.h
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-08 13:20:10 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-08 13:20:10 +0000
commit732eaa72c18b9bc6ddb9b6c5ac2294420d14552e (patch)
treeb8a84f945f5eff61e24fd76fd95d94f2b76797bf /os/hal/include/i2c.h
parent60975ca7fed0e2960bced2fe72239422f8376068 (diff)
downloadChibiOS-732eaa72c18b9bc6ddb9b6c5ac2294420d14552e.tar.gz
ChibiOS-732eaa72c18b9bc6ddb9b6c5ac2294420d14552e.tar.bz2
ChibiOS-732eaa72c18b9bc6ddb9b6c5ac2294420d14552e.zip
I2C. Code cleanups.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@2937 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/i2c.h')
-rw-r--r--os/hal/include/i2c.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h
index 6e740cfa9..c3e5c0538 100644
--- a/os/hal/include/i2c.h
+++ b/os/hal/include/i2c.h
@@ -77,11 +77,11 @@
* @brief Driver state machine possible states.
*/
typedef enum {
- I2C_UNINIT = 0, /**< @brief Not initialized. */
- I2C_STOP = 1, /**< @brief Stopped. */
- I2C_READY = 2, /**< @brief Ready. */
- I2C_ACTIVE = 3, /**< @brief In communication. */
- I2C_COMPLETE = 4, /**< @brief Asynchronous operation complete. */
+ I2C_UNINIT = 0, /**< @brief Not initialized. */
+ I2C_STOP = 1, /**< @brief Stopped. */
+ I2C_READY = 2, /**< @brief Ready. */
+ I2C_ACTIVE = 3, /**< @brief In communication. */
+ I2C_COMPLETE = 4, /**< @brief Asynchronous operation complete. */
// slave part
I2C_SACTIVE = 10,
@@ -150,12 +150,12 @@ struct I2CSlaveConfig{
/**
* @brief Receive and transmit buffers.
*/
- size_t tx_remaining_bytes;
- size_t rx_remaining_bytes;
- i2cblock_t *rxbuf;/*!< Pointer to receive buffer. */
- i2cblock_t *txbuf;/*!< Pointer to transmit buffer.*/
+ size_t tx_bytes;
+ size_t rx_bytes;
+ i2cblock_t *rxbuf; /*!< Pointer to receive buffer. */
+ i2cblock_t *txbuf; /*!< Pointer to transmit buffer.*/
uint16_t slave_addr;
- uint8_t nbit_address;
+ uint8_t nbit_address; /*!< Length of address (must be 7 or 10).*/
i2cflags_t errors;
i2cflags_t flags;
/* Status Change @p EventSource.*/
@@ -224,10 +224,10 @@ struct I2CSlaveConfig{
*/
#define _i2c_isr_code(i2cp, i2cscfg) { \
(i2cp)->id_state = I2C_COMPLETE; \
- if(((i2cp)->id_slave_config)->id_callback) { \
- ((i2cp)->id_slave_config)->id_callback(i2cp, i2cscfg); \
- } \
- _i2c_wakeup_isr(i2cp); \
+ if(((i2cp)->id_slave_config)->id_callback) { \
+ ((i2cp)->id_slave_config)->id_callback(i2cp, i2cscfg); \
+ } \
+ _i2c_wakeup_isr(i2cp); \
}
/*===========================================================================*/