c6dofimu9 2.0.0.0
c6dofimu9.h File Reference

This file contains API for 6DOF IMU 9 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  c6dofimu9_s
 Click ctx object definition. More...
 
struct  c6dofimu9_cfg_t
 Click configuration structure definition. More...
 

Macros

#define C6DOFIMU9_MAP_MIKROBUS(cfg, mikrobus)
 
#define C6DOFIMU9_MASTER_I2C   0
 
#define C6DOFIMU9_MASTER_SPI   1
 
#define C6DOFIMU9_RETVAL   uint8_t
 
#define C6DOFIMU9_OK   0x00
 
#define C6DOFIMU9_INIT_ERROR   0xFF
 
#define C6DOFIMU9_I2C_SLAVE_ADDRESS_0   0x68
 
#define C6DOFIMU9_I2C_SLAVE_ADDRESS_1   0x69
 
#define C6DOFIMU9_SPI_WRITE_CMD   0x00
 
#define C6DOFIMU9_SPI_READ_CMD   0x80
 
#define C6DOFIMU9_REG_SELF_TEST_X_GYRO   0x00
 
#define C6DOFIMU9_REG_SELF_TEST_Y_GYRO   0x01
 
#define C6DOFIMU9_REG_SELF_TEST_Z_GYRO   0x02
 
#define C6DOFIMU9_REG_SELF_TEST_X_ACCEL   0x0D
 
#define C6DOFIMU9_REG_SELF_TEST_Y_ACCEL   0x0E
 
#define C6DOFIMU9_REG_SELF_TEST_Z_ACCEL   0x0F
 
#define C6DOFIMU9_REG_XG_OFFS_USRH   0x13
 
#define C6DOFIMU9_REG_XG_OFFS_USRL   0x14
 
#define C6DOFIMU9_REG_YG_OFFS_USRH   0x15
 
#define C6DOFIMU9_REG_YG_OFFS_USRL   0x16
 
#define C6DOFIMU9_REG_ZG_OFFS_USRH   0x17
 
#define C6DOFIMU9_REG_ZG_OFFS_USRL   0x18
 
#define C6DOFIMU9_REG_SMPLRT_DIV   0x19
 
#define C6DOFIMU9_REG_CONFIG   0x1A
 
#define C6DOFIMU9_REG_GYRO_CONFIG   0x1B
 
#define C6DOFIMU9_REG_ACCEL_CONFIG   0x1C
 
#define C6DOFIMU9_REG_ACCEL_CONFIG_2   0x1D
 
#define C6DOFIMU9_REG_LP_MODE_CFG   0x1E
 
#define C6DOFIMU9_REG_ACCEL_WOM_THR   0x1F
 
#define C6DOFIMU9_REG_FIFO_EN   0x23
 
#define C6DOFIMU9_REG_FSYNC_INT   0x36
 
#define C6DOFIMU9_REG_INT_PIN_CFG   0x37
 
#define C6DOFIMU9_REG_INT_ENABLE   0x38
 
#define C6DOFIMU9_REG_INT_STATUS   0x3A
 
#define C6DOFIMU9_REG_ACCEL_XOUT_H   0x3B
 
#define C6DOFIMU9_REG_ACCEL_XOUT_L   0x3C
 
#define C6DOFIMU9_REG_ACCEL_YOUT_H   0x3D
 
#define C6DOFIMU9_REG_ACCEL_YOUT_L   0x3E
 
#define C6DOFIMU9_REG_ACCEL_ZOUT_H   0x3F
 
#define C6DOFIMU9_REG_ACCEL_ZOUT_L   0x40
 
#define C6DOFIMU9_REG_TEMP_OUT_H   0x41
 
#define C6DOFIMU9_REG_TEMP_OUT_L   0x42
 
#define C6DOFIMU9_REG_GYRO_XOUT_H   0x43
 
#define C6DOFIMU9_REG_GYRO_XOUT_L   0x44
 
#define C6DOFIMU9_REG_GYRO_YOUT_H   0x45
 
#define C6DOFIMU9_REG_GYRO_YOUT_L   0x46
 
#define C6DOFIMU9_REG_GYRO_ZOUT_H   0x47
 
#define C6DOFIMU9_REG_GYRO_ZOUT_L   0x48
 
#define C6DOFIMU9_REG_SIGNAL_PATH_RESET   0x68
 
#define C6DOFIMU9_REG_ACCEL_INTEL_CTRL   0x69
 
#define C6DOFIMU9_REG_USER_CTRL   0x6A
 
