c6dofimu17 2.0.0.0
c6dofimu17.h File Reference

This file contains API for 6DOF IMU 17 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  c6dofimu17_s
 6DOF IMU 17 Click context object. More...
 
struct  c6dofimu17_cfg_t
 6DOF IMU 17 Click configuration object. More...
 
struct  c6dofimu17_axis_t
 6DOF IMU 17 Axis structure object. More...
 
struct  c6dofimu17_gyro_cfg_t
 6DOF IMU 17 Gyro configuration structure object. More...
 
struct  c6dofimu17_accel_cfg_t
 6DOF IMU 17 Accelerometer configuration structure object. More...
 

Macros

#define C6DOFIMU17_REG_DEVICE_CONFIG   0x11
 6DOF IMU 17 description user bank 0 register.
 
#define C6DOFIMU17_REG_DRIVE_CONFIG   0x13
 
#define C6DOFIMU17_REG_INT_CONFIG   0x14
 
#define C6DOFIMU17_REG_FIFO_CONFIG   0x16
 
#define C6DOFIMU17_REG_TEMP_DATA1_UI   0x1D
 
#define C6DOFIMU17_REG_TEMP_DATA0_UI   0x1E
 
#define C6DOFIMU17_REG_ACCEL_DATA_X1_UI   0x1F
 
#define C6DOFIMU17_REG_ACCEL_DATA_X0_UI   0x20
 
#define C6DOFIMU17_REG_ACCEL_DATA_Y1_UI   0x21
 
#define C6DOFIMU17_REG_ACCEL_DATA_Y0_UI   0x22
 
#define C6DOFIMU17_REG_ACCEL_DATA_Z1_UI   0x23
 
#define C6DOFIMU17_REG_ACCEL_DATA_Z0_UI   0x24
 
#define C6DOFIMU17_REG_GYRO_DATA_X1_UI   0x25
 
#define C6DOFIMU17_REG_GYRO_DATA_X0_UI   0x26
 
#define C6DOFIMU17_REG_GYRO_DATA_Y1_UI   0x27
 
#define C6DOFIMU17_REG_GYRO_DATA_Y0_UI   0x28
 
#define C6DOFIMU17_REG_GYRO_DATA_Z1_UI   0x29
 
#define C6DOFIMU17_REG_GYRO_DATA_Z0_UI   0x2A
 
#define C6DOFIMU17_REG_TMST_FSYNCH   0x2B
 
#define C6DOFIMU17_REG_TMST_FSYNCL   0x2C
 
#define C6DOFIMU17_REG_INT_STATUS   0x2D
 
#define C6DOFIMU17_REG_FIFO_COUNTH   0x2E
 
#define C6DOFIMU17_REG_FIFO_COUNTL   0x2F
 
#define C6DOFIMU17_REG_FIFO_DATA   0x30
 
#define C6DOFIMU17_REG_APEX_DATA0   0x31
 
#define C6DOFIMU17_REG_APEX_DATA1   0x32
 
#define C6DOFIMU17_REG_APEX_DATA2   0x33
 
#define C6DOFIMU17_REG_APEX_DATA3   0x34
 
#define C6DOFIMU17_REG_APEX_DATA4   0x35
 
#define C6DOFIMU17_REG_APEX_DATA5   0x36
 
#define C6DOFIMU17_REG_INT_STATUS2   0x37
 
#define C6DOFIMU17_REG_INT_STATUS3   0x38
 
#define C6DOFIMU17_REG_SIGNAL_PATH_RESET   0x4B
 
#define C6DOFIMU17_REG_INTF_CONFIG0   0x4C
 
#define C6DOFIMU17_REG_INTF_CONFIG1   0x4D
 
#define C6DOFIMU17_REG_PWR_MGMT0   0x4E
 
#define C6DOFIMU17_REG_GYRO_CONFIG0   0x4F
 
#define C6DOFIMU17_REG_ACCEL_CONFIG0   0x50
 
