airquality9 2.0.0.0
|
API for configuring and manipulating Air Quality 9 Click driver. More...
Topics | |
Air Quality 9 Registers List | |
List of registers of Air Quality 9 Click driver. | |
Air Quality 9 Registers Settings | |
Settings for registers of Air Quality 9 Click driver. | |
Air Quality 9 MikroBUS Map | |
MikroBUS pin mapping of Air Quality 9 Click driver. | |
Functions | |
void | airquality9_cfg_setup (airquality9_cfg_t *cfg) |
Air Quality 9 configuration object setup function. | |
void | airquality9_drv_interface_selection (airquality9_cfg_t *cfg, airquality9_drv_t drv_sel) |
Air Quality 9 driver interface setup function. | |
err_t | airquality9_init (airquality9_t *ctx, airquality9_cfg_t *cfg) |
Air Quality 9 initialization function. | |
err_t | airquality9_default_cfg (airquality9_t *ctx) |
Air Quality 9 default configuration function. | |
err_t | airquality9_generic_write (airquality9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Air Quality 9 data writing function. | |
err_t | airquality9_generic_read (airquality9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Air Quality 9 data reading function. | |
void | airquality9_enable_device (airquality9_t *ctx) |
Air Quality 9 enable device function. | |
void | airquality9_disable_device (airquality9_t *ctx) |
Air Quality 9 disable device function. | |
uint8_t | airquality9_get_int_pin (airquality9_t *ctx) |
Air Quality 9 get int pin function. | |
err_t | airquality9_check_communication (airquality9_t *ctx) |
Air Quality 9 check communication function. | |
err_t | airquality9_set_operating_mode (airquality9_t *ctx, uint8_t opmode) |
Air Quality 9 set operating mode function. | |
err_t | airquality9_set_interrupt_config (airquality9_t *ctx, uint8_t int_cfg) |
Air Quality 9 set interrupt config function. | |
err_t | airquality9_read_status (airquality9_t *ctx, uint8_t *status) |
Air Quality 9 read status function. | |
err_t | airquality9_read_aqi_uba (airquality9_t *ctx, uint8_t *aqi_uba) |
Air Quality 9 read aqi uba function. | |
err_t | airquality9_read_tvoc (airquality9_t *ctx, uint16_t *tvoc) |
Air Quality 9 read tvoc function. | |
err_t | airquality9_read_eco2 (airquality9_t *ctx, uint16_t *eco2) |
Air Quality 9 read eco2 function. | |
API for configuring and manipulating Air Quality 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void airquality9_cfg_setup | ( | airquality9_cfg_t * | cfg | ) |
Air Quality 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See airquality9_cfg_t object definition for detailed explanation. |
err_t airquality9_check_communication | ( | airquality9_t * | ctx | ) |
Air Quality 9 check communication function.
This function checks the communication by reading and verifying the chip part ID.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_default_cfg | ( | airquality9_t * | ctx | ) |
Air Quality 9 default configuration function.
This function executes a default configuration of Air Quality 9 click board.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
0
- Success, -1
- Error.void airquality9_disable_device | ( | airquality9_t * | ctx | ) |
Air Quality 9 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
void airquality9_drv_interface_selection | ( | airquality9_cfg_t * | cfg, |
airquality9_drv_t | drv_sel ) |
Air Quality 9 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See airquality9_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See airquality9_drv_t object definition for detailed explanation. |
void airquality9_enable_device | ( | airquality9_t * | ctx | ) |
Air Quality 9 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
err_t airquality9_generic_read | ( | airquality9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Air Quality 9 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_generic_write | ( | airquality9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Air Quality 9 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t airquality9_get_int_pin | ( | airquality9_t * | ctx | ) |
Air Quality 9 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
err_t airquality9_init | ( | airquality9_t * | ctx, |
airquality9_cfg_t * | cfg ) |
Air Quality 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See airquality9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t airquality9_read_aqi_uba | ( | airquality9_t * | ctx, |
uint8_t * | aqi_uba ) |
Air Quality 9 read aqi uba function.
This function reads the Air Quality Index per UBA (AQI-UBA).
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[out] | aqi_uba | : AQI-UBA value [1-5]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_read_eco2 | ( | airquality9_t * | ctx, |
uint16_t * | eco2 ) |
Air Quality 9 read eco2 function.
This function reads the calculated Equivalent CO2 (eCO2) concentration per ppm.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[out] | eco2 | : eCO2 per ppm [400-65000]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_read_status | ( | airquality9_t * | ctx, |
uint8_t * | status ) |
Air Quality 9 read status function.
This function reads the data status register.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[out] | status | : Data status register value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_read_tvoc | ( | airquality9_t * | ctx, |
uint16_t * | tvoc ) |
Air Quality 9 read tvoc function.
This function reads the calculated Total Volatile Organic Compounds (TVOC) concentration per ppb.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[out] | tvoc | : TVOC per ppb [0-65000]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_set_interrupt_config | ( | airquality9_t * | ctx, |
uint8_t | int_cfg ) |
Air Quality 9 set interrupt config function.
This function sets the interrupt config register.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[in] | int_cfg | : Interrupt config register value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airquality9_set_operating_mode | ( | airquality9_t * | ctx, |
uint8_t | opmode ) |
Air Quality 9 set operating mode function.
This function sets the device operating mode.
[in] | ctx | : Click context object. See airquality9_t object definition for detailed explanation. |
[in] | opmode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation.