ndirco2 2.0.0.0
|
Functions | |
void | ndirco2_cfg_setup (ndirco2_cfg_t *cfg) |
Config Object Initialization function. | |
NDIRCO2_RETVAL | ndirco2_init (ndirco2_t *ctx, ndirco2_cfg_t *cfg) |
Initialization function. | |
void | ndirco2_generic_write (ndirco2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | ndirco2_generic_read (ndirco2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | ndirco2_read_register (ndirco2_t *ctx, uint8_t register_address, uint16_t *data_out) |
Generic Read function. | |
uint8_t | ndirco2_write_register (ndirco2_t *ctx, uint8_t register_address, uint8_t transfer_data) |
Generic Write function. | |
void | ndirco2_read_current_address (ndirco2_t *ctx, uint8_t *data_out, uint8_t n_bytes) |
Current Address Read function. | |
void | ndirco2_read_co2 (ndirco2_t *ctx, uint8_t set_check_mode, uint16_t *output_data) |
CO2 Concentration Read function. | |
uint8_t | ndirco2_check_busy (ndirco2_t *ctx) |
Data Ready Check function. | |
uint8_t | ndirco2_check_average_complete (ndirco2_t *ctx) |
Average Complete Check function. | |
void | ndirco2_set_mode (ndirco2_t *ctx, uint8_t select_mode) |
Mode Set function. | |
void | ndirco2_reset (ndirco2_t *ctx) |
Software Reset function. | |
uint8_t | ndirco2_check_alarm (ndirco2_t *ctx) |
CO2 Concentration Limit Check function. | |
void ndirco2_cfg_setup | ( | ndirco2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t ndirco2_check_alarm | ( | ndirco2_t * | ctx | ) |
CO2 Concentration Limit Check function.
ctx | Click object. |
@description Function checks is CO2 concentration cross limit value, and when that happens then generates interrupt (ALARM pin).
uint8_t ndirco2_check_average_complete | ( | ndirco2_t * | ctx | ) |
Average Complete Check function.
ctx | Click object. |
@description Function checks is number of measurements exceeded determined value (averaging operation is completed).
uint8_t ndirco2_check_busy | ( | ndirco2_t * | ctx | ) |
Data Ready Check function.
ctx | Click object. |
@description Function checks is data ready for reading by checking state of Busy pin.
void ndirco2_generic_read | ( | ndirco2_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 |
@description This function reads data from the desired register.
void ndirco2_generic_write | ( | ndirco2_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. |
@description This function writes data to the desired register.
NDIRCO2_RETVAL ndirco2_init | ( | ndirco2_t * | ctx, |
ndirco2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void ndirco2_read_co2 | ( | ndirco2_t * | ctx, |
uint8_t | set_check_mode, | ||
uint16_t * | output_data ) |
CO2 Concentration Read function.
ctx | Click object. |
set_check_mode | 0 - reads data after each measurement when data is ready to be read 1 - reads data after number of measurements determined by AVE register + 1 |
output_data | Buffer where 15-bit CO2 concentration data be stored |
@description Function reads 15-bit CO2 concentration data from data registers only when data is ready for reading after each measurement or after number of measurements determined by AVE register + 1.
void ndirco2_read_current_address | ( | ndirco2_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | n_bytes ) |
Current Address Read function.
ctx | Click object. |
data_out | Buffer where data be stored |
n_bytes | Number of bytes which be read |
@description Function reads one byte data from the last accessed address + 1.
uint8_t ndirco2_read_register | ( | ndirco2_t * | ctx, |
uint8_t | register_address, | ||
uint16_t * | data_out ) |
Generic Read function.
ctx | Click object. |
register_address | Address which from data be read |
data_out | Buffer where data be stored |
@description Function reads data from register.
void ndirco2_reset | ( | ndirco2_t * | ctx | ) |
Software Reset function.
ctx | Click object. |
@description Function performs reset of device and after that puts device in power down mode when reset is done.
void ndirco2_set_mode | ( | ndirco2_t * | ctx, |
uint8_t | select_mode ) |
Mode Set function.
ctx | Click object. |
select_mode | 0 - power down mode, 1 (value different from zero) - continuous operating mode |
@desription Function puts device in desired mode (power down or continuous operating mode).
uint8_t ndirco2_write_register | ( | ndirco2_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | transfer_data ) |
Generic Write function.
ctx | Click object. |
register_address | Address where data be written |
transfer_data | Data which be written |
@description Function writes one byte data to register.