#define C6DOFIMU9_REG_PWR_MGMT_1   0x6B
 
#define C6DOFIMU9_REG_PWR_MGMT_2   0x6C
 
#define C6DOFIMU9_REG_FIFO_COUNTH   0x72
 
#define C6DOFIMU9_REG_FIFO_COUNTL   0x73
 
#define C6DOFIMU9_REG_FIFO_R_W   0x74
 
#define C6DOFIMU9_REG_WHO_AM_I   0x75
 
#define C6DOFIMU9_REG_XA_OFFSET_H   0x77
 
#define C6DOFIMU9_REG_XA_OFFSET_L   0x78
 
#define C6DOFIMU9_REG_YA_OFFSET_H   0x7A
 
#define C6DOFIMU9_REG_YA_OFFSET_L   0x7B
 
#define C6DOFIMU9_REG_ZA_OFFSET_H   0x7D
 
#define C6DOFIMU9_REG_ZA_OFFSET_L   0x7E
 
#define C6DOFIMU9_BM_FIFO_MODE_FULL_REPLACE_OLD_DATA   0x00
 
#define C6DOFIMU9_BM_FIFO_MODE_FULL_NO_WRITE_DATA   0x40
 
#define C6DOFIMU9_BM_DISABLE_FSYNC_PIN   0x00
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_TEMP_OUT_L   0x08
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_GYRO_XOUT_L   0x10
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_GYRO_YOUT_L   0x18
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_GYRO_ZOUT_L   0x20
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_ACCEL_XOUT_L   0x28
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_ACCEL_YOUT_L   0x30
 
#define C6DOFIMU9_BM_ENABLE_FSYNC_PIN_ACCEL_ZOUT_L   0x38
 
#define C6DOFIMU9_GYRO_FULL_SCALE_250dps   0x00FA
 
#define C6DOFIMU9_GYRO_FULL_SCALE_500dps   0x01F4
 
#define C6DOFIMU9_GYRO_FULL_SCALE_1000dps   0x03E8
 
#define C6DOFIMU9_GYRO_FULL_SCALE_2000dps   0x07D0
 
#define C6DOFIMU9_ACCEL_FULL_SCALE_2g   0x02
 
#define C6DOFIMU9_ACCEL_FULL_SCALE_4g   0x04
 
#define C6DOFIMU9_ACCEL_FULL_SCALE_8g   0x08
 
#define C6DOFIMU9_ACCEL_FULL_SCALE_16g   0x10
 
#define C6DOFIMU9_ACCEL_AVERAGE_4_SAMPLES   0x04
 
#define C6DOFIMU9_ACCEL_AVERAGE_8_SAMPLES   0x08
 
#define C6DOFIMU9_ACCEL_AVERAGE_16_SAMPLES   0x10
 
#define C6DOFIMU9_ACCEL_AVERAGE_32_SAMPLES   0x20
 
#define C6DOFIMU9_GYRO_AVERAGE_1x   0x01
 
#define C6DOFIMU9_GYRO_AVERAGE_2x   0x02
 
#define C6DOFIMU9_GYRO_AVERAGE_4x   0x04
 
#define C6DOFIMU9_GYRO_AVERAGE_8x   0x08
 
#define C6DOFIMU9_GYRO_AVERAGE_16x   0x10
 
#define C6DOFIMU9_GYRO_AVERAGE_32x   0x20
 
#define C6DOFIMU9_GYRO_AVERAGE_64x   0x40
 
#define C6DOFIMU9_GYRO_AVERAGE_128x   0x80
 
#define C6DOFIMU9_BM_DISABLE_TEMP_FIFO   0x00
 
#define C6DOFIMU9_BM_ENABLE_TEMP_FIFO   0x80
 
#define C6DOFIMU9_BM_DISABLE_XGYRO_FIFO   0x00
 
#define C6DOFIMU9_BM_ENABLE_XGYRO_FIFO   0x40
 
#define C6DOFIMU9_BM_DISABLE_YGYRO_FIFO   0x00
 
#define C6DOFIMU9_BM_ENABLE_YGYRO_FIFO   0x20
 
#define C6DOFIMU9_BM_DISABLE_ZGYRO_FIFO   0x00
 
#define C6DOFIMU9_BM_ENABLE_ZGYRO_FIFO   0x10
 
#define C6DOFIMU9_BM_DISABLE_ACCEL_FIFO   0x00
 
#define C6DOFIMU9_BM_ENABLE_ACCEL_FIFO   0x08
 
