c6dofimu16 2.1.0.0
c6dofimu16.h File Reference

This file contains API for 6DOF IMU 16 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  c6dofimu16_s
 6DOF IMU 16 Click context object. More...
 
struct  c6dofimu16_cfg_t
 6DOF IMU 16 Click configuration object. More...
 
struct  c6dofimu16_axis_t
 6DOF IMU 16 Click axes data structure. More...
 

Macros

#define C6DOFIMU16_REG_ACCEL_DATA_X1_UI   0x00
 6DOF IMU 16 description register.
 
#define C6DOFIMU16_REG_ACCEL_DATA_X0_UI   0x01
 
#define C6DOFIMU16_REG_ACCEL_DATA_Y1_UI   0x02
 
#define C6DOFIMU16_REG_ACCEL_DATA_Y0_UI   0x03
 
#define C6DOFIMU16_REG_ACCEL_DATA_Z1_UI   0x04
 
#define C6DOFIMU16_REG_ACCEL_DATA_Z0_UI   0x05
 
#define C6DOFIMU16_REG_GYRO_DATA_X1_UI   0x06
 
#define C6DOFIMU16_REG_GYRO_DATA_X0_UI   0x07
 
#define C6DOFIMU16_REG_GYRO_DATA_Y1_UI   0x08
 
#define C6DOFIMU16_REG_GYRO_DATA_Y0_UI   0x09
 
#define C6DOFIMU16_REG_GYRO_DATA_Z1_UI   0x0A
 
#define C6DOFIMU16_REG_GYRO_DATA_Z0_UI   0x0B
 
#define C6DOFIMU16_REG_TEMP_DATA1_UI   0x0C
 
#define C6DOFIMU16_REG_TEMP_DATA0_UI   0x0D
 
#define C6DOFIMU16_REG_TMST_FSYNCH   0x0E
 
#define C6DOFIMU16_REG_TMST_FSYNCL   0x0F
 
#define C6DOFIMU16_REG_PWR_MGMNT0   0x10
 
#define C6DOFIMU16_REG_FIFO_COUNT_0   0x12
 
#define C6DOFIMU16_REG_FIFO_COUNT_1   0x13
 
#define C6DOFIMU16_REG_FIFO_DATA   0x14
 
#define C6DOFIMU16_REG_INT1_CONFIG0   0x16
 
#define C6DOFIMU16_REG_INT1_CONFIG1   0x17
 
#define C6DOFIMU16_REG_INT1_CONFIG2   0x18
 
#define C6DOFIMU16_REG_INT1_STATUS0   0x19
 
#define C6DOFIMU16_REG_ACCEL_CONFIG0   0x1B
 
#define C6DOFIMU16_REG_GYRO_CONFIG0   0x1C
 
#define C6DOFIMU16_REG_FIFO_CONFIG0   0x1D
 
#define C6DOFIMU16_REG_FIFO_CONFIG1_0   0x1E
 
#define C6DOFIMU16_REG_FIFO_CONFIG1_1   0x1F
 
#define C6DOFIMU16_REG_FIFO_CONFIG2   0x20
 
#define C6DOFIMU16_REG_FIFO_CONFIG3   0x21
 
#define C6DOFIMU16_REG_FIFO_CONFIG4   0x22
 
#define C6DOFIMU16_REG_DMP_EXT_SEN_ODR_CFG   0x27
 
#define C6DOFIMU16_REG_EDMP_APEX_EN0   0x29
 
#define C6DOFIMU16_REG_EDMP_APEX_EN1   0x2A
 
#define C6DOFIMU16_REG_APEX_BUFFER_MGMT   0x2B
 
#define C6DOFIMU16_REG_INTF_CONFIG0   0x2C
 
#define C6DOFIMU16_REG_INTF_CONFIG1_OVRD   0x2D
 
#define C6DOFIMU16_REG_IOC_PAD_SCENARIO   0x2F
 
#define C6DOFIMU16_REG_IOC_PAD_SCENARIO_AUX_OVRD   0x30
 
#define C6DOFIMU16_REG_IOC_PAD_SCENARIO_OVRD   0x31
 
#define C6DOFIMU16_REG_DRIVE_CONFIG0   0x32
 
#define C6DOFIMU16_REG_DRIVE_CONFIG1   0x33
 
#define C6DOFIMU16_REG_DRIVE_CONFIG2   0x34
 
#define C6DOFIMU16_REG_INT_APEX_CONFIG1   0x3A
 
#define C6DOFIMU16_REG_INT_APEX_STATUS0   0x3B
 
#define C6DOFIMU16_REG_INT_APEX_STATUS1   0x3C
 
#define C6DOFIMU16_REG_INT2_CONFIG0   0x56
 
#define C6DOFIMU16_REG_INT2_CONFIG1   0x57
 
#define C6DOFIMU16_REG_INT2_CONFIG2   0x58
 
#define C6DOFIMU16_REG_INT2_STATUS0   0x59
 
