accel4 2.0.0.0
|
API for configuring and manipulating Accel 4 Click driver. More...
Topics | |
Accel 4 Registers List | |
List of registers of Accel 4 Click driver. | |
Accel 4 Registers Settings | |
Settings for registers of Accel 4 Click driver. | |
Accel 4 MikroBUS Map | |
MikroBUS pin mapping of Accel 4 Click driver. | |
Functions | |
void | accel4_cfg_setup (accel4_cfg_t *cfg) |
Accel 4 configuration object setup function. | |
void | accel4_drv_interface_selection (accel4_cfg_t *cfg, accel4_drv_t drv_sel) |
Accel 4 driver interface setup function. | |
err_t | accel4_init (accel4_t *ctx, accel4_cfg_t *cfg) |
Accel 4 initialization function. | |
err_t | accel4_default_cfg (accel4_t *ctx) |
Accel 4 default configuration function. | |
err_t | accel4_generic_write (accel4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Accel 4 data writing function. | |
err_t | accel4_generic_read (accel4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Accel 4 data reading function. | |
uint8_t | accel4_get_int1 (accel4_t *ctx) |
Get interrupt 1 pin state. | |
uint8_t | accel4_get_int2 (accel4_t *ctx) |
Get interrupt 2 pin state. | |
err_t | accel4_get_axes_data (accel4_t *ctx, accel4_axes_t *axes) |
Accel data reading. | |
float | accel4_axes_get_resolution (accel4_t *ctx) |
Reads current resolution of output data. | |
API for configuring and manipulating Accel 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
float accel4_axes_get_resolution | ( | accel4_t * | ctx | ) |
Reads current resolution of output data.
This function reads current configuration for resolution of output data.
[in] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
void accel4_cfg_setup | ( | accel4_cfg_t * | cfg | ) |
Accel 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel4_cfg_t object definition for detailed explanation. |
err_t accel4_default_cfg | ( | accel4_t * | ctx | ) |
Accel 4 default configuration function.
This function executes a default configuration of Accel 4 click board.
[in] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
0
- Success, -1
- Error.void accel4_drv_interface_selection | ( | accel4_cfg_t * | cfg, |
accel4_drv_t | drv_sel ) |
Accel 4 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 accel4_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See accel4_drv_t object definition for detailed explanation. |
err_t accel4_generic_read | ( | accel4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Accel 4 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel4_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 accel4_generic_write | ( | accel4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Accel 4 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel4_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 accel4_get_axes_data | ( | accel4_t * | ctx, |
accel4_axes_t * | axes ) |
Accel data reading.
This function reads a accel data and calculates it with resolution set in ctx object. Data will be set in axes object.
[in] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
[out] | axes | : Axes data object. See accel4_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t accel4_get_int1 | ( | accel4_t * | ctx | ) |
Get interrupt 1 pin state.
This function reads logic state of interrupt 1 pin.
[in] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
uint8_t accel4_get_int2 | ( | accel4_t * | ctx | ) |
Get interrupt 2 pin state.
This function reads logic state of interrupt 2 pin.
[in] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
err_t accel4_init | ( | accel4_t * | ctx, |
accel4_cfg_t * | cfg ) |
Accel 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.