gyro3 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ gyro3_cfg_setup()

void gyro3_cfg_setup ( gyro3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ gyro3_default_cfg()

void gyro3_default_cfg ( gyro3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Gyro 3 click.

◆ gyro3_di2_get()

uint8_t gyro3_di2_get ( gyro3_t * ctx)

Get di2 (AN) pin state.

Parameters
ctxClick object.
Returns
0 for LOW and 1 for HIGH pin di2 state.

@description This function gets AN i.e di2 pin state.

◆ gyro3_generic_read()

void gyro3_generic_read ( gyro3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ gyro3_generic_write()

void gyro3_generic_write ( gyro3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ gyro3_get_axes()

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.

Parameters
ctxClick 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.

◆ gyro3_get_fifo_data_level()

void gyro3_get_fifo_data_level ( gyro3_t * ctx,
uint8_t * fifo_data_level )

Get FIFO data level.

Parameters
ctxClick 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

◆ gyro3_get_status()

void gyro3_get_status ( gyro3_t * ctx,
uint8_t * status_register )

Getting status register content.

Parameters
ctxClick object.
status_register- Status register value.

@description This function gets value of status register (27h)

◆ gyro3_get_temp()

void gyro3_get_temp ( gyro3_t * ctx,
uint8_t * temperature_value )

Read value from temperature register.

Parameters
ctxClick object.
temperature_value- Value stored to temperature register (26h).

@description This function reads value stored in temperature register (26h).

◆ gyro3_init()

GYRO3_RETVAL gyro3_init ( gyro3_t * ctx,
gyro3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ gyro3_int_get()

uint8_t gyro3_int_get ( gyro3_t * ctx)

Get INT pin state.

Parameters
ctxClick object.
Returns
0 for LOW and 1 for HIGH INT pin state.

@description This function gets INT pin state.

◆ gyro3_read()

void gyro3_read ( gyro3_t * ctx,
uint8_t register_address,
uint8_t * read_buffer,
uint8_t n_bytes )

Reading register(s)

Parameters
ctxClick 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.

◆ gyro3_set_int1_duration()

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.

Parameters
ctxClick object.
wait_enable_bit- WAKE bit value
duration_value- Duration steps and maximum values depend on the ODR chosen
Returns
0-success, 1-error

@description This function sets the minimum duration of the interrupt event to be recognized.

◆ gyro3_set_int1_thresholds()

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.

Parameters
ctxClick 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

◆ gyro3_write()

void gyro3_write ( gyro3_t * ctx,
uint8_t register_address,
uint8_t value )

Write byte to regiter.

Parameters
ctxClick 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.