#define C6DOFIMU16_REG_WHO_AM_I   0x72
 
#define C6DOFIMU16_REG_REG_HOST_MSG   0x73
 
#define C6DOFIMU16_REG_IREG_ADDR_15_8   0x7C
 
#define C6DOFIMU16_REG_IREG_ADDR_7_0   0x7D
 
#define C6DOFIMU16_REG_IREG_DATA   0x7E
 
#define C6DOFIMU16_REG_REG_MISC2   0x7F
 
#define C6DOFIMU16_GYRO_MODE_OFF   0x00
 6DOF IMU 16 description setting.
 
#define C6DOFIMU16_GYRO_MODE_STANDBY   0x04
 
#define C6DOFIMU16_GYRO_MODE_LOW_POWER   0x08
 
#define C6DOFIMU16_GYRO_MODE_LOW_NOISE   0x0C
 
#define C6DOFIMU16_ACCEL_MODE_OFF   0x00
 
#define C6DOFIMU16_ACCEL_MODE_STANDBY   0x01
 
#define C6DOFIMU16_ACCEL_MODE_LOW_POWER   0x02
 
#define C6DOFIMU16_ACCEL_MODE_LOW_NOISE   0x03
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_MASK   0xF0
 6DOF IMU 16 gyro full-scale setting.
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_2000DPS   0x10
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_1000DPS   0x20
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_500DPS   0x30
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_250DPS   0x40
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_125DPS   0x50
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_62_5DPS   0x60
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_31_25DPS   0x70
 
#define C6DOFIMU16_GYRO_UI_FS_SEL_15_625DPS   0x80
 
#define C6DOFIMU16_ACCEL_UI_FS_SEL_MASK   0x70
 6DOF IMU 16 accel full-scale setting.
 
#define C6DOFIMU16_ACCEL_UI_FS_SEL_16g   0x10
 
#define C6DOFIMU16_ACCEL_UI_FS_SEL_8g   0x20
 
#define C6DOFIMU16_ACCEL_UI_FS_SEL_4g   0x30
 
#define C6DOFIMU16_ACCEL_UI_FS_SEL_2g   0x40
 
#define C6DOFIMU16_ACCEL_ODR_6_4_KHZ   0x03
 6DOF IMU 16 accel ODR setting.
 
#define C6DOFIMU16_ACCEL_ODR_3_2_KHZ   0x04
 
#define C6DOFIMU16_ACCEL_ODR_1_6_KHZ   0x05
 
#define C6DOFIMU16_ACCEL_ODR_800_HZ   0x06
 
#define C6DOFIMU16_ACCEL_ODR_400_HZ   0x07
 
#define C6DOFIMU16_ACCEL_ODR_200_HZ   0x08
 
#define C6DOFIMU16_ACCEL_ODR_100_HZ   0x09
 
#define C6DOFIMU16_ACCEL_ODR_50_HZ   0x0A
 
#define C6DOFIMU16_ACCEL_ODR_25_HZ   0x0B
 
#define C6DOFIMU16_ACCEL_ODR_12_5_HZ   0x0C
 
#define C6DOFIMU16_ACCEL_ODR_6_25_HZ   0x0D
 
#define C6DOFIMU16_ACCEL_ODR_3_125_HZ   0x0E
 
#define C6DOFIMU16_ACCEL_ODR_1_5625_HZ   0x0F
 
#define C6DOFIMU16_GYRO_ODR_6_4_KHZ   0x03
 6DOF IMU 16 gyro ODR setting.
 
#define C6DOFIMU16_GYRO_ODR_3_2_KHZ   0x04
 
#define C6DOFIMU16_GYRO_ODR_1_6_KHZ   0x05
 
#define C6DOFIMU16_GYRO_ODR_800_HZ   0x06
 
#define C6DOFIMU16_GYRO_ODR_400_HZ   0x07
 
#define C6DOFIMU16_GYRO_ODR_200_HZ   0x08
 
#define C6DOFIMU16_GYRO_ODR_100_HZ   0x09
 
#define C6DOFIMU16_GYRO_ODR_50_HZ   0x0A
 
#define C6DOFIMU16_GYRO_ODR_25_HZ   0x0B
 
#define C6DOFIMU16_GYRO_ODR_12_5_HZ   0x0C
 
#define C6DOFIMU16_GYRO_ODR_6_25_HZ   0x0D
 
#define C6DOFIMU16_GYRO_ODR_3_125_HZ   0x0E
 
#define C6DOFIMU16_GYRO_ODR_1_5625_HZ   0x0F
 
#define C6DOFIMU16_SOFTWARE_RESET   0x02
 6DOF IMU 16 software reset setting.
 
#define C6DOFIMU16_DEVICE_ID   0xE5
 6DOF IMU 16 device ID setting.
 
#define C6DOFIMU16_ACCEL_2G_CONV_MUL   16384u
 6DOF IMU 16 data conversion factor setting.
 
