c6dofimu2 2.0.0.0

Functions

void c6dofimu2_cfg_setup (c6dofimu2_cfg_t *cfg)
 Config Object Initialization function.
 
C6DOFIMU2_RETVAL c6dofimu2_init (c6dofimu2_t *ctx, c6dofimu2_cfg_t *cfg)
 Initialization function.
 
void c6dofimu2_default_cfg (c6dofimu2_t *ctx, c6dofimu2_cfg_t *cfg)
 Click Default Configuration function.
 
void c6dofimu2_generic_write (c6dofimu2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c6dofimu2_generic_read (c6dofimu2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
int16_t c6dofimu2_get_axis (c6dofimu2_t *ctx, uint8_t adr_reg_low, uint8_t adr_reg_high)
 Low and high register data function.
 
void c6dofimu2_read_accel (c6dofimu2_t *ctx, c6dofimu2_accel_data_t *accel_data)
 Read axis function.
 
void c6dofimu2_read_gyro (c6dofimu2_t *ctx, c6dofimu2_gyro_data_t *gyro_data)
 Read axis function.
 

Detailed Description

Function Documentation

◆ c6dofimu2_cfg_setup()

void c6dofimu2_cfg_setup ( c6dofimu2_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.

◆ c6dofimu2_default_cfg()

void c6dofimu2_default_cfg ( c6dofimu2_t * ctx,
c6dofimu2_cfg_t * cfg )

Click Default Configuration function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function executes default configuration for 6DOF IMU 2 click.

Note
Click default configuration: First recognizes type of communication and then sets both

accelerometer and gyroscope in their normal state of performance.

    C6DOFIMU2_CFG_COMMAND
--------------------------------------
    C6DOFIMU2_ACCEL_NORMAL 
  | C6DOFIMU2_GYRO_NORMAL

◆ c6dofimu2_generic_read()

void c6dofimu2_generic_read ( c6dofimu2_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.

◆ c6dofimu2_generic_write()

void c6dofimu2_generic_write ( c6dofimu2_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.

◆ c6dofimu2_get_axis()

int16_t c6dofimu2_get_axis ( c6dofimu2_t * ctx,
uint8_t adr_reg_low,
uint8_t adr_reg_high )

Low and high register data function.

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

@description This function get data from two BMI160 registers.

◆ c6dofimu2_init()

C6DOFIMU2_RETVAL c6dofimu2_init ( c6dofimu2_t * ctx,
c6dofimu2_cfg_t * cfg )

Initialization function.

Parameters
c6dofimu2Click object.
cfgClick configuration structure.

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

◆ c6dofimu2_read_accel()

void c6dofimu2_read_accel ( c6dofimu2_t * ctx,
c6dofimu2_accel_data_t * accel_data )

Read axis function.

Parameters
ctxClick object.
accel_dataPointer to structure where Accel data be stored.

@description This function read Accel X-axis, Y-axis and Z-axis.

◆ c6dofimu2_read_gyro()

void c6dofimu2_read_gyro ( c6dofimu2_t * ctx,
c6dofimu2_gyro_data_t * gyro_data )

Read axis function.

Parameters
ctxClick object.
gyro_dataPointer to structure where Gyro data be stored.

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