aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/I2C/tmp75.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-21 18:30:50 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-21 18:30:50 +0000
commitb54133ab1beba9d2923450d1d5f1b2c73dc2afa3 (patch)
tree035bf75674c3919bf7c5d870b11ed6eb3ad2f597 /testhal/STM32/I2C/tmp75.c
parent30c130dc10cd5f890c2ad534b97de1ceb2182d0a (diff)
downloadChibiOS-b54133ab1beba9d2923450d1d5f1b2c73dc2afa3.tar.gz
ChibiOS-b54133ab1beba9d2923450d1d5f1b2c73dc2afa3.tar.bz2
ChibiOS-b54133ab1beba9d2923450d1d5f1b2c73dc2afa3.zip
I2C. Some fields from I2CSlaveConfig moved to driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3066 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/I2C/tmp75.c')
-rw-r--r--testhal/STM32/I2C/tmp75.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/testhal/STM32/I2C/tmp75.c b/testhal/STM32/I2C/tmp75.c
index 80aa352ee..e5f502e23 100644
--- a/testhal/STM32/I2C/tmp75.c
+++ b/testhal/STM32/I2C/tmp75.c
@@ -37,23 +37,19 @@ static void i2c_tmp75_cb(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg){
static I2CSlaveConfig tmp75 = {
i2c_tmp75_cb,
i2c_tmp75_error_cb,
- 0,
- 0,
tmp75_rx_data,
tmp75_tx_data,
0b1001000,
- 0,
- 0,
{NULL},
};
/* This is main function. */
void request_temperature(void){
- tmp75.txbytes = 0; // set to zero because we need only reading
- tmp75.rxbytes = 2; // we need to read 2 bytes
+#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);
+ i2cMasterReceive(&I2CD2, &tmp75, RXBYTES);
i2cReleaseBus(&I2CD2);
}