accel8 2.0.0.0
Public function

Functions

void accel8_cfg_setup (accel8_cfg_t *cfg)
 Config Object Initialization function.
 
ACCEL8_RETVAL accel8_init (accel8_t *ctx, accel8_cfg_t *cfg)
 Initialization function.
 
void accel8_default_cfg (accel8_t *ctx, uint8_t accel_cfg, uint8_t gyro_cfg, range_retval_t *rng)
 Click Default Configuration function.
 
void accel8_generic_write (accel8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void accel8_generic_read (accel8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t accel8_read_data (accel8_t *ctx, uint8_t reg)
 Generic read function.
 
float accel8_get_temperature (accel8_t *ctx)
 Functions for read Temperature data in C.
 
void accel8_get_accel_axis (accel8_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Functions for read Accel axis data.
 
void accel8_get_gyro_axis (accel8_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Functions for read Gyro axis data.
 
uint8_t accel8_get_interrupt (accel8_t *ctx)
 Functions for read INT pin state.
 

Detailed Description

Function Documentation

◆ accel8_cfg_setup()

void accel8_cfg_setup ( accel8_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.

◆ accel8_default_cfg()

void accel8_default_cfg ( accel8_t * ctx,
uint8_t accel_cfg,
uint8_t gyro_cfg,
range_retval_t * rng )

Click Default Configuration function.

Parameters
ctxClick object.
accel_cfgAccel configutarion.
accel_rangeAccel range output value.
rngRange value object.

@description This function executes default configuration and gets values for range for Accel8 click.

◆ accel8_generic_read()

void accel8_generic_read ( accel8_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

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

@description This function reads data from the desired register.

◆ accel8_generic_write()

void accel8_generic_write ( accel8_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

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

@description This function writes data to the desired register.

◆ accel8_get_accel_axis()

void accel8_get_accel_axis ( accel8_t * ctx,
int16_t * x_axis,
int16_t * y_axis,
int16_t * z_axis )

Functions for read Accel axis data.

Parameters
ctxClick object.
x_axisAccel X axis data.
y_axisAccel Y axis data.
z_axisAccel Z axis data.

@description This function reads Accel axis data.

◆ accel8_get_gyro_axis()

void accel8_get_gyro_axis ( accel8_t * ctx,
int16_t * x_axis,
int16_t * y_axis,
int16_t * z_axis )

Functions for read Gyro axis data.

Parameters
ctxClick object.
x_axisGyro X axis data.
y_axisGyro Y axis data.
z_axisGyro Z axis data.

@description This function reads Gyro axis data.

◆ accel8_get_interrupt()

uint8_t accel8_get_interrupt ( accel8_t * ctx)

Functions for read INT pin state.

Parameters
ctxClick object.
Return values
Interruptstate.

@description This function returns Interupt state.

◆ accel8_get_temperature()

float accel8_get_temperature ( accel8_t * ctx)

Functions for read Temperature data in C.

Parameters
ctxClick object.
Return values
Temperaturedata

@Note Formule :

   Temperature = Temp_OUT / 340 + 36.53
   Temp_OUT = 16bit Temp data
 

◆ accel8_init()

ACCEL8_RETVAL accel8_init ( accel8_t * ctx,
accel8_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ accel8_read_data()

uint16_t accel8_read_data ( accel8_t * ctx,
uint8_t reg )

Generic read function.

Parameters
ctxClick object.
regRegister address.
Return values
Oneword read from the register.

@description This function reads 1 word from the desired register.