c6dofimu5 2.0.0.0
c6dofimu5.h File Reference

This file contains API for C6DOF IMU 5 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  c6dofimu5_process_data_t
 
struct  c6dofimu5_s
 Click ctx object definition. More...
 
struct  c6dofimu5_cfg_t
 Click configuration structure definition. More...
 

Macros

#define C6DOFIMU5_MAP_MIKROBUS(cfg, mikrobus)
 
#define C6DOFIMU5_RETVAL   uint8_t
 
#define C6DOFIMU5_OK   0x00
 
#define C6DOFIMU5_INIT_ERROR   0xFF
 
#define C6DOFIMU5_I2C_SLAVE_ADR   0x63
 
#define C6DOFIMU5_READ_BIT_MASK   0x80
 
#define C6DOFIMU5_WRITE_BIT_MASK   0x7F
 
#define C6DOFIMU5_SELF_TEST_X_GYRO   0x00
 
#define C6DOFIMU5_SELF_TEST_Y_GYRO   0x01
 
#define C6DOFIMU5_SELF_TEST_Z_GYRO   0x02
 
#define C6DOFIMU5_SELF_TEST_X_ACCEL   0x0D
 
#define C6DOFIMU5_SELF_TEST_Y_ACCEL   0x0E
 
#define C6DOFIMU5_SELF_TEST_Z_ACCEL   0x0F
 
#define C6DOFIMU5_XG_OFFS_USR_H   0x13
 
#define C6DOFIMU5_XG_OFFS_USR_L   0x14
 
#define C6DOFIMU5_YG_OFFS_USR_H   0x15
 
#define C6DOFIMU5_YG_OFFS_USR_L   0x16
 
#define C6DOFIMU5_ZG_OFFS_USR_H   0x17
 
#define C6DOFIMU5_ZG_OFFS_USR_L   0x18
 
#define C6DOFIMU5_SMPL_RT_DIV   0x19
 
#define C6DOFIMU5_CFG   0x1A
 
#define C6DOFIMU5_GYRO_CFG   0x1B
 
#define C6DOFIMU5_ACCEL_CFG   0x1C
 
#define C6DOFIMU5_ACCEL_CFG_2   0x1D
 
#define C6DOFIMU5_LP_MODE_CTL   0x1E
 
#define C6DOFIMU5_ACCEL_WOM_X_THR   0x20
 
#define C6DOFIMU5_ACCEL_WOM_Y_THR   0x21
 
#define C6DOFIMU5_ACCEL_WOM_Z_THR   0x22
 
#define C6DOFIMU5_FIFO_EN   0x23
 
#define C6DOFIMU5_INT_PIN_CFG   0x37
 
#define C6DOFIMU5_INT_ENABLE   0x38
 
#define C6DOFIMU5_DMP_INT_STAT   0x39
 
#define C6DOFIMU5_INT_STAT   0x3A
 
#define C6DOFIMU5_ACCEL_XOUT_H   0x3B
 
#define C6DOFIMU5_ACCEL_XOUT_L   0x3C
 
#define C6DOFIMU5_ACCEL_YOUT_H   0x3D
 
#define C6DOFIMU5_ACCEL_YOUT_L   0x3E
 
#define C6DOFIMU5_ACCEL_ZOUT_H   0x3F
 
#define C6DOFIMU5_ACCEL_ZOUT_L   0x40
 
#define C6DOFIMU5_TEMP_OUT_H   0x41
 
#define C6DOFIMU5_TEMP_OUT_L   0x42
 
#define C6DOFIMU5_GYRO_XOUT_H   0x43
 
#define C6DOFIMU5_GYRO_XOUT_L   0x44
 
#define C6DOFIMU5_GYRO_YOUT_H   0x45
 
#define C6DOFIMU5_GYRO_YOUT_L   0x46
 
#define C6DOFIMU5_GYRO_ZOUT_H   0x47
 
#define C6DOFIMU5_GYRO_ZOUT_L   0x48
 
#define C6DOFIMU5_SIGNAL_PATH_RST   0x68
 
#define C6DOFIMU5_ACCEL_INTEL_CTL   0x69
 
#define C6DOFIMU5_USER_CTL   0x6A
 
#define C6DOFIMU5_PWR_MGMT_1   0x6B
 
#define C6DOFIMU5_PWR_MGMT_2   0x6C
 
#define C6DOFIMU5_FIFO_CNT_H   0x72
 
#define C6DOFIMU5_FIFO_CNT_L   0x73
 
#define C6DOFIMU5_FIFO_R_W   0x74
 
#define C6DOFIMU5_WHO_AM_I   0x75
 
#define C6DOFIMU5_XA_OFFS_H   0x77
 
