co2
2.0.0.0
|
API for configuring and manipulating CO2 Click driver. More...
Modules | |
CO2 Registers List | |
List of registers of CO2 Click driver. | |
CO2 Registers Settings | |
Settings for registers of CO2 Click driver. | |
CO2 MikroBUS Map | |
MikroBUS pin mapping of CO2 Click driver. | |
Functions | |
void | co2_cfg_setup (co2_cfg_t *cfg) |
CO2 configuration object setup function. More... | |
err_t | co2_init (co2_t *ctx, co2_cfg_t *cfg) |
CO2 initialization function. More... | |
err_t | co2_default_cfg (co2_t *ctx) |
CO2 default configuration function. More... | |
err_t | co2_generic_write (co2_t *ctx, uint16_t reg, uint16_t *tx_buf, uint8_t tx_len) |
CO2 I2C writing function. More... | |
err_t | co2_generic_read (co2_t *ctx, uint16_t reg, uint16_t *rx_buf, uint8_t rx_len) |
CO2 I2C reading function. More... | |
err_t | co2_reset (co2_t *ctx) |
Reset device. More... | |
err_t | co2_get_id (co2_t *ctx) |
Read device and serial ID's. More... | |
err_t | co2_set_reference (co2_t *ctx, uint16_t humidity, uint16_t pressure) |
Set device refrence values for gas calculation. More... | |
err_t | co2_read_gas (co2_t *ctx, float *gas_concentration, float *temperature) |
Read CO2 concentration and temperature value. More... | |
err_t | co2_disable_crc (co2_t *ctx) |
Disable use of CRC. More... | |
API for configuring and manipulating CO2 Click driver.
void co2_cfg_setup | ( | co2_cfg_t * | cfg | ) |
CO2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See co2_cfg_t object definition for detailed explanation. |
err_t co2_default_cfg | ( | co2_t * | ctx | ) |
CO2 default configuration function.
This function executes a default configuration of CO2 click board.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
0
- Success, -1
- Error. -2
- Error self-test.err_t co2_disable_crc | ( | co2_t * | ctx | ) |
Disable use of CRC.
This function sends command to disable crc data for device.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t co2_generic_read | ( | co2_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
CO2 I2C reading function.
This function reads a desired number of data starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of words to be read. |
0
- Success, -1
- Error, -3
- CRC Error.err_t co2_generic_write | ( | co2_t * | ctx, |
uint16_t | reg, | ||
uint16_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
CO2 I2C writing function.
This function writes a desired number of data starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of words to be written. |
0
- Success, -1
- Error.err_t co2_get_id | ( | co2_t * | ctx | ) |
Read device and serial ID's.
This function reads device and serial ID's and set places that data in the context object.
[in,out] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
0
- Success, -1
- Error.CO2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See co2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t co2_read_gas | ( | co2_t * | ctx, |
float * | gas_concentration, | ||
float * | temperature | ||
) |
Read CO2 concentration and temperature value.
This function reads CO2 gas concentration and temperature from device.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
[out] | gas_concentration | : CO2 concentartion data in %. |
[out] | temperature | : Temperature data in degC. |
0
- Success, -1
- Error.err_t co2_reset | ( | co2_t * | ctx | ) |
Reset device.
This function sends command to reset device.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
0
- Success, -1
- Error. err_t co2_set_reference | ( | co2_t * | ctx, |
uint16_t | humidity, | ||
uint16_t | pressure | ||
) |
Set device refrence values for gas calculation.
This function set reference values for device to calculate gas concetration. If reference values aren't set device will look at them like 0.
[in] | ctx | : Click context object. See co2_t object definition for detailed explanation. |
[in] | humidity | : Humidity value in %. |
[in] | pressure | : Pressure value in mBar. |
0
- Success, -1
- Error.