accel25
2.1.0.0
|
API for configuring and manipulating Accel 25 Click driver. More...
Modules | |
Accel 25 Registers List | |
List of registers of Accel 25 Click driver. | |
Accel 25 Registers Settings | |
Settings for registers of Accel 25 Click driver. | |
Accel 25 MikroBUS Map | |
MikroBUS pin mapping of Accel 25 Click driver. | |
Functions | |
void | accel25_cfg_setup (accel25_cfg_t *cfg) |
Accel 25 configuration object setup function. More... | |
err_t | accel25_init (accel25_t *ctx, accel25_cfg_t *cfg) |
Accel 25 initialization function. More... | |
err_t | accel25_default_cfg (accel25_t *ctx) |
Accel 25 default configuration function. More... | |
err_t | accel25_generic_write (accel25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Accel 25 I2C writing function. More... | |
err_t | accel25_generic_read (accel25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Accel 25 I2C reading function. More... | |
err_t | accel25_write_register (accel25_t *ctx, uint8_t reg, uint8_t data_in) |
Accel 25 write register function. More... | |
err_t | accel25_read_register (accel25_t *ctx, uint8_t reg, uint8_t *data_out) |
Accel 25 read register function. More... | |
err_t | accel25_check_communication (accel25_t *ctx) |
Accel 25 check communication function. More... | |
uint8_t | accel25_get_int_pin (accel25_t *ctx) |
Accel 25 get int pin function. More... | |
err_t | accel25_soft_reset (accel25_t *ctx) |
Accel 25 soft reset function. More... | |
err_t | accel25_set_full_scale_range (accel25_t *ctx, uint8_t fsr) |
Accel 25 set full scale range function. More... | |
err_t | accel25_read_data (accel25_t *ctx, accel25_data_t *data_out) |
Accel 25 read data function. More... | |
API for configuring and manipulating Accel 25 Click driver.
void accel25_cfg_setup | ( | accel25_cfg_t * | cfg | ) |
Accel 25 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See accel25_cfg_t object definition for detailed explanation. |
err_t accel25_check_communication | ( | accel25_t * | ctx | ) |
Accel 25 check communication function.
This function checks the communication by reading and verifying the who am I register.
[in] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_default_cfg | ( | accel25_t * | ctx | ) |
Accel 25 default configuration function.
This function executes a default configuration of Accel 25 click board.
[in] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_generic_read | ( | accel25_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Accel 25 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 accel25_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 accel25_generic_write | ( | accel25_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Accel 25 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 accel25_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. uint8_t accel25_get_int_pin | ( | accel25_t * | ctx | ) |
Accel 25 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
err_t accel25_init | ( | accel25_t * | ctx, |
accel25_cfg_t * | cfg | ||
) |
Accel 25 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See accel25_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_read_data | ( | accel25_t * | ctx, |
accel25_data_t * | data_out | ||
) |
Accel 25 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 accel25_t object definition for detailed explanation. |
[out] | data_out | : Output data read. See accel25_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_read_register | ( | accel25_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Accel 25 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel25_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 accel25_set_full_scale_range | ( | accel25_t * | ctx, |
uint8_t | fsr | ||
) |
Accel 25 set full scale range function.
This function sets the full scale range resolution.
[in] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
[in] | fsr | : Full-scale range
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_soft_reset | ( | accel25_t * | ctx | ) |
Accel 25 soft reset function.
This function performs the software reset by setting the SW RST bit.
[in] | ctx | : Click context object. See accel25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t accel25_write_register | ( | accel25_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Accel 25 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See accel25_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.