apc1sensor 2.1.0.0
|
API for configuring and manipulating APC1 Sensor Demo driver. More...
Topics | |
APC1 Sensor Commands List | |
List of commands of APC1 Sensor Demo driver. | |
APC1 Sensor Registers Settings | |
Settings for registers of APC1 Sensor Demo driver. | |
APC1 Sensor MikroBUS Map | |
MikroBUS pin mapping of APC1 Sensor Demo driver. | |
Functions | |
void | apc1sensor_cfg_setup (apc1sensor_cfg_t *cfg) |
APC1 Sensor configuration object setup function. | |
void | apc1sensor_drv_interface_sel (apc1sensor_cfg_t *cfg, apc1sensor_drv_t drv_sel) |
APC1 Sensor driver interface setup function. | |
err_t | apc1sensor_init (apc1sensor_t *ctx, apc1sensor_cfg_t *cfg) |
APC1 Sensor initialization function. | |
err_t | apc1sensor_default_cfg (apc1sensor_t *ctx) |
APC1 Sensor default configuration function. | |
err_t | apc1sensor_set_idle_mode (apc1sensor_t *ctx) |
APC1 Sensor set idle mode function. | |
err_t | apc1sensor_start_measurement (apc1sensor_t *ctx) |
APC1 Sensor start measurement function. | |
err_t | apc1sensor_sw_reset (apc1sensor_t *ctx) |
APC1 Sensor sw reset function. | |
err_t | apc1sensor_set_meas_mode (apc1sensor_t *ctx, uint8_t mode) |
APC1 Sensor set meas mode function. | |
err_t | apc1sensor_request_meas (apc1sensor_t *ctx) |
APC1 Sensor request meas function. | |
err_t | apc1sensor_read_info (apc1sensor_t *ctx, apc1sensor_info_t *info) |
APC1 Sensor read info function. | |
err_t | apc1sensor_read_measurement (apc1sensor_t *ctx, apc1sensor_measurement_t *measurement) |
APC1 Sensor read measurement function. | |
void | apc1sensor_set_opmode (apc1sensor_t *ctx, uint8_t opmode) |
APC1 Sensor set opmode function. | |
void | apc1sensor_reset_device (apc1sensor_t *ctx) |
APC1 Sensor reset device function. | |
API for configuring and manipulating APC1 Sensor Demo driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void apc1sensor_cfg_setup | ( | apc1sensor_cfg_t * | cfg | ) |
APC1 Sensor configuration object setup function.
This function initializes demo configuration structure to initial values.
[out] | cfg | : Demo configuration structure. See apc1sensor_cfg_t object definition for detailed explanation. |
err_t apc1sensor_default_cfg | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor default configuration function.
This function executes a default configuration of APC1 Sensor demo board.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void apc1sensor_drv_interface_sel | ( | apc1sensor_cfg_t * | cfg, |
apc1sensor_drv_t | drv_sel ) |
APC1 Sensor 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 apc1sensor_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See apc1sensor_drv_t object definition for detailed explanation. |
err_t apc1sensor_init | ( | apc1sensor_t * | ctx, |
apc1sensor_cfg_t * | cfg ) |
APC1 Sensor initialization function.
This function initializes all necessary pins and peripherals used for this demo board.
[out] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
[in] | cfg | : Demo configuration structure. See apc1sensor_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t apc1sensor_read_info | ( | apc1sensor_t * | ctx, |
apc1sensor_info_t * | info ) |
APC1 Sensor read info function.
This function reads the device name, serial number, and firmware version.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
[out] | info | : Device info object. See apc1sensor_info_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t apc1sensor_read_measurement | ( | apc1sensor_t * | ctx, |
apc1sensor_measurement_t * | measurement ) |
APC1 Sensor read measurement function.
This function reads the measurement 64-bytes output structure data.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
[out] | measurement | : Measurement output object. See apc1sensor_measurement_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t apc1sensor_request_meas | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor request meas function.
This function requests measurement in passive measurement mode (UART only).
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void apc1sensor_reset_device | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor reset device function.
This function resets the device by toggling the RST pin state.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
err_t apc1sensor_set_idle_mode | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor set idle mode function.
This function sets the device to IDLE mode.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t apc1sensor_set_meas_mode | ( | apc1sensor_t * | ctx, |
uint8_t | mode ) |
APC1 Sensor set meas mode function.
This function sets measurement mode to active or passive (UART only).
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void apc1sensor_set_opmode | ( | apc1sensor_t * | ctx, |
uint8_t | opmode ) |
APC1 Sensor set opmode function.
This function sets the operation mode by setting the SET and RST pins state.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
[in] | opmode | :
|
err_t apc1sensor_start_measurement | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor start measurement function.
This function starts measurement by setting the device to measurement mode.
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t apc1sensor_sw_reset | ( | apc1sensor_t * | ctx | ) |
APC1 Sensor sw reset function.
This function performs a device software reset (I2C only).
[in] | ctx | : Demo context object. See apc1sensor_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.