c6dofimu4 2.0.0.0

Functions

void c6dofimu4_cfg_setup (c6dofimu4_cfg_t *cfg)
 Config Object Initialization function.
 
C6DOFIMU4_RETVAL c6dofimu4_init (c6dofimu4_t *ctx, c6dofimu4_cfg_t *cfg)
 Initialization function.
 
void c6dofimu4_default_cfg (c6dofimu4_t *ctx)
 Click Default Configuration function.
 
void c6dofimu4_generic_write (c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c6dofimu4_generic_read (c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t c6dofimu4_write_byte (c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Generic Single Byte Write function.
 
uint8_t c6dofimu4_read_byte (c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t *data_out)
 Generic Single Byte Read function.
 
uint8_t c6dofimu4_write_word (c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t data_in)
 Generic Word Write function.
 
uint8_t c6dofimu4_read_word (c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Generic Word Read function.
 
uint8_t c6dofimu4_write_bytes (c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
 Generic Sequential Write function.
 
uint8_t c6dofimu4_read_bytes (c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
 Generic Sequential Read function.
 
void c6dofimu4_reset (c6dofimu4_t *ctx)
 Device Reset function.
 
void c6dofimu4_set_sync_pin (c6dofimu4_t *ctx, uint8_t state)
 Sync Pin Setting function.
 
uint8_t c6dofimu4_get_int_pin (c6dofimu4_t *ctx)
 Int Pin Check function.
 
uint8_t c6dofimu4_get_status (c6dofimu4_t *ctx, uint8_t bit_mask)
 Status Check function.
 
void c6dofimu4_get_data (c6dofimu4_t *ctx, c6dofimu4_axis_t *accel_out, c6dofimu4_axis_t *gyro_out, int8_t *temp_out)
 Data Get function.
 
uint8_t c6dofimu4_set_fsr (c6dofimu4_t *ctx, uint8_t gyro_resol, uint8_t accel_resol)
 Full Scale Setting function.
 

Detailed Description

Function Documentation

◆ c6dofimu4_cfg_setup()

void c6dofimu4_cfg_setup ( c6dofimu4_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.

◆ c6dofimu4_default_cfg()

void c6dofimu4_default_cfg ( c6dofimu4_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
      set: C6DOFIMU4_I2C_IF_REG
            -C6DOFIMU4_I2C_IF_EN
      set: C6DOFIMU4_PWR_MGMT_2_REG
            -C6DOFIMU4_ALL_AXIS_EN
      set: C6DOFIMU4_PWR_MGMT_1_REG
            -C6DOFIMU4_CLKSEL_INTERNAL_20_MHZ
      set: C6DOFIMU4_INT_PIN_CFG_REG
            -C6DOFIMU4_INT_DRDY_PIN_ACT_HIGH
            -C6DOFIMU4_INT_DRDY_PIN_STAT_CLEARED
            -C6DOFIMU4_INT_STAT_CLEARED_STAT_REG_READ
      set: C6DOFIMU4_GYRO_FS_SEL_2000_DPS
            -C6DOFIMU4_ACCEL_FS_SEL_16_G

@description This function executes default configuration for c6DOF IMU 4 click.

◆ c6dofimu4_generic_read()

void c6dofimu4_generic_read ( c6dofimu4_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.

◆ c6dofimu4_generic_write()

void c6dofimu4_generic_write ( c6dofimu4_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.

◆ c6dofimu4_get_data()

void c6dofimu4_get_data ( c6dofimu4_t * ctx,
c6dofimu4_axis_t * accel_out,
c6dofimu4_axis_t * gyro_out,
int8_t * temp_out )

Data Get function.

Parameters
ctxClick object.
accel_outMemory location where accelerometer axis data be stored
gyro_outMemory location where gyroscope axis data be stored
temp_outMemory location where temperature data be stored

@description Function performs a data reading and all necessary calculations to get accelerometer, gyroscope and temperature data.

◆ c6dofimu4_get_int_pin()

uint8_t c6dofimu4_get_int_pin ( c6dofimu4_t * ctx)

Int Pin Check function.

Parameters
ctxClick object.
Returns
0 - Interrupt is not generated, 1 - Interrupt is generated

@description Function checks does interrupt generated on the Int pin.

◆ c6dofimu4_get_status()

uint8_t c6dofimu4_get_status ( c6dofimu4_t * ctx,
uint8_t bit_mask )

Status Check function.

Parameters
ctxClick object.
bit_maskSelects which interrupt bit of the Status register be checked
Returns
Masked interrupt status

@description Function checks does the desired interrupt generated.

◆ c6dofimu4_init()

C6DOFIMU4_RETVAL c6dofimu4_init ( c6dofimu4_t * ctx,
c6dofimu4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ c6dofimu4_read_byte()

uint8_t c6dofimu4_read_byte ( c6dofimu4_t * ctx,
uint8_t reg_addr,
uint8_t * data_out )

Generic Single Byte Read function.

Parameters
ctxClick object.
reg_addrAddress which from data be read
data_outMemory location where data be stored
Returns
0 - OK, 2 - Wrong address

@description Function reads one byte data from the desired register.

◆ c6dofimu4_read_bytes()

uint8_t c6dofimu4_read_bytes ( c6dofimu4_t * ctx,
uint8_t start_addr,
uint8_t * data_out,
uint8_t n_bytes )

Generic Sequential Read function.

Parameters
ctxClick object.
start_addrStart address which from data reading be started
data_outMemory location where data be stored
n_bytesNumber of bytes to be read
Returns
0 - OK, 2 - Wrong address

@description Function performs a sequential data reading starting from the desired address.

◆ c6dofimu4_read_word()

uint8_t c6dofimu4_read_word ( c6dofimu4_t * ctx,
uint8_t reg_addr,
uint16_t * data_out )

Generic Word Read function.

Parameters
ctxClick object.
reg_addrAddress of the higher byte of data which will be read
data_outMemory location where data be stored
Returns
0 - OK, 2 - Wrong address

@description Function reads 16bit data from the desired register.

◆ c6dofimu4_reset()

void c6dofimu4_reset ( c6dofimu4_t * ctx)

Device Reset function.

Parameters
ctxClick object.

@description Function performs a device reset.

◆ c6dofimu4_set_fsr()

uint8_t c6dofimu4_set_fsr ( c6dofimu4_t * ctx,
uint8_t gyro_resol,
uint8_t accel_resol )

Full Scale Setting function.

Parameters
ctxClick object.
gyro_resolSelects a full scale for gyroscope measurement [0-3]
accel_resolSelects a full scale for accelerometer measurement [0-3]
Returns
0 - OK, 3 - Full scale range error

@description Function selects a measurement full scale range.

◆ c6dofimu4_set_sync_pin()

void c6dofimu4_set_sync_pin ( c6dofimu4_t * ctx,
uint8_t state )

Sync Pin Setting function.

Parameters
ctxClick object.
stateDesired state of the Sync pin

@description Function sets the Sync pin on the desired state.

◆ c6dofimu4_write_byte()

uint8_t c6dofimu4_write_byte ( c6dofimu4_t * ctx,
uint8_t reg_addr,
uint8_t data_in )

Generic Single Byte Write function.

Parameters
ctxClick object.
reg_addrAddress where data be written
data_inData to be written
Returns
0 - OK, 2 - Wrong address

@description Function writes one byte data to the desired register.

◆ c6dofimu4_write_bytes()

uint8_t c6dofimu4_write_bytes ( c6dofimu4_t * ctx,
uint8_t start_addr,
uint8_t * data_in,
uint8_t n_bytes )

Generic Sequential Write function.

Parameters
ctxClick object.
start_addrStart address which from data writing be started
data_inData to be written
n_bytesNumber of bytes to be written
Returns
0 - OK, 2 - Wrong address

@description Function performs a sequential data writing starting from the desired address.

◆ c6dofimu4_write_word()

uint8_t c6dofimu4_write_word ( c6dofimu4_t * ctx,
uint8_t reg_addr,
uint16_t data_in )

Generic Word Write function.

Parameters
ctxClick object.
reg_addrAddress of the higher byte of data which will be written
data_inData to be written
Returns
0 - OK, 2 - Wrong address

@description Function writes 16bit data to the desired register.