gyro6 2.0.0.0
|
API for configuring and manipulating Gyro 6 Click driver. More...
Topics | |
Gyro 6 Registers List | |
List of registers of Gyro 6 Click driver. | |
Gyro 6 Registers Settings | |
Settings for registers of Gyro 6 Click driver. | |
Gyro 6 MikroBUS Map | |
MikroBUS pin mapping of Gyro 6 Click driver. | |
Functions | |
void | gyro6_cfg_setup (gyro6_cfg_t *cfg) |
Gyro 6 configuration object setup function. | |
void | gyro6_drv_interface_selection (gyro6_cfg_t *cfg, gyro6_drv_t drv_sel) |
Gyro 6 driver interface setup function. | |
err_t | gyro6_init (gyro6_t *ctx, gyro6_cfg_t *cfg) |
Gyro 6 initialization function. | |
err_t | gyro6_default_cfg (gyro6_t *ctx) |
Gyro 6 default configuration function. | |
err_t | gyro6_generic_write (gyro6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Gyro 6 data writing function. | |
err_t | gyro6_generic_read (gyro6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Gyro 6 data reading function. | |
err_t | gyro6_write_register (gyro6_t *ctx, uint8_t reg, uint8_t data_in) |
Gyro 6 write register function. | |
err_t | gyro6_read_register (gyro6_t *ctx, uint8_t reg, uint8_t *data_out) |
Gyro 6 read register function. | |
uint8_t | gyro6_get_int_pin (gyro6_t *ctx) |
Gyro 6 get INT pin function. | |
void | gyro6_set_pwm_pin (gyro6_t *ctx, uint8_t state) |
Gyro 6 set PWM pin function. | |
err_t | gyro6_check_communication (gyro6_t *ctx) |
Gyro 6 check communication function. | |
err_t | gyro6_read_die_temperature (gyro6_t *ctx, float *temperature) |
Gyro 6 read DIE temperature function. | |
err_t | gyro6_get_axis (gyro6_t *ctx, float *x_axis, float *y_axis, float *z_axis) |
Gyro 6 get axis function. | |
err_t | gyro6_set_low_power_mode (gyro6_t *ctx, uint8_t sample_rate, uint8_t average) |
Gyro 6 set low power mode function. | |
API for configuring and manipulating Gyro 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void gyro6_cfg_setup | ( | gyro6_cfg_t * | cfg | ) |
Gyro 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See gyro6_cfg_t object definition for detailed explanation. |
err_t gyro6_check_communication | ( | gyro6_t * | ctx | ) |
Gyro 6 check communication function.
This function checks the communication by reading and verifying the device ID bytes.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t gyro6_default_cfg | ( | gyro6_t * | ctx | ) |
Gyro 6 default configuration function.
This function executes a default configuration of Gyro 6 click board.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
0
- Success, -1
- Error.void gyro6_drv_interface_selection | ( | gyro6_cfg_t * | cfg, |
gyro6_drv_t | drv_sel ) |
Gyro 6 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See gyro6_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See gyro6_drv_t object definition for detailed explanation. |
err_t gyro6_generic_read | ( | gyro6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Gyro 6 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See gyro6_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.err_t gyro6_generic_write | ( | gyro6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Gyro 6 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See gyro6_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.err_t gyro6_get_axis | ( | gyro6_t * | ctx, |
float * | x_axis, | ||
float * | y_axis, | ||
float * | z_axis ) |
Gyro 6 get axis function.
This function reads the gyroscope values for all three axis.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[out] | x_axis | : X axis value. |
[out] | y_axis | : Y axis value. |
[out] | z_axis | : Z axis value. |
0
- Success, -1
- Error.uint8_t gyro6_get_int_pin | ( | gyro6_t * | ctx | ) |
Gyro 6 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
err_t gyro6_init | ( | gyro6_t * | ctx, |
gyro6_cfg_t * | cfg ) |
Gyro 6 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See gyro6_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t gyro6_read_die_temperature | ( | gyro6_t * | ctx, |
float * | temperature ) |
Gyro 6 read DIE temperature function.
This function reads the chip internal temperature.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error.err_t gyro6_read_register | ( | gyro6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Gyro 6 read register function.
This function reads a data byte from the selected register.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.err_t gyro6_set_low_power_mode | ( | gyro6_t * | ctx, |
uint8_t | sample_rate, | ||
uint8_t | average ) |
Gyro 6 set low power mode function.
This function enables low power mode and sets the sample rate and average sample data.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[in] | sample_rate | : Sample Rate divider. |
[in] | average | : Average sample data. See #gyro6_set group for detailed explanation. |
0
- Success, -1
- Error.void gyro6_set_pwm_pin | ( | gyro6_t * | ctx, |
uint8_t | state ) |
Gyro 6 set PWM pin function.
This function sets the PWM pin logic state.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t gyro6_write_register | ( | gyro6_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Gyro 6 write register function.
This function writes a data byte to the selected register.
[in] | ctx | : Click context object. See gyro6_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.