#define C6DOFIMU9_DEVICE_ID   0xA9
 

Typedefs

typedef uint8_t c6dofimu9_select_t
 Communication type.
 
typedef void(* c6dofimu9_master_io_t) (struct c6dofimu9_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct c6dofimu9_s c6dofimu9_t
 Click ctx object definition.
 

Functions

void c6dofimu9_cfg_setup (c6dofimu9_cfg_t *cfg)
 Config Object Initialization function.
 
C6DOFIMU9_RETVAL c6dofimu9_init (c6dofimu9_t *ctx, c6dofimu9_cfg_t *cfg)
 Initialization function.
 
void c6dofimu9_default_cfg (c6dofimu9_t *ctx)
 Click Default Configuration function.
 
void c6dofimu9_generic_write (c6dofimu9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c6dofimu9_generic_read (c6dofimu9_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t c6dofimu9_check_interrupt (c6dofimu9_t *ctx)
 Check interrupt state function.
 
void c6dofimu9_set_config (c6dofimu9_t *ctx, uint8_t config_data)
 Set configuration function.
 
void c6dofimu9_set_gyro_config (c6dofimu9_t *ctx, uint8_t gyro_config_data)
 Set Gyro configuration function.
 
void c6dofimu9_set_gyro_measurement_range (c6dofimu9_t *ctx, uint16_t gyro_full_scale_range)
 Set Gyro measurement range configuration function.
 
void c6dofimu9_set_accel_config (c6dofimu9_t *ctx, uint16_t accel_config_data)
 Set Accel configuration function.
 
void c6dofimu9_set_accel_measurement_range (c6dofimu9_t *ctx, uint8_t accel_full_scale_range)
 Set Accel measurement range configuration function.
 
void c6dofimu9_set_accel_avg_filter_mode (c6dofimu9_t *ctx, uint8_t accel_avg_samples)
 Set Accel averaging filter settings for Low Power mode function.
 
void c6dofimu9_set_gyro_config_lp_mode (c6dofimu9_t *ctx, uint8_t gyro_averages)
 Generic read function.
 
uint8_t c6dofimu9_get_accel_wake_on_motion_trsh (c6dofimu9_t *ctx)
 Get Accel wake-on motion threshold function.
 
void c6dofimu9_enable_fifo (c6dofimu9_t *ctx, uint8_t en_fifo_data)
 Enable FIFO configuration function.
 
void c6dofimu9_enable_accel_interrupt (c6dofimu9_t *ctx)
 Enable Accel interrupt function.
 
void c6dofimu9_enable_gyro_interrupt (c6dofimu9_t *ctx)
 Enable Gyro interrupt function.
 
void c6dofimu9_enable_data_ready_interrupt (c6dofimu9_t *ctx)
 Enable data ready interrupt function.
 
uint8_t c6dofimu9_get_interrupt_status (c6dofimu9_t *ctx)
 Get interrupt status function.
 
void c6dofimu9_reset_accel_signal (c6dofimu9_t *ctx)
 Reset Accel signal path function.
 
void c6dofimu9_reset_gyro_signal (c6dofimu9_t *ctx)
 Reset Gyro signal path function.
 
void c6dofimu9_enable_accel_wake_on_motion (c6dofimu9_t *ctx)
 Enable the Wake-on-Motion detection function.
 
void c6dofimu9_reset_default (c6dofimu9_t *ctx)
 Reset the internal registers and restores the default settings function.
 
void c6dofimu9_set_sleep_mode (c6dofimu9_t *ctx)
 Set the device to sleep mode function.
 
void c6dofimu9_set_standby_mode (c6dofimu9_t *ctx)
 Set the device to standby mode function.
 
uint8_t c6dofimu9_get_device_id (c6dofimu9_t *ctx)
 Get device ID function.
 
int16_t c6dofimu9_get_axis (c6dofimu9_t *ctx, uint8_t addr_reg_msb, uint8_t addr_reg_lsb)
 Get axis data function.
 
void c6dofimu9_get_accel_data (c6dofimu9_t *ctx, int16_t *p_accel_x, int16_t *p_accel_y, int16_t *p_accel_z)
 Read Accel X-axis, Y-axis and Z-axis axis function.
 
void c6dofimu9_get_gyro_data (c6dofimu9_t *ctx, int16_t *p_gyro_x, int16_t *p_gyro_y, int16_t *p_gyro_z)
 Read Gyro X-axis, Y-axis and Z-axis axis function.
 

Detailed Description

This file contains API for 6DOF IMU 9 Click driver.