39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
52#include "drv_spi_master.h"
74#define C6DOFIMU14_REG0_DEVICE_CONFIG 0x11
75#define C6DOFIMU14_REG0_DRIVE_CONFIG 0x13
76#define C6DOFIMU14_REG0_INT_CONFIG 0x14
77#define C6DOFIMU14_REG0_FIFO_CONFIG 0x16
78#define C6DOFIMU14_REG0_TEMP_DATA_MSB 0x1D
79#define C6DOFIMU14_REG0_TEMP_DATA_LSB 0x1E
80#define C6DOFIMU14_REG0_ACCEL_X_MSB 0x1F
81#define C6DOFIMU14_REG0_ACCEL_X_LSB 0x20
82#define C6DOFIMU14_REG0_ACCEL_Y_MSB 0x21
83#define C6DOFIMU14_REG0_ACCEL_Y_LSB 0x22
84#define C6DOFIMU14_REG0_ACCEL_Z_MSB 0x23
85#define C6DOFIMU14_REG0_ACCEL_Z_LSB 0x24
86#define C6DOFIMU14_REG0_GYRO_X_MSB 0x25
87#define C6DOFIMU14_REG0_GYRO_X_LSB 0x26
88#define C6DOFIMU14_REG0_GYRO_Y_MSB 0x27
89#define C6DOFIMU14_REG0_GYRO_Y_LSB 0x28
90#define C6DOFIMU14_REG0_GYRO_Z_MSB 0x29
91#define C6DOFIMU14_REG0_GYRO_Z_LSB 0x2A
92#define C6DOFIMU14_REG0_TMST_FSYNC_MSB 0x2B
93#define C6DOFIMU14_REG0_TMST_FSYNC_LSB 0x2C
94#define C6DOFIMU14_REG0_INT_STATUS_1 0x2D
95#define C6DOFIMU14_REG0_FIFO_COUNT_MSB 0x2E
96#define C6DOFIMU14_REG0_FIFO_COUNT_LSB 0x2F
97#define C6DOFIMU14_REG0_FIFO_DATA 0x30
98#define C6DOFIMU14_REG0_APEX_DATA_LSB 0x31
99#define C6DOFIMU14_REG0_APEX_DATA_MSB 0x32
100#define C6DOFIMU14_REG0_APEX_STEP_CADENCE 0x33
101#define C6DOFIMU14_REG0_APEX_DATA_3 0x34
102#define C6DOFIMU14_REG0_APEX_DATA_4 0x35
103#define C6DOFIMU14_REG0_APEX_DATA_5 0x36
104#define C6DOFIMU14_REG0_INT_STATUS_2 0x37
105#define C6DOFIMU14_REG0_INT_STATUS_3 0x38
106#define C6DOFIMU14_REG0_SIGNAL_PATH_RESET 0x4B
107#define C6DOFIMU14_REG0_INTF_CONFIG_0 0x4C
108#define C6DOFIMU14_REG0_INTF_CONFIG_1 0x4D
109#define C6DOFIMU14_REG0_PWR_MGMT_0 0x4E
110#define C6DOFIMU14_REG0_GYRO_CONFIG_0 0x4F
111#define C6DOFIMU14_REG0_ACCEL_CONFIG_0 0x50
112#define C6DOFIMU14_REG0_GYRO_CONFIG_1 0x51
113#define C6DOFIMU14_REG0_GYRO_ACCEL_CFG_0 0x52
114#define C6DOFIMU14_REG0_ACCEL_CONFIG_1 0x53
115#define C6DOFIMU14_REG0_TMST_CONFIG 0x54
116#define C6DOFIMU14_REG0_APRX_CONFIG_0 0x56
117#define C6DOFIMU14_REG0_SMD_CONFIG 0x57
118#define C6DOFIMU14_REG0_FIFO_CONFIG_1 0x5F
119#define C6DOFIMU14_REG0_FIFO_CONFIG_2 0x60
120#define C6DOFIMU14_REG0_FIFO_CONFIG_3 0x61
121#define C6DOFIMU14_REG0_FSYNC_CONFIG 0x62
122#define C6DOFIMU14_REG0_INT_CONFIG_0 0x63
123#define C6DOFIMU14_REG0_INT_CONFIG_1 0x64
124#define C6DOFIMU14_REG0_INT_SOURCE_0 0x65
125#define C6DOFIMU14_REG0_INT_SOURCE_1 0x66
126#define C6DOFIMU14_REG0_INT_SOURCE_3 0x68
127#define C6DOFIMU14_REG0_INT_SOURCE_4 0x69
128#define C6DOFIMU14_REG0_FIFO_LOST_PKT_0 0x6C
129#define C6DOFIMU14_REG0_FIFO_LOST_PKT_1 0x6D
130#define C6DOFIMU14_REG0_SELF_TEST_CONFIG 0x70
131#define C6DOFIMU14_REG0_WHO_AM_I 0x75
132#define C6DOFIMU14_REG0_BANK_SEL 0x76
138#define C6DOFIMU14_REG1_SENSOR_CONFIG_0 0x03
139#define C6DOFIMU14_REG1_GYRO_CONFIG_2 0x0B
140#define C6DOFIMU14_REG1_GYRO_CONFIG_3 0x0C
141#define C6DOFIMU14_REG1_GYRO_CONFIG_4 0x0D
142#define C6DOFIMU14_REG1_GYRO_CONFIG_5 0x0E
143#define C6DOFIMU14_REG1_GYRO_CONFIG_6 0x0F
144#define C6DOFIMU14_REG1_GYRO_CONFIG_7 0x10
145#define C6DOFIMU14_REG1_GYRO_CONFIG_8 0x11
146#define C6DOFIMU14_REG1_GYRO_CONFIG_9 0x12
147#define C6DOFIMU14_REG1_GYRO_CONFIG_10 0x13
148#define C6DOFIMU14_REG1_XG_ST_DATA 0x5F
149#define C6DOFIMU14_REG1_YG_ST_DATA 0x60
150#define C6DOFIMU14_REG1_ZG_ST_DATA 0x61
151#define C6DOFIMU14_REG1_TMST_VALUE_LSB 0x62
152#define C6DOFIMU14_REG1_TMST_VALUE_MID 0x63
153#define C6DOFIMU14_REG1_TMST_VALUE_MSB 0x64
154#define C6DOFIMU14_REG1_INTF_CONFIG_4 0x7A
155#define C6DOFIMU14_REG1_INTF_CONFIG_5 0x7B
156#define C6DOFIMU14_REG1_INTF_CONFIG_6 0x7C
162#define C6DOFIMU14_REG2_ACCEL_CONFIG_2 0x03
163#define C6DOFIMU14_REG2_ACCEL_CONFIG_3 0x04
164#define C6DOFIMU14_REG2_ACCEL_CONFIG_4 0x05
165#define C6DOFIMU14_REG2_XA_ST_DATA 0x3B
166#define C6DOFIMU14_REG2_YA_ST_DATA 0x3C
167#define C6DOFIMU14_REG2_ZA_ST_DATA 0x3D
173#define C6DOFIMU14_REG4_APEX_CONFIG_1 0x40
174#define C6DOFIMU14_REG4_APEX_CONFIG_2 0x41
175#define C6DOFIMU14_REG4_APEX_CONFIG_3 0x42
176#define C6DOFIMU14_REG4_APEX_CONFIG_4 0x43
177#define C6DOFIMU14_REG4_APEX_CONFIG_5 0x44
178#define C6DOFIMU14_REG4_APEX_CONFIG_6 0x45
179#define C6DOFIMU14_REG4_APEX_CONFIG_7 0x46
180#define C6DOFIMU14_REG4_APEX_CONFIG_8 0x47
181#define C6DOFIMU14_REG4_APEX_CONFIG_9 0x48
182#define C6DOFIMU14_REG4_ACCEL_WOM_X_THR 0x4A
183#define C6DOFIMU14_REG4_ACCEL_WOM_Y_THR 0x4B
184#define C6DOFIMU14_REG4_ACCEL_WOM_Z_THR 0x4C
185#define C6DOFIMU14_REG4_INT_SOURCE_6 0x4D
186#define C6DOFIMU14_REG4_INT_SOURCE_7 0x4E
187#define C6DOFIMU14_REG4_INT_SOURCE_8 0x4F
188#define C6DOFIMU14_REG4_INT_SOURCE_9 0x50
189#define C6DOFIMU14_REG4_INT_SOURCE_10 0x51
190#define C6DOFIMU14_REG4_OFFSET_USER_0 0x77
191#define C6DOFIMU14_REG4_OFFSET_USER_1 0x78
192#define C6DOFIMU14_REG4_OFFSET_USER_2 0x79
193#define C6DOFIMU14_REG4_OFFSET_USER_3 0x7A
194#define C6DOFIMU14_REG4_OFFSET_USER_4 0x7B
195#define C6DOFIMU14_REG4_OFFSET_USER_5 0x7C
196#define C6DOFIMU14_REG4_OFFSET_USER_6 0x7D
197#define C6DOFIMU14_REG4_OFFSET_USER_7 0x7E
198#define C6DOFIMU14_REG4_OFFSET_USER_8 0x7F
217#define C6DOFIMU14_SPR_DMP_INIT_EN 0x40
218#define C6DOFIMU14_SPR_DMP_MEM_RST_EN 0x20
219#define C6DOFIMU14_SPR_ABORT_AND_RESET 0x08
220#define C6DOFIMU14_SPR_TMST_STROBE 0x04
221#define C6DOFIMU14_SPR_FIFO_FLUSH 0x02
227#define C6DOFIMU14_INTF0_FIFO_HOLD_LAST_DATA_EN 0x80
228#define C6DOFIMU14_INTF0_FIFO_HOLD_LAST_DATA_DIS 0x00
229#define C6DOFIMU14_INTF0_FIFO_COUNT_REC_0 0x00
230#define C6DOFIMU14_INTF0_FIFO_COUNT_REC_1 0x40
231#define C6DOFIMU14_INTF0_FIFO_COUNT_ENDIAN_0 0x00
232#define C6DOFIMU14_INTF0_FIFO_COUNT_ENDIAN_1 0x20
233#define C6DOFIMU14_INTF0_SENSOR_DATA_ENDIAN_0 0x00
234#define C6DOFIMU14_INTF0_SENSOR_DATA_ENDIAN_1 0x10
235#define C6DOFIMU14_INTF0_UI_SIFS_CFG_DISABLE_SPI 0x00
236#define C6DOFIMU14_INTF0_UI_SIFS_CFG_DISABLE_I2C 0x01
242#define C6DOFIMU14_INTF1_ACLP_CLK_SEL_WAKEUP_CLK 0x00
243#define C6DOFIMU14_INTF1_ACLP_CLK_SEL_RC_CLK 0x08
244#define C6DOFIMU14_INTF1_RTC_MODE_NO_INPUT 0x00
245#define C6DOFIMU14_INTF1_RTC_MODE_INPUT 0x04
246#define C6DOFIMU14_INTF1_CLKSEL_RC_OS 0x00
247#define C6DOFIMU14_INTF1_CLKSEL_PLL_RC_OS 0x01
248#define C6DOFIMU14_INTF1_CLKSEL_DISABLE_ALL_OS 0x11
254#define C6DOFIMU14_PWR_TEMP_ENABLE 0x00
255#define C6DOFIMU14_PWR_TEMP_DISABLE 0x20
256#define C6DOFIMU14_PWR_IDLE_1 0x10
257#define C6DOFIMU14_PWR_IDLE_0 0x00
258#define C6DOFIMU14_PWR_GYRO_MODE_OFF 0x00
259#define C6DOFIMU14_PWR_GYRO_MODE_STAND_BY 0x04
260#define C6DOFIMU14_PWR_GYRO_MODE_LOW_NOISE 0x0C
261#define C6DOFIMU14_PWR_ACCEL_MODE_OFF 0x00
262#define C6DOFIMU14_PWR_ACCEL_MODE_LOW_POWER 0x02
263#define C6DOFIMU14_PWR_ACCEL_MODE_LOW_NOISE 0x03
269#define C6DOFIMU14_GCFG0_FS_SEL_2000DPS 0x00
270#define C6DOFIMU14_GCFG0_FS_SEL_1000DPS 0x20
271#define C6DOFIMU14_GCFG0_FS_SEL_500DPS 0x40
272#define C6DOFIMU14_GCFG0_FS_SEL_250DPS 0x60
273#define C6DOFIMU14_GCFG0_FS_SEL_125DPS 0x80
274#define C6DOFIMU14_GCFG0_FS_SEL_62p5DPS 0xA0
275#define C6DOFIMU14_GCFG0_FS_SEL_31p25DPS 0xC0
276#define C6DOFIMU14_GCFG0_FS_SEL_15p625DPS 0xE0
277#define C6DOFIMU14_GCFG0_ODR_32KHZ 0x01
278#define C6DOFIMU14_GCFG0_ODR_16KHZ 0x02
279#define C6DOFIMU14_GCFG0_ODR_8KHZ 0x03
280#define C6DOFIMU14_GCFG0_ODR_4KHZ 0x04
281#define C6DOFIMU14_GCFG0_ODR_2KHZ 0x05
282#define C6DOFIMU14_GCFG0_ODR_1KHZ 0x06
283#define C6DOFIMU14_GCFG0_ODR_200HZ 0x07
284#define C6DOFIMU14_GCFG0_ODR_100HZ 0x08
285#define C6DOFIMU14_GCFG0_ODR_50HZ 0x09
286#define C6DOFIMU14_GCFG0_ODR_25HZ 0x0A
287#define C6DOFIMU14_GCFG0_ODR_12p5HZ 0x0B
288#define C6DOFIMU14_GCFG0_ODR_500HZ 0x0F
294#define C6DOFIMU14_ACFG0_FS_SEL_16G 0x00
295#define C6DOFIMU14_ACFG0_FS_SEL_8G 0x20
296#define C6DOFIMU14_ACFG0_FS_SEL_4G 0x40
297#define C6DOFIMU14_ACFG0_FS_SEL_2G 0x60
298#define C6DOFIMU14_ACFG0_ODR_32KHZ 0x01
299#define C6DOFIMU14_ACFG0_ODR_16KHZ 0x02
300#define C6DOFIMU14_ACFG0_ODR_8KHZ 0x03
301#define C6DOFIMU14_ACFG0_ODR_4KHZ 0x04
302#define C6DOFIMU14_ACFG0_ODR_2KHZ 0x05
303#define C6DOFIMU14_ACFG0_ODR_1KHZ 0x06
304#define C6DOFIMU14_ACFG0_ODR_200HZ 0x07
305#define C6DOFIMU14_ACFG0_ODR_100HZ 0x08
306#define C6DOFIMU14_ACFG0_ODR_50HZ 0x09
307#define C6DOFIMU14_ACFG0_ODR_25HZ 0x0A
308#define C6DOFIMU14_ACFG0_ODR_12p5HZ 0x0B
309#define C6DOFIMU14_ACFG0_ODR_6p25HZ 0x0C
310#define C6DOFIMU14_ACFG0_ODR_3p125HZ 0x0D
311#define C6DOFIMU14_ACFG0_ODR_1p562HZ 0x0E
312#define C6DOFIMU14_ACFG0_ODR_500HZ 0x0F
318#define C6DOFIMU14_GCFG1_FILT_BW_4000HZ 0x00
319#define C6DOFIMU14_GCFG1_FILT_BW_170HZ 0x20
320#define C6DOFIMU14_GCFG1_FILT_BW_82HZ 0x40
321#define C6DOFIMU14_GCFG1_FILT_BW_40HZ 0x60
322#define C6DOFIMU14_GCFG1_FILT_BW_20HZ 0x80
323#define C6DOFIMU14_GCFG1_FILT_BW_10HZ 0xA0
324#define C6DOFIMU14_GCFG1_FILT_BW_5HZ 0xC0
325#define C6DOFIMU14_GCFG1_UI_FILT_ORD_1ST_OTHER 0x00
326#define C6DOFIMU14_GCFG1_UI_FILT_ORD_2ND_OTHER 0x04
327#define C6DOFIMU14_GCFG1_UI_FILT_ORD_3RD_OTHER 0x08
328#define C6DOFIMU14_GCFG1_DEC2_M2_ORD_3RD_OTHER 0x02
334#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_2 0x00
335#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_4 0x10
336#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_5 0x20
337#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_8 0x30
338#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_10 0x40
339#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_16 0x50
340#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_20 0x60
341#define C6DOFIMU14_GACFG0_AC_UI_BW_ODR_40 0x70
342#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_2 0x00
343#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_4 0x01
344#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_5 0x02
345#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_8 0x03
346#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_10 0x04
347#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_16 0x05
348#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_20 0x06
349#define C6DOFIMU14_GACFG0_GY_UI_BW_ODR_40 0x07
355#define C6DOFIMU14_ACFG1_UI_FILT_ORD_1ST_OTHER 0x00
356#define C6DOFIMU14_ACFG1_UI_FILT_ORD_2ND_OTHER 0x04
357#define C6DOFIMU14_ACFG1_UI_FILT_ORD_3RD_OTHER 0x08
358#define C6DOFIMU14_ACFG1_DEC2_M2_ORD_3RD_OTHER 0x02
364#define C6DOFIMU14_TMSTCFG_TO_REGS_EN 0x10
365#define C6DOFIMU14_TMSTCFG_TO_REGS_DIS 0x00
366#define C6DOFIMU14_TMSTCFG_RES_0 0x00
367#define C6DOFIMU14_TMSTCFG_RES_1 0x08
368#define C6DOFIMU14_TMSTCFG_DELTA_EN 0x04
369#define C6DOFIMU14_TMSTCFG_DELTA_DIS 0x00
370#define C6DOFIMU14_TMSTCFG_FSYNC_EN 0x02
371#define C6DOFIMU14_TMSTCFG_FSYNC_DIS 0x00
372#define C6DOFIMU14_TMSTCFG_TMST_ENABLE 0x01
373#define C6DOFIMU14_TMSTCFG_TMST_DISABLE 0x00
379#define C6DOFIMU14_APEXCFG0_DMP_NOT_ACTIVE 0x00
380#define C6DOFIMU14_APEXCFG0_DMP_ACTIVE 0x80
381#define C6DOFIMU14_APEXCFG0_TAP_ENABLE 0x40
382#define C6DOFIMU14_APEXCFG0_TAP_DISABLE 0x00
383#define C6DOFIMU14_APEXCFG0_PED_ENABLE 0x20
384#define C6DOFIMU14_APEXCFG0_PED_DISABLE 0x00
385#define C6DOFIMU14_APEXCFG0_TILT_ENABLE 0x10
386#define C6DOFIMU14_APEXCFG0_TILT_DISABLE 0x00
387#define C6DOFIMU14_APEXCFG0_R2W_EMABLE 0x08
388#define C6DOFIMU14_APEXCFG0_R2W_DISABLE 0x00
389#define C6DOFIMU14_APEXCFG0_DMP_ODR_25HZ 0x00
390#define C6DOFIMU14_APEXCFG0_DMP_ODR_50HZ 0x03
396#define C6DOFIMU14_SMDCFG_WOM_INT_MODE_0 0x00
397#define C6DOFIMU14_SMDCFG_WOM_INT_MODE_1 0x08
398#define C6DOFIMU14_SMDCFG_WOM_MODE_0 0x00
399#define C6DOFIMU14_SMDCFG_WOM_MODE_1 0x04
400#define C6DOFIMU14_SMDCFG_SMD_MODE_DISABLE 0x00
401#define C6DOFIMU14_SMDCFG_SMD_MODE_SHORT 0x02
402#define C6DOFIMU14_SMDCFG_SMD_MODE_LONG 0x03
408#define C6DOFIMU14_ISRC0_UI_FSYNC_INT1_EN 0x40
409#define C6DOFIMU14_ISRC0_UI_FSYNC_INT1_DIS 0x00
410#define C6DOFIMU14_ISRC0_PLL_RDY_INT1_EN 0x20
411#define C6DOFIMU14_ISRC0_PLL_RDY_INT1_DIS 0x00
412#define C6DOFIMU14_ISRC0_RESET_DONE_INT1_EN 0x10
413#define C6DOFIMU14_ISRC0_RESET_DONE_INT1_DIS 0x00
414#define C6DOFIMU14_ISRC0_UI_DRDY_INT1_EN 0x08
415#define C6DOFIMU14_ISRC0_UI_DRDY_INT1_DIS 0x00
416#define C6DOFIMU14_ISRC0_FIFO_THS_INT1_EN 0x04
417#define C6DOFIMU14_ISRC0_FIFO_THS_INT1_DIS 0x00
418#define C6DOFIMU14_ISRC0_FIFO_FULL_INT1_EN 0x02
419#define C6DOFIMU14_ISRC0_FIFO_FULL_INT1_DIS 0x00
420#define C6DOFIMU14_ISRC0_UI_AGC_RDY_INT1_EN 0x01
421#define C6DOFIMU14_ISRC0_UI_AGC_RDY_INT1_DIS 0x00
427#define C6DOFIMU14_DEF_WHO_AM_I 0x47
433#define C6DOFIMU14_BANK_0 0x00
434#define C6DOFIMU14_BANK_1 0x01
435#define C6DOFIMU14_BANK_2 0x02
436#define C6DOFIMU14_BANK_3 0x03
437#define C6DOFIMU14_BANK_4 0x04
443#define C6DOFIMU14_SENSOR_CFG_GYRO_Z_EN 0x00
444#define C6DOFIMU14_SENSOR_CFG_GYRO_Z_DIS 0x20
445#define C6DOFIMU14_SENSOR_CFG_GYRO_Y_EN 0x00
446#define C6DOFIMU14_SENSOR_CFG_GYRO_Y_DIS 0x10
447#define C6DOFIMU14_SENSOR_CFG_GYRO_X_EN 0x00
448#define C6DOFIMU14_SENSOR_CFG_GYRO_X_DIS 0x08
449#define C6DOFIMU14_SENSOR_CFG_ACCEL_Z_EN 0x00
450#define C6DOFIMU14_SENSOR_CFG_ACCEL_Z_DIS 0x04
451#define C6DOFIMU14_SENSOR_CFG_ACCEL_Y_EN 0x00
452#define C6DOFIMU14_SENSOR_CFG_ACCEL_Y_DIS 0x02
453#define C6DOFIMU14_SENSOR_CFG_ACCEL_X_EN 0x00
454#define C6DOFIMU14_SENSOR_CFG_ACCEL_X_DIS 0x01
460#define C6DOFIMU14_APEX_CFG1_LOW_ENERGY_SEL 0xA0
461#define C6DOFIMU14_APEX_CFG1_TIME_SEL_0SEC 0x00
462#define C6DOFIMU14_APEX_CFG1_TIME_SEL_4SEC 0x01
463#define C6DOFIMU14_APEX_CFG1_TIME_SEL_8SEC 0x02
464#define C6DOFIMU14_APEX_CFG1_TIME_SEL_12SEC 0x03
465#define C6DOFIMU14_APEX_CFG1_TIME_SEL_16SEC 0x04
466#define C6DOFIMU14_APEX_CFG1_TIME_SEL_20SEC 0x05
467#define C6DOFIMU14_APEX_CFG1_TIME_SEL_24SEC 0x06
468#define C6DOFIMU14_APEX_CFG1_TIME_SEL_28SEC 0x07
469#define C6DOFIMU14_APEX_CFG1_TIME_SEL_32SEC 0x08
470#define C6DOFIMU14_APEX_CFG1_TIME_SEL_36SEC 0x09
471#define C6DOFIMU14_APEX_CFG1_TIME_SEL_40SEC 0x0A
472#define C6DOFIMU14_APEX_CFG1_TIME_SEL_44SEC 0x0B
473#define C6DOFIMU14_APEX_CFG1_TIME_SEL_48SEC 0x0C
474#define C6DOFIMU14_APEX_CFG1_TIME_SEL_52SEC 0x0D
475#define C6DOFIMU14_APEX_CFG1_TIME_SEL_56SEC 0x0E
476#define C6DOFIMU14_APEX_CFG1_TIME_SEL_60SEC 0x0F
482#define C6DOFIMU14_APEX_CFG2_PED_AMP_TH_SEL 0x80
483#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_0 0x00
484#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_1 0x01
485#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_2 0x02
486#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_3 0x03
487#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_4 0x04
488#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_5 0x05
489#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_6 0x06
490#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_7 0x07
491#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_8 0x08
492#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_9 0x09
493#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_10 0x0A
494#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_11 0x0B
495#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_12 0x0C
496#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_13 0x0D
497#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_14 0x0E
498#define C6DOFIMU14_APEX_CFG2_PED_CNT_SEL_15 0x0F
504#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_0 0x00
505#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_1 0x20
506#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_2 0x40
507#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_3 0x60
508#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_4 0x80
509#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_5 0xA0
510#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_6 0xC0
511#define C6DOFIMU14_APEX_CFG3_STEP_DET_SEL_7 0xE0
512#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_0 0x00
513#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_1 0x04
514#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_2 0x08
515#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_3 0x0C
516#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_4 0x10
517#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_5 0x14
518#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_6 0x18
519#define C6DOFIMU14_APEX_CFG3_TIMER_SEL_7 0x1C
520#define C6DOFIMU14_APEX_CFG3_HI_EN_TH_SEL 0x01
526#define C6DOFIMU14_APEX_CFG4_TILT_WAIT_SEL_0S 0x00
527#define C6DOFIMU14_APEX_CFG4_TILT_WAIT_SEL_2S 0x40
528#define C6DOFIMU14_APEX_CFG4_TILT_WAIT_SEL_4S 0x80
529#define C6DOFIMU14_APEX_CFG4_TILT_WAIT_SEL_6S 0xC0
530#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_1p28SEC 0x00
531#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_2p56SEC 0x08
532#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_3p84SEC 0x10
533#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_5p12SEC 0x18
534#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_6p40SEC 0x20
535#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_7p68SEC 0x28
536#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_8p96SEC 0x30
537#define C6DOFIMU14_APEX_CFG4_TILT_SLEEP_TIME_10p24SEC 0x38
543#define C6DOFIMU14_INTSRC6_STEP_DET_INT1_EN 0x20
544#define C6DOFIMU14_INTSRC6_STEP_DET_INT1_DIS 0x00
545#define C6DOFIMU14_INTSRC6_STEP_CNT_OFL_INT1_EN 0x10
546#define C6DOFIMU14_INTSRC6_STEP_CNT_OFL_INT1_DIS 0x00
547#define C6DOFIMU14_INTSRC6_TILT_DET_INT1_EN 0x08
548#define C6DOFIMU14_INTSRC6_TILT_DET_INT1_DIS 0x00
549#define C6DOFIMU14_INTSRC6_WAKE_DET_INT1_EN 0x04
550#define C6DOFIMU14_INTSRC6_WAKE_DET_INT1_DIS 0x00
551#define C6DOFIMU14_INTSRC6_SLEEP_DET_INT1_EN 0x02
552#define C6DOFIMU14_INTSRC6_SLEEP_DET_INT1_DIS 0x00
553#define C6DOFIMU14_INTSRC6_TAP_DET_INT1_EN 0x01
554#define C6DOFIMU14_INTSRC6_TAP_DET_INT1_DIS 0x00
560#define C6DOFIMU14_INTSRC7_STEP_DET_INT2_EN 0x20
561#define C6DOFIMU14_INTSRC7_STEP_DET_INT2_DIS 0x00
562#define C6DOFIMU14_INTSRC7_STEP_CNT_OFL_INT2_EN 0x10
563#define C6DOFIMU14_INTSRC7_STEP_CNT_OFL_INT2_DIS 0x00
564#define C6DOFIMU14_INTSRC7_TILT_DET_INT2_EN 0x08
565#define C6DOFIMU14_INTSRC7_TILT_DET_INT2_DIS 0x00
566#define C6DOFIMU14_INTSRC7_WAKE_DET_INT2_EN 0x04
567#define C6DOFIMU14_INTSRC7_WAKE_DET_INT2_DIS 0x00
568#define C6DOFIMU14_INTSRC7_SLEEP_DET_INT2_EN 0x02
569#define C6DOFIMU14_INTSRC7_SLEEP_DET_INT2_DIS 0x00
570#define C6DOFIMU14_INTSRC7_TAP_DET_INT2_EN 0x01
571#define C6DOFIMU14_INTSRC7_TAP_DET_INT2_DIS 0x00
577#define C6DOFIMU14_DEVCONFIG_SPI_MODE_03 0x00
578#define C6DOFIMU14_DEVCONFIG_SPI_MODE_12 0x10
579#define C6DOFIMU14_DEVCONFIG_SOFT_RESET_NORMAL 0x00
580#define C6DOFIMU14_DEVCONFIG_SOFT_RESET_ENABLE 0x01
586#define C6DOFIMU14_DRIVECONFIG_MAX_SLEW_RATE 0x55
587#define C6DOFIMU14_DRIVECONFIG_MIN_SLEW_RATE 0x00
593#define C6DOFIMU14_FIFOCONFIG_BYPASS_MODE 0x00
594#define C6DOFIMU14_FIFOCONFIG_STREAM_TO_FIFO_MODE 0x40
595#define C6DOFIMU14_FIFOCONFIG_STOP_ON_FULL_MODE 0x80
601#define C6DOFIMU14_FIFOCONFIG1_RESUME_PARTIAL_RD 0x40
602#define C6DOFIMU14_FIFOCONFIG1_HIRES_EN 0x10
603#define C6DOFIMU14_FIFOCONFIG1_TMST_FSYNC_EN 0x08
604#define C6DOFIMU14_FIFOCONFIG1_TEMP_EN 0x04
605#define C6DOFIMU14_FIFOCONFIG1_GYRO_EN 0x02
606#define C6DOFIMU14_FIFOCONFIG1_ACCEL_EN 0x01
612#define C6DOFIMU14_INTSTATUS_UI_FSYNC 0x40
613#define C6DOFIMU14_INTSTATUS_PLL_RDY 0x20
614#define C6DOFIMU14_INTSTATUS_RESET_DONE 0x10
615#define C6DOFIMU14_INTSTATUS_DATA_RDY 0x08
616#define C6DOFIMU14_INTSTATUS_FIFO_THS 0x04
617#define C6DOFIMU14_INTSTATUS_FIFO_FULL 0x02
618#define C6DOFIMU14_INTSTATUS_AGC_RDY 0x01
624#define C6DOFIMU14_FIFOHEADER_MSG 0x80
625#define C6DOFIMU14_FIFOHEADER_ACCEL 0x40
626#define C6DOFIMU14_FIFOHEADER_GYRO 0x20
627#define C6DOFIMU14_FIFOHEADER_20 0x10
628#define C6DOFIMU14_FIFOHEADER_TIMESTAMP_ODR 0x08
629#define C6DOFIMU14_FIFOHEADER_ODR_ACCEL 0x02
630#define C6DOFIMU14_FIFOHEADER_ODR_GYRO 0x01
636#define C6DOFIMU14_SPI_READ_MASK 0x80
637#define C6DOFIMU14_SPI_WRITE_MASK 0x7F
644#define C6DOFIMU14_SET_DEV_ADDR_GND 0x68
645#define C6DOFIMU14_SET_DEV_ADDR_VCC 0x69
663#define C6DOFIMU14_MAP_MIKROBUS( cfg, mikrobus ) \
664 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
665 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
666 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
667 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
668 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
669 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
670 cfg.snc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
671 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
struct c6dofimu14_s c6dofimu14_t
6DOF IMU 14 Click context object.
c6dofimu14_drv_t
6DOF IMU 14 Click driver selector.
Definition c6dofimu14.h:681
@ C6DOFIMU14_DRV_SEL_I2C
Definition c6dofimu14.h:683
@ C6DOFIMU14_DRV_SEL_SPI
Definition c6dofimu14.h:682
err_t(* c6dofimu14_master_io_t)(struct c6dofimu14_s *, uint8_t, uint8_t *, uint8_t)
6DOF IMU 14 Click driver interface.
Definition c6dofimu14.h:691
c6dofimu14_return_value_t
6DOF IMU 14 Click return value data.
Definition c6dofimu14.h:758
@ C6DOFIMU14_OK
Definition c6dofimu14.h:759
@ C6DOFIMU14_ERROR
Definition c6dofimu14.h:760
err_t c6dofimu14_default_cfg(c6dofimu14_t *ctx)
6DOF IMU 14 default configuration function.
err_t c6dofimu14_get_data(c6dofimu14_t *ctx, c6dofimu14_axis_t *acc_axis, c6dofimu14_axis_t *gyro_axis)
6DOF IMU 14 get accel and gyro data function.
uint8_t c6dofimu14_get_int_pin(c6dofimu14_t *ctx)
6DOF IMU 14 get INT pin state function.
err_t c6dofimu14_generic_read(c6dofimu14_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
6DOF IMU 14 data reading function.
err_t c6dofimu14_init(c6dofimu14_t *ctx, c6dofimu14_cfg_t *cfg)
6DOF IMU 14 initialization function.
uint8_t c6dofimu14_get_snc_pin(c6dofimu14_t *ctx)
6DOF IMU 14 get SNC pin state function.
err_t c6dofimu14_get_temperature(c6dofimu14_t *ctx, float *temp)
6DOF IMU 14 get temperature data function.
err_t c6dofimu14_software_reset(c6dofimu14_t *ctx)
6DOF IMU 14 software reset function.
err_t c6dofimu14_generic_write(c6dofimu14_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
6DOF IMU 14 data writing function.
err_t c6dofimu14_get_accel_axis(c6dofimu14_t *ctx, c6dofimu14_axis_t *axis)
6DOF IMU 14 get accel data function.
err_t c6dofimu14_get_gyro_axis(c6dofimu14_t *ctx, c6dofimu14_axis_t *axis)
6DOF IMU 14 get gyro data function.
void c6dofimu14_cfg_setup(c6dofimu14_cfg_t *cfg)
6DOF IMU 14 configuration object setup function.
void c6dofimu14_drv_interface_selection(c6dofimu14_cfg_t *cfg, c6dofimu14_drv_t drv_sel)
6DOF IMU 14 driver interface setup function.
6DOF IMU 14 Axis structure object.
Definition c6dofimu14.h:698
int16_t z
Definition c6dofimu14.h:701
int16_t x
Definition c6dofimu14.h:699
int16_t y
Definition c6dofimu14.h:700
6DOF IMU 14 Click configuration object.
Definition c6dofimu14.h:732
c6dofimu14_drv_t drv_sel
Definition c6dofimu14.h:749
uint32_t i2c_speed
Definition c6dofimu14.h:742
spi_master_chip_select_polarity_t cs_polarity
Definition c6dofimu14.h:747
pin_name_t sck
Definition c6dofimu14.h:737
spi_master_mode_t spi_mode
Definition c6dofimu14.h:746
pin_name_t mosi
Definition c6dofimu14.h:736
uint32_t spi_speed
Definition c6dofimu14.h:745
pin_name_t snc
Definition c6dofimu14.h:739
pin_name_t scl
Definition c6dofimu14.h:733
pin_name_t int_pin
Definition c6dofimu14.h:740
pin_name_t miso
Definition c6dofimu14.h:735
pin_name_t sda
Definition c6dofimu14.h:734
pin_name_t cs
Definition c6dofimu14.h:738
uint8_t i2c_address
Definition c6dofimu14.h:743
6DOF IMU 14 Click context object.
Definition c6dofimu14.h:710
digital_out_t cs
Definition c6dofimu14.h:711
c6dofimu14_drv_t drv_sel
Definition c6dofimu14.h:720
spi_master_t spi
Definition c6dofimu14.h:716
c6dofimu14_master_io_t write_f
Definition c6dofimu14.h:722
c6dofimu14_master_io_t read_f
Definition c6dofimu14.h:723
digital_in_t snc
Definition c6dofimu14.h:712
digital_in_t int_pin
Definition c6dofimu14.h:713
i2c_master_t i2c
Definition c6dofimu14.h:715
uint8_t slave_address
Definition c6dofimu14.h:718
pin_name_t chip_select
Definition c6dofimu14.h:719