accel27 2.1.0.0
|
API for configuring and manipulating Accel 27 Click driver. More...
Topics | |
Accel 27 Registers List | |
List of registers of Accel 27 Click driver. | |
Accel 27 Registers Settings | |
Settings for registers of Accel 27 Click driver. | |
Accel 27 MikroBUS Map | |
MikroBUS pin mapping of Accel 27 Click driver. | |
Functions | |
void | accel27_cfg_setup (accel27_cfg_t *cfg) |
Accel 27 configuration object setup function. | |
void | accel27_drv_interface_selection (accel27_cfg_t *cfg, accel27_drv_t drv_sel) |
Accel 27 driver interface setup function. | |
err_t | accel27_init (accel27_t *ctx, accel27_cfg_t *cfg) |
Accel 27 initialization function. | |
err_t | accel27_default_cfg (accel27_t *ctx) |
Accel 27 default configuration function. | |
err_t | accel27_generic_write (accel27_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Accel 27 data writing function. | |
err_t | accel27_generic_read (accel27_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Accel 27 data reading function. | |
err_t | accel27_write_register (accel27_t *ctx, uint8_t reg, uint8_t data_in) |
Accel 27 write register function. | |
err_t | accel27_read_register (accel27_t *ctx, uint8_t reg, uint8_t *data_out) |
Accel 27 read register function. | |
err_t | accel27_check_communication (accel27_t *ctx) |
Accel 27 check communication function. | |
uint8_t | accel27_get_int1_pin (accel27_t *ctx) |
Accel 27 get int1 pin function. | |
uint8_t | accel27_get_int2_pin (accel27_t *ctx) |
Accel 27 get int2 pin function. | |
err_t | accel27_get_axes (accel27_t *ctx, accel27_axes_t *axes) |
Accel 27 get axes function. | |
err_t | accel27_reset_device (accel27_t *ctx) |
Accel 27 reset device function. | |
API for configuring and manipulating Accel 27 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void accel27_cfg_setup | ( | accel27_cfg_t * | cfg | ) |
Accel 27 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel27_cfg_t object definition for detailed explanation. |
err_t accel27_check_communication | ( | accel27_t * | ctx | ) |
Accel 27 check communication function.
This function checks the communication by reading and verifying the device ID bytes.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel27_default_cfg | ( | accel27_t * | ctx | ) |
Accel 27 default configuration function.
This function executes a default configuration of Accel 27 click board.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void accel27_drv_interface_selection | ( | accel27_cfg_t * | cfg, |
accel27_drv_t | drv_sel ) |
Accel 27 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 accel27_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See accel27_drv_t object definition for detailed explanation. |
err_t accel27_generic_read | ( | accel27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Accel 27 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel27_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 accel27_generic_write | ( | accel27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Accel 27 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel27_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 accel27_get_axes | ( | accel27_t * | ctx, |
accel27_axes_t * | axes ) |
Accel 27 get axes function.
This function reads accel X, Y, and Z axis data in g.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
[out] | axes | : X, Y, and Z axis data in g. See accel27_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t accel27_get_int1_pin | ( | accel27_t * | ctx | ) |
Accel 27 get int1 pin function.
This function returns the interrupt 1 (INT1) pin logic state.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
uint8_t accel27_get_int2_pin | ( | accel27_t * | ctx | ) |
Accel 27 get int2 pin function.
This function returns the interrupt 2 (INT2) pin logic state.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
err_t accel27_init | ( | accel27_t * | ctx, |
accel27_cfg_t * | cfg ) |
Accel 27 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel27_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel27_read_register | ( | accel27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Accel 27 read register function.
This function reads data from the selected register.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel27_reset_device | ( | accel27_t * | ctx | ) |
Accel 27 reset device function.
This function performs the chip software reset.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel27_write_register | ( | accel27_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Accel 27 write register function.
This function writes a desired data to the selected register.
[in] | ctx | : Click context object. See accel27_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.