#define C6DOFIMU17_REG_GYRO_CONFIG1   0x51
 
#define C6DOFIMU17_REG_GYRO_ACCEL_CONFIG0   0x52
 
#define C6DOFIMU17_REG_ACCEL_CONFIG1   0x53
 
#define C6DOFIMU17_REG_TMST_CONFIG   0x54
 
#define C6DOFIMU17_REG_APEX_CONFIG0   0x55
 
#define C6DOFIMU17_REG_SMD_CONFIG   0x56
 
#define C6DOFIMU17_REG_FIFO_CONFIG1   0x5F
 
#define C6DOFIMU17_REG_FIFO_CONFIG2   0x60
 
#define C6DOFIMU17_REG_FIFO_CONFIG3   0x61
 
#define C6DOFIMU17_REG_FSYNC_CONFIG   0x62
 
#define C6DOFIMU17_REG_INT_CONFIG0   0x63
 
#define C6DOFIMU17_REG_INT_CONFIG1   0x64
 
#define C6DOFIMU17_REG_INT_SOURCE0   0x65
 
#define C6DOFIMU17_REG_INT_SOURCE1   0x66
 
#define C6DOFIMU17_REG_INT_SOURCE3   0x68
 
#define C6DOFIMU17_REG_INT_SOURCE4   0x69
 
#define C6DOFIMU17_REG_FIFO_LOST_PKT0   0x6C
 
#define C6DOFIMU17_REG_FIFO_LOST_PKT1   0x6D
 
#define C6DOFIMU17_REG_SELF_TEST_CONFIG   0x70
 
#define C6DOFIMU17_REG_WHO_AM_I   0x75
 
#define C6DOFIMU17_REG_BANK_SEL   0x76
 
#define C6DOFIMU17_CHIP_ID   0x6F
 
#define C6DOFIMU17_REG_SENSOR_CONFIG0   0x03
 6DOF IMU 17 description user bank 1 register.
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC2   0x0B
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC3   0x0C
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC4   0x0D
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC5   0x0E
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC6   0x0F
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC7   0x10
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC8   0x11
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC9   0x12
 
#define C6DOFIMU17_REG_GYRO_CONFIG_STATIC10   0x13
 
#define C6DOFIMU17_REG_XG_ST_DATA   0x5F
 
#define C6DOFIMU17_REG_YG_ST_DATA   0x60
 
#define C6DOFIMU17_REG_ZG_ST_DATA   0x61
 
#define C6DOFIMU17_REG_TMSTVAL0   0x62
 
#define C6DOFIMU17_REG_TMSTVAL1   0x63
 
#define C6DOFIMU17_REG_TMSTVAL2   0x64
 
#define C6DOFIMU17_REG_INTF_CONFIG4   0x7A
 
#define C6DOFIMU17_REG_INTF_CONFIG5   0x7B
 
#define C6DOFIMU17_REG_INTF_CONFIG6   0x7C
 
#define C6DOFIMU17_REG_ACCEL_CONFIG_STATIC2   0x03
 6DOF IMU 17 description user bank 2 register.
 
#define C6DOFIMU17_REG_ACCEL_CONFIG_STATIC3   0x04
 
#define C6DOFIMU17_REG_ACCEL_CONFIG_STATIC4   0x05
 
#define C6DOFIMU17_REG_XA_ST_DATA   0x3B
 
#define C6DOFIMU17_REG_YA_ST_DATA   0x3C
 
#define C6DOFIMU17_REG_ZA_ST_DATA   0x3D
 
#define C6DOFIMU17_REG_PU_PD_CONFIG1   0x06
 6DOF IMU 17 description user bank 3 register.
 
#define C6DOFIMU17_REG_PU_PD_CONFIG2   0x0E
 
#define C6DOFIMU17_REG_FDR_CONFIG   0x09
 6DOF IMU 17 description user bank 4 register.
 
#define C6DOFIMU17_REG_APEX_CONFIG1   0x40
 
