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"
75#define C6DOFIMU20_REG_CHIP_ID 0x00
76#define C6DOFIMU20_REG_ERR 0x01
77#define C6DOFIMU20_REG_STATUS 0x02
78#define C6DOFIMU20_REG_ACC_DATA_X 0x03
79#define C6DOFIMU20_REG_ACC_DATA_Y 0x04
80#define C6DOFIMU20_REG_ACC_DATA_Z 0x05
81#define C6DOFIMU20_REG_GYR_DATA_X 0x06
82#define C6DOFIMU20_REG_GYR_DATA_Y 0x07
83#define C6DOFIMU20_REG_GYR_DATA_Z 0x08
84#define C6DOFIMU20_REG_TEMP_DATA 0x09
85#define C6DOFIMU20_REG_SENSOR_TIME_0 0x0A
86#define C6DOFIMU20_REG_SENSOR_TIME_1 0x0B
87#define C6DOFIMU20_REG_SAT_FLAGS 0x0C
88#define C6DOFIMU20_REG_INT_STATUS_INT1 0x0D
89#define C6DOFIMU20_REG_INT_STATUS_INT2 0x0E
90#define C6DOFIMU20_REG_INT_STATUS_IBI 0x0F
91#define C6DOFIMU20_REG_FEATURE_IO0 0x10
92#define C6DOFIMU20_REG_FEATURE_IO1 0x11
93#define C6DOFIMU20_REG_FEATURE_IO2 0x12
94#define C6DOFIMU20_REG_FEATURE_IO3 0x13
95#define C6DOFIMU20_REG_FEATURE_IO_STATUS 0x14
96#define C6DOFIMU20_REG_FIFO_FILL_LEVEL 0x15
97#define C6DOFIMU20_REG_FIFO_DATA 0x16
98#define C6DOFIMU20_REG_ACC_CONF 0x20
99#define C6DOFIMU20_REG_GYR_CONF 0x21
100#define C6DOFIMU20_REG_ALT_ACC_CONF 0x28
101#define C6DOFIMU20_REG_ALT_GYR_CONF 0x29
102#define C6DOFIMU20_REG_ALT_CONF 0x2A
103#define C6DOFIMU20_REG_ALT_STATUS 0x2B
104#define C6DOFIMU20_REG_FIFO_WATERMARK 0x35
105#define C6DOFIMU20_REG_FIFO_CONF 0x36
106#define C6DOFIMU20_REG_FIFO_CTRL 0x37
107#define C6DOFIMU20_REG_IO_INT_CTRL 0x38
108#define C6DOFIMU20_REG_INT_CONF 0x39
109#define C6DOFIMU20_REG_INT_MAP1 0x3A
110#define C6DOFIMU20_REG_INT_MAP2 0x3B
111#define C6DOFIMU20_REG_FEATURE_CTRL 0x40
112#define C6DOFIMU20_REG_FEATURE_DATA_ADDR 0x41
113#define C6DOFIMU20_REG_FEATURE_DATA_TX 0x42
114#define C6DOFIMU20_REG_FEATURE_DATA_STATUS 0x43
115#define C6DOFIMU20_REG_FEATURE_ENGINE_STATUS 0x45
116#define C6DOFIMU20_REG_FEATURE_EVENT_EXT 0x47
117#define C6DOFIMU20_REG_IO_PDN_CTRL 0x4F
118#define C6DOFIMU20_REG_IO_SPI_IF 0x50
119#define C6DOFIMU20_REG_IO_PAD_STRENGTH 0x51
120#define C6DOFIMU20_REG_IO_I2C_IF 0x52
121#define C6DOFIMU20_REG_IO_ODR_DEVIATION 0x53
122#define C6DOFIMU20_REG_ACC_DP_OFF_X 0x60
123#define C6DOFIMU20_REG_ACC_DP_DGAIN_X 0x61
124#define C6DOFIMU20_REG_ACC_DP_OFF_Y 0x62
125#define C6DOFIMU20_REG_ACC_DP_DGAIN_Y 0x63
126#define C6DOFIMU20_REG_ACC_DP_OFF_Z 0x64
127#define C6DOFIMU20_REG_ACC_DP_DGAIN_Z 0x65
128#define C6DOFIMU20_REG_GYR_DP_OFF_X 0x66
129#define C6DOFIMU20_REG_GYR_DP_DGAIN_X 0x67
130#define C6DOFIMU20_REG_GYR_DP_OFF_Y 0x68
131#define C6DOFIMU20_REG_GYR_DP_DGAIN_Y 0x69
132#define C6DOFIMU20_REG_GYR_DP_OFF_Z 0x6A
133#define C6DOFIMU20_REG_GYR_DP_DGAIN_Z 0x6B
134#define C6DOFIMU20_REG_CMD 0x7E
135#define C6DOFIMU20_REG_CFG_RES 0x7F
141#define C6DOFIMU20_REG_SC_ST_VALUE4 0x2C
142#define C6DOFIMU20_REG_SC_ST_VALUE3 0x2B
143#define C6DOFIMU20_REG_SC_ST_VALUE2 0x2A
144#define C6DOFIMU20_REG_SC_ST_VALUE1 0x29
145#define C6DOFIMU20_REG_SC_ST_VALUE0 0x28
146#define C6DOFIMU20_REG_GYR_SC_ST_CONF_RE 0x27
147#define C6DOFIMU20_REG_GYR_SC_SELECT 0x26
148#define C6DOFIMU20_REG_ST_SELECT 0x25
149#define C6DOFIMU20_REG_ST_RESULT 0x24
150#define C6DOFIMU20_REG_ALT_CONFIG_CHG 0x23
151#define C6DOFIMU20_REG_TILT_2 0x22
152#define C6DOFIMU20_REG_TILT_1 0x21
153#define C6DOFIMU20_REG_TAP_3 0x20
154#define C6DOFIMU20_REG_TAP_2 0x1F
155#define C6DOFIMU20_REG_TAP_1 0x1E
156#define C6DOFIMU20_REG_ORIENT_2 0x1D
157#define C6DOFIMU20_REG_ORIENT_1 0x1C
158#define C6DOFIMU20_REG_SC_12 0x1B
159#define C6DOFIMU20_REG_SC_11 0x1A
160#define C6DOFIMU20_REG_SC_10 0x19
161#define C6DOFIMU20_REG_SC_9 0x18
162#define C6DOFIMU20_REG_SC_8 0x17
163#define C6DOFIMU20_REG_SC_7 0x16
164#define C6DOFIMU20_REG_SC_6 0x15
165#define C6DOFIMU20_REG_SC_5 0x14
166#define C6DOFIMU20_REG_SC_4 0x13
167#define C6DOFIMU20_REG_SC_3 0x12
168#define C6DOFIMU20_REG_SC_2 0x11
169#define C6DOFIMU20_REG_SC_1 0x10
170#define C6DOFIMU20_REG_SIGMO_3 0x0F
171#define C6DOFIMU20_REG_SIGMO_2 0x0E
172#define C6DOFIMU20_REG_SIGMO_1 0x0D
173#define C6DOFIMU20_REG_FLAT_2 0x0C
174#define C6DOFIMU20_REG_FLAT_1 0x0B
175#define C6DOFIMU20_REG_MOMO_3 0x0A
176#define C6DOFIMU20_REG_MOMO_2 0x09
177#define C6DOFIMU20_REG_MOMO_1 0x08
178#define C6DOFIMU20_REG_ANYMO_3 0x07
179#define C6DOFIMU20_REG_ANYMO_2 0x06
180#define C6DOFIMU20_REG_ANYMO_1 0x05
181#define C6DOFIMU20_REG_AXIS_MAP_1 0x03
182#define C6DOFIMU20_REG_GEN_SET_1 0x02
200#define C6DOFIMU20_SW_RESET_CMD 0xDEAF
206#define C6DOFIMU20_REG_ERR_FATAL_ERR_FLAG 0x0001
207#define C6DOFIMU20_REG_ERR_FEAT_ENG_OVRLD_FLAG 0x0004
208#define C6DOFIMU20_REG_ERR_ACC_CONF_ERR_FLAG 0x0020
209#define C6DOFIMU20_REG_ERR_GYR_CONF_ERR_FLAG 0x0040
215#define C6DOFIMU20_STATUS_POR_DETECTED_FLAG 0x0001
216#define C6DOFIMU20_STATUS_DRDY_TEMP_FLAG 0x0020
217#define C6DOFIMU20_STATUS_DRDY_GYR_FLAG 0x0040
218#define C6DOFIMU20_STATUS_DRDY_ACC_FLAG 0x0080
224#define C6DOFIMU20_SAT_FLAGS_SATF_ACC_X_FLAG 0x0001
225#define C6DOFIMU20_SAT_FLAGS_SATF_ACC_Y_FLAG 0x0002
226#define C6DOFIMU20_SAT_FLAGS_SATF_ACC_Z_FLAG 0x0004
227#define C6DOFIMU20_SAT_FLAGS_SATF_GYR_X_FLAG 0x0008
228#define C6DOFIMU20_SAT_FLAGS_SATF_GYR_Y_FLAG 0x0010
229#define C6DOFIMU20_SAT_FLAGS_SATF_GYR_Z_FLAG 0x0020
235#define C6DOFIMU20_INT_STATUS_INT1_NO_MOTION 0x0001
236#define C6DOFIMU20_INT_STATUS_INT1_ANY_MOTION 0x0002
237#define C6DOFIMU20_INT_STATUS_INT1_FLAT 0x0004
238#define C6DOFIMU20_INT_STATUS_INT1_ORIENTATION 0x0008
239#define C6DOFIMU20_INT_STATUS_INT1_STEP_DETECTOR 0x0010
240#define C6DOFIMU20_INT_STATUS_INT1_STEP_COUNTER 0x0020
241#define C6DOFIMU20_INT_STATUS_INT1_SIG_MOTION 0x0040
242#define C6DOFIMU20_INT_STATUS_INT1_TILT 0x0080
243#define C6DOFIMU20_INT_STATUS_INT1_TAP 0x0100
244#define C6DOFIMU20_INT_STATUS_INT1_ERR_STATUS 0x0400
245#define C6DOFIMU20_INT_STATUS_INT1_TEMP_DRDY 0x0800
246#define C6DOFIMU20_INT_STATUS_INT1_GYR_DRDY 0x1000
247#define C6DOFIMU20_INT_STATUS_INT1_ACC_DRDY 0x2000
248#define C6DOFIMU20_INT_STATUS_INT1_FWM 0x4000
249#define C6DOFIMU20_INT_STATUS_INT1_FFULL 0x8000
255#define C6DOFIMU20_INT_STATUS_INT2_NO_MOTION 0x0001
256#define C6DOFIMU20_INT_STATUS_INT2_ANY_MOTION 0x0002
257#define C6DOFIMU20_INT_STATUS_INT2_FLAT 0x0004
258#define C6DOFIMU20_INT_STATUS_INT2_ORIENTATION 0x0008
259#define C6DOFIMU20_INT_STATUS_INT2_STEP_DETECTOR 0x0010
260#define C6DOFIMU20_INT_STATUS_INT2_STEP_COUNTER 0x0020
261#define C6DOFIMU20_INT_STATUS_INT2_SIG_MOTION 0x0040
262#define C6DOFIMU20_INT_STATUS_INT2_TILT 0x0080
263#define C6DOFIMU20_INT_STATUS_INT2_TAP 0x0100
264#define C6DOFIMU20_INT_STATUS_INT2_ERR_STATUS 0x0400
265#define C6DOFIMU20_INT_STATUS_INT2_TEMP_DRDY 0x0800
266#define C6DOFIMU20_INT_STATUS_INT2_GYR_DRDY 0x1000
267#define C6DOFIMU20_INT_STATUS_INT2_ACC_DRDY 0x2000
268#define C6DOFIMU20_INT_STATUS_INT2_FWM 0x4000
269#define C6DOFIMU20_INT_STATUS_INT2_FFULL 0x8000
275#define C6DOFIMU20_ACC_CONF_ODR_0POINT78125_Hz 0x0001
276#define C6DOFIMU20_ACC_CONF_ODR_1POINT5625_Hz 0x0002
277#define C6DOFIMU20_ACC_CONF_ODR_3POINT125_Hz 0x0003
278#define C6DOFIMU20_ACC_CONF_ODR_6POINT25_Hz 0x0004
279#define C6DOFIMU20_ACC_CONF_ODR_12POINT5_Hz 0x0005
280#define C6DOFIMU20_ACC_CONF_ODR_25_Hz 0x0006
281#define C6DOFIMU20_ACC_CONF_ODR_50_Hz 0x0007
282#define C6DOFIMU20_ACC_CONF_ODR_100_Hz 0x0008
283#define C6DOFIMU20_ACC_CONF_ODR_200_Hz 0x0009
284#define C6DOFIMU20_ACC_CONF_ODR_400_Hz 0x000A
285#define C6DOFIMU20_ACC_CONF_ODR_800_Hz 0x000B
286#define C6DOFIMU20_ACC_CONF_ODR_1POINT6_kHz 0x000C
287#define C6DOFIMU20_ACC_CONF_ODR_3POINT2_kHz 0x000D
288#define C6DOFIMU20_ACC_CONF_ODR_6POINT4_kHz 0x000E
289#define C6DOFIMU20_ACC_CONF_ACC_RANGE_2G 0x0000
290#define C6DOFIMU20_ACC_CONF_ACC_RANGE_4G 0x0010
291#define C6DOFIMU20_ACC_CONF_ACC_RANGE_8G 0x0020
292#define C6DOFIMU20_ACC_CONF_ACC_RANGE_16G 0x0030
293#define C6DOFIMU20_ACC_CONF_ACC_BW_DIV_2 0x0000
294#define C6DOFIMU20_ACC_CONF_ACC_BW_DIV_4 0x0080
295#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_0 0x0000
296#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_2 0x0100
297#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_4 0x0200
298#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_8 0x0300
299#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_16 0x0400
300#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_32 0x0500
301#define C6DOFIMU20_ACC_CONF_ACC_AVG_NUM_64 0x0600
302#define C6DOFIMU20_ACC_CONF_ACC_MODE_DIS 0x0000
303#define C6DOFIMU20_ACC_CONF_ACC_MODE_DUTY_CYCLING 0x3000
304#define C6DOFIMU20_ACC_CONF_ACC_MODE_CONSTANT_OPERATION 0x4000
305#define C6DOFIMU20_ACC_CONF_ACC_MODE_HIGH_PERFORMANCE 0x7000
311#define C6DOFIMU20_GYR_CONF_ODR_0POINT78125_Hz 0x0001
312#define C6DOFIMU20_GYR_CONF_ODR_1POINT5625_Hz 0x0002
313#define C6DOFIMU20_GYR_CONF_ODR_3POINT125_Hz 0x0003
314#define C6DOFIMU20_GYR_CONF_ODR_6POINT25_Hz 0x0004
315#define C6DOFIMU20_GYR_CONF_ODR_12POINT5_Hz 0x0005
316#define C6DOFIMU20_GYR_CONF_ODR_25_Hz 0x0006
317#define C6DOFIMU20_GYR_CONF_ODR_50_Hz 0x0007
318#define C6DOFIMU20_GYR_CONF_ODR_100_Hz 0x0008
319#define C6DOFIMU20_GYR_CONF_ODR_200_Hz 0x0009
320#define C6DOFIMU20_GYR_CONF_ODR_400_Hz 0x000A
321#define C6DOFIMU20_GYR_CONF_ODR_800_Hz 0x000B
322#define C6DOFIMU20_GYR_CONF_ODR_1POINT6_kHz 0x000C
323#define C6DOFIMU20_GYR_CONF_ODR_3POINT2_kHz 0x000D
324#define C6DOFIMU20_GYR_CONF_ODR_6POINT4_kHz 0x000E
325#define C6DOFIMU20_GYR_CONF_GYR_RANGE_2G 0x0000
326#define C6DOFIMU20_GYR_CONF_GYR_RANGE_4G 0x0010
327#define C6DOFIMU20_GYR_CONF_GYR_RANGE_8G 0x0020
328#define C6DOFIMU20_GYR_CONF_GYR_RANGE_16G 0x0030
329#define C6DOFIMU20_GYR_CONF_GYR_BW_DIV_2 0x0000
330#define C6DOFIMU20_GYR_CONF_GYR_BW_DIV_4 0x0080
331#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_0 0x0000
332#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_2 0x0100
333#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_4 0x0200
334#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_8 0x0300
335#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_16 0x0400
336#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_32 0x0500
337#define C6DOFIMU20_GYR_CONF_GYR_AVG_NUM_64 0x0600
338#define C6DOFIMU20_GYR_CONF_GYR_MODE_DIS 0x0000
339#define C6DOFIMU20_GYR_CONF_GYR_MODE_DUTY_CYCLING 0x3000
340#define C6DOFIMU20_GYR_CONF_GYR_MODE_CONSTANT_OPERATION 0x4000
341#define C6DOFIMU20_GYR_CONF_GYR_MODE_HIGH_PERFORMANCE 0x7000
347#define C6DOFIMU20_IO_INT_CTRL_INT1_LVL_ACTIVE_HIGH 0x0001
348#define C6DOFIMU20_IO_INT_CTRL_INT1_LVL_ACTIVE_LOW 0x0000
349#define C6DOFIMU20_IO_INT_CTRL_INT1_OUTPUT_PUSH_PULL 0x0000
350#define C6DOFIMU20_IO_INT_CTRL_INT1_OUTPUT_OPEN_DRAIN 0x0002
351#define C6DOFIMU20_IO_INT_CTRL_INT1_OUTPUT_EN 0x0004
352#define C6DOFIMU20_IO_INT_CTRL_INT2_LVL_ACTIVE_HIGH 0x0100
353#define C6DOFIMU20_IO_INT_CTRL_INT2_LVL_ACTIVE_LOW 0x0000
354#define C6DOFIMU20_IO_INT_CTRL_INT2_OUTPUT_PUSH_PULL 0x0000
355#define C6DOFIMU20_IO_INT_CTRL_INT2_OUTPUT_OPEN_DRAIN 0x0200
356#define C6DOFIMU20_IO_INT_CTRL_INT2_OUTPUT_EN 0x0400
362#define C6DOFIMU20_INT_CONF_INT_LATCH_EN 0x0001
363#define C6DOFIMU20_INT_CONF_INT_LATCH_DIS 0x0000
369#define C6DOFIMU20_INT_MAP1_NO_MOTION_OUT_DIS 0x0000
370#define C6DOFIMU20_INT_MAP1_NO_MOTION_OUT_INT1 0x0001
371#define C6DOFIMU20_INT_MAP1_NO_MOTION_OUT_INT2 0x0002
372#define C6DOFIMU20_INT_MAP1_ANY_MOTION_OUT_DIS 0x0000
373#define C6DOFIMU20_INT_MAP1_ANY_MOTION_OUT_INT1 0x0004
374#define C6DOFIMU20_INT_MAP1_ANY_MOTION_OUT_INT2 0x0008
375#define C6DOFIMU20_INT_MAP1_FLAT_OUT_DIS 0x0000
376#define C6DOFIMU20_INT_MAP1_FLAT_OUT_INT1 0x0010
377#define C6DOFIMU20_INT_MAP1_FLAT_OUT_INT2 0x0020
378#define C6DOFIMU20_INT_MAP1_ORIENTATION_OUT_DIS 0x0000
379#define C6DOFIMU20_INT_MAP1_ORIENTATION_OUT_INT1 0x0040
380#define C6DOFIMU20_INT_MAP1_ORIENTATION_OUT_INT2 0x0080
381#define C6DOFIMU20_INT_MAP1_STEP_DETECTOR_OUT_DIS 0x0000
382#define C6DOFIMU20_INT_MAP1_STEP_DETECTOR_OUT_INT1 0x0100
383#define C6DOFIMU20_INT_MAP1_STEP_DETECTOR_OUT_INT2 0x0200
384#define C6DOFIMU20_INT_MAP1_STEP_COUNTER_OUT_DIS 0x0000
385#define C6DOFIMU20_INT_MAP1_STEP_COUNTER_OUT_INT1 0x0400
386#define C6DOFIMU20_INT_MAP1_STEP_COUNTER_OUT_INT2 0x0800
387#define C6DOFIMU20_INT_MAP1_SIG_MOTION_OUT_DIS 0x0000
388#define C6DOFIMU20_INT_MAP1_SIG_MOTION_OUT_INT1 0x1000
389#define C6DOFIMU20_INT_MAP1_SIG_MOTION_OUT_INT2 0x2000
390#define C6DOFIMU20_INT_MAP1_TILT_OUT_DIS 0x0000
391#define C6DOFIMU20_INT_MAP1_TILT_OUT_INT1 0x4000
392#define C6DOFIMU20_INT_MAP1_TILT_OUT_INT2 0x8000
398#define C6DOFIMU20_INT_MAP2_TAP_OUT_OUT_DIS 0x0000
399#define C6DOFIMU20_INT_MAP2_TAP_OUT_OUT_INT1 0x0001
400#define C6DOFIMU20_INT_MAP2_TAP_OUT_OUT_INT2 0x0002
401#define C6DOFIMU20_INT_MAP2_ERR_STATUS_DIS 0x0000
402#define C6DOFIMU20_INT_MAP2_ERR_STATUS_INT1 0x0010
403#define C6DOFIMU20_INT_MAP2_ERR_STATUS_INT2 0x0020
404#define C6DOFIMU20_INT_MAP2_TEMP_DRDY_INT_DIS 0x0000
405#define C6DOFIMU20_INT_MAP2_TEMP_DRDY_INT_INT1 0x0040
406#define C6DOFIMU20_INT_MAP2_TEMP_DRDY_INT_INT2 0x0080
407#define C6DOFIMU20_INT_MAP2_GYR_DRDY_INT_DIS 0x0000
408#define C6DOFIMU20_INT_MAP2_GYR_DRDY_INT_INT1 0x0100
409#define C6DOFIMU20_INT_MAP2_GYR_DRDY_INT_INT2 0x0200
410#define C6DOFIMU20_INT_MAP2_ACC_DRDY_INT_DIS 0x0000
411#define C6DOFIMU20_INT_MAP2_ACC_DRDY_INT_INT1 0x0400
412#define C6DOFIMU20_INT_MAP2_ACC_DRDY_INT_INT2 0x0800
413#define C6DOFIMU20_INT_MAP2_FIFO_WATERMARK_INT_DIS 0x0000
414#define C6DOFIMU20_INT_MAP2_FIFO_WATERMARK_INT_INT1 0x1000
415#define C6DOFIMU20_INT_MAP2_FIFO_WATERMARK_INT_INT2 0x2000
416#define C6DOFIMU20_INT_MAP2_FIFO_FULL_INT_DIS 0x0000
417#define C6DOFIMU20_INT_MAP2_FIFO_FULL_INT_INT1 0x4000
418#define C6DOFIMU20_INT_MAP2_FIFO_FULL_INT_INT2 0x8000
425#define C6DOFIMU20_TEMP_CALC_DIVIDER 512
426#define C6DOFIMU20_TEMP_CALC_VALUE 23
433#define C6DOFIMU20_CHIP_ID 0x43
440#define C6DOFIMU20_DEVICE_ADDRESS_GND 0x68
441#define C6DOFIMU20_DEVICE_ADDRESS_VCC 0x69
451#define C6DOFIMU20_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
452#define C6DOFIMU20_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
470#define C6DOFIMU20_MAP_MIKROBUS( cfg, mikrobus ) \
471 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
472 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
473 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
474 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
475 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
476 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
477 cfg.it1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
478 cfg.it2 = MIKROBUS( mikrobus, MIKROBUS_INT )
c6dofimu20_return_value_t
6 DOF IMU 20 Click return value data.
Definition c6dofimu20.h:566
@ C6DOFIMU20_OK
Definition c6dofimu20.h:567
@ C6DOFIMU20_ERROR
Definition c6dofimu20.h:568
err_t(* c6dofimu20_master_io_t)(struct c6dofimu20_s *, uint8_t, uint8_t *, uint8_t)
6 DOF IMU 20 Click driver interface.
Definition c6dofimu20.h:498
struct c6dofimu20_s c6dofimu20_t
6 DOF IMU 20 Click context object.
c6dofimu20_drv_t
6 DOF IMU 20 Click driver selector.
Definition c6dofimu20.h:488
@ C6DOFIMU20_DRV_SEL_I2C
Definition c6dofimu20.h:490
@ C6DOFIMU20_DRV_SEL_SPI
Definition c6dofimu20.h:489
err_t c6dofimu20_get_temperature(c6dofimu20_t *ctx, float *temp_data)
6 DOF IMU 20 temperature reading function.
err_t c6dofimu20_set_reg(c6dofimu20_t *ctx, uint8_t reg, uint16_t data_in)
6 DOF IMU 20 register data writing function.
void c6dofimu20_drv_interface_selection(c6dofimu20_cfg_t *cfg, c6dofimu20_drv_t drv_sel)
6 DOF IMU 20 driver interface setup function.
uint8_t c6dofimu20_get_int2_state(c6dofimu20_t *ctx)
6 DOF IMU 20 IT2 state reading function.
err_t c6dofimu20_generic_read(c6dofimu20_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
6 DOF IMU 20 data reading function.
err_t c6dofimu20_get_gyr_data(c6dofimu20_t *ctx, c6dofimu20_data_t *gyr_data)
6 DOF IMU 20 gyro data reading function.
uint8_t c6dofimu20_get_int1_state(c6dofimu20_t *ctx)
6 DOF IMU 20 IT1 state reading function.
err_t c6dofimu20_get_id(c6dofimu20_t *ctx, uint8_t *chip_id)
6 DOF IMU 20 register chip id reading function.
err_t c6dofimu20_init(c6dofimu20_t *ctx, c6dofimu20_cfg_t *cfg)
6 DOF IMU 20 initialization function.
err_t c6dofimu20_default_cfg(c6dofimu20_t *ctx)
6 DOF IMU 20 default configuration function.
err_t c6dofimu20_generic_write(c6dofimu20_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
6 DOF IMU 20 data writing function.
err_t c6dofimu20_get_reg(c6dofimu20_t *ctx, uint8_t reg, uint16_t *data_out)
6 DOF IMU 20 register data reading function.
err_t c6dofimu20_get_acc_data(c6dofimu20_t *ctx, c6dofimu20_data_t *acc_data)
6 DOF IMU 20 accel data reading function.
void c6dofimu20_cfg_setup(c6dofimu20_cfg_t *cfg)
6 DOF IMU 20 configuration object setup function.
err_t c6dofimu20_sw_reset(c6dofimu20_t *ctx)
6 DOF IMU 20 software reset function.
This file contains SPI specific macros, functions, etc.
6 DOF IMU 20 Click configuration object.
Definition c6dofimu20.h:528
pin_name_t it2
Definition c6dofimu20.h:536
uint32_t i2c_speed
Definition c6dofimu20.h:538
pin_name_t it1
Definition c6dofimu20.h:535
spi_master_chip_select_polarity_t cs_polarity
Definition c6dofimu20.h:543
pin_name_t sck
Definition c6dofimu20.h:533
spi_master_mode_t spi_mode
Definition c6dofimu20.h:542
pin_name_t mosi
Definition c6dofimu20.h:532
uint32_t spi_speed
Definition c6dofimu20.h:541
pin_name_t scl
Definition c6dofimu20.h:529
pin_name_t miso
Definition c6dofimu20.h:531
pin_name_t sda
Definition c6dofimu20.h:530
c6dofimu20_drv_t drv_sel
Definition c6dofimu20.h:545
pin_name_t cs
Definition c6dofimu20.h:534
uint8_t i2c_address
Definition c6dofimu20.h:539
6 DOF IMU 20 Click data object.
Definition c6dofimu20.h:554
int16_t data_y
Definition c6dofimu20.h:556
int16_t data_z
Definition c6dofimu20.h:557
int16_t data_x
Definition c6dofimu20.h:555
6 DOF IMU 20 Click context object.
Definition c6dofimu20.h:505
digital_out_t cs
Definition c6dofimu20.h:506
spi_master_t spi
Definition c6dofimu20.h:512
digital_in_t it2
Definition c6dofimu20.h:509
c6dofimu20_master_io_t write_f
Definition c6dofimu20.h:518
i2c_master_t i2c
Definition c6dofimu20.h:511
c6dofimu20_master_io_t read_f
Definition c6dofimu20.h:519
uint8_t slave_address
Definition c6dofimu20.h:514
c6dofimu20_drv_t drv_sel
Definition c6dofimu20.h:516
pin_name_t chip_select
Definition c6dofimu20.h:515
digital_in_t it1
Definition c6dofimu20.h:508