smoke2 2.0.0.0
|
API for configuring and manipulating Smoke 2 Click driver. More...
Topics | |
Smoke 2 Registers List | |
List of registers of Smoke 2 Click driver. | |
Smoke 2 Registers Settings | |
Settings for registers of Smoke 2 Click driver. | |
Smoke 2 MikroBUS Map | |
MikroBUS pin mapping of Smoke 2 Click driver. | |
Functions | |
void | smoke2_cfg_setup (smoke2_cfg_t *cfg) |
Smoke 2 configuration object setup function. | |
void | smoke2_drv_interface_selection (smoke2_cfg_t *cfg, smoke2_drv_t drv_sel) |
Smoke 2 driver interface setup function. | |
err_t | smoke2_init (smoke2_t *ctx, smoke2_cfg_t *cfg) |
Smoke 2 initialization function. | |
void | smoke2_default_cfg (smoke2_t *ctx) |
Smoke 2 default configuration function. | |
err_t | smoke2_generic_write (smoke2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Smoke 2 data writing function. | |
err_t | smoke2_generic_read (smoke2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Smoke 2 data reading function. | |
uint8_t | smoke2_get_int_pin (smoke2_t *ctx) |
Smoke 2 get state of int pin function. | |
void | smoke2_write_data (smoke2_t *ctx, uint8_t reg, uint16_t tx_data) |
Smoke 2 generic function for writing data to register function. | |
uint16_t | smoke2_read_data (smoke2_t *ctx, uint8_t reg) |
Smoke 2 generic function for reading data from registar. | |
void | smoke2_set_bit (smoke2_t *ctx, uint8_t reg, uint8_t bit_num, uint8_t val) |
Smoke 2 generic function for writing bit state. | |
uint8_t | smoke2_get_bit (smoke2_t *ctx, uint8_t reg, uint8_t bit_num) |
Smoke 2 generic function for reading bit state. | |
void | smoke2_set_mode (smoke2_t *ctx, uint8_t mode) |
Smoke 2 setting mode function. | |
void | smoke2_get_int (smoke2_t *ctx, uint8_t *fifo, uint8_t *slot_a, uint8_t *slot_b) |
Smoke 2 get mode function. | |
uint16_t | smoke2_read_sens_data (smoke2_t *ctx, uint8_t slot, uint8_t chn) |
Smoke 2 reading bit state function. | |
void | smoke2_soft_reset (smoke2_t *ctx) |
Smoke 2 reseting device function. | |
uint16_t | smoke2_smoke_calibration (smoke2_t *ctx, uint16_t threshold) |
Smoke 2 calibrating data and setting threshold function. | |
uint8_t | smoke2_check_smoke (smoke2_t *ctx) |
Smoke 2 checking smoke detection function. | |
API for configuring and manipulating Smoke 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void smoke2_cfg_setup | ( | smoke2_cfg_t * | cfg | ) |
Smoke 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See smoke2_cfg_t object definition for detailed explanation. |
uint8_t smoke2_check_smoke | ( | smoke2_t * | ctx | ) |
Smoke 2 checking smoke detection function.
This function checking smoke detection of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
void smoke2_default_cfg | ( | smoke2_t * | ctx | ) |
Smoke 2 default configuration function.
This function executes a default configuration of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
void smoke2_drv_interface_selection | ( | smoke2_cfg_t * | cfg, |
smoke2_drv_t | drv_sel ) |
Smoke 2 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 smoke2_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See smoke2_drv_t object definition for detailed explanation. |
err_t smoke2_generic_read | ( | smoke2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Smoke 2 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See smoke2_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.err_t smoke2_generic_write | ( | smoke2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Smoke 2 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See smoke2_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.uint8_t smoke2_get_bit | ( | smoke2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | bit_num ) |
Smoke 2 generic function for reading bit state.
This function is generic for reading bit state of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | reg | : register address. |
[in] | bit_num | : bit to be written. |
void smoke2_get_int | ( | smoke2_t * | ctx, |
uint8_t * | fifo, | ||
uint8_t * | slot_a, | ||
uint8_t * | slot_b ) |
Smoke 2 get mode function.
This function get mode of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[out] | fifo | : fifo data. |
[out] | slot_a | : slot a int. |
[out] | slot_b | : slot b int. |
uint8_t smoke2_get_int_pin | ( | smoke2_t * | ctx | ) |
Smoke 2 get state of int pin function.
This function eget state of int pin of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
err_t smoke2_init | ( | smoke2_t * | ctx, |
smoke2_cfg_t * | cfg ) |
Smoke 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See smoke2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint16_t smoke2_read_data | ( | smoke2_t * | ctx, |
uint8_t | reg ) |
Smoke 2 generic function for reading data from registar.
This function is generic for reading data from registar of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | reg | : register address. |
uint16_t smoke2_read_sens_data | ( | smoke2_t * | ctx, |
uint8_t | slot, | ||
uint8_t | chn ) |
Smoke 2 reading bit state function.
This function reading bit state of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | slot | : slot to be read. |
[in] | chn | : channel to be read |
void smoke2_set_bit | ( | smoke2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | bit_num, | ||
uint8_t | val ) |
Smoke 2 generic function for writing bit state.
This function is generic for writing bit state of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | reg | : register address. |
[in] | bit_num | : bit to be written. |
[in] | val | : value to be written. |
void smoke2_set_mode | ( | smoke2_t * | ctx, |
uint8_t | mode ) |
Smoke 2 setting mode function.
This function setting mode of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | mode | : device mode. |
uint16_t smoke2_smoke_calibration | ( | smoke2_t * | ctx, |
uint16_t | threshold ) |
Smoke 2 calibrating data and setting threshold function.
This function calibrating data and setting threshold of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | threshold | : threshold for smoke detection. |
void smoke2_soft_reset | ( | smoke2_t * | ctx | ) |
Smoke 2 reseting device function.
This function reseting device of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
void smoke2_write_data | ( | smoke2_t * | ctx, |
uint8_t | reg, | ||
uint16_t | tx_data ) |
Smoke 2 generic function for writing data to register function.
This function is generic for writing data to register of Smoke 2 click board.
[in] | ctx | : Click context object. See smoke2_t object definition for detailed explanation. |
[in] | reg | : register address. |
[in] | tx_data | : data to be written. |