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.
 

Detailed Description

Function Documentation

◆ gyro2_calc_axis()

void gyro2_calc_axis ( int16_t * axis_data)

Calc axis funtion.

Parameters
axis_data16bit axis data array

@description Function for calculating raw axis data.

◆ gyro2_cfg_setup()

void gyro2_cfg_setup ( gyro2_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.

◆ gyro2_cs_set()

void gyro2_cs_set ( gyro2_t * ctx,
uint8_t val )

Comm interface function.

Parameters
ctxClick object.
valPin state value.

@description Function for setting the communication interface.

 0 - I2C inteface enabled
 1 - SPI interface enabled 

◆ gyro2_default_cfg()

uint8_t gyro2_default_cfg ( gyro2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

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

◆ gyro2_fr_setup()

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.

Parameters
ctxClick object
low_passLow pass filte
hi_passHigh pass filte
scale_setScake settin

@description Function for setting filters and the full scale of the measurement

◆ gyro2_generic_read()

void gyro2_generic_read ( gyro2_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.

◆ gyro2_generic_write()

void gyro2_generic_write ( gyro2_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.

◆ gyro2_get_axisraw()

void gyro2_get_axisraw ( gyro2_t * ctx,
int16_t * axis_data )

Axis read function.

Parameters
ctxClick object.
axis_data16bit axis data array

@description Function will read the X, Y and Z axis registers. Data that is read is storred the 3 16bit array.

◆ gyro2_get_id()

uint8_t gyro2_get_id ( gyro2_t * ctx)

ID return function.

Parameters
ctxClick object.

@description Function will return the ID from the ID register

◆ gyro2_hw_reset()

void gyro2_hw_reset ( gyro2_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description Function for hardware reset of the device.

◆ gyro2_init()

GYRO2_RETVAL gyro2_init ( gyro2_t * ctx,
gyro2_cfg_t * cfg )

Initialization function.

Parameters
gyro2Click object.
cfgClick configuration structure.

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

◆ gyro2_int_get()

uint8_t gyro2_int_get ( gyro2_t * ctx)

Get int pin function.

Parameters
ctxClick object.

@description Function for reading the state of the interrupt pin.

◆ gyro2_interrupt_cfg()

void gyro2_interrupt_cfg ( gyro2_t * ctx,
uint8_t int_route,
uint8_t int_en,
uint8_t polarity_outdrvsetting )

Interrupt cfg function.

Parameters
ctxClick object.
int_routeCfg route.
int_enInterrupt enable
polarity_outdrvsettinglogical polarity

@description Function for configuring Interrupt register

◆ gyro2_interrupt_event_generation()

void gyro2_interrupt_event_generation ( gyro2_t * ctx,
uint8_t cfg )

Int event generation function.

Parameters
ctxClick object.
cfgConfiguration value

@description Function for enabling interrupt event generation

◆ gyro2_rdy_get()

uint8_t gyro2_rdy_get ( gyro2_t * ctx)

Get ready pin function.

Parameters
ctxClick object.

@description Function for reading the state of the ready pin.

◆ gyro2_rdy_set()

void gyro2_rdy_set ( gyro2_t * ctx,
uint8_t val )

Set ready pin function.

Parameters
ctxClick object.
valPin state value.

@description Function for setting the ready pin.

◆ gyro2_read_temperature()

uint8_t gyro2_read_temperature ( gyro2_t * ctx)

Temperature read function.

Parameters
ctxClick object.

@description Function for reading the temperature register.

◆ gyro2_rst_set()

void gyro2_rst_set ( gyro2_t * ctx,
uint8_t val )

Set rst pin function.

Parameters
ctxClick object.
valPin state value.

@description Function for setting the hw reset pin.

◆ gyro2_scs_set()

void gyro2_scs_set ( gyro2_t * ctx,
uint8_t val )

Set cs pin function.

Parameters
ctxClick object.
valPin state value.

@description Function for setting the chip select pin value.

◆ gyro2_sensitivity()

void gyro2_sensitivity ( gyro2_t * ctx,
uint8_t s_setting )

Sensitivity function.

Parameters
ctxClick object
s_settingSensitivity setting

@description Function for setting the sensitivity

◆ gyro2_set_dr()

void gyro2_set_dr ( gyro2_t * ctx,
uint8_t rate )

Data rate function.

Parameters
ctxClick object.
rateData rate

@description Function for setting the data rate.

◆ gyro2_set_opmode()

void gyro2_set_opmode ( gyro2_t * ctx,
uint8_t opmode )

◆ gyro2_sw_reset()

void gyro2_sw_reset ( gyro2_t * ctx)

Soft reset function.

Parameters
ctxClick object.

@description Function for tringgering a software reset of the click board.