diff options
Diffstat (limited to 'os/hal/include/i2c.h')
-rw-r--r-- | os/hal/include/i2c.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 01d3739e8..64816186b 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -34,6 +34,7 @@ /* Driver constants. */
/*===========================================================================*/
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -60,10 +61,11 @@ typedef enum { I2C_UNINIT = 0, /**< Not initialized. */
I2C_STOP = 1, /**< Stopped. */
I2C_READY = 2, /**< Ready. */
- I2C_MREADY = 3, /**< START and address sent. */
+ I2C_MACTIVE = 3, /**< START condition sent. */
I2C_MTRANSMIT = 4, /**< Master transmitting. */
I2C_MRECEIVE = 5, /**< Master receiving. */
- I2C_MERROR = 6 /**< Error condition. */
+ I2C_MWAIT_TF = 6, /**< Master wait Transmission Finished */
+ I2C_MERROR = 7 /**< Error condition. */
} i2cstate_t;
#include "i2c_lld.h"
@@ -112,23 +114,23 @@ typedef enum { /*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
-
#ifdef __cplusplus
extern "C" {
#endif
void i2cInit(void);
void i2cObjectInit(I2CDriver *i2cp);
- void i2cStart(I2CDriver *i2cp, const I2CConfig *config);
+ void i2cStart(I2CDriver *i2cp, I2CConfig *config);
void i2cStop(I2CDriver *i2cp);
- void i2cMasterStartI(I2CDriver *i2cp,
- uint16_t header,
- i2ccallback_t callback);
- void i2cMasterStopI(I2CDriver *i2cp, i2ccallback_t callback);
- void i2cMasterRestartI(I2CDriver *i2cp, i2ccallback_t callback);
- void i2cMasterTransmitI(I2CDriver *i2cp, size_t n, const uint8_t *txbuf,
- i2ccallback_t callback);
- void i2cMasterReceiveI(I2CDriver *i2cp, size_t n, uint8_t *rxbuf,
- i2ccallback_t callback);
+ void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg);
+ void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg);
+
+
+
+ void i2cMasterStartI(I2CDriver *i2cp,uint16_t header);
+ void i2cMasterStopI(I2CDriver *i2cp);
+ void i2cMasterRestartI(I2CDriver *i2cp);
+ void i2cMasterTransmitI(I2CDriver *i2cp, size_t n, const uint8_t *txbuf);
+ void i2cMasterReceiveI(I2CDriver *i2cp, size_t n, uint8_t *rxbuf);
#if I2C_USE_MUTUAL_EXCLUSION
void i2cAcquireBus(I2CDriver *i2cp);
void i2cReleaseBus(I2CDriver *i2cp);
|