Capacitive digital sensor for relative humidity and temperature.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_ST_Sensors MOTENV_Mbed mbed-os-mqtt-client HTS221_JS ... more
Revision 4:9f317607860e, committed 2019-03-04
- Comitter:
- cparata
- Date:
- Mon Mar 04 13:50:28 2019 +0000
- Parent:
- 3:aadcccf527ef
- Child:
- 5:ccf7f36492ae
- Commit message:
- Fix typos
Changed in this revision
HTS221Sensor.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTS221Sensor.h Mon Mar 04 13:06:44 2019 +0000 +++ b/HTS221Sensor.h Mon Mar 04 13:50:28 2019 +0000 @@ -45,6 +45,7 @@ /* Includes ------------------------------------------------------------------*/ #include "DevI2C.h" +#include <SPI.h> #include "HTS221_driver.h" #include "HumiditySensor.h" #include "TempSensor.h" @@ -83,12 +84,12 @@ if (_dev_spi) { /* Write Reg Address */ _dev_spi->lock(); - _cs_pin = 0; + _cs_pin = 0; /* Write RD Reg Address with RD bit*/ - uint8_t TxByte = RegisterAddr | 0x80; + uint8_t TxByte = RegisterAddr | 0x80; _dev_spi->write((char *)&TxByte, 1, (char *)pBuffer, (int) NumByteToRead); _cs_pin = 1; - _dev_spi->unlock(); + _dev_spi->unlock(); return 0; } if (_dev_i2c) return (uint8_t) _dev_i2c->i2c_read(pBuffer, _address, RegisterAddr, NumByteToRead); @@ -121,7 +122,7 @@ /* Helper classes. */ DevI2C *_dev_i2c; - SPI * _dev_spi; + SPI *_dev_spi; /* Configuration */ uint8_t _address;