gyro5  2.0.0.0
Functions
Public function

Functions

void gyro5_cfg_setup (gyro5_cfg_t *cfg)
 Config Object Initialization function. More...
 
GYRO5_RETVAL gyro5_init (gyro5_t *ctx, gyro5_cfg_t *cfg)
 Initialization function. More...
 
void gyro5_default_cfg (gyro5_t *ctx)
 Click Default Configuration function. More...
 
void gyro5_generic_write (gyro5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void gyro5_generic_read (gyro5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
uint8_t gyro5_get_int (gyro5_t *ctx)
 Getting INT pin state. More...
 
uint8_t gyro5_int_status (gyro5_t *ctx, uint8_t int_type)
 Getting interrupt status. More...
 
void gyro5_get_temperature (gyro5_t *ctx, float *temperature)
 Getting temperature value. More...
 
void gyro5_get_axes (gyro5_t *ctx, float *x_axis, float *y_axis, float *z_axis)
 Getting gyroscope axes values. More...
 
void gyro5_sleep (gyro5_t *ctx, uint8_t en_sleep)
 Set sleep mode. More...
 

Detailed Description

Function Documentation

◆ gyro5_cfg_setup()

void gyro5_cfg_setup ( gyro5_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.

◆ gyro5_default_cfg()

void gyro5_default_cfg ( gyro5_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Gyro 5 Click.

◆ gyro5_generic_read()

void gyro5_generic_read ( gyro5_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.

◆ gyro5_generic_write()

void gyro5_generic_write ( gyro5_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.

◆ gyro5_get_axes()

void gyro5_get_axes ( gyro5_t ctx,
float *  x_axis,
float *  y_axis,
float *  z_axis 
)

Getting gyroscope axes values.

Parameters
ctxClick object.
x_axispointer to memory location where float x axis value be stored
y_axispointer to memory location where float y axis value be stored
z_axispointer to memory location where float z axis value be stored

@description This function reads axes measurement registers. This function converts raw axes measurement data to get gyroscope data in [deg/s]

◆ gyro5_get_int()

uint8_t gyro5_get_int ( gyro5_t ctx)

Getting INT pin state.

Parameters
ctxClick object.
Returns
  • 0 : if INT pin state is LOW
  • 1 : if INT pin state is HIGH

@description This function returns INT pin state

◆ gyro5_get_temperature()

void gyro5_get_temperature ( gyro5_t ctx,
float *  temperature 
)

Getting temperature value.

Parameters
ctxClick object.
temperaturepointer to memory location where float temperature data be stored

@description This function reads temperature measurement registers. This function converts raw temperature data to get die temperature in [deg C]

◆ gyro5_init()

GYRO5_RETVAL gyro5_init ( gyro5_t ctx,
gyro5_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ gyro5_int_status()

uint8_t gyro5_int_status ( gyro5_t ctx,
uint8_t  int_type 
)

Getting interrupt status.

Parameters
ctxClick object.
int_typeuint8_t interrupt_type - interrupt type (data ready, fsync or fifo overflow)
Returns
  • 0 : for successful operations
  • 1 : for unsuccessful operations

@description This function returns state of specified interrupt bit

◆ gyro5_sleep()

void gyro5_sleep ( gyro5_t ctx,
uint8_t  en_sleep 
)

Set sleep mode.

Parameters
ctxClick object.
en_sleep
  • 0 : disable sleep mode
  • 1 : enable sleep mode

@description This function set sleep mode