diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-01-30 23:28:02 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-01-30 23:28:02 +0000 |
commit | 25d42f8b9061f28f553e42afd0d7835a47bbb9c3 (patch) | |
tree | 392760f5bb19c9896f77185138958cd86390c240 /os/hal/platforms/STM32/i2c_lld.h | |
parent | 47cd88dcc6eba547ffadbea2981ddc8a6729a15a (diff) | |
download | ChibiOS-25d42f8b9061f28f553e42afd0d7835a47bbb9c3.tar.gz ChibiOS-25d42f8b9061f28f553e42afd0d7835a47bbb9c3.tar.bz2 ChibiOS-25d42f8b9061f28f553e42afd0d7835a47bbb9c3.zip |
I2C. Master receiving and master trasmitting written. Needs testing and debugging.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@2699 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/i2c_lld.h')
-rw-r--r-- | os/hal/platforms/STM32/i2c_lld.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.h b/os/hal/platforms/STM32/i2c_lld.h index 1b684a167..bac1dfff0 100644 --- a/os/hal/platforms/STM32/i2c_lld.h +++ b/os/hal/platforms/STM32/i2c_lld.h @@ -90,17 +90,21 @@ typedef struct I2CSlaveConfig I2CSlaveConfig; /** * @brief I2C notification callback type. + * @details This function must be used to send start or stop events to I2C bus, + * and change states of I2CDriver. * - * @param[in] i2cp FIXME: pointer to the @p I2CDriver object triggering the + * @param[in] i2cp pointer to the @p I2CDriver object triggering the + * callback + * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object triggering the * callback */ typedef void (*i2ccallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); -//typedef void (*i2ccallback_t)(void); + /** * @brief I2C error notification callback type. * - * @param[in] i2cp FIXME: pointer to the @p I2CDriver object triggering the + * @param[in] i2cp TODO: pointer to the @p I2CDriver object triggering the * callback */ typedef void (*i2cerrorcallback_t)(void); @@ -143,8 +147,7 @@ struct I2CSlaveConfig{ * by DMA buffer events * @p NULL then the callback is disabled. */ - i2ccallback_t id_stop_callback; - i2ccallback_t id_restart_callback; + i2ccallback_t id_callback; /** * @brief Callback pointer. * @note TODO: I don't know, when this callback is inwoked @@ -242,17 +245,17 @@ extern "C" { void i2c_lld_init(void); void i2c_lld_start(I2CDriver *i2cp); void i2c_lld_stop(I2CDriver *i2cp); -void i2c_lld_master_start(I2CDriver *i2cp, uint16_t header); + +void i2c_lld_master_start(I2CDriver *i2cp); void i2c_lld_master_stop(I2CDriver *i2cp); void i2c_lld_master_transmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg, bool_t restart); -bool_t i2c_lld_txbyte(I2CDriver *i2cp); // helper function void i2c_lld_master_transmitI(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); +bool_t i2c_lld_txbyte(I2CDriver *i2cp); // helper function void i2c_lld_master_receive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); void i2c_lld_master_receiveI(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); bool_t i2c_lld_rxbyte(I2CDriver *i2cp); -//static i2cflags_t translate_errors(uint16_t sr); #ifdef __cplusplus } |