gyro7 2.0.0.0
|
API for configuring and manipulating Gyro 7 Click driver. More...
Topics | |
Gyro 7 Registers List | |
List of registers of Gyro 7 Click driver. | |
Gyro 7 Registers Settings | |
Settings for registers of Gyro 7 Click driver. | |
Gyro 7 MikroBUS Map | |
MikroBUS pin mapping of Gyro 7 Click driver. | |
Functions | |
void | gyro7_cfg_setup (gyro7_cfg_t *cfg) |
Gyro 7 configuration object setup function. | |
err_t | gyro7_init (gyro7_t *ctx, gyro7_cfg_t *cfg) |
Gyro 7 initialization function. | |
err_t | gyro7_default_cfg (gyro7_t *ctx) |
Gyro 7 default configuration function. | |
err_t | gyro7_generic_write (gyro7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Gyro 7 data writing function. | |
err_t | gyro7_generic_read (gyro7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Gyro 7 data reading function. | |
err_t | gyro7_write_register (gyro7_t *ctx, uint8_t reg, uint8_t data_in) |
Gyro 7 write register function. | |
err_t | gyro7_read_register (gyro7_t *ctx, uint8_t reg, uint8_t *data_out) |
Gyro 7 read register function. | |
err_t | gyro7_check_communication (gyro7_t *ctx) |
Gyro 7 check communication function. | |
uint8_t | gyro7_get_int_pin (gyro7_t *ctx) |
Gyro 7 get int pin function. | |
err_t | gyro7_set_dlpf_config (gyro7_t *ctx, uint8_t freq) |
Gyro 7 set DLPF config function. | |
err_t | gyro7_read_gyroscope (gyro7_t *ctx, float *x_axis, float *y_axis) |
Gyro 7 read gyroscope function. | |
err_t | gyro7_read_temperature (gyro7_t *ctx, float *temperature) |
Gyro 7 read temperature function. | |
API for configuring and manipulating Gyro 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void gyro7_cfg_setup | ( | gyro7_cfg_t * | cfg | ) |
Gyro 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See gyro7_cfg_t object definition for detailed explanation. |
err_t gyro7_check_communication | ( | gyro7_t * | ctx | ) |
Gyro 7 check communication function.
This function checks the communication by reading and verifying the WHO AM I register.
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_default_cfg | ( | gyro7_t * | ctx | ) |
Gyro 7 default configuration function.
This function executes a default configuration of Gyro 7 click board.
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_generic_read | ( | gyro7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Gyro 7 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gyro7_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 gyro7_generic_write | ( | gyro7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Gyro 7 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gyro7_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 gyro7_get_int_pin | ( | gyro7_t * | ctx | ) |
Gyro 7 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
err_t gyro7_init | ( | gyro7_t * | ctx, |
gyro7_cfg_t * | cfg ) |
Gyro 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See gyro7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_read_gyroscope | ( | gyro7_t * | ctx, |
float * | x_axis, | ||
float * | y_axis ) |
Gyro 7 read gyroscope function.
This function reads the gyroscope X and Y axis in degrees per second (dps).
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
[out] | x_axis | : X axis value in dps. |
[out] | y_axis | : Y axis value in dps. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_read_register | ( | gyro7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Gyro 7 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gyro7_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 gyro7_read_temperature | ( | gyro7_t * | ctx, |
float * | temperature ) |
Gyro 7 read temperature function.
This function reads the internal temperature in Celsius.
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
[out] | temperature | : Internal temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_set_dlpf_config | ( | gyro7_t * | ctx, |
uint8_t | freq ) |
Gyro 7 set DLPF config function.
This function sets the DLPF register for the selected corner frequency.
[in] | ctx | : Click context object. See gyro7_t object definition for detailed explanation. |
[in] | freq | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t gyro7_write_register | ( | gyro7_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Gyro 7 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gyro7_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.