44 #include <avr/pgmspace.h>
45 #include <avr/sleep.h>
48 #include <avr/eeprom.h>
49 #include "dev/watchdog.h"
52 #include "co2_sa_kxx-sensor.h"
60 configure(
int type,
int c)
74 i2c_start_wait(I2C_CO2SA_ADDR | I2C_WRITE);
82 if(var == CO2_SA_KXX_CO2) {
87 if(var == CO2_SA_KXX_TEMP) {
92 if(var == CO2_SA_KXX_RH) {
106 i2c_start(I2C_CO2SA_ADDR | I2C_READ);
113 status = i2c_readAck();
115 if((status & 0x01) == 0)
118 buf[0] = i2c_readAck();
119 buf[1] = i2c_readAck();
120 csum = i2c_readNak();
123 val = ((int16_t)(buf[0] << 8)) | buf[1];
131 SENSORS_SENSOR(co2_sa_kxx_sensor,
"CO2", value, configure, status);
void clock_delay_msec(uint16_t howlong)
Delay up to 65535 milliseconds.
Linked list manipulation routines.
Memory block allocation routines.