accel24
2.1.0.0
|
API for configuring and manipulating Accel 24 Click driver. More...
Modules | |
Accel 24 Registers List | |
List of registers of Accel 24 Click driver. | |
Accel 24 Registers Settings | |
Settings for registers of Accel 24 Click driver. | |
Accel 24 MikroBUS Map | |
MikroBUS pin mapping of Accel 24 Click driver. | |
Functions | |
void | accel24_cfg_setup (accel24_cfg_t *cfg) |
Accel 24 configuration object setup function. More... | |
err_t | accel24_init (accel24_t *ctx, accel24_cfg_t *cfg) |
Accel 24 initialization function. More... | |
err_t | accel24_default_cfg (accel24_t *ctx) |
Accel 24 default configuration function. More... | |
err_t | accel24_generic_write (accel24_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Accel 24 I2C writing function. More... | |
err_t | accel24_generic_read (accel24_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Accel 24 I2C reading function. More... | |
err_t | accel24_write_register (accel24_t *ctx, uint8_t reg, uint8_t data_in) |
Accel 24 write register function. More... | |
err_t | accel24_read_register (accel24_t *ctx, uint8_t reg, uint8_t *data_out) |
Accel 24 read register function. More... | |
err_t | accel24_check_communication (accel24_t *ctx) |
Accel 24 check communication function. More... | |
uint8_t | accel24_get_int_pin (accel24_t *ctx) |
Accel 24 get int pin function. More... | |
err_t | accel24_soft_reset (accel24_t *ctx) |
Accel 24 soft reset function. More... | |
err_t | accel24_set_full_scale_range (accel24_t *ctx, uint8_t fsr) |
Accel 24 set full scale range function. More... | |
err_t | accel24_read_data (accel24_t *ctx, accel24_data_t *data_out) |
Accel 24 read data function. More... | |
API for configuring and manipulating Accel 24 Click driver.
void accel24_cfg_setup | ( | accel24_cfg_t * | cfg | ) |
Accel 24 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel24_cfg_t object definition for detailed explanation. |
err_t accel24_check_communication | ( | accel24_t * | ctx | ) |
Accel 24 check communication function.
This function checks the communication by reading and verifying the who am I register.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_default_cfg | ( | accel24_t * | ctx | ) |
Accel 24 default configuration function.
This function executes a default configuration of Accel 24 click board.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_generic_read | ( | accel24_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Accel 24 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 accel24_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 (up to 16 bytes). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_generic_write | ( | accel24_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Accel 24 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel24_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 (up to 16 bytes). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t accel24_get_int_pin | ( | accel24_t * | ctx | ) |
Accel 24 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
err_t accel24_init | ( | accel24_t * | ctx, |
accel24_cfg_t * | cfg | ||
) |
Accel 24 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel24_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_read_data | ( | accel24_t * | ctx, |
accel24_data_t * | data_out | ||
) |
Accel 24 read data function.
This function checks the data ready bit, clears it, and then reads the accel (X, Y, Z) and temperature measurements.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
[out] | data_out | : Output data read. See accel24_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_read_register | ( | accel24_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Accel 24 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel24_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 accel24_set_full_scale_range | ( | accel24_t * | ctx, |
uint8_t | fsr | ||
) |
Accel 24 set full scale range function.
This function sets the full scale range resolution.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
[in] | fsr | : Full-scale range
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_soft_reset | ( | accel24_t * | ctx | ) |
Accel 24 soft reset function.
This function performs the software reset by setting the SW RST bit.
[in] | ctx | : Click context object. See accel24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel24_write_register | ( | accel24_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Accel 24 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel24_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.