c9dof 2.0.0.0
c9dof.h File Reference

This file contains API for 9 DOF 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  c9dof_t
 Click ctx object definition. More...
 
struct  c9dof_cfg_t
 Click configuration structure definition. More...
 
struct  c9dof_accel_data_t
 Accel data object definition. More...
 
struct  c9dof_gyro_data_t
 Gyro data object definition. More...
 
struct  c9dof_mag_data_t
 Magnetometer data object definition. More...
 

Macros

#define C9DOF_MAP_MIKROBUS(cfg, mikrobus)
 
#define C9DOF_RETVAL   uint8_t
 
#define C9DOF_OK   0x00
 
#define C9DOF_INIT_ERROR   0xFF
 
#define C9DOF_SLAVE_ADDRESS_ACCEL_GYRO_0   0x6A
 
#define C9DOF_SLAVE_ADDRESS_MAG_0   0x1C
 
#define C9DOF_SLAVE_ADDRESS_ACCEL_GYRO_1   0x6B
 
#define C9DOF_SLAVE_ADDRESS_MAG_1   0x1E
 
#define C9DOF_REG_ACT_THS   0x04
 
#define C9DOF_REG_ACT_DUR   0x05
 
#define C9DOF_REG_INT_GEN_CFG_XL   0x06
 
#define C9DOF_REG_INT_GEN_THS_X_XL   0x07
 
#define C9DOF_REG_INT_GEN_THS_Y_XL   0x08
 
#define C9DOF_REG_INT_GEN_THS_Z_XL   0x09
 
#define C9DOF_REG_INT_GEN_DUR_XL   0x0A
 
#define C9DOF_REG_REFERENCE_G   0x0B
 
#define C9DOF_REG_INT1_CTRL   0x0C
 
#define C9DOF_REG_INT2_CTRL   0x0D
 
#define C9DOF_REG_WHO_AM_I   0x0F
 
#define C9DOF_REG_CTRL_REG1_G   0x10
 
#define C9DOF_REG_CTRL_REG2_G   0x11
 
#define C9DOF_REG_CTRL_REG3_G   0x12
 
#define C9DOF_REG_ORIENT_CFG_G   0x13
 
#define C9DOF_REG_INT_GEN_SRC_G   0x14
 
#define C9DOF_REG_OUT_TEMP_L   0x15
 
#define C9DOF_REG_OUT_TEMP_H   0x16
 
#define C9DOF_REG_STATUS_REG   0x17
 
#define C9DOF_REG_OUT_X_L_G   0x18
 
#define C9DOF_REG_OUT_X_H_G   0x19
 
#define C9DOF_REG_OUT_Y_L_G   0x1A
 
#define C9DOF_REG_OUT_Y_H_G   0x1B
 
#define C9DOF_REG_OUT_Z_L_G   0x1C
 
#define C9DOF_REG_OUT_Z_H_G   0x1D
 
#define C9DOF_REG_CTRL_REG4   0x1E
 
#define C9DOF_REG_CTRL_REG5_XL   0x1F
 
#define C9DOF_REG_CTRL_REG6_XL   0x20
 
#define C9DOF_REG_CTRL_REG7_XL   0x21
 
#define C9DOF_REG_CTRL_REG8   0x22
 
#define C9DOF_REG_CTRL_REG9   0x23
 
#define C9DOF_REG_CTRL_REG10   0x24
 
#define C9DOF_REG_INT_GEN_SRC_XL   0x26
 
#define C9DOF_REG_OUT_X_L_XL   0x28
 
#define C9DOF_REG_OUT_X_H_XL   0x29
 
#define C9DOF_REG_OUT_Y_L_XL   0x2A
 
#define C9DOF_REG_OUT_Y_H_XL   0x2B
 
#define C9DOF_REG_OUT_Z_L_XL   0x2C
 
#define C9DOF_REG_OUT_Z_H_XL   0x2D
 
#define C9DOF_REG_FIFO_CTRL   0x2E
 
#define C9DOF_REG_FIFO_SRC   0x2F
 
#define C9DOF_REG_INT_GEN_CFG_G   0x30
 
#define C9DOF_REG_INT_GEN_THS_XH_G   0x31
 
#define C9DOF_REG_INT_GEN_THS_XL_G   0x32
 