#define C6DOFIMU5_XA_OFFS_L   0x78
 
#define C6DOFIMU5_YA_OFFS_H   0x7A
 
#define C6DOFIMU5_YA_OFFS_L   0x7B
 
#define C6DOFIMU5_ZA_OFFS_H   0x7D
 
#define C6DOFIMU5_ZA_OFFS_L   0x7E
 
#define C6DOFIMU5_CFG_FIFO_MODE   0x40
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_1   0x08
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_2   0x10
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_3   0x18
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_4   0x20
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_5   0x28
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_6   0x30
 
#define C6DOFIMU5_CFG_EXT_SYNC_SET_7   0x38
 
#define C6DOFIMU5_CFG_DLPF_CFG_0   0x00
 
#define C6DOFIMU5_CFG_DLPF_CFG_1   0x01
 
#define C6DOFIMU5_CFG_DLPF_CFG_2   0x02
 
#define C6DOFIMU5_CFG_DLPF_CFG_3   0x03
 
#define C6DOFIMU5_CFG_DLPF_CFG_4   0x04
 
#define C6DOFIMU5_CFG_DLPF_CFG_5   0x05
 
#define C6DOFIMU5_CFG_DLPF_CFG_6   0x06
 
#define C6DOFIMU5_CFG_DLPF_CFG_7   0x07
 
#define C6DOFIMU5_GYRO_CFG_XGYRO_STEN   0x80
 
#define C6DOFIMU5_GYRO_CFG_YGYRO_STEN   0x40
 
#define C6DOFIMU5_GYRO_CFG_ZGYRO_STEN   0x20
 
#define C6DOFIMU5_GYRO_CFG_FS_SEL_2000   0x18
 
#define C6DOFIMU5_GYRO_CFG_FS_SEL_1000   0x10
 
#define C6DOFIMU5_GYRO_CFG_FS_SEL_500   0x08
 
#define C6DOFIMU5_GYRO_CFG_FS_SEL_250   0x00
 
#define C6DOFIMU5_GYRO_CFG_FCHOICE_B_2   0x02
 
#define C6DOFIMU5_GYRO_CFG_FCHOICE_B_1   0x01
 
#define C6DOFIMU5_GYRO_CFG_FCHOICE_B_0   0x00
 
#define C6DOFIMU5_ACCEL_CFG_AX_ST_EN   0x80
 
#define C6DOFIMU5_ACCEL_CFG_AY_ST_EN   0x40
 
#define C6DOFIMU5_ACCEL_CFG_AZ_ST_EN   0x20
 
#define C6DOFIMU5_ACCEL_CFG_FS_SEL_16G   0x18
 
#define C6DOFIMU5_ACCEL_CFG_FS_SEL_8G   0x10
 
#define C6DOFIMU5_ACCEL_CFG_FS_SEL_4G   0x08
 
#define C6DOFIMU5_ACCEL_CFG_FS_SEL_2G   0x00
 
#define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_4KB   0x40
 
#define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_2KB   0x08
 
#define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_1KB   0x10
 
#define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_512B   0x18
 
#define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_32   0x30
 
#define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_16   0x20
 
#define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_8   0x10
 
#define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_4   0x00
 
#define C6DOFIMU5_ACCEL2_CFG_FCHOICE_B   0x00
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_0   0x00
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_1   0x01
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_2   0x02
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_3   0x03
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_4   0x04
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_5   0x05
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_6   0x06
 
#define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_7   0x07
 
#define C6DOFIMU5_FIFO_EN_TEMP_OUT   0x80
 
#define C6DOFIMU5_FIFO_EN_GYRO_XOUT   0x40
 
#define C6DOFIMU5_FIFO_EN_GYRO_YOUT   0x20
 
#define C6DOFIMU5_FIFO_EN_GYRO_ZOUT   0x10
 
#define C6DOFIMU5_FIFO_EN_ACCEL_XYZ_OUT   0x08
 
#define C6DOFIMU5_INT_PIN_CFG_ACTL   0x80
 
#define C6DOFIMU5_INT_PIN_CFG_OPEN   0x40
 
#define C6DOFIMU5_INT_PIN_CFG_LATCH_INT_EN   0x20
 
#define C6DOFIMU5_INT_PIN_CFG_INT_ANYRD_2CLR   0x10
 
#define C6DOFIMU5_INT_PIN_CFG_ACTL_FSYNC   0x08
 
#define C6DOFIMU5_INT_PIN_CFG_FSYNC_INT_MODE_EN   0x04
 
#define C6DOFIMU5_INT_PIN_CFG_BYPASS_EN   0x02
 
#define C6DOFIMU5_INT_ENABLE_WOM_X_INT_EN   0x80
 
