accel21 2.1.0.0
|
API for configuring and manipulating Accel 21 Click driver. More...
Topics | |
Accel 21 Registers List | |
List of registers of Accel 21 Click driver. | |
Accel 21 Registers Settings | |
Settings for registers of Accel 21 Click driver. | |
Accel 21 MikroBUS Map | |
MikroBUS pin mapping of Accel 21 Click driver. | |
Functions | |
void | accel21_cfg_setup (accel21_cfg_t *cfg) |
Accel 21 configuration object setup function. | |
void | accel21_drv_interface_selection (accel21_cfg_t *cfg, accel21_drv_t drv_sel) |
Accel 21 driver interface setup function. | |
err_t | accel21_init (accel21_t *ctx, accel21_cfg_t *cfg) |
Accel 21 initialization function. | |
err_t | accel21_default_cfg (accel21_t *ctx) |
Accel 21 default configuration function. | |
err_t | accel21_generic_write (accel21_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Accel 21 data writing function. | |
err_t | accel21_generic_read (accel21_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Accel 21 data reading function. | |
err_t | accel21_get_temp_status (accel21_t *ctx, uint8_t *temp_status) |
Accel 21 get temperature status function. | |
err_t | accel21_check_temp_data_ready (accel21_t *ctx, uint8_t *temp_data_ready) |
Accel 21 check temperature data ready function. | |
err_t | accel21_enable_temp_data (accel21_t *ctx) |
Accel 21 enable temperature data function. | |
err_t | accel21_check_temp_data_ovr (accel21_t *ctx, uint8_t *temp_data_ovr) |
Accel 21 check temperature overrun function. | |
err_t | accel21_get_temp_data (accel21_t *ctx, int16_t *temp_data) |
Accel 21 get temperature data function. | |
err_t | accel21_get_temperature (accel21_t *ctx, float *temperature) |
Accel 21 get temperature function. | |
err_t | accel21_set_op_mode (accel21_t *ctx, uint8_t op_mode) |
Accel 21 set operating mode function. | |
err_t | accel21_get_op_mode (accel21_t *ctx, uint8_t *op_mode) |
Accel 21 get operating mode function. | |
err_t | accel21_get_device_id (accel21_t *ctx, uint8_t *device_id) |
Accel 21 get device ID function. | |
err_t | accel21_check_id (accel21_t *ctx) |
Accel 21 check device ID function. | |
err_t | accel21_get_status (accel21_t *ctx, uint8_t *status) |
Accel 21 get status function. | |
err_t | accel21_check_data_overrun (accel21_t *ctx, uint8_t *data_overrun) |
Accel 21 check accel overrun function. | |
err_t | accel21_check_new_data (accel21_t *ctx, uint8_t *new_data_avl) |
Accel 21 check accel data ready function. | |
err_t | accel21_set_config (accel21_t *ctx, accel21_config_t config) |
Accel 21 set config function. | |
err_t | accel21_get_axis (accel21_t *ctx, accel21_axis_t *acc_axis) |
Accel 21 get accel data function. | |
uint8_t | accel21_get_in1_pin (accel21_t *ctx) |
Accel 21 get interrupt 1 function. | |
uint8_t | accel21_get_in2_pin (accel21_t *ctx) |
Accel 21 get interrupt 2 function. | |
API for configuring and manipulating Accel 21 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void accel21_cfg_setup | ( | accel21_cfg_t * | cfg | ) |
Accel 21 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel21_cfg_t object definition for detailed explanation. |
err_t accel21_check_data_overrun | ( | accel21_t * | ctx, |
uint8_t * | data_overrun ) |
Accel 21 check accel overrun function.
This function check if new accel data has overwritten the previous data of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | data_overrun | : X-, Y- and Z-axis data overrun. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_check_id | ( | accel21_t * | ctx | ) |
Accel 21 check device ID function.
This function checking the device ID of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
0
- OK, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_check_new_data | ( | accel21_t * | ctx, |
uint8_t * | new_data_avl ) |
Accel 21 check accel data ready function.
This function check if accel data ready of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[out] | new_data_avl | : Temperature new data available:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_check_temp_data_ovr | ( | accel21_t * | ctx, |
uint8_t * | temp_data_ovr ) |
Accel 21 check temperature overrun function.
This function check if new temperature data has overwritten the previous data of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | temp_data_ovr | : Temperature new data available:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_check_temp_data_ready | ( | accel21_t * | ctx, |
uint8_t * | temp_data_ready ) |
Accel 21 check temperature data ready function.
This function check if temperature data ready of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[out] | temp_data_ready | : Temperature new data available:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_default_cfg | ( | accel21_t * | ctx | ) |
Accel 21 default configuration function.
This function executes a default configuration of Accel 21 click board.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void accel21_drv_interface_selection | ( | accel21_cfg_t * | cfg, |
accel21_drv_t | drv_sel ) |
Accel 21 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 accel21_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See accel21_drv_t object definition for detailed explanation. |
err_t accel21_enable_temp_data | ( | accel21_t * | ctx | ) |
Accel 21 enable temperature data function.
This function enables the temperature sensor of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_generic_read | ( | accel21_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Accel 21 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel21_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 accel21_generic_write | ( | accel21_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Accel 21 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel21_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. err_t accel21_get_axis | ( | accel21_t * | ctx, |
accel21_axis_t * | acc_axis ) |
Accel 21 get accel data function.
This function reads accel data for all three axis of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[out] | acc_axis | : Accel axis output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_get_device_id | ( | accel21_t * | ctx, |
uint8_t * | device_id ) |
Accel 21 get device ID function.
This function reads the device ID of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | device_id | : Device ID. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t accel21_get_in1_pin | ( | accel21_t * | ctx | ) |
Accel 21 get interrupt 1 function.
This function get states of the Interrupt 1 ( PWM pin ) of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
0
- Low pin state, -1
- High pin state. See #err_t definition for detailed explanation. uint8_t accel21_get_in2_pin | ( | accel21_t * | ctx | ) |
Accel 21 get interrupt 2 function.
This function get states of the Interrupt 2 ( INT pin ) of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
0
- Low pin state, -1
- High pin state. See #err_t definition for detailed explanation. err_t accel21_get_op_mode | ( | accel21_t * | ctx, |
uint8_t * | op_mode ) |
Accel 21 get operating mode function.
This function reads the operating mode of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | op_mode | : Operating mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_get_status | ( | accel21_t * | ctx, |
uint8_t * | status ) |
Accel 21 get status function.
This function reads the status data of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_get_temp_data | ( | accel21_t * | ctx, |
int16_t * | temp_data ) |
Accel 21 get temperature data function.
This function reads the raw temperature data of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | temp_data | : Temperature sensor data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_get_temp_status | ( | accel21_t * | ctx, |
uint8_t * | temp_status ) |
Accel 21 get temperature status function.
This function reads a temperature status of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[out] | temp_status | : Output temperature status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_get_temperature | ( | accel21_t * | ctx, |
float * | temperature ) |
Accel 21 get temperature function.
This function reads the raw temperature data and converts it to Celsius of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_init | ( | accel21_t * | ctx, |
accel21_cfg_t * | cfg ) |
Accel 21 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel21_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_set_config | ( | accel21_t * | ctx, |
accel21_config_t | config ) |
Accel 21 set config function.
This function set sensor configuration of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. See accel21_t object definition for detailed explanation. |
[out] | config | : Configuration structure object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel21_set_op_mode | ( | accel21_t * | ctx, |
uint8_t | op_mode ) |
Accel 21 set operating mode function.
This function set the desired operating mode of the the MEMS digital output motion sensor ultra-low-power high-performance 3-axis accelerometer on the Accel 21 Click board™.
[in] | ctx | : Click context object. |
[in] | op_mode | : Operating mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation.