accel17 2.0.0.0
|
API for configuring and manipulating Accel 17 Click driver. More...
Topics | |
Accel 17 Registers List | |
List of registers of Accel 17 Click driver. | |
Accel 17 Registers Settings | |
Settings for registers of Accel 17 Click driver. | |
Accel 17 MikroBUS Map | |
MikroBUS pin mapping of Accel 17 Click driver. | |
Functions | |
void | accel17_cfg_setup (accel17_cfg_t *cfg) |
Accel 17 configuration object setup function. | |
err_t | accel17_init (accel17_t *ctx, accel17_cfg_t *cfg) |
Accel 17 initialization function. | |
err_t | accel17_default_cfg (accel17_t *ctx) |
Accel 17 default configuration function. | |
err_t | accel17_generic_write (accel17_t *ctx, uint8_t reg, uint8_t tx_data) |
Accel 17 I2C writing function. | |
err_t | accel17_generic_read (accel17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Accel 17 I2C reading function. | |
err_t | accel17_get_axes_data (accel17_t *ctx, accel17_axes_t *axes) |
Accel data reading. | |
API for configuring and manipulating Accel 17 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void accel17_cfg_setup | ( | accel17_cfg_t * | cfg | ) |
Accel 17 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel17_cfg_t object definition for detailed explanation. |
err_t accel17_default_cfg | ( | accel17_t * | ctx | ) |
Accel 17 default configuration function.
This function executes a default configuration of Accel 17 click board.
[in] | ctx | : Click context object. See accel17_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t accel17_generic_read | ( | accel17_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Accel 17 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel17_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t accel17_generic_write | ( | accel17_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_data ) |
Accel 17 I2C writing function.
This function writes a byte of data to the selected register.
[in] | ctx | : Click context object. See accel17_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | tx_data | : Data to write. |
0
- Success, -1
- Error.err_t accel17_get_axes_data | ( | accel17_t * | ctx, |
accel17_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 accel17_t object definition for detailed explanation. |
[out] | axes | : Axes data object. See accel17_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t accel17_init | ( | accel17_t * | ctx, |
accel17_cfg_t * | cfg ) |
Accel 17 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel17_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel17_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.