co2
2.0.0.0
|
Functions | |
void | co2_cfg_setup (co2_cfg_t *cfg) |
Config Object Initialization function. More... | |
CO2_RETVAL | co2_init (co2_t *ctx, co2_cfg_t *cfg) |
Initialization function. More... | |
uint8_t | co2_generic_write (co2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
uint8_t | co2_generic_read (co2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
void | co2_wait_i2c_ready (co2_t *ctx) |
Generic read function. More... | |
void | co2_enable (co2_t *ctx, uint8_t state) |
Device Enable function. More... | |
void | co2_read_adc (co2_t *ctx, uint16_t *data_out) |
Read ADC Data function. More... | |
void | co2_get_co2_ppm (co2_t *ctx, float *co2_data) |
Get CO Data function. More... | |
void co2_cfg_setup | ( | co2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void co2_enable | ( | co2_t * | ctx, |
uint8_t | state | ||
) |
Device Enable function.
ctx | Click object. |
state | 0 - enable, value different from 0 - disable |
Function puts the device to enabled or to disabled state.
uint8_t co2_generic_read | ( | co2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len | ||
) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
This function reads data from the desired register.
uint8_t co2_generic_write | ( | co2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len | ||
) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
This function writes data to the desired register.
void co2_get_co2_ppm | ( | co2_t * | ctx, |
float * | co2_data | ||
) |
Get CO Data function.
ctx | Click object. |
co_data | Memory where CO data from the device be stored |
Function reads the CO converted data and calculates this value to the ppm.
CO2_RETVAL co2_init | ( | co2_t * | ctx, |
co2_cfg_t * | cfg | ||
) |
Initialization function.
co2 | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void co2_read_adc | ( | co2_t * | ctx, |
uint16_t * | data_out | ||
) |
Read ADC Data function.
ctx | Click object. |
data_out | Buffer where the converted data be stored |
Function reads the converted data (CO) from the 12-bit AD converter.
void co2_wait_i2c_ready | ( | co2_t * | ctx | ) |
Generic read function.
ctx | Click object. |
Function waits until I2C is ready for the next command.