#define C6DOFIMU17_REG_APEX_CONFIG2   0x41
 
#define C6DOFIMU17_REG_APEX_CONFIG3   0x42
 
#define C6DOFIMU17_REG_APEX_CONFIG4   0x43
 
#define C6DOFIMU17_REG_APEX_CONFIG5   0x44
 
#define C6DOFIMU17_REG_APEX_CONFIG6   0x45
 
#define C6DOFIMU17_REG_APEX_CONFIG7   0x46
 
#define C6DOFIMU17_REG_APEX_CONFIG8   0x47
 
#define C6DOFIMU17_REG_APEX_CONFIG9   0x48
 
#define C6DOFIMU17_REG_APEX_CONFIG10   0x49
 
#define C6DOFIMU17_REG_ACCEL_WOM_X_THR   0x4A
 
#define C6DOFIMU17_REG_ACCEL_WOM_Y_THR   0x4B
 
#define C6DOFIMU17_REG_ACCEL_WOM_Z_THR   0x4C
 
#define C6DOFIMU17_REG_INT_SOURCE6   0x4D
 
#define C6DOFIMU17_REG_INT_SOURCE7   0x4E
 
#define C6DOFIMU17_REG_INT_SOURCE8   0x4F
 
#define C6DOFIMU17_REG_INT_SOURCE9   0x50
 
#define C6DOFIMU17_REG_INT_SOURCE10   0x51
 
#define C6DOFIMU17_REG_OFFSET_USER0   0x77
 
#define C6DOFIMU17_REG_OFFSET_USER1   0x78
 
#define C6DOFIMU17_REG_OFFSET_USER2   0x79
 
#define C6DOFIMU17_REG_OFFSET_USER3   0x7A
 
#define C6DOFIMU17_REG_OFFSET_USER4   0x7B
 
#define C6DOFIMU17_REG_OFFSET_USER5   0x7C
 
#define C6DOFIMU17_REG_OFFSET_USER6   0x7D
 
#define C6DOFIMU17_REG_OFFSET_USER7   0x7E
 
#define C6DOFIMU17_REG_OFFSET_USER8   0x7F
 
#define C6DOFIMU17_SET_TEMPERATURE_ENABLED   0xDF
 6DOF IMU 17 description setting.
 
#define C6DOFIMU17_SET_TEMPERATURE_DISABLED   0x20
 
#define C6DOFIMU17_SET_GYRO_OFF_MODE   0x00
 
#define C6DOFIMU17_SET_GYRO_STANDBY_MODE   0x04
 
#define C6DOFIMU17_SET_GYRO_TLOW_NOISE_MODE   0x0C
 
#define C6DOFIMU17_SET_ACCEL_OFF_MODE   0x00
 
#define C6DOFIMU17_SET_ACCEL_LOW_POWER_MODE   0x02
 
#define C6DOFIMU17_SET_ACCEL_LOW_NOISE_MODE   0x03
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_2000_dps   0x00
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_1000_dps   0x01
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_500_dps   0x02
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_250_dps   0x03
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_125_dps   0x04
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_62_5_dps   0x05
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_31_25_dps   0x06
 
#define C6DOFIMU17_SET_GYRO_FS_SEL_16_625_dps   0x07
 
#define C6DOFIMU17_SET_GYRO_ODR_32kHz   0x01
 
#define C6DOFIMU17_SET_GYRO_ODR_16kHz   0x02
 
#define C6DOFIMU17_SET_GYRO_ODR_8kHz   0x03
 
#define C6DOFIMU17_SET_GYRO_ODR_4kHz   0x04
 
#define C6DOFIMU17_SET_GYRO_ODR_2kHz   0x05
 
#define C6DOFIMU17_SET_GYRO_ODR_1kHz   0x06
 
#define C6DOFIMU17_SET_GYRO_ODR_200Hz   0x07
 
#define C6DOFIMU17_SET_GYRO_ODR_100Hz   0x08
 
#define C6DOFIMU17_SET_GYRO_ODR_50Hz   0x09
 
