gyro2 2.0.0.0
|
Functions | |
void | gyro2_cfg_setup (gyro2_cfg_t *cfg) |
Config Object Initialization function. | |
GYRO2_RETVAL | gyro2_init (gyro2_t *ctx, gyro2_cfg_t *cfg) |
Initialization function. | |
uint8_t | gyro2_default_cfg (gyro2_t *ctx) |
Click Default Configuration function. | |
void | gyro2_generic_write (gyro2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | gyro2_generic_read (gyro2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | gyro2_scs_set (gyro2_t *ctx, uint8_t val) |
Set cs pin function. | |
void | gyro2_rst_set (gyro2_t *ctx, uint8_t val) |
Set rst pin function. | |
void | gyro2_cs_set (gyro2_t *ctx, uint8_t val) |
Comm interface function. | |
void | gyro2_rdy_set (gyro2_t *ctx, uint8_t val) |
Set ready pin function. | |
uint8_t | gyro2_rdy_get (gyro2_t *ctx) |
Get ready pin function. | |
uint8_t | gyro2_int_get (gyro2_t *ctx) |
Get int pin function. | |
void | gyro2_hw_reset (gyro2_t *ctx) |
Hardware reset function. | |
uint8_t | gyro2_get_id (gyro2_t *ctx) |
ID return function. | |
void | gyro2_get_axisraw (gyro2_t *ctx, int16_t *axis_data) |
Axis read function. | |
void | gyro2_calc_axis (int16_t *axis_data) |
Calc axis funtion. | |
uint8_t | gyro2_read_temperature (gyro2_t *ctx) |
Temperature read function. | |
void | gyro2_sw_reset (gyro2_t *ctx) |
Soft reset function. | |
void | gyro2_set_dr (gyro2_t *ctx, uint8_t rate) |
Data rate function. | |
void | gyro2_set_opmode (gyro2_t *ctx, uint8_t opmode) |
void | gyro2_interrupt_cfg (gyro2_t *ctx, uint8_t int_route, uint8_t int_en, uint8_t polarity_outdrvsetting) |
Interrupt cfg function. | |
void | gyro2_interrupt_event_generation (gyro2_t *ctx, uint8_t cfg) |
Int event generation function. | |
void | gyro2_sensitivity (gyro2_t *ctx, uint8_t s_setting) |
Sensitivity function. | |
void | gyro2_fr_setup (gyro2_t *ctx, uint8_t low_pass, uint8_t hi_pass, uint8_t scale_set) |
Filter and scale of measurement functio. | |
void gyro2_calc_axis | ( | int16_t * | axis_data | ) |
Calc axis funtion.
axis_data | 16bit axis data array |
@description Function for calculating raw axis data.
void gyro2_cfg_setup | ( | gyro2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void gyro2_cs_set | ( | gyro2_t * | ctx, |
uint8_t | val ) |
Comm interface function.
ctx | Click object. |
val | Pin state value. |
@description Function for setting the communication interface.
0 - I2C inteface enabled 1 - SPI interface enabled
uint8_t gyro2_default_cfg | ( | gyro2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Gyro 2 click.
void gyro2_fr_setup | ( | gyro2_t * | ctx, |
uint8_t | low_pass, | ||
uint8_t | hi_pass, | ||
uint8_t | scale_set ) |
Filter and scale of measurement functio.
ctx | Click object |
low_pass | Low pass filte |
hi_pass | High pass filte |
scale_set | Scake settin |
@description Function for setting filters and the full scale of the measurement
void gyro2_generic_read | ( | gyro2_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 gyro2_generic_write | ( | gyro2_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 gyro2_get_axisraw | ( | gyro2_t * | ctx, |
int16_t * | axis_data ) |
Axis read function.
ctx | Click object. |
axis_data | 16bit axis data array |
@description Function will read the X, Y and Z axis registers. Data that is read is storred the 3 16bit array.
uint8_t gyro2_get_id | ( | gyro2_t * | ctx | ) |
ID return function.
ctx | Click object. |
@description Function will return the ID from the ID register
void gyro2_hw_reset | ( | gyro2_t * | ctx | ) |
Hardware reset function.
ctx | Click object. |
@description Function for hardware reset of the device.
GYRO2_RETVAL gyro2_init | ( | gyro2_t * | ctx, |
gyro2_cfg_t * | cfg ) |
Initialization function.
gyro2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t gyro2_int_get | ( | gyro2_t * | ctx | ) |
Get int pin function.
ctx | Click object. |
@description Function for reading the state of the interrupt pin.
void gyro2_interrupt_cfg | ( | gyro2_t * | ctx, |
uint8_t | int_route, | ||
uint8_t | int_en, | ||
uint8_t | polarity_outdrvsetting ) |
Interrupt cfg function.
ctx | Click object. |
int_route | Cfg route. |
int_en | Interrupt enable |
polarity_outdrvsetting | logical polarity |
@description Function for configuring Interrupt register
void gyro2_interrupt_event_generation | ( | gyro2_t * | ctx, |
uint8_t | cfg ) |
Int event generation function.
ctx | Click object. |
cfg | Configuration value |
@description Function for enabling interrupt event generation
uint8_t gyro2_rdy_get | ( | gyro2_t * | ctx | ) |
Get ready pin function.
ctx | Click object. |
@description Function for reading the state of the ready pin.
void gyro2_rdy_set | ( | gyro2_t * | ctx, |
uint8_t | val ) |
Set ready pin function.
ctx | Click object. |
val | Pin state value. |
@description Function for setting the ready pin.
uint8_t gyro2_read_temperature | ( | gyro2_t * | ctx | ) |
Temperature read function.
ctx | Click object. |
@description Function for reading the temperature register.
void gyro2_rst_set | ( | gyro2_t * | ctx, |
uint8_t | val ) |
Set rst pin function.
ctx | Click object. |
val | Pin state value. |
@description Function for setting the hw reset pin.
void gyro2_scs_set | ( | gyro2_t * | ctx, |
uint8_t | val ) |
Set cs pin function.
ctx | Click object. |
val | Pin state value. |
@description Function for setting the chip select pin value.
void gyro2_sensitivity | ( | gyro2_t * | ctx, |
uint8_t | s_setting ) |
Sensitivity function.
ctx | Click object |
s_setting | Sensitivity setting |
@description Function for setting the sensitivity
void gyro2_set_dr | ( | gyro2_t * | ctx, |
uint8_t | rate ) |
Data rate function.
ctx | Click object. |
rate | Data rate |
@description Function for setting the data rate.
void gyro2_set_opmode | ( | gyro2_t * | ctx, |
uint8_t | opmode ) |
void gyro2_sw_reset | ( | gyro2_t * | ctx | ) |
Soft reset function.
ctx | Click object. |
@description Function for tringgering a software reset of the click board.