HTS221 Init and Deinit Sensor
I am working with HTS221 Humidity and Temperature sensor on STM32L4 IoT node eval board. So far its working fine as far as inint and read data apis are concerned. However i have couple of questions reagarding de_init (disable) the sensor i.e putting it in power down mode.
- Below is the code i am using to de_init the sensor
status_t de_init(int8_t DeviceAddr){
uint8_t tmp;
tmp = SENSOR_IO_Read(DeviceAddr, HTS221_CTRL_REG1);
/* HTS221 in power down */
tmp &= ~HTS221_PD_MASK;
/* ake HTS221 boot */
tmp &= ~HTS221_BOOT_BIT;
SENSOR_IO_Write(DeviceAddr, HTS221_CTRL_REG1, tmp);
}After executing this i start getting constant temperature/humidity value whenever i read from sensor. I understood that the sensor is power down mode and receving last stored (before power down) values from control registerd. Do we need to clear the control registers as well ? How to do that. ?
2. Is there any way to only disable humidity or temperature alone. Currently If I put it in power down mode i cannot read either of the sensor values. Please correct me if my understanding is wrong, I am new to driver level programming.