#define C6DOFIMU17_SET_GYRO_ODR_25Hz   0x0A
 
#define C6DOFIMU17_SET_GYRO_ODR_12_5Hz   0x0B
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_ORD_1st   0x00
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_ORD_2st   0x01
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_ORD_3st   0x02
 
#define C6DOFIMU17_SET_GYRO_DEC2_M2_ORD_3st   0x02
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_2   0x00
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_4   0x01
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_5   0x02
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_8   0x03
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_10   0x04
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_16   0x05
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_20   0x06
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_40   0x07
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_LOW_LATENCY_0   0x0E
 
#define C6DOFIMU17_SET_GYRO_UI_FILT_BW_LOW_LATENCY_1   0x0F
 
#define C6DOFIMU17_SET_ACCEL_FS_SEL_16g   0x00
 
#define C6DOFIMU17_SET_ACCEL_FS_SEL_8g   0x01
 
#define C6DOFIMU17_SET_ACCEL_FS_SEL_4g   0x02
 
#define C6DOFIMU17_SET_ACCEL_FS_SEL_2g   0x03
 
#define C6DOFIMU17_SET_ACCEL_ODR_32kHz   0x01
 
#define C6DOFIMU17_SET_ACCEL_ODR_16kHz   0x02
 
#define C6DOFIMU17_SET_ACCEL_ODR_8kHz   0x03
 
#define C6DOFIMU17_SET_ACCEL_ODR_4kHz   0x04
 
#define C6DOFIMU17_SET_ACCEL_ODR_2kHz   0x05
 
#define C6DOFIMU17_SET_ACCEL_ODR_1kHz   0x06
 
#define C6DOFIMU17_SET_ACCEL_ODR_200Hz   0x07
 
#define C6DOFIMU17_SET_ACCEL_ODR_100Hz   0x08
 
#define C6DOFIMU17_SET_ACCEL_ODR_50Hz   0x09
 
#define C6DOFIMU17_SET_ACCEL_ODR_25Hz   0x0A
 
#define C6DOFIMU17_SET_ACCEL_ODR_12_5Hz   0x0B
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_2   0x00
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_4   0x01
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_5   0x02
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_8   0x03
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_10   0x04
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_16   0x05
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_20   0x06
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_40   0x07
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_LOW_LATENCY_0   0x0E
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_BW_LOW_LATENCY_1   0x0F
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_ORD_1st   0x00
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_ORD_2st   0x01
 
#define C6DOFIMU17_SET_ACCEL_UI_FILT_ORD_3st   0x02
 
#define C6DOFIMU17_SET_ACCEL_DEC2_M2_ORD_3st   0x02
 
#define C6DOFIMU17_SET_BANK_0   0x00
 
#define C6DOFIMU17_SET_BANK_1   0x01
 
#define C6DOFIMU17_SET_BANK_2   0x02
 
#define C6DOFIMU17_SET_BANK_3   0x03
 
#define C6DOFIMU17_SET_BANK_4   0x04
 
#define C6DOFIMU17_SET_DEV_ADDR   0x68
 6DOF IMU 17 device address setting.
 
#define C6DOFIMU17_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define C6DOFIMU17_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define C6DOFIMU17_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* c6dofimu17_master_io_t) (struct c6dofimu17_s *, uint8_t, uint8_t *, uint8_t)
 6DOF IMU 17 Click driver interface.
 
typedef struct c6dofimu17_s c6dofimu17_t
 6DOF IMU 17 Click context object.
 

Enumerations

enum  c6dofimu17_drv_t { C6DOFIMU17_DRV_SEL_SPI , C6DOFIMU17_DRV_SEL_I2C }
 6DOF IMU 17 Click driver selector. More...
 
enum  c6dofimu17_return_value_t { C6DOFIMU17_OK = 0 , C6DOFIMU17_ERROR = -1 }
 6DOF IMU 17 Click return value data. More...
 

Functions

