diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-21 20:17:14 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-21 20:17:14 +0000 |
commit | 70179f12dd387a82493d13fd51d5aab7e4e55674 (patch) | |
tree | ead37a5e698acfac0a69cb3247351561bc38efe0 /testhal/STM32/I2C/tmp75.c | |
parent | b54133ab1beba9d2923450d1d5f1b2c73dc2afa3 (diff) | |
download | ChibiOS-70179f12dd387a82493d13fd51d5aab7e4e55674.tar.gz ChibiOS-70179f12dd387a82493d13fd51d5aab7e4e55674.tar.bz2 ChibiOS-70179f12dd387a82493d13fd51d5aab7e4e55674.zip |
I2C. Slave config structure now have const qualifier. Moset of fields moved to the driver structure. May be broken events subsystem in driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3067 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/I2C/tmp75.c')
-rw-r--r-- | testhal/STM32/I2C/tmp75.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/testhal/STM32/I2C/tmp75.c b/testhal/STM32/I2C/tmp75.c index e5f502e23..6744fe325 100644 --- a/testhal/STM32/I2C/tmp75.c +++ b/testhal/STM32/I2C/tmp75.c @@ -34,22 +34,23 @@ static void i2c_tmp75_cb(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg){ }
// Fill TMP75 config.
-static I2CSlaveConfig tmp75 = {
+static const I2CSlaveConfig tmp75 = {
i2c_tmp75_cb,
i2c_tmp75_error_cb,
tmp75_rx_data,
tmp75_tx_data,
- 0b1001000,
{NULL},
};
+#define tmp75_addr 0b1001000
+
/* This is main function. */
void request_temperature(void){
#define TXBYTES 0 // set to zero because we need only reading
#define RXBYTES 2 // we need to read 2 bytes
i2cAcquireBus(&I2CD2);
- i2cMasterReceive(&I2CD2, &tmp75, RXBYTES);
+ i2cMasterReceive(&I2CD2, &tmp75, tmp75_addr, RXBYTES);
i2cReleaseBus(&I2CD2);
}
|