diff options
Diffstat (limited to 'os/hal/include/i2c.h')
-rw-r--r-- | os/hal/include/i2c.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index c46e7f096..ba7131c26 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -103,7 +103,7 @@ typedef enum { * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object triggering the
* callback
*/
-typedef void (*i2ccallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg);
+typedef void (*i2ccallback_t)(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg);
/**
@@ -114,7 +114,7 @@ typedef void (*i2ccallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object triggering the
* callback
*/
-typedef void (*i2cerrorcallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg);
+typedef void (*i2cerrorcallback_t)(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg);
/**
@@ -143,20 +143,8 @@ struct I2CSlaveConfig{ */
i2cerrorcallback_t id_err_callback;
-// size_t txbytes; /*!< Number of bytes to transmitted. */
-// size_t rxbytes; /*!< Number of bytes to received. */
i2cblock_t *rxbuf; /*!< Pointer to receive buffer. */
i2cblock_t *txbuf; /*!< Pointer to transmit buffer.*/
- /**
- * @brief Slave device address.
- * @details Bits 0-9 contain slave device address.
- *
- * Bit 15 must be set to 1 if 10-bit addressing modes used. Otherwise
- * keep it cleared.
- *
- * Bits 10-14 unused.
- */
- uint16_t slave_addr;
/* Status Change @p EventSource.*/
EventSource sevent;
@@ -240,8 +228,8 @@ extern "C" { void i2cObjectInit(I2CDriver *i2cp);
void i2cStart(I2CDriver *i2cp, const I2CConfig *config);
void i2cStop(I2CDriver *i2cp);
- void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg, size_t txbytes, size_t rxbytes);
- void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg, size_t rxbytes);
+ void i2cMasterTransmit(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, size_t txbytes, size_t rxbytes);
+ void i2cMasterReceive(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, size_t rxbytes);
void i2cMasterStart(I2CDriver *i2cp);
void i2cMasterStop(I2CDriver *i2cp);
void i2cAddFlagsI(I2CDriver *i2cp, i2cflags_t mask);
|