c6dofimu3 2.0.0.0
c6dofimu3.h File Reference

This file contains API for 6 Dof imu 3 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  c6dofimu3_accel_t
 
struct  c6dofimu3_mag_t
 
struct  c6dofimu3_s
 Click ctx object definition. More...
 
struct  c6dofimu3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define c6dofimu3_obj_t   const uint8_t*
 
#define C6DOFIMU3_RETVAL_T   uint8_t
 
#define C6DOFIMU3_MAP_MIKROBUS(cfg, mikrobus)
 
#define C6DOFIMU3_MASTER_I2C   0
 
#define C6DOFIMU3_MASTER_SPI   1
 
#define C6DOFIMU3_RETVAL   uint8_t
 
#define C6DOFIMU3_OK   0x00
 
#define C6DOFIMU3_INIT_ERROR   0xFF
 
#define C6DOFIMU3_REG_I2C_ADDR_0   0x1E
 
#define C6DOFIMU3_REG_I2C_ADDR_1   0x1D
 
#define C6DOFIMU3_REG_I2C_ADDR_2   0x1C
 
#define C6DOFIMU3_REG_I2C_ADDR_3   0x1F
 
#define C6DOFIMU3_STATUS   0x00
 
#define C6DOFIMU3_DR_STATUS   0x00
 
#define C6DOFIMU3_F_STATUS   0x00
 
#define C6DOFIMU3_OUT_X_MSB   0x01
 
#define C6DOFIMU3_OUT_X_LSB   0x02
 
#define C6DOFIMU3_OUT_Y_MSB   0x03
 
#define C6DOFIMU3_OUT_Y_LSB   0x04
 
#define C6DOFIMU3_OUT_Z_MSB   0x05
 
#define C6DOFIMU3_OUT_Z_LSB   0x06
 
#define C6DOFIMU3_F_SETUP   0x09
 
#define C6DOFIMU3_TRIG_CFG   0x0A
 
#define C6DOFIMU3_SYSMOD   0x0B
 
#define C6DOFIMU3_INT_SOURCE   0x0C
 
#define C6DOFIMU3_WHO_AM_I   0x0D
 
#define C6DOFIMU3_XYZ_DATA_CFG   0x0E
 
#define C6DOFIMU3_HP_FILTER_CUTOFF   0x0F
 
#define C6DOFIMU3_PL_STATUS   0x10
 
#define C6DOFIMU3_PL_CFG   0x11
 
#define C6DOFIMU3_PL_COUNT   0x12
 
#define C6DOFIMU3_PL_BF_ZCOMP   0x13
 
#define C6DOFIMU3_P_L_THS_REG   0x14
 
#define C6DOFIMU3_A_FFMT_CFG   0x15
 
#define C6DOFIMU3_A_FFMT_SRC   0x16
 
#define C6DOFIMU3_A_FFMT_THS   0x17
 
#define C6DOFIMU3_A_FFMT_COUNT   0x18
 
#define C6DOFIMU3_TRANSIENT_CFG   0x1D
 
#define C6DOFIMU3_TRANSIENT_SRC   0x1E
 
#define C6DOFIMU3_TRANSIENT_THS   0x1F
 
#define C6DOFIMU3_TRANSIENT_COUNT   0x20
 
#define C6DOFIMU3_PULSE_CFG   0x21
 
#define C6DOFIMU3_PULSE_SRC   0x22
 
#define C6DOFIMU3_PULSE_THSX   0x23
 
#define C6DOFIMU3_PULSE_THSY   0x24
 
#define C6DOFIMU3_PULSE_THSZ   0x25
 
#define C6DOFIMU3_PULSE_TMLT   0x26
 
#define C6DOFIMU3_PULSE_LTCY   0x27
 
#define C6DOFIMU3_PULSE_WIND   0x28
 
#define C6DOFIMU3_ASLP_COUNT   0x29
 
#define C6DOFIMU3_CTRL_REG1   0x2A
 
#define C6DOFIMU3_CTRL_REG2   0x2B
 
#define C6DOFIMU3_CTRL_REG3   0x2C
 
#define C6DOFIMU3_CTRL_REG4   0x2D
 
#define C6DOFIMU3_CTRL_REG5   0x2E
 
#define C6DOFIMU3_OFF_X   0x2F
 
#define C6DOFIMU3_OFF_Y   0x30
 
#define C6DOFIMU3_OFF_Z   0x31
 
#define C6DOFIMU3_M_DR_STATUS   0x32
 
