gyro4 2.0.0.0
|
Functions | |
void | gyro4_cfg_setup (gyro4_cfg_t *cfg) |
Config Object Initialization function. | |
GYRO4_RETVAL | gyro4_init (gyro4_t *ctx, gyro4_cfg_t *cfg) |
Initialization function. | |
void | gyro4_generic_transfer (gyro4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint8_t | gyro4_int_get (gyro4_t *ctx) |
Getting INT pin state. | |
void | gyro4_cs_set (gyro4_t *ctx, uint8_t pin_state) |
Setting CS pin state. | |
uint8_t | gyro4_spi_get (gyro4_t *ctx, uint8_t register_address, uint8_t *register_buffer, uint16_t n_registers) |
Getting register content. | |
uint8_t | gyro4_spi_set (gyro4_t *ctx, uint8_t register_address, uint8_t data_in) |
Setting register content. | |
uint8_t | gyro4_initialize (gyro4_t *ctx) |
Device initialization. | |
uint8_t | gyro4_get_temperature (gyro4_t *ctx, float *temperature) |
Getting die temperature value. | |
uint8_t | gyro4_get_axes (gyro4_t *ctx, float *x_axis, float *y_axis) |
Getting axes values. | |
uint8_t | gyro4_software_reset (gyro4_t *ctx) |
Performing software reset. | |
uint8_t | gyro4_set_power_mode (gyro4_t *ctx, uint8_t power_mode) |
Setting power mode. | |
uint8_t | gyro4_set_full_scale_range (gyro4_t *ctx, uint8_t full_scale_range) |
Settinf full scale range. | |
void gyro4_cfg_setup | ( | gyro4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void gyro4_cs_set | ( | gyro4_t * | ctx, |
uint8_t | pin_state ) |
Setting CS pin state.
ctx | Click object. |
pin_state | pin state (0 for LOW and 1 for HIGH) |
@description This function gets INT pin state
void gyro4_generic_transfer | ( | gyro4_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
uint8_t gyro4_get_axes | ( | gyro4_t * | ctx, |
float * | x_axis, | ||
float * | y_axis ) |
Getting axes values.
ctx | Click object. |
x_axis | X axis value |
y_axis | Y axis value |
@description This function gets values from axes registers and converts those values to [deg/s]
uint8_t gyro4_get_temperature | ( | gyro4_t * | ctx, |
float * | temperature ) |
Getting die temperature value.
ctx | Click object. |
temperature | temperature value |
@desrciption This function gets values of temperature registers and convets those values to [deg C]
GYRO4_RETVAL gyro4_init | ( | gyro4_t * | ctx, |
gyro4_cfg_t * | cfg ) |
Initialization function.
gyro4 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t gyro4_initialize | ( | gyro4_t * | ctx | ) |
Device initialization.
ctx | Click object. |
This function initializes the device This function sets _GYRO4_REG_CTRL1_OIS register value to 0x4B This function sets _GYRO4_REG_CTRL2_OIS register value to 0x00 This function sets _GYRO4_REG_CTRL3_OIS register value to 0x02 This function sets _GYRO4_REG_CTRL4_OIS register value to 0x10 This function sets _GYRO4_REG_OIS_CFG register value to 0x08 *
uint8_t gyro4_int_get | ( | gyro4_t * | ctx | ) |
Getting INT pin state.
ctx | Click object. |
@description This function gets INT pin state
uint8_t gyro4_set_full_scale_range | ( | gyro4_t * | ctx, |
uint8_t | full_scale_range ) |
Settinf full scale range.
ctx | Click object. |
full_scale_range | Full scale range (use macros) |
@description This function sets full scale range to plus/minus 100 or plus/minus 200 degrees per second
uint8_t gyro4_set_power_mode | ( | gyro4_t * | ctx, |
uint8_t | power_mode ) |
Setting power mode.
ctx | Click object. |
power_mode | power mode (use macros) |
@description This function sets power mode to POWER DOWN, SLEEP or NORMAL mode
uint8_t gyro4_software_reset | ( | gyro4_t * | ctx | ) |
Performing software reset.
ctx | Click object. |
@description This function activates software reset and makes 1 second delay
uint8_t gyro4_spi_get | ( | gyro4_t * | ctx, |
uint8_t | register_address, | ||
uint8_t * | register_buffer, | ||
uint16_t | n_registers ) |
Getting register content.
ctx | Click object. |
register_address | register address |
register_buffer | register buffer |
n_registers | number of registers |
@description This function gets specified number of registers (max. 4 registers) starting at specified registered address and stores register values into register buffer
uint8_t gyro4_spi_set | ( | gyro4_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | data_in ) |
Setting register content.
ctx | Click object. |
register_address | register address |
data_in | register buffer |
@description This function sets values from register buffer to specified number of registers (max. 1 registers) starting at specified registered address