ndirco2 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ ndirco2_cfg_setup()

void ndirco2_cfg_setup ( ndirco2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ndirco2_check_alarm()

uint8_t ndirco2_check_alarm ( ndirco2_t * ctx)

CO2 Concentration Limit Check function.

Parameters
ctxClick object.
Returns
0 - the CO2 concentration drops below ten times the value of Low Alarm Threshold register 1 - the CO2 concentration goes above ten times the value of High Alarm Threshold register

@description Function checks is CO2 concentration cross limit value, and when that happens then generates interrupt (ALARM pin).

◆ ndirco2_check_average_complete()

uint8_t ndirco2_check_average_complete ( ndirco2_t * ctx)

Average Complete Check function.

Parameters
ctxClick object.
Returns
0 - averaging operation not completed yet, 1 - averaging operation completed

@description Function checks is number of measurements exceeded determined value (averaging operation is completed).

◆ ndirco2_check_busy()

uint8_t ndirco2_check_busy ( ndirco2_t * ctx)

Data Ready Check function.

Parameters
ctxClick object.
Returns
0 - data readable, 1 - busy state

@description Function checks is data ready for reading by checking state of Busy pin.

◆ ndirco2_generic_read()

void ndirco2_generic_read ( ndirco2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ ndirco2_generic_write()

void ndirco2_generic_write ( ndirco2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ ndirco2_init()

NDIRCO2_RETVAL ndirco2_init ( ndirco2_t * ctx,
ndirco2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ ndirco2_read_co2()

void ndirco2_read_co2 ( ndirco2_t * ctx,
uint8_t set_check_mode,
uint16_t * output_data )

CO2 Concentration Read function.

Parameters
ctxClick object.
set_check_mode0 - 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_dataBuffer 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.

◆ ndirco2_read_current_address()

void ndirco2_read_current_address ( ndirco2_t * ctx,
uint8_t * data_out,
uint8_t n_bytes )

Current Address Read function.

Parameters
ctxClick object.
data_outBuffer where data be stored
n_bytesNumber of bytes which be read

@description Function reads one byte data from the last accessed address + 1.

◆ ndirco2_read_register()

uint8_t ndirco2_read_register ( ndirco2_t * ctx,
uint8_t register_address,
uint16_t * data_out )

Generic Read function.

Parameters
ctxClick object.
register_addressAddress which from data be read
data_outBuffer where data be stored
Returns
0 - OK, 1 - wrong address parameter

@description Function reads data from register.

◆ ndirco2_reset()

void ndirco2_reset ( ndirco2_t * ctx)

Software Reset function.

Parameters
ctxClick object.

@description Function performs reset of device and after that puts device in power down mode when reset is done.

◆ ndirco2_set_mode()

void ndirco2_set_mode ( ndirco2_t * ctx,
uint8_t select_mode )

Mode Set function.

Parameters
ctxClick object.
select_mode0 - power down mode, 1 (value different from zero) - continuous operating mode

@desription Function puts device in desired mode (power down or continuous operating mode).

◆ ndirco2_write_register()

uint8_t ndirco2_write_register ( ndirco2_t * ctx,
uint8_t register_address,
uint8_t transfer_data )

Generic Write function.

Parameters
ctxClick object.
register_addressAddress where data be written
transfer_dataData which be written
Returns
0 - OK, 1 - wrong address parameter

@description Function writes one byte data to register.