gyro3 2.0.0.0
|
Functions | |
void | gyro3_cfg_setup (gyro3_cfg_t *cfg) |
Config Object Initialization function. | |
GYRO3_RETVAL | gyro3_init (gyro3_t *ctx, gyro3_cfg_t *cfg) |
Initialization function. | |
void | gyro3_default_cfg (gyro3_t *ctx) |
Click Default Configuration function. | |
void | gyro3_generic_write (gyro3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | gyro3_generic_read (gyro3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | gyro3_int_get (gyro3_t *ctx) |
Get INT pin state. | |
uint8_t | gyro3_di2_get (gyro3_t *ctx) |
Get di2 (AN) pin state. | |
void | gyro3_read (gyro3_t *ctx, uint8_t register_address, uint8_t *read_buffer, uint8_t n_bytes) |
Reading register(s) | |
void | gyro3_write (gyro3_t *ctx, uint8_t register_address, uint8_t value) |
Write byte to regiter. | |
void | gyro3_get_temp (gyro3_t *ctx, uint8_t *temperature_value) |
Read value from temperature register. | |
void | gyro3_get_axes (gyro3_t *ctx, float *x_axis, float *y_axis, float *z_axis, uint8_t measurement_range) |
Get XYZ axes dps values. | |
void | gyro3_get_status (gyro3_t *ctx, uint8_t *status_register) |
Getting status register content. | |
void | gyro3_get_fifo_data_level (gyro3_t *ctx, uint8_t *fifo_data_level) |
Get FIFO data level. | |
void | gyro3_set_int1_thresholds (gyro3_t *ctx, int16_t x_threshold, int16_t y_threshold, int16_t z_threshold) |
Setting values for interrupt thresholds. | |
uint8_t | gyro3_set_int1_duration (gyro3_t *ctx, uint8_t wait_enable_bit, uint8_t duration_value) |
Setting interrupt duration time on INT1 pin. | |
void gyro3_cfg_setup | ( | gyro3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void gyro3_default_cfg | ( | gyro3_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Gyro 3 click.
uint8_t gyro3_di2_get | ( | gyro3_t * | ctx | ) |
Get di2 (AN) pin state.
ctx | Click object. |
@description This function gets AN i.e di2 pin state.
void gyro3_generic_read | ( | gyro3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function reads data from the desired register.
void gyro3_generic_write | ( | gyro3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function writes data to the desired register.
void gyro3_get_axes | ( | gyro3_t * | ctx, |
float * | x_axis, | ||
float * | y_axis, | ||
float * | z_axis, | ||
uint8_t | measurement_range ) |
Get XYZ axes dps values.
ctx | Click object. |
x_axis | - Value stored in x axis register multiplied by sensitivity. |
y_axis | - Value stored in y axis register multiplied by sensitivity. |
z_axis | - Value stored in z axis register multiplied by sensitivity. |
measurement_range | - Measurement range set by user (by default measurement range is 2000 dps). |
@description This function reads values from XYZ axes registers and converts them to degrees per second value based on measurement range setting.
void gyro3_get_fifo_data_level | ( | gyro3_t * | ctx, |
uint8_t * | fifo_data_level ) |
Get FIFO data level.
ctx | Click object. |
fifo_data_level | - Data level in FIFO register. |
@description This function reads data level value in FIFO register from FIFO SRC register (2Fh) and stores result in fifo_data_level
void gyro3_get_status | ( | gyro3_t * | ctx, |
uint8_t * | status_register ) |
Getting status register content.
ctx | Click object. |
status_register | - Status register value. |
@description This function gets value of status register (27h)
void gyro3_get_temp | ( | gyro3_t * | ctx, |
uint8_t * | temperature_value ) |
Read value from temperature register.
ctx | Click object. |
temperature_value | - Value stored to temperature register (26h). |
@description This function reads value stored in temperature register (26h).
GYRO3_RETVAL gyro3_init | ( | gyro3_t * | ctx, |
gyro3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t gyro3_int_get | ( | gyro3_t * | ctx | ) |
Get INT pin state.
ctx | Click object. |
@description This function gets INT pin state.
void gyro3_read | ( | gyro3_t * | ctx, |
uint8_t | register_address, | ||
uint8_t * | read_buffer, | ||
uint8_t | n_bytes ) |
Reading register(s)
ctx | Click object. |
register_address | - Address of the first register to be read. |
read_buffer | - Buffer for storing read register values. |
n_bytes | - Number of bytes to read. |
@description This function reads specified number of registers starting from specified address and stores their values to output buffer.
uint8_t gyro3_set_int1_duration | ( | gyro3_t * | ctx, |
uint8_t | wait_enable_bit, | ||
uint8_t | duration_value ) |
Setting interrupt duration time on INT1 pin.
ctx | Click object. |
wait_enable_bit | - WAKE bit value |
duration_value | - Duration steps and maximum values depend on the ODR chosen |
@description This function sets the minimum duration of the interrupt event to be recognized.
void gyro3_set_int1_thresholds | ( | gyro3_t * | ctx, |
int16_t | x_threshold, | ||
int16_t | y_threshold, | ||
int16_t | z_threshold ) |
Setting values for interrupt thresholds.
ctx | Click object. |
x_threshold | - X-Axis threshold value. |
y_threshold | - Y-Axis threshold value. |
z_threshold | - Z-Axis threshold value. |
@description This function sets threshold values for interrupt generation on XYZ-Axes
void gyro3_write | ( | gyro3_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | value ) |
Write byte to regiter.
ctx | Click object. |
register_address | - Address of the register to write to. |
register_value | - Value to write to specified register. |
@description This function writes specified value to specified register.