34#include <util/delay.h>
38static const char *p_system_tag =
"MAIN";
40static uint16_t eco2 = 0;
41static uint16_t etvoc = 0;
45 .drive_mode = drive_mode_1sec,
46 .wake_pin_enabled =
true,
47 .interrupt_dataready =
false,
48 .interrupt_threshold =
false,
56 log_message_with_dec_val(p_system_tag, ERROR,
57 "CCS81 init return code: ", error);
64 log_message_with_16bit_dec_val(p_system_tag, DEBUG,
"eCo2 Level: ", eco2);
67 log_message_with_16bit_dec_val(p_system_tag, DEBUG,
"eTVOC Level: ", etvoc);
uint16_t ccs811_get_etvoc_level(void)
Read eTVOC (equivalent total volatile organic compounds) level from sensor.
uint16_t ccs811_get_eco2_level(void)
Read eCO2 (equivalent carbon dioxide) level from sensor.
uint8_t init_ccs811(ccs811_config_t *p_config)
Initialisation routine (run once at startup).
bool ccs811_data_ready_check(void)
Read the status register and check if the data ready flag is set.
Driver for the CCS811 gas sensor .
void init_log_system(void)
Initialisation routine - call this function once at startup before using other functions.
int main()
Main routine to be executed on the MCU.
Driver file providing logging functionality over USART, to print debug messages and values to a temin...
Config object, to be instantiated and values assigned to members before passing the object address in...