#define C6DOFIMU16_ACCEL_4G_CONV_MUL   8192u
 
#define C6DOFIMU16_ACCEL_8G_CONV_MUL   4096u
 
#define C6DOFIMU16_ACCEL_16G_CONV_MUL   2048u
 
#define C6DOFIMU16_GYRO_2000DPS_CONV_MUL   16.4f
 
#define C6DOFIMU16_GYRO_1000DPS_CONV_MUL   32.8f
 
#define C6DOFIMU16_GYRO_500DPS_CONV_MUL   65.5f
 
#define C6DOFIMU16_GYRO_250DPS_CONV_MUL   131.0f
 
#define C6DOFIMU16_GYRO_125DPS_CONV_MUL   262.0f
 
#define C6DOFIMU16_GYRO_62_5DPS_CONV_MUL   524.3f
 
#define C6DOFIMU16_GYRO_31_25DPS_CONV_MUL   1048.6f
 
#define C6DOFIMU16_GYRO_15_625DPS_CONV_MUL   2097.2f
 
#define C6DOFIMU16_DEVICE_ADDRESS_0   0x68
 6DOF IMU 16 device address setting.
 
#define C6DOFIMU16_DEVICE_ADDRESS_1   0x69
 
#define C6DOFIMU16_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define C6DOFIMU16_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define C6DOFIMU16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* c6dofimu16_master_io_t) (struct c6dofimu16_s *, uint8_t, uint8_t *, uint8_t)
 
typedef struct c6dofimu16_s c6dofimu16_t
 6DOF IMU 16 Click context object.
 

Enumerations

enum  c6dofimu16_drv_t { C6DOFIMU16_DRV_SEL_SPI , C6DOFIMU16_DRV_SEL_I2C }
 6DOF IMU 16 Click driver selector. More...
 
enum  c6dofimu16_return_value_t { C6DOFIMU16_OK = 0 , C6DOFIMU16_ERROR = -1 }
 6DOF IMU 16 Click return value data. More...
 

Functions

void c6dofimu16_cfg_setup (c6dofimu16_cfg_t *cfg)
 6DOF IMU 16 configuration object setup function.
 
void c6dofimu16_drv_interface_sel (c6dofimu16_cfg_t *cfg, c6dofimu16_drv_t drv_sel)
 6DOF IMU 16 driver interface setup function.
 
err_t c6dofimu16_init (c6dofimu16_t *ctx, c6dofimu16_cfg_t *cfg)
 6DOF IMU 16 initialization function.
 
err_t c6dofimu16_default_cfg (c6dofimu16_t *ctx)
 6DOF IMU 16 default configuration function.
 
err_t c6dofimu16_generic_write (c6dofimu16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 6DOF IMU 16 data writing function.
 
err_t c6dofimu16_generic_read (c6dofimu16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 6DOF IMU 16 data reading function.
 
uint8_t c6dofimu16_get_int1_pin (c6dofimu16_t *ctx)
 6DOF IMU 16 get int1 pin function.
 
uint8_t c6dofimu16_get_int2_pin (c6dofimu16_t *ctx)
 6DOF IMU 16 get int2 pin function.
 
err_t c6dofimu16_reg_write (c6dofimu16_t *ctx, uint8_t reg, uint8_t data_in)
 6DOF IMU 16 data writing function.
 
err_t c6dofimu16_reg_read (c6dofimu16_t *ctx, uint8_t reg, uint8_t *data_out)
 6DOF IMU 16 register data reading function.
 
err_t c6dofimu16_sw_reset (c6dofimu16_t *ctx)
 6DOF IMU 16 software reset device function.
 
err_t c6dofimu16_get_gyro_data (c6dofimu16_t *ctx, c6dofimu16_axis_t *gyro_data)
 6DOF IMU 16 read gyro function.
 
err_t c6dofimu16_get_accel_data (c6dofimu16_t *ctx, c6dofimu16_axis_t *accel_data)
 6DOF IMU 16 read accel function.
 

Detailed Description

This file contains API for 6DOF IMU 16 Click Driver.

Typedef Documentation

◆ c6dofimu16_master_io_t

typedef err_t(* c6dofimu16_master_io_t) (struct c6dofimu16_s *, uint8_t, uint8_t *, uint8_t)

Driver serial interface.

◆ c6dofimu16_t

typedef struct c6dofimu16_s c6dofimu16_t

6DOF IMU 16 Click context object.

Context object definition of 6DOF IMU 16 Click driver.

Enumeration Type Documentation

◆ c6dofimu16_drv_t

6DOF IMU 16 Click driver selector.

Selects target driver interface of 6DOF IMU 16 Click driver.

Enumerator
C6DOFIMU16_DRV_SEL_SPI 

SPI driver descriptor.

C6DOFIMU16_DRV_SEL_I2C 

I2C driver descriptor.

◆ c6dofimu16_return_value_t

6DOF IMU 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
C6DOFIMU16_OK 
C6DOFIMU16_ERROR