void c6dofimu17_cfg_setup (c6dofimu17_cfg_t *cfg)
 6DOF IMU 17 configuration object setup function.
 
void c6dofimu17_drv_interface_selection (c6dofimu17_cfg_t *cfg, c6dofimu17_drv_t drv_sel)
 6DOF IMU 17 driver interface setup function.
 
err_t c6dofimu17_init (c6dofimu17_t *ctx, c6dofimu17_cfg_t *cfg)
 6DOF IMU 17 initialization function.
 
err_t c6dofimu17_default_cfg (c6dofimu17_t *ctx)
 6DOF IMU 17 default configuration function.
 
err_t c6dofimu17_generic_write (c6dofimu17_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 6DOF IMU 17 data writing function.
 
err_t c6dofimu17_generic_read (c6dofimu17_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 6DOF IMU 17 data reading function.
 
err_t c6dofimu17_bank_selection (c6dofimu17_t *ctx, uint8_t bank_sel)
 6DOF IMU 17 bank selection function.
 
uint8_t c6dofimu17_get_interrupt (c6dofimu17_t *ctx)
 6DOF IMU 17 get interrupt function.
 
err_t c6dofimu17_get_device_id (c6dofimu17_t *ctx, uint8_t *device_id)
 6DOF IMU 17 get device ID function.
 
err_t c6dofimu17_temperature_enable (c6dofimu17_t *ctx)
 6DOF IMU 17 temperature enable function.
 
err_t c6dofimu17_gyro_enable (c6dofimu17_t *ctx)
 6DOF IMU 17 gyroscope enable function.
 
err_t c6dofimu17_accel_enable (c6dofimu17_t *ctx)
 6DOF IMU 17 accelerometer enable function.
 
err_t c6dofimu17_set_config_gyro (c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t gyro_cfg)
 6DOF IMU 17 set config gyroscope function.
 
err_t c6dofimu17_get_config_gyro (c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t *gyro_cfg)
 6DOF IMU 17 get config gyroscope function.
 
err_t c6dofimu17_set_config_accel (c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t accel_cfg)
 6DOF IMU 17 set config accelerometer function.
 
err_t c6dofimu17_get_config_accel (c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t *accel_cfg)
 6DOF IMU 17 get config accelerometer function.
 
err_t c6dofimu17_soft_reset (c6dofimu17_t *ctx)
 6DOF IMU 17 soft reset function.
 
err_t c6dofimu17_get_accel_data (c6dofimu17_t *ctx, c6dofimu17_axis_t *accel_data)
 6DOF IMU 17 get accel data function.
 
err_t c6dofimu17_get_gyro_data (c6dofimu17_t *ctx, c6dofimu17_axis_t *gyro_data)
 6DOF IMU 17 get gyroscope data function.
 
err_t c6dofimu17_get_temperature (c6dofimu17_t *ctx, float *temperature)
 6DOF IMU 17 get temperature data function.
 

Detailed Description

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

Typedef Documentation

◆ c6dofimu17_master_io_t

typedef err_t(* c6dofimu17_master_io_t) (struct c6dofimu17_s *, uint8_t, uint8_t *, uint8_t)

6DOF IMU 17 Click driver interface.

Definition of driver interface of 6DOF IMU 17 Click driver. Driver serial interface.

◆ c6dofimu17_t

typedef struct c6dofimu17_s c6dofimu17_t

6DOF IMU 17 Click context object.

Context object definition of 6DOF IMU 17 Click driver.

Enumeration Type Documentation

◆ c6dofimu17_drv_t

6DOF IMU 17 Click driver selector.

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

Enumerator
C6DOFIMU17_DRV_SEL_SPI 

SPI driver descriptor.

C6DOFIMU17_DRV_SEL_I2C 

I2C driver descriptor.

◆ c6dofimu17_return_value_t

6DOF IMU 17 Click return value data.

Predefined enum values for driver return values.

Enumerator
C6DOFIMU17_OK 
C6DOFIMU17_ERROR