accel16 2.0.0.0
|
API for configuring and manipulating Accel 16 Click driver. More...
Topics | |
Accel 16 Registers List | |
List of registers of Accel 16 Click driver. | |
Accel 16 Registers Settings | |
Settings for registers of Accel 16 Click driver. | |
Accel 16 MikroBUS Map | |
MikroBUS pin mapping of Accel 16 Click driver. | |
Functions | |
void | accel16_cfg_setup (accel16_cfg_t *cfg) |
Accel 16 configuration object setup function. | |
err_t | accel16_init (accel16_t *ctx, accel16_cfg_t *cfg) |
Accel 16 initialization function. | |
err_t | accel16_default_cfg (accel16_t *ctx) |
Accel 16 default configuration function. | |
err_t | accel16_multiple_reg_write (accel16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Write multiple registers. | |
err_t | accel16_single_reg_write (accel16_t *ctx, uint8_t reg, uint8_t data_in) |
Write single register. | |
err_t | accel16_multiple_reg_read (accel16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Read multiple registers. | |
err_t | accel16_single_reg_read (accel16_t *ctx, uint8_t reg, uint8_t *data_out) |
Read single registers. | |
err_t | accel16_fifo_read (accel16_t *ctx, uint8_t *data_out, uint16_t len) |
Read fifo. | |
uint8_t | accel16_get_interrupt_1 (accel16_t *ctx) |
Get interrupt 1 state. | |
uint8_t | accel16_get_interrupt_2 (accel16_t *ctx) |
Get interrupt 2 state. | |
err_t | accel16_filter_configuration (accel16_t *ctx, accel16_gain_t gain, accel16_output_rate_t odr) |
Filter configuration. | |
err_t | accel16_get_axes (accel16_t *ctx, accel16_axes_t *axes) |
Get axes data. | |
err_t | accel16_get_temperature (accel16_t *ctx, float *temperature) |
Get temperature data. | |
err_t | accel16_get_adc (accel16_t *ctx, float *v_adc) |
Get adc data. | |
err_t | accel16_calibrate_temperature (accel16_t *ctx, float room_temperature) |
Accel 16 calibrate temperature function. | |
API for configuring and manipulating Accel 16 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t accel16_calibrate_temperature | ( | accel16_t * | ctx, |
float | room_temperature ) |
Accel 16 calibrate temperature function.
This function calibrates the temperature readings to the known room temperature in Celsius.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[in] | room_temperature | : Known room temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void accel16_cfg_setup | ( | accel16_cfg_t * | cfg | ) |
Accel 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel16_cfg_t object definition for detailed explanation. |
err_t accel16_default_cfg | ( | accel16_t * | ctx | ) |
Accel 16 default configuration function.
This function executes a default configuration of Accel 16 click board.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel16_fifo_read | ( | accel16_t * | ctx, |
uint8_t * | data_out, | ||
uint16_t | len ) |
Read fifo.
This function reads a desired number of data bytes from fifo buffer.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[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 accel16_filter_configuration | ( | accel16_t * | ctx, |
accel16_gain_t | gain, | ||
accel16_output_rate_t | odr ) |
Filter configuration.
This function changes configuration of filter register of gain and output data rate.
[in,out] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[in] | gain | : Data resolution. |
[in] | odr | : Output data rate. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel16_get_adc | ( | accel16_t * | ctx, |
float * | v_adc ) |
Get adc data.
This function reads adc data from register and calculates voltage level.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[out] | v_adc | : Voltage output data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel16_get_axes | ( | accel16_t * | ctx, |
accel16_axes_t * | axes ) |
Get axes data.
This function reads axes data from registers and calculates values in g.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[out] | axes | : Axes data. See accel16_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t accel16_get_interrupt_1 | ( | accel16_t * | ctx | ) |
Get interrupt 1 state.
This function reads int1 pin state.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
uint8_t accel16_get_interrupt_2 | ( | accel16_t * | ctx | ) |
Get interrupt 2 state.
This function reads int2 pin state.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
err_t accel16_get_temperature | ( | accel16_t * | ctx, |
float * | temperature ) |
Get temperature data.
This function reads temperature data from registers and calculates values in degreese C.
[in] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[out] | temperature | : Temperature data in degreese Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel16_init | ( | accel16_t * | ctx, |
accel16_cfg_t * | cfg ) |
Accel 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel16_multiple_reg_read | ( | accel16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Read multiple registers.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel16_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 accel16_multiple_reg_write | ( | accel16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Write multiple registers.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See accel16_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 accel16_single_reg_read | ( | accel16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Read single registers.
This function reads a byte from the selected register.
[in] | ctx | : Click context object. See accel16_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 accel16_single_reg_write | ( | accel16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Write single register.
This function writes a bytes to the selected register.
[in] | ctx | : Click context object. See accel16_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.