I2C. Revert const qualifier to the pointer to I2CSlaveConfig.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3310 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
barthess 2011-09-12 15:50:35 +00:00
parent 7148a664b5
commit d3e15bccfc
4 changed files with 9 additions and 8 deletions

View File

@ -105,7 +105,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);
/**
@ -116,7 +116,8 @@ 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);
/**
@ -255,11 +256,11 @@ extern "C" {
void i2cObjectInit(I2CDriver *i2cp);
void i2cStart(I2CDriver *i2cp, const I2CConfig *config);
void i2cStop(I2CDriver *i2cp);
void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg,
void i2cMasterTransmit(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg,
uint16_t slave_addr,
uint8_t *txbuf, size_t txbytes,
uint8_t *rxbuf, size_t rxbytes);
void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg,
void i2cMasterReceive(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg,
uint16_t slave_addr, uint8_t *rxbuf, size_t rxbytes);
void i2cMasterStart(I2CDriver *i2cp);
void i2cMasterStop(I2CDriver *i2cp);

View File

@ -40,7 +40,7 @@
* Note:
* When the STOP, START or PEC bit is set, the software must NOT perform
* any write access to I2C_CR1 before this bit is cleared by hardware.
* Otherwise there is a risk of setting a second STOP, START or PEC request.
* Otherwise there is a risk of setting a second STOP, START or PEC request.
*/
/*===========================================================================*/

View File

@ -212,7 +212,7 @@ struct I2CDriver{
/**
* @brief Current slave configuration data.
*/
I2CSlaveConfig *id_slave_config;
const I2CSlaveConfig *id_slave_config;
__IO size_t txbytes; /*!< @brief Number of bytes to be transmitted. */
__IO size_t rxbytes; /*!< @brief Number of bytes to be received. */

View File

@ -166,7 +166,7 @@ void i2cStop(I2CDriver *i2cp) {
* you want transmit only
*/
void i2cMasterTransmit(I2CDriver *i2cp,
I2CSlaveConfig *i2cscfg,
const I2CSlaveConfig *i2cscfg,
uint16_t slave_addr,
uint8_t *txbuf,
size_t txbytes,
@ -210,7 +210,7 @@ void i2cMasterTransmit(I2CDriver *i2cp,
* @param[in] rxbuf pointer to receive buffer
*/
void i2cMasterReceive(I2CDriver *i2cp,
I2CSlaveConfig *i2cscfg,
const I2CSlaveConfig *i2cscfg,
uint16_t slave_addr,
uint8_t *rxbuf,
size_t rxbytes){