#define C9DOF_REG_INT_GEN_THS_YH_G   0x33
 
#define C9DOF_REG_INT_GEN_THS_YL_G   0x34
 
#define C9DOF_REG_INT_GEN_THS_ZH_G   0x35
 
#define C9DOF_REG_INT_GEN_THS_ZL_G   0x36
 
#define C9DOF_REG_INT_GEN_DUR_G   0x37
 
#define C9DOF_REG_OFFSET_X_REG_L_M   0x05
 
#define C9DOF_REG_OFFSET_X_REG_H_M   0x06
 
#define C9DOF_REG_OFFSET_Y_REG_L_M   0x07
 
#define C9DOF_REG_OFFSET_Y_REG_H_M   0x08
 
#define C9DOF_REG_OFFSET_Z_REG_L_M   0x09
 
#define C9DOF_REG_OFFSET_Z_REG_H_M   0x0A
 
#define C9DOF_REG_CTRL_REG1_M   0x20
 
#define C9DOF_REG_CTRL_REG2_M   0x21
 
#define C9DOF_REG_CTRL_REG3_M   0x22
 
#define C9DOF_REG_CTRL_REG4_M   0x23
 
#define C9DOF_REG_CTRL_REG5_M   0x24
 
#define C9DOF_REG_STATUS_REG_M   0x27
 
#define C9DOF_REG_OUT_X_L_M   0x28
 
#define C9DOF_REG_OUT_X_H_M   0x29
 
#define C9DOF_REG_OUT_Y_L_M   0x2A
 
#define C9DOF_REG_OUT_Y_H_M   0x2B
 
#define C9DOF_REG_OUT_Z_L_M   0x2C
 
#define C9DOF_REG_OUT_Z_H_M   0x2D
 
#define C9DOF_REG_INT_CFG_M   0x30
 
#define C9DOF_REG_INT_SRC_M   0x31
 
#define C9DOF_REG_INT_THS_L_M   0x32
 
#define C9DOF_REG_INT_THS_H_M   0x33
 
#define C9DOF_REG_XG_ID   0x68
 
#define C9DOF_REG_MAG_ID   0x3D
 
#define C9DOF_CTRL_REG4_CONFIG   0x38
 
#define C9DOF_CTRL_REG1_G_CONFIG   0x82
 
#define C9DOF_CTRL_REG5_XL_CONFIG   0x38
 
#define C9DOF_CTRL_REG6_XL_CONFIG   0x83
 
#define C9DOF_CTRL_REG8_CONFIG   0x44
 
#define C9DOF_CTRL_REG1_M_CONFIG   0xD0
 
#define C9DOF_CTRL_REG2_M_CONFIG   0x00
 
#define C9DOF_CTRL_REG3_M_CONFIG   0x00
 
#define C9DOF_CTRL_REG4_M_CONFIG   0x08
 
#define C9DOF_CTRL_REG5_M_CONFIG   0x40
 

Functions

void c9dof_cfg_setup (c9dof_cfg_t *cfg)
 Config Object Initialization function.
 
C9DOF_RETVAL c9dof_init (c9dof_t *ctx, c9dof_cfg_t *cfg)
 Initialization function.
 
void c9dof_default_cfg (c9dof_t *ctx)
 Click Default Configuration function.
 
void c9dof_set_power_mode (c9dof_t *ctx, uint8_t pwr_mode)
 Set accel and gyro power mode function.
 
void c9dof_generic_write_accel_gyro (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel and gyro write function.
 
void c9dof_generic_read_accel_gyro (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel and gyro read function.
 
void c9dof_generic_write_mag (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic mag write function.
 
void c9dof_generic_read_mag (c9dof_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic mag read function.
 
void c9dof_read_accel (c9dof_t *ctx, c9dof_accel_data_t *accel_data)
 Get accelerometer data function.
 
void c9dof_read_gyro (c9dof_t *ctx, c9dof_gyro_data_t *gyro_data)
 Get gyroscope data function.
 
void c9dof_read_mag (c9dof_t *ctx, c9dof_mag_data_t *mag_data)
 Get magnetometer data function.
 
uint8_t c9dof_get_interrupt (c9dof_t *ctx)
 Get state of the Magnetic sensor interrupt function.
 

Detailed Description

This file contains API for 9 DOF Click driver.