gyro  2.0.0.0
Functions
Public function

Functions

void gyro_cfg_setup (gyro_cfg_t *cfg)
 Config Object Initialization function. More...
 
GYRO_RETVAL gyro_init (gyro_t *ctx, gyro_cfg_t *cfg)
 Initialization function. More...
 
void gyro_default_cfg (gyro_t *ctx)
 Click Default Configuration function. More...
 
void gyro_write_data (gyro_t *ctx, uint8_t address, uint8_t write_command)
 Generic write data function. More...
 
uint8_t gyro_read_data (gyro_t *ctx, uint8_t address)
 Generic read data function. More...
 
int16_t gyro_get_axis (gyro_t *ctx, uint8_t adr_reg_low)
 Function get low and high register data. More...
 
void gyro_read_gyro (gyro_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
 Function read axis. More...
 

Detailed Description

Function Documentation

◆ gyro_cfg_setup()

void gyro_cfg_setup ( gyro_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.

◆ gyro_default_cfg()

void gyro_default_cfg ( gyro_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Gyro Click.

◆ gyro_get_axis()

int16_t gyro_get_axis ( gyro_t ctx,
uint8_t  adr_reg_low 
)

Function get low and high register data.

Parameters
ctxClick object.
adr_reg_lowlow data register address
Returns
16-bit value ( low and high data )

@description Function get data from two L3GD20 register.

◆ gyro_init()

GYRO_RETVAL gyro_init ( gyro_t ctx,
gyro_cfg_t cfg 
)

Initialization function.

Parameters
gyroClick object.
cfgClick configuration structure.

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

◆ gyro_read_data()

uint8_t gyro_read_data ( gyro_t ctx,
uint8_t  address 
)

Generic read data function.

Parameters
ctxClick object.
addressRegister address
Returns
Data from addressed register in L3GD20

@description Function read byte of data from register address of L3GD20.

◆ gyro_read_gyro()

void gyro_read_gyro ( gyro_t ctx,
int16_t *  gyro_x,
int16_t *  gyro_y,
int16_t *  gyro_z 
)

Function read axis.

Parameters
ctxClick object.
gyro_xpointer to read Gyro X-axis data
gyro_ypointer to read Gyro Y-axis data
gyro_zpointer to read Gyro Z-axis data

@description Function read Gyro X-axis, Y-axis and Z-axis axis.

◆ gyro_write_data()

void gyro_write_data ( gyro_t ctx,
uint8_t  address,
uint8_t  write_command 
)

Generic write data function.

Parameters
ctxClick object.
addressRegister address
write_commandCommand to write

@description Function write byte of data to L3GD20.