|
accel19 2.2.0
|
API for configuring and manipulating Accel 19 Click driver. More...
Topics | |
| Accel 19 Registers List | |
| List of registers of Accel 19 Click driver. | |
| Accel 19 Registers Settings | |
| Settings for registers of Accel 19 Click driver. | |
| Accel 19 MikroBUS Map | |
| MikroBUS pin mapping of Accel 19 Click driver. | |
Functions | |
| void | accel19_cfg_setup (accel19_cfg_t *cfg) |
| Accel 19 configuration object setup function. | |
| void | accel19_drv_interface_selection (accel19_cfg_t *cfg, accel19_drv_t drv_sel) |
| Accel 19 driver interface setup function. | |
| err_t | accel19_init (accel19_t *ctx, accel19_cfg_t *cfg) |
| Accel 19 initialization function. | |
| err_t | accel19_default_cfg (accel19_t *ctx) |
| Accel 19 default configuration function. | |
| err_t | accel19_generic_write (accel19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Accel 19 data writing function. | |
| err_t | accel19_generic_read (accel19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Accel 19 data reading function. | |
| err_t | accel19_get_temperature (accel19_t *ctx, float *temperature) |
| Accel 19 get temperature function. | |
| err_t | accel19_check_device_id (accel19_t *ctx) |
| Accel 19 check device ID function. | |
| err_t | accel19_set_control (accel19_t *ctx, uint8_t odr, uint8_t op_mode, uint8_t lp_mode) |
| Accel 19 set control function. | |
| err_t | accel19_soft_reset (accel19_t *ctx) |
| Accel 19 soft reset function. | |
| err_t | accel19_get_status (accel19_t *ctx, uint8_t *status) |
| Accel 19 get status function. | |
| uint8_t | accel19_data_ready (accel19_t *ctx) |
| Accel 19 data ready function. | |
| err_t | accel19_set_full_scale (accel19_t *ctx, uint8_t full_scale) |
| Accel 19 set full scale function. | |
| err_t | accel19_set_bw_filt_odr (accel19_t *ctx, uint8_t bw_filt_odr) |
| Accel 19 set digital filtering cutoff function. | |
| err_t | accel19_get_axis_data (accel19_t *ctx, accel19_axis_t *axis) |
| Accel 19 get accelerometer axis function. | |
| uint8_t | accel19_get_int_1 (accel19_t *ctx) |
| Accel 19 get Interrupt 1 function. | |
| uint8_t | accel19_get_int_2 (accel19_t *ctx) |
| Accel 19 get Interrupt 2 function. | |
API for configuring and manipulating Accel 19 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void accel19_cfg_setup | ( | accel19_cfg_t * | cfg | ) |
Accel 19 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See accel19_cfg_t object definition for detailed explanation. |
| err_t accel19_check_device_id | ( | accel19_t * | ctx | ) |
Accel 19 check device ID function.
This function rcheck device ID and communication of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Success, -1 - Error.| uint8_t accel19_data_ready | ( | accel19_t * | ctx | ) |
Accel 19 data ready function.
This function check data ready interrupt reporte of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Data is not ready, 1 - Data is ready.| err_t accel19_default_cfg | ( | accel19_t * | ctx | ) |
Accel 19 default configuration function.
This function executes a default configuration of Accel 19 Click board.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Success, -1 - Error.| void accel19_drv_interface_selection | ( | accel19_cfg_t * | cfg, |
| accel19_drv_t | drv_sel ) |
Accel 19 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 accel19_cfg_t object definition for detailed explanation. |
| [in] | drv_sel | : Driver interface selection. See accel19_drv_t object definition for detailed explanation. |
| err_t accel19_generic_read | ( | accel19_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Accel 19 data reading function.
This function reads a desired number of data bytes starting from the selected register.
| [in] | ctx | : Click context object. See accel19_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 accel19_generic_write | ( | accel19_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Accel 19 data writing function.
This function writes a desired number of data bytes starting from the selected register.
| [in] | ctx | : Click context object. See accel19_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.| err_t accel19_get_axis_data | ( | accel19_t * | ctx, |
| accel19_axis_t * | axis ) |
Accel 19 get accelerometer axis function.
This function get accelerometer data of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [out] | axis | : An object that contains X , Y and Z axis data. |
0 - Data is not ready, 1 - Data is ready.| uint8_t accel19_get_int_1 | ( | accel19_t * | ctx | ) |
Accel 19 get Interrupt 1 function.
This function get states of the Interrupt 1 ( INT pin ) of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Low pin state, -1 - High pin state.| uint8_t accel19_get_int_2 | ( | accel19_t * | ctx | ) |
Accel 19 get Interrupt 2 function.
This function get states of the Interrupt 2 ( PWM pin ) of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Low pin state, -1 - High pin state.| err_t accel19_get_status | ( | accel19_t * | ctx, |
| uint8_t * | status ) |
Accel 19 get status function.
This function reads status register of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [out] | status | : Status data. |
0 - Success, -1 - Error.| err_t accel19_get_temperature | ( | accel19_t * | ctx, |
| float * | temperature ) |
Accel 19 get temperature function.
This function reads a temperature data
of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [out] | temperature | : Temperature in degree Celsius. |
0 - Success, -1 - Error.| err_t accel19_init | ( | accel19_t * | ctx, |
| accel19_cfg_t * | cfg ) |
Accel 19 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See accel19_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error.| err_t accel19_set_bw_filt_odr | ( | accel19_t * | ctx, |
| uint8_t | bw_filt_odr ) |
Accel 19 set digital filtering cutoff function.
This function bandwidth selection of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [in] | bw_filt_odr | : Digital filtering cutoff selection. |
0 - Data is not ready, 1 - Data is ready.| err_t accel19_set_control | ( | accel19_t * | ctx, |
| uint8_t | odr, | ||
| uint8_t | op_mode, | ||
| uint8_t | lp_mode ) |
Accel 19 set control function.
This function set control 1 register of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [in] | odr | : Data rate configuration. |
| [in] | op_mode | : Mode selection. |
| [in] | lp_mode | : Low-power mode selection. |
0 - Success, -1 - Error.| err_t accel19_set_full_scale | ( | accel19_t * | ctx, |
| uint8_t | full_scale ) |
Accel 19 set full scale function.
This function set full scales of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
| [in] | full_scale | : Full scales of ±2g/±4g/±8g/±16g. |
0 - Data is not ready, 1 - Data is ready.| err_t accel19_soft_reset | ( | accel19_t * | ctx | ) |
Accel 19 soft reset function.
This function executes a software reset of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.
| [in] | ctx | : Click context object. See accel19_t object definition for detailed explanation. |
0 - Success, -1 - Error.