c6dofimu13 2.0.0.0
c6dofimu13.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  c6dofimu13_t
 6DOF IMU 13 Click context object. More...
 
struct  c6dofimu13_cfg_t
 6DOF IMU 13 Click configuration object. More...
 

Macros

#define C6DOFIMU13_MAG_SELFTEST_RESP   0x0C
 6DOF IMU 13 Magnetometer register summary.
 
#define C6DOFIMU13_MAG_MORE_INFO_VER   0x0D
 
#define C6DOFIMU13_MAG_MORE_INFO   0x0E
 
#define C6DOFIMU13_MAG_WHO_I_AM   0x0F
 
#define C6DOFIMU13_MAG_OUT_X_LSB   0x10
 
#define C6DOFIMU13_MAG_OUT_X_MSB   0x11
 
#define C6DOFIMU13_MAG_OUT_Y_LSB   0x12
 
#define C6DOFIMU13_MAG_OUT_Y_MSB   0x13
 
#define C6DOFIMU13_MAG_OUT_Z_LSB   0x14
 
#define C6DOFIMU13_MAG_OUT_Z_MSB   0x15
 
#define C6DOFIMU13_MAG_STAT   0x18
 
#define C6DOFIMU13_MAG_CTL_1   0x1B
 
#define C6DOFIMU13_MAG_CTL_2   0x1C
 
#define C6DOFIMU13_MAG_CTL_3   0x1D
 
#define C6DOFIMU13_MAG_CTL_4   0x1E
 
#define C6DOFIMU13_MAG_OFFS_X_LSB   0x20
 
#define C6DOFIMU13_MAG_OFFS_X_MSB   0x21
 
#define C6DOFIMU13_MAG_OFFS_Y_LSB   0x22
 
#define C6DOFIMU13_MAG_OFFS_Y_MSB   0x23
 
#define C6DOFIMU13_MAG_OFFS_Z_LSB   0x24
 
#define C6DOFIMU13_MAG_OFFS_Z_MSB   0x25
 
#define C6DOFIMU13_MAG_ITHR_L   0x26
 
#define C6DOFIMU13_MAG_ITHR_H   0x27
 
#define C6DOFIMU13_MAG_TEMP_VAL   0x31
 
#define C6DOFIMU13_ACCEL_SR   0x03
 6DOF IMU 13 Accelerometer register summary.
 
#define C6DOFIMU13_ACCEL_OPSTAT   0x04
 
#define C6DOFIMU13_ACCEL_INTEN   0x06
 
#define C6DOFIMU13_ACCEL_MODE   0x07
 
#define C6DOFIMU13_ACCEL_SRTFR   0x08
 
#define C6DOFIMU13_ACCEL_TAPEN   0x09
 
#define C6DOFIMU13_ACCEL_TTTRX   0x0A
 
#define C6DOFIMU13_ACCEL_TTTRY   0x0B
 
#define C6DOFIMU13_ACCEL_TTTRZ   0x0C
 
#define C6DOFIMU13_ACCEL_XOUT_EX_L   0x0D
 
#define C6DOFIMU13_ACCEL_XOUT_EX_H   0x0E
 
#define C6DOFIMU13_ACCEL_YOUT_EX_L   0x0F
 
#define C6DOFIMU13_ACCEL_YOUT_EX_H   0x10
 
#define C6DOFIMU13_ACCEL_ZOUT_EX_L   0x11
 
#define C6DOFIMU13_ACCEL_ZOUT_EX_H   0x12
 
#define C6DOFIMU13_ACCEL_OUTCFG   0x20
 
#define C6DOFIMU13_ACCEL_XOFFL   0x21
 
#define C6DOFIMU13_ACCEL_XOFFH   0x22
 
#define C6DOFIMU13_ACCEL_YOFFL   0x23
 
#define C6DOFIMU13_ACCEL_YOFFH   0x24
 
#define C6DOFIMU13_ACCEL_ZOFFL   0x25
 
#define C6DOFIMU13_ACCEL_ZOFFH   0x26
 
#define C6DOFIMU13_ACCEL_XGAIN   0x27
 
#define C6DOFIMU13_ACCEL_YGAIN   0x28
 
#define C6DOFIMU13_ACCEL_ZGAIN   0x29
 
#define C6DOFIMU13_ACCEL_PCODE   0x3B
 
#define C6DOFIMU13_MAG_STAT_DRDY   0x40
 6DOF IMU 13 Status register settings.
 
#define C6DOFIMU13_MAG_STAT_DOR   0x20
 
#define C6DOFIMU13_MAG_CTL_1_PC_NORM   0x80
 6DOF IMU 13 Control 1 register settings.
 
#define C6DOFIMU13_MAG_CTL_1_PC_STBY   0x00
 
#define C6DOFIMU13_MAG_CTL_1_ODR_05   0x00
 
#define C6DOFIMU13_MAG_CTL_1_ODR_10   0x08
 
#define C6DOFIMU13_MAG_CTL_1_ODR_20   0x10
 
#define C6DOFIMU13_MAG_CTL_1_ODR_100   0x18
 
#define C6DOFIMU13_MAG_CTL_1_FS_DEF   0x02
 
#define C6DOFIMU13_MAG_CTL_1_FS_NORM   0x00
 
#define C6DOFIMU13_MAG_CTL_3_SRST_SR   0x80
 6DOF IMU 13 Control 3 register settings.
 
#define C6DOFIMU13_MAG_CTL_3_SRST_NOP   0x00
 
#define C6DOFIMU13_MAG_CTL_3_FRC_SM   0x40
 
#define C6DOFIMU13_MAG_CTL_3_FRC_NOP   0x00
 
#define C6DOFIMU13_MAG_CTL_3_STC_EN   0x10
 
#define C6DOFIMU13_MAG_CTL_3_STC_NOP   0x00
 
#define C6DOFIMU13_MAG_CTL_3_TCS_EN   0x02
 
#define C6DOFIMU13_MAG_CTL_3_TCS_NOP   0x00
 
#define C6DOFIMU13_MAG_CTL_3_OCL_EN   0x01
 
#define C6DOFIMU13_MAG_CTL_3_OCL_NOP   0x00
 
#define C6DOFIMU13_MAG_CTL_4_RS_S_14   0x00
 6DOF IMU 13 Control 4 register settings.
 
#define C6DOFIMU13_MAG_CTL_4_RS_S_15   0x10
 
#define C6DOFIMU13_MAG_SENS   0.15
 6DOF IMU 13 Magnetometer Sensitivity settings.
 
#define C6DOFIMU13_MAG_ORIENTATION_COEF   -1.0
 
#define C6DOFIMU13_MAG_RES_14_BIT   0x00
 6DOF IMU 13 Magnetometer Range and operation mode settings.
 
#define C6DOFIMU13_MAG_RES_15_BIT   0x01
 
#define C6DOFIMU13_MAG_OP_MODE_S_SHOT   0x00
 
#define C6DOFIMU13_MAG_OP_MODE_CONT   0x01
 
#define C6DOFIMU13_MAG_TEMP_MEAS_OFF   0x00
 
#define C6DOFIMU13_MAG_TEMP_MEAS_ON   0x01
 
#define C6DOFIMU13_MAG_AXIS_X   0x00
 6DOF IMU 13 Magnetometer axis settings.
 
#define C6DOFIMU13_MAG_AXIS_Y   0x01
 
#define C6DOFIMU13_MAG_AXIS_Z   0x02
 
#define C6DOFIMU13_ACCEL_SR_TAP_XP   0x01
 6DOF IMU 13 Accelerometer SR: Status Register Flags settings.
 
#define C6DOFIMU13_ACCEL_SR_TAP_XN   0x02
 
#define C6DOFIMU13_ACCEL_SR_TAP_YP   0x04
 
#define C6DOFIMU13_ACCEL_SR_TAP_YN   0x08
 
#define C6DOFIMU13_ACCEL_SR_TAP_ZP   0x10
 
#define C6DOFIMU13_ACCEL_SR_TAP_ZN   0x20
 
#define C6DOFIMU13_ACCEL_SR_AC_INT   0x80
 
#define C6DOFIMU13_ACCEL_OPSTAT_WAKE   0x01
 6DOF IMU 13 Accelerometer OPSTAT: Device Status Register Flags settings.
 
#define C6DOFIMU13_ACCEL_OPSTAT_WDT   0x10
 
#define C6DOFIMU13_ACCEL_OPSTAT_OTPA   0x80
 
#define C6DOFIMU13_ACCEL_INTEN_TIXPEN   0x01
 6DOF IMU 13 Accelerometer INTEN: Interrupt Enable Register settings.
 
#define C6DOFIMU13_ACCEL_INTEN_TIXNEN   0x02
 
#define C6DOFIMU13_ACCEL_INTEN_TIYPEN   0x04
 
#define C6DOFIMU13_ACCEL_INTEN_TIYNEN   0x08
 
#define C6DOFIMU13_ACCEL_INTEN_TIZPEN   0x10
 
#define C6DOFIMU13_ACCEL_INTEN_TIZNEN   0x20
 
#define C6DOFIMU13_ACCEL_INTEN_AC_INT_EN   0x80
 
#define C6DOFIMU13_ACCEL_MODE_STDBY   0x00
 6DOF IMU 13 Accelerometer MODE: Mode Register settings.
 
#define C6DOFIMU13_ACCEL_MODE_WAKE   0x01
 
#define C6DOFIMU13_ACCEL_MODE_WDT_NEG   0x10
 
#define C6DOFIMU13_ACCEL_MODE_WDT_POS   0x20
 
#define C6DOFIMU13_ACCEL_MODE_IPP   0x40
 
#define C6DOFIMU13_ACCEL_MODE_IAH   0x80
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_32   0x00
 6DOF IMU 13 Accelerometer SRTFR: Sample Rate and Tap Feature Register settings.
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_16   0x01
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_8   0x02
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_4   0x03
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_2   0x04
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_1   0x05
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_0_5   0x06
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_0_25   0x07
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_64   0x08
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_128   0x09
 
#define C6DOFIMU13_ACCEL_SRTFR_RATE_256   0x0A
 
#define C6DOFIMU13_ACCEL_SRTFR_FLIP_TAPX   0x10
 
#define C6DOFIMU13_ACCEL_SRTFR_FLIP_TAPY   0x20
 
#define C6DOFIMU13_ACCEL_SRTFR_FLIP_TAPZ   0x40
 
#define C6DOFIMU13_ACCEL_SRTFR_TAP_LATCH   0x80
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPXPEN   0x01
 6DOF IMU 13 Accelerometer TAPEN: Tap Control Register settings.
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPXNEN   0x02
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPYPEN   0x04
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPYNEN   0x08
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPZPEN   0x10
 
#define C6DOFIMU13_ACCEL_TAPEN_TAPZNEN   0x20
 
#define C6DOFIMU13_ACCEL_TAPEN_THRDUR   0x40
 
#define C6DOFIMU13_ACCEL_TAPEN_TAP_EN   0x80
 
#define C6DOFIMU13_ACCEL_OUTCFG_RANGE_2   0x00
 6DOF IMU 13 Accelerometer OUTCFG: Output Configuration Register settings.
 
#define C6DOFIMU13_ACCEL_OUTCFG_RANGE_4   0x10
 
#define C6DOFIMU13_ACCEL_OUTCFG_RANGE_8   0x20
 
#define C6DOFIMU13_ACCEL_OUTCFG_RANGE_16   0x30
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_6   0x00
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_7   0x01
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_8   0x02
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_10   0x03
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_12   0x04
 
#define C6DOFIMU13_ACCEL_OUTCFG_RES_14   0x05
 
#define C6DOFIMU13_ACCEL_AXIS_X   0x00
 6DOF IMU 13 Accelerometer axis.
 
#define C6DOFIMU13_ACCEL_AXIS_Y   0x01
 
#define C6DOFIMU13_ACCEL_AXIS_Z   0x02
 
#define C6DOFIMU13_DEV_ADDRESS_ACCEL_GND   0x4C
 6DOF IMU 13 device address setting.
 
#define C6DOFIMU13_DEV_ADDRESS_ACCEL_VCC   0x6C
 
#define C6DOFIMU13_DEV_ADDRESS_MAG   0x0C
 
#define C6DOFIMU13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  c6dofimu13_return_value_t { C6DOFIMU13_OK = 0 , C6DOFIMU13_ERROR = -1 }
 6DOF IMU 13 Click return value data. More...
 

Functions

void c6dofimu13_cfg_setup (c6dofimu13_cfg_t *cfg)
 6DOF IMU 13 configuration object setup function.
 
err_t c6dofimu13_init (c6dofimu13_t *ctx, c6dofimu13_cfg_t *cfg)
 6DOF IMU 13 initialization function.
 
err_t c6dofimu13_default_cfg (c6dofimu13_t *ctx)
 6DOF IMU 13 default configuration function.
 
err_t c6dofimu13_set_slave_address (c6dofimu13_t *ctx, uint8_t slave_address)
 6DOF IMU 13 set slave address function.
 
err_t c6dofimu13_generic_write (c6dofimu13_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 6DOF IMU 13 I2C writing function.
 
err_t c6dofimu13_generic_read (c6dofimu13_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 6DOF IMU 13 I2C reading function.
 
err_t c6dofimu13_mag_init (c6dofimu13_t *ctx, uint8_t res, uint8_t op_mode, uint8_t temp_meas)
 6DOF IMU 13 Magnetometer initialize function.
 
err_t c6dofimu13_mag_get_x (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Magnetometer get X-Axis data function.
 
err_t c6dofimu13_mag_get_y (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Magnetometer get Y-Axis data function.
 
err_t c6dofimu13_mag_get_z (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Magnetometer get Z-Axis data function.
 
err_t c6dofimu13_mag_get_data (c6dofimu13_t *ctx, float *mag_x, float *mag_y, float *mag_z)
 6DOF IMU 13 Magnetometer get X, Y, and Z-Axis data function.
 
err_t c6dofimu13_mag_offset (c6dofimu13_t *ctx, int16_t offset, uint8_t axis)
 6DOF IMU 13 set magnetometer offset function.
 
err_t c6dofimu13_accel_init (c6dofimu13_t *ctx, uint8_t samp_rate, uint8_t samp_range, uint8_t samp_res)
 6DOF IMU 13 Accelerometer initialize function.
 
err_t c6dofimu13_accel_get_raw_x (c6dofimu13_t *ctx, int16_t *result)
 6DOF IMU 13 Accelerometer get RAW X-Axis data function.
 
err_t c6dofimu13_accel_get_raw_y (c6dofimu13_t *ctx, int16_t *result)
 6DOF IMU 13 Accelerometer get RAW Y-Axis data function.
 
err_t c6dofimu13_accel_get_raw_z (c6dofimu13_t *ctx, int16_t *result)
 6DOF IMU 13 Accelerometer get RAW Z-Axis data function.
 
err_t c6dofimu13_accel_get_x (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Accelerometer get X-Axis data function.
 
err_t c6dofimu13_accel_get_y (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Accelerometer get Y-Axis data function.
 
err_t c6dofimu13_accel_get_z (c6dofimu13_t *ctx, float *result)
 6DOF IMU 13 Accelerometer get Z-Axis data function.
 
err_t c6dofimu13_accel_get_data (c6dofimu13_t *ctx, float *accel_x, float *accel_y, float *accel_z)
 6DOF IMU 13 Accelerometer get X, Y, and Z-Axis data function.
 
err_t c6dofimu13_accel_offset (c6dofimu13_t *ctx, int16_t offset, uint8_t axis)
 6DOF IMU 13 set accelerometer offset function.
 
uint8_t c6dofimu13_get_in1 (c6dofimu13_t *ctx)
 6DOF IMU 13 get in1 pin state function.
 
uint8_t c6dofimu13_get_in2 (c6dofimu13_t *ctx)
 6DOF IMU 13 get in2 pin state function.
 

Detailed Description

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

Enumeration Type Documentation

◆ c6dofimu13_return_value_t

6DOF IMU 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
C6DOFIMU13_OK 
C6DOFIMU13_ERROR