#define C6DOFIMU5_INT_ENABLE_WOM_Y_INT_EN   0x40
 
#define C6DOFIMU5_INT_ENABLE_WOM_Z_INT_EN   0x20
 
#define C6DOFIMU5_INT_ENABLE_FIFO_OVF_EN   0x10
 
#define C6DOFIMU5_INT_ENABLE_GDRIVE_RDY_EN   0x04
 
#define C6DOFIMU5_INT_ENABLE_DMP_INT_EN   0x02
 
#define C6DOFIMU5_INT_ENABLE_RAW_RDY_EN   0x01
 
#define C6DOFIMU5_INT_STAT_WOM_X_INT   0x80
 
#define C6DOFIMU5_INT_STAT_WOM_Y_INT   0x40
 
#define C6DOFIMU5_INT_STAT_WOM_Z_INT   0x20
 
#define C6DOFIMU5_INT_STAT_FIFO_OVF_INT   0x10
 
#define C6DOFIMU5_INT_STAT_GDRIVE_RDY_INT   0x04
 
#define C6DOFIMU5_INT_STAT_DMP_INT   0x02
 
#define C6DOFIMU5_INT_STAT_RAW_RDY_INT   0x01
 
#define C6DOFIMU5_SIGNAL_PATH_RST_GYRO_RST   0x80
 
#define C6DOFIMU5_SIGNAL_PATH_RST_ACCEL_RST   0x40
 
#define C6DOFIMU5_SIGNAL_PATH_RST_TEMP_RST   0x20
 
#define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_EN   0x80
 
#define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_PREV_SAMP   0x40
 
#define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_FIRST_SAMP   0x00
 
#define C6DOFIMU5_USER_CTL_DMP_EN   0x80
 
#define C6DOFIMU5_USER_CTL_FIFO_EN   0x40
 
#define C6DOFIMU5_USER_CTL_I2C_IF_DIS   0x10
 
#define C6DOFIMU5_USER_CTL_DMP_RST   0x08
 
#define C6DOFIMU5_USER_CTL_FIFO_RST   0x04
 
#define C6DOFIMU5_USER_CTL_SIG_COND_RST   0x01
 
#define C6DOFIMU5_PWR_MGMT_1_DEV_RST   0x80
 
#define C6DOFIMU5_PWR_MGMT_1_SLEEP   0x40
 
#define C6DOFIMU5_PWR_MGMT_1_ACCEL_CYC   0x20
 
#define C6DOFIMU5_PWR_MGMT_1_GYRO_STDBY   0x10
 
#define C6DOFIMU5_PWR_MGMT_1_TEMP_DIS   0x08
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_7   0x07
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_6   0x06
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_5   0x05
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_4   0x04
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_3   0x03
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_2   0x02
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_1   0x01
 
#define C6DOFIMU5_PWR_MGMT_1_CLKSEL_0   0x00
 
#define C6DOFIMU5_PWR_MGMT_2_LP_DIS   0x80
 
#define C6DOFIMU5_PWR_MGMT_2_DMP_LP_DIS   0x40
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_XA   0x20
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_YA   0x10
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZA   0x08
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_XG   0x04
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_YG   0x02
 
#define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZG   0x01
 
#define C6DOFIMU5_WHO_AM_I_VAL   0x03
 
#define C6DOFIMU5_MEAS_CMD_LP_TRANS_T_FIRST   0x609C
 
#define C6DOFIMU5_MEAS_CMD_N_TRANS_T_FIRST   0x6825
 
#define C6DOFIMU5_MEAS_CMD_LN_TRANS_T_FIRST   0x70DF
 
#define C6DOFIMU5_MEAS_CMD_ULN_TRANS_T_FIRST   0x7866
 
#define C6DOFIMU5_MEAS_CMD_LP_TRANS_P_FIRST   0x401A
 
#define C6DOFIMU5_MEAS_CMD_N_TRANS_P_FIRST   0x48A3
 
#define C6DOFIMU5_MEAS_CMD_LN_TRANS_P_FIRST   0x5059
 
#define C6DOFIMU5_MEAS_CMD_ULN_TRANS_P_FIRST   0x58E0
 
#define C6DOFIMU5_DEVICE_SOFT_RESET_CMD   0x805D
 
#define C6DOFIMU5_READ_ID_REGISTER   0xEFC8
 
#define C6DOFIMU5_INCREMENTAL_READ   0xC7F7
 
#define C6DOFIMU5_ADR_REG_MOVE_POINTER   0xC595
 
#define C6DOFIMU5_POWER_ON   0x01
 
#define C6DOFIMU5_POWER_OFF   0x00
 
#define C6DOFIMU5_GYRO_SENS_FS_SEL_2000   16.4
 
#define C6DOFIMU5_GYRO_SENS_FS_SEL_1000   32.8
 
#define C6DOFIMU5_GYRO_SENS_FS_SEL_500   65.5
 
#define C6DOFIMU5_GYRO_SENS_FS_SEL_250   131.0
 
#define C6DOFIMU5_ACCEL_SENS_FS_SEL_16G   2048.0
 
#define C6DOFIMU5_ACCEL_SENS_FS_SEL_8G   4096.0
 
#define C6DOFIMU5_ACCEL_SENS_FS_SEL_4G   8192.0
 
#define C6DOFIMU5_ACCEL_SENS_FS_SEL_2G   16384.0
 
#define C6DOFIMU5_LUT_LOWER   3670016.0
 
#define C6DOFIMU5_LUT_UPPER   12058624.0
 
#define C6DOFIMU5_QUADR_FACTOR   0.000000059604644775390625
 
#define C6DOFIMU5_OFFST_FACTOR   2048.0
 
#define C6DOFIMU5_P_PA_CALIB_0   45000.0
 
#define C6DOFIMU5_P_PA_CALIB_1   80000.0
 
#define C6DOFIMU5_P_PA_CALIB_2   105000.0
 

Typedefs

typedef struct c6dofimu5_s c6dofimu5_t
 Click ctx object definition.
 

Functions

void c6dofimu5_cfg_setup (c6dofimu5_cfg_t *cfg)
 Config Object Initialization function.
 
C6DOFIMU5_RETVAL c6dofimu5_init (c6dofimu5_t *ctx, c6dofimu5_cfg_t *cfg)
 Initialization function.
 
void c6dofimu5_default_cfg (c6dofimu5_t *ctx)
 Click Default Configuration function.
 
void c6dofimu5_write_bytes (c6dofimu5_t *ctx, uint8_t reg, uint8_t *wr_data, uint16_t n_bytes)
 Generic write function.
 
void c6dofimu5_read_bytes (c6dofimu5_t *ctx, uint8_t reg, uint8_t *rd_data, uint16_t n_bytes)
 Generic read function.
 
void c6dofimu5_power (c6dofimu5_t *ctx, uint8_t on_off)
 Power up function.
 
int16_t c6dofimu5_read_gyro_x (c6dofimu5_t *ctx)
 Read Gyroscope X-axis data function.
 
int16_t c6dofimu5_read_gyro_y (c6dofimu5_t *ctx)
 Read Gyroscope Y-axis data function.
 
int16_t c6dofimu5_read_gyro_z (c6dofimu5_t *ctx)
 Read Gyroscope Z-axis data function.
 
void c6dofimu5_read_gyroscope (c6dofimu5_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
 Read gyroscope data function.
 
void c6dofimu5_angular_rate (c6dofimu5_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte)
 Read Angular Rate function.
 
int16_t c6dofimu5_read_accel_x (c6dofimu5_t *ctx)
 Read Accelerometer X-axis data function.
 
int16_t c6dofimu5_read_accel_y (c6dofimu5_t *ctx)
 Read Accelerometer Y-axis data function.
 
int16_t c6dofimu5_read_accel_z (c6dofimu5_t *ctx)
 Read Accelerometer Z-axis data function.
 
void c6dofimu5_read_accelerometer (c6dofimu5_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z)
 Read accelerometer data function.
 
void c6dofimu5_acceleration_rate (c6dofimu5_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte)
 Read acceleration Rate function.
 
float c6dofimu5_read_temp_out (c6dofimu5_t *ctx)
 Read temperture function.
 
void c6dofimu5_baro_read (c6dofimu5_t *ctx, uint16_t cmd, uint8_t *data_out, uint16_t n_bytes)
 Barometer Read function.
 
void c6dofimu5_baro_write (c6dofimu5_t *ctx, uint8_t *data_in, uint16_t n_bytes)
 Barometer Write function.
 
void c6dofimu5_baro_settings (c6dofimu5_t *ctx)
 I2C Barometer Settings function.
 
uint8_t c6dofimu5_baro_id_read (c6dofimu5_t *ctx)
 Barometer ID Readout function.
 
void c6dofimu5_baro_soft_rst (c6dofimu5_t *ctx)
 Soft Reset Command function.
 
void c6dofimu5_process_data (c6dofimu5_t *ctx, c6dofimu5_process_data_t *process_d)
 Process data function.
 
void c6dofimu5_read_raw_data (c6dofimu5_t *ctx, uint32_t *pres, uint16_t *temp)
 Read raw data function.
 
uint8_t c6dofimu5_check_int_pin (c6dofimu5_t *ctx)
 Check Interrupt state function.
 

Detailed Description

This file contains API for C6DOF IMU 5 Click driver.