Library for Silicon Labs Si7006 digital temperature and humidity chip.
Dependents: acd52832_Humidity_Temp_Example iBeacon acnsensa acnSENSA
Revision 2:7c3c7db34528, committed 2017-09-26
- Comitter:
- jurica238814
- Date:
- Tue Sep 26 12:04:12 2017 +0000
- Parent:
- 1:155934570c14
- Commit message:
- I2C object replaced by I2C reference.
Changed in this revision
Si7006A20.cpp | Show annotated file Show diff for this revision Revisions of this file |
Si7006A20.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 155934570c14 -r 7c3c7db34528 Si7006A20.cpp --- a/Si7006A20.cpp Mon Sep 25 10:21:52 2017 +0000 +++ b/Si7006A20.cpp Tue Sep 26 12:04:12 2017 +0000 @@ -41,8 +41,9 @@ char cmd_id_2[] = {0xFC, 0xC9}; char cmd_fw_ver[] = {0x84, 0xB8}; -Si7006::Si7006(PinName sda, PinName scl): i2c(sda, scl, (char)I2C_ADDR){ - // Constructor + +Si7006::Si7006(I2C *i2c) : i2c(i2c, char(I2C_ADDR)){ + } uint8_t Si7006::getElectronicId(char* id){
diff -r 155934570c14 -r 7c3c7db34528 Si7006A20.h --- a/Si7006A20.h Mon Sep 25 10:21:52 2017 +0000 +++ b/Si7006A20.h Tue Sep 26 12:04:12 2017 +0000 @@ -43,14 +43,12 @@ RH_10b_TEMP_13b = 0x2, ///< 10 bits for RH, 13 bits for Temp RH_11b_TEMP_11b = 0x3, ///< 11 bits for RH, 11 bits for Temp } resolution_t; - + /** - * Si7006 constructor. + * Si7006 constructor * - * @param sda mbed pin to use for SDA line of I2C interface. - * @param scl mbed pin to use for SCL line of I2C interface. */ - Si7006(PinName sda, PinName scl); + Si7006(I2C *ic2); /** * @brief Get Electronic ID.