#define C6DOFIMU3_M_OUT_X_MSB   0x33
 
#define C6DOFIMU3_M_OUT_X_LSB   0x34
 
#define C6DOFIMU3_M_OUT_Y_MSB   0x35
 
#define C6DOFIMU3_M_OUT_Y_LSB   0x36
 
#define C6DOFIMU3_M_OUT_Z_MSB   0x37
 
#define C6DOFIMU3_M_OUT_Z_LSB   0x38
 
#define C6DOFIMU3_CMP_OUT_X_MSB   0x39
 
#define C6DOFIMU3_CMP_OUT_X_LSB   0x3A
 
#define C6DOFIMU3_CMP_OUT_Y_MSB   0x3B
 
#define C6DOFIMU3_CMP_OUT_Y_LSB   0x3C
 
#define C6DOFIMU3_CMP_OUT_Z_MSB   0x3D
 
#define C6DOFIMU3_CMP_OUT_Z_LSB   0x3E
 
#define C6DOFIMU3_M_OFF_X_MSB   0x3F
 
#define C6DOFIMU3_M_OFF_X_LSB   0x40
 
#define C6DOFIMU3_M_OFF_Y_MSB   0x41
 
#define C6DOFIMU3_M_OFF_Y_LSB   0x42
 
#define C6DOFIMU3_M_OFF_Z_MSB   0x43
 
#define C6DOFIMU3_M_OFF_Z_LSB   0x44
 
#define C6DOFIMU3_MAX_X_MSB   0x45
 
#define C6DOFIMU3_MAX_X_LSB   0x46
 
#define C6DOFIMU3_MAX_Y_MSB   0x47
 
#define C6DOFIMU3_MAX_Y_LSB   0x48
 
#define C6DOFIMU3_MAX_Z_MSB   0x49
 
#define C6DOFIMU3_MAX_Z_LSB   0x4A
 
#define C6DOFIMU3_MIN_X_MSB   0x4B
 
#define C6DOFIMU3_MIN_X_LSB   0x4C
 
#define C6DOFIMU3_MIN_Y_MSB   0x4D
 
#define C6DOFIMU3_MIN_Y_LSB   0x4E
 
#define C6DOFIMU3_MIN_Z_MSB   0x4F
 
#define C6DOFIMU3_MIN_Z_LSB   0x50
 
#define C6DOFIMU3_TEMP   0x51
 
#define C6DOFIMU3_M_THS_CFG   0x52
 
#define C6DOFIMU3_M_THS_SRC   0x53
 
#define C6DOFIMU3_M_THS_X_MSB   0x54
 
#define C6DOFIMU3_M_THS_X_LSB   0x55
 
#define C6DOFIMU3_M_THS_Y_MSB   0x56
 
#define C6DOFIMU3_M_THS_Y_LSB   0x57
 
#define C6DOFIMU3_M_THS_Z_MSB   0x58
 
#define C6DOFIMU3_M_THS_Z_LSB   0x59
 
#define C6DOFIMU3_M_THS_COUNT   0x5A
 
#define C6DOFIMU3_M_CTRL_REG1   0x5B
 
#define C6DOFIMU3_M_CTRL_REG2   0x5C
 
#define C6DOFIMU3_M_CTRL_REG3   0x5D
 
#define C6DOFIMU3_M_INT_SRC   0x5E
 
#define C6DOFIMU3_A_VECM_CFG   0x5F
 
#define C6DOFIMU3_A_VECM_THS_MSB   0x60
 
#define C6DOFIMU3_A_VECM_THS_LSB   0x61
 
#define C6DOFIMU3_A_VECM_CNT   0x62
 
#define C6DOFIMU3_A_VECM_INITX_MSB   0x63
 
#define C6DOFIMU3_A_VECM_INITX_LSB   0x64
 
#define C6DOFIMU3_A_VECM_INITY_MSB   0x65
 
#define C6DOFIMU3_A_VECM_INITY_LSB   0x66
 
#define C6DOFIMU3_A_VECM_INITZ_MSB   0x67
 
#define C6DOFIMU3_A_VECM_INITZ_LSB   0x68
 
#define C6DOFIMU3_M_VECM_CFG   0x69
 
#define C6DOFIMU3_M_VECM_THS_MSB   0x6A
 
#define C6DOFIMU3_M_VECM_THS_LSB   0x6B
 
#define C6DOFIMU3_M_VECM_CNT   0x6C
 
#define C6DOFIMU3_M_VECM_INITX_MSB   0x6D
 
#define C6DOFIMU3_M_VECM_INITX_LSB   0x6E
 
#define C6DOFIMU3_M_VECM_INITY_MSB   0x6F
 
#define C6DOFIMU3_M_VECM_INITY_LSB   0x70
 
#define C6DOFIMU3_M_VECM_INITZ_MSB   0x71
 
#define C6DOFIMU3_M_VECM_INITZ_LSB   0x72
 
#define C6DOFIMU3_A_FFMT_THS_X_MSB   0x73
 
#define C6DOFIMU3_A_FFMT_THS_X_LSB   0x74
 
#define C6DOFIMU3_A_FFMT_THS_Y_MSB   0x75
 
#define C6DOFIMU3_A_FFMT_THS_Y_LSB   0x76
 
#define C6DOFIMU3_A_FFMT_THS_Z_MSB   0x77
 
#define C6DOFIMU3_A_FFMT_THS_Z_LSB   0x78
 
#define C6DOFIMU3_ACCEL_RES_2G   0.244
 
#define C6DOFIMU3_ACCEL_RES_4G   0.488
 
#define C6DOFIMU3_ACCEL_RES_8G   0.976
 
#define C6DOFIMU3_MAGNETOMETER_RES   0.1
 
#define C6DOFIMU3_DEVICE_ID_VAL   0xC7
 
#define C6DOFIMU3_ERROR   0x00
 
#define C6DOFIMU3_SUCCESS   0x01
 
#define C6DOFIMU3_BIT_MASK_SPI_CMD_WRITE   0x80
 
#define C6DOFIMU3_BIT_MASK_SPI_CMD_READ   0x7F
 
#define C6DOFIMU3_BIT_MASK_BIT_7   0x80
 
#define C6DOFIMU3_DR_STATUS_XYZ_DATA_ERROR   0x00
 
#define C6DOFIMU3_RST_PIN_STATE_LOW   0x00
 
#define C6DOFIMU3_RST_PIN_STATE_HIGH   0x01
 
#define C6DOFIMU3_SPI_COMMUNICATION_DUMMY   0x00
 
#define SPI_COMMUNICATION   1
 
#define I2C_COMMUNICATION   2
 

Typedefs

typedef uint8_t c6dofimu3_select_t
 Communication type.
 
typedef void(* c6dofimu3_master_io_t) (struct c6dofimu3_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct c6dofimu3_s c6dofimu3_t
 Click ctx object definition.
 

Functions

void c6dofimu3_cfg_setup (c6dofimu3_cfg_t *cfg)
 Config Object Initialization function.
 
C6DOFIMU3_RETVAL c6dofimu3_init (c6dofimu3_t *ctx, c6dofimu3_cfg_t *cfg)
 Initialization function.
 
void c6dofimu3_default_cfg (c6dofimu3_t *ctx)
 Click Default Configuration function.
 
void c6dofimu3_generic_write (c6dofimu3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c6dofimu3_generic_read (c6dofimu3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void c6dofimu3_set_rst (c6dofimu3_t *ctx, uint8_t rst_state)
 Set RST pin state function.
 
void c6dofimu3_multi_write (c6dofimu3_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
 Multi data write function.
 
void c6dofimu3_multi_read (c6dofimu3_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
 Multi data read function.
 
C6DOFIMU3_RETVAL_T c6dofimu3_check_id (c6dofimu3_t *ctx)
 Check ID function.
 
C6DOFIMU3_RETVAL_T c6dofimu3_check_data_ready (c6dofimu3_t *ctx)
 Check data ready function.
 
void c6dofimu3_standby (c6dofimu3_t *ctx)
 Set standby mode function.
 
void c6dofimu3_active (c6dofimu3_t *ctx)
 Set active mode function.
 
void c6dofimu3_read_accel_data (c6dofimu3_t *ctx, c6dofimu3_accel_t *accel_data)
 Read Accel data function.
 
void c6dofimu3_read_mag_data (c6dofimu3_t *ctx, c6dofimu3_mag_t *mag_data)
 Read Magnetometer data function.
 
void c6dofimu3_get_data (c6dofimu3_t *ctx, c6dofimu3_accel_t *accel_data, c6dofimu3_mag_t *mag_data)
 Read Accel and Magnetometer data function.
 
uint8_t c6dofimu3_check_int1 (c6dofimu3_t *ctx)
 Get interrupt ststus function.
 

Detailed Description

This file contains API for 6 Dof imu 3 Click driver.