c6dofimu15  2.0.0.0
c6dofimu15.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright© 2020 MikroElektronika d.o.o.
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22  * OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
33 // ----------------------------------------------------------------------------
34 
35 #ifndef C6DOFIMU15_H
36 #define C6DOFIMU15_H
37 
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_i2c_master.h"
41 #include "drv_spi_master.h"
42 
43 // -------------------------------------------------------------- PUBLIC MACROS
54 #define C6DOFIMU15_MAP_MIKROBUS( cfg, mikrobus ) \
55  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
56  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
57  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
58  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
59  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
60  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
61  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
62 
68 #define C6DOFIMU15_MASTER_I2C 0
69 #define C6DOFIMU15_MASTER_SPI 1
70 
76 #define C6DOFIMU15_RETVAL uint8_t
77 
78 #define C6DOFIMU15_OK 0x00
79 #define C6DOFIMU15_INIT_ERROR 0xFF
80 
86 #define C6DOFIMU15_I2C_ADR_GND 0x6A
87 #define C6DOFIMU15_I2C_ADR_VCC 0x6B
88 
94 #define C6DOFIMU15_PIN_CTL 0x02
95 #define C6DOFIMU15_FIFO_CTL1 0x07
96 #define C6DOFIMU15_FIFO_CTL2 0x08
97 #define C6DOFIMU15_FIFO_CTL3 0x09
98 #define C6DOFIMU15_FIFO_CTL4 0x0A
99 #define C6DOFIMU15_CNT_BDR_REG1 0x0B
100 #define C6DOFIMU15_CNT_BDR_REG2 0x0C
101 #define C6DOFIMU15_INT1_CTL 0x0D
102 #define C6DOFIMU15_INT2_CTL 0x0E
103 #define C6DOFIMU15_WHO_AM_I 0x0F
104 #define C6DOFIMU15_CTL1_XL 0x10
105 #define C6DOFIMU15_CTL2_G 0x11
106 #define C6DOFIMU15_CTL3_C 0x12
107 #define C6DOFIMU15_CTL4_C 0x13
108 #define C6DOFIMU15_CTL5_C 0x14
109 #define C6DOFIMU15_CTL6_C 0x15
110 #define C6DOFIMU15_CTL7_G 0x16
111 #define C6DOFIMU15_CTL8_XL 0x17
112 #define C6DOFIMU15_CTL9_XL 0x18
113 #define C6DOFIMU15_CTL10_C 0x19
114 #define C6DOFIMU15_ALL_INT_SRC 0x1A
115 #define C6DOFIMU15_WAKE_UP_SRC 0x1B
116 #define C6DOFIMU15_D6D_SRC 0x1D
117 #define C6DOFIMU15_STAT_REG 0x1E
118 #define C6DOFIMU15_OUT_TEMP_L 0x20
119 #define C6DOFIMU15_OUT_TEMP_H 0x21
120 #define C6DOFIMU15_OUTX_L_G 0x22
121 #define C6DOFIMU15_OUTX_H_G 0x23
122 #define C6DOFIMU15_OUTY_L_G 0x24
123 #define C6DOFIMU15_OUTY_H_G 0x25
124 #define C6DOFIMU15_OUTZ_L_G 0x26
125 #define C6DOFIMU15_OUTZ_H_G 0x27
126 #define C6DOFIMU15_OUTX_L_A 0x28
127 #define C6DOFIMU15_OUTX_H_A 0x29
128 #define C6DOFIMU15_OUTY_L_A 0x2A
129 #define C6DOFIMU15_OUTY_H_A 0x2B
130 #define C6DOFIMU15_OUTZ_L_A 0x2C
131 #define C6DOFIMU15_OUTZ_H_A 0x2D
132 #define C6DOFIMU15_FIFO_STAT1 0x3A
133 #define C6DOFIMU15_FIFO_STAT2 0x3B
134 #define C6DOFIMU15_T_STMP_0_REG 0x40
135 #define C6DOFIMU15_T_STMP_1_REG 0x41
136 #define C6DOFIMU15_T_STMP_2_REG 0x42
137 #define C6DOFIMU15_T_STMP_3_REG 0x43
138 #define C6DOFIMU15_INT_CFG0 0x56
139 #define C6DOFIMU15_INT_CFG1 0x58
140 #define C6DOFIMU15_THS_6D 0x59
141 #define C6DOFIMU15_WAKE_UP_THS 0x5B
142 #define C6DOFIMU15_WAKE_UP_DUR 0x5C
143 #define C6DOFIMU15_FREE_FALL 0x5D
144 #define C6DOFIMU15_MD1_CFG 0x5E
145 #define C6DOFIMU15_MD2_CFG 0x5F
146 #define C6DOFIMU15_INT_FRQ_FINE 0x63
147 #define C6DOFIMU15_X_OFS_USR 0x73
148 #define C6DOFIMU15_Y_OFS_USR 0x74
149 #define C6DOFIMU15_Z_OFS_USR 0x75
150 #define C6DOFIMU15_FIFO_DATA_OUT_TAG 0x78
151 #define C6DOFIMU15_FIFO_DATA_OUT_X_L 0x79
152 #define C6DOFIMU15_FIFO_DATA_OUT_X_H 0x7A
153 #define C6DOFIMU15_FIFO_DATA_OUT_Y_L 0x7B
154 #define C6DOFIMU15_FIFO_DATA_OUT_Y_H 0x7C
155 #define C6DOFIMU15_FIFO_DATA_OUT_Z_L 0x7D
156 #define C6DOFIMU15_FIFO_DATA_OUT_Z_H 0x7E
157 
163 #define C6DOFIMU15_SDO_PU_EN 0x7F
164 #define C6DOFIMU15_SDO_PU_DIS 0x3F
165 
171 #define C6DOFIMU15_BDR_GY_FIFO_NB 0x00
172 #define C6DOFIMU15_BDR_GY_12_5_HZ 0x10
173 #define C6DOFIMU15_BDR_GY_26_HZ 0x20
174 #define C6DOFIMU15_BDR_GY_52_HZ 0x30
175 #define C6DOFIMU15_BDR_GY_104_HZ 0x40
176 #define C6DOFIMU15_BDR_GY_208_HZ 0x50
177 #define C6DOFIMU15_BDR_GY_417_HZ 0x60
178 #define C6DOFIMU15_BDR_GY_833_HZ 0x70
179 #define C6DOFIMU15_BDR_GY_1667_HZ 0x80
180 #define C6DOFIMU15_BDR_GY_3333_HZ 0x90
181 #define C6DOFIMU15_BDR_GY_6667_HZ 0xA0
182 #define C6DOFIMU15_BDR_GY_6_5_HZ 0xB0
183 #define C6DOFIMU15_BDR_XL_FIFO_NB 0x00
184 #define C6DOFIMU15_BDR_XL_12_5_HZ 0x01
185 #define C6DOFIMU15_BDR_XL_26_HZ 0x02
186 #define C6DOFIMU15_BDR_XL_52_HZ 0x03
187 #define C6DOFIMU15_BDR_XL_104_HZ 0x04
188 #define C6DOFIMU15_BDR_XL_208_HZ 0x05
189 #define C6DOFIMU15_BDR_XL_417_HZ 0x06
190 #define C6DOFIMU15_BDR_XL_833_HZ 0x07
191 #define C6DOFIMU15_BDR_XL_1667_HZ 0x80
192 #define C6DOFIMU15_BDR_XL_3333_HZ 0x09
193 #define C6DOFIMU15_BDR_XL_6667_HZ 0x0A
194 
200 #define C6DOFIMU15_DEC_TS_BATCH_1 0x40
201 #define C6DOFIMU15_DEC_TS_BATCH_8 0x80
202 #define C6DOFIMU15_DEC_TS_BATCH_32 0xC0
203 #define C6DOFIMU15_ODR_T_BATCH_1_6_HZ 0x10
204 #define C6DOFIMU15_ODR_T_BATCH_12_5_HZ 0x20
205 #define C6DOFIMU15_ODR_T_BATCH_52_HZ 0x30
206 #define C6DOFIMU15_FIFO_DIS 0x00
207 #define C6DOFIMU15_FIFO_ST_WHEN_FULL 0x01
208 #define C6DOFIMU15_CONT_TO_FIFO 0x03
209 #define C6DOFIMU15_BYP_TO_CONT 0x04
210 #define C6DOFIMU15_CONT_MODE 0x06
211 #define C6DOFIMU15_BYP_TO_FIFO 0x07
212 
218 #define C6DOFIMU15_DEN_DRDY_FLAG 0x80
219 #define C6DOFIMU15_INT1_CNT_BDR 0x40
220 #define C6DOFIMU15_INT1_FIFO_FULL 0x20
221 #define C6DOFIMU15_INT1_FIFO_OVR 0x10
222 #define C6DOFIMU15_INT1_FIFO_TH 0x08
223 #define C6DOFIMU15_INT1_BOOT 0x04
224 #define C6DOFIMU15_INT1_DRDY_G 0x02
225 #define C6DOFIMU15_INT1_DRDY_XL 0x01
226 
232 #define C6DOFIMU15_INT2_CNT_BDR 0x40
233 #define C6DOFIMU15_INT2_FIFO_FULL 0x20
234 #define C6DOFIMU15_INT2_FIFO_OVR 0x10
235 #define C6DOFIMU15_INT2_FIFO_TH 0x08
236 #define C6DOFIMU15_INT2_DRDY_TEMP 0x04
237 #define C6DOFIMU15_INT2_DRDY_G 0x02
238 #define C6DOFIMU15_INT2_DRDY_XL 0x01
239 
245 #define C6DOFIMU15_WHO_AM_I_VAL 0x6B
246 
252 #define C6DOFIMU15_ODR_XL_POW_DWN 0x00
253 #define C6DOFIMU15_ODR_XL_12_5_HZ 0x10
254 #define C6DOFIMU15_ODR_XL_26_HZ 0x20
255 #define C6DOFIMU15_ODR_XL_52_HZ 0x30
256 #define C6DOFIMU15_ODR_XL_104_HZ 0x40
257 #define C6DOFIMU15_ODR_XL_208_HZ 0x50
258 #define C6DOFIMU15_ODR_XL_417_HZ 0x60
259 #define C6DOFIMU15_ODR_XL_833_HZ 0x70
260 #define C6DOFIMU15_ODR_XL_1667_HZ 0x80
261 #define C6DOFIMU15_ODR_XL_3333_HZ 0x90
262 #define C6DOFIMU15_ODR_XL_6667_HZ 0xA0
263 #define C6DOFIMU15_FS_XL_2_G 0x00
264 #define C6DOFIMU15_FS_XL_16_G 0x04
265 #define C6DOFIMU15_FS_XL_4_G 0x08
266 #define C6DOFIMU15_FS_XL_8_G 0x0C
267 #define C6DOFIMU15_LPF2_XL_EN 0x02
268 
274 #define C6DOFIMU15_ODR_G_POW_DWN 0x00
275 #define C6DOFIMU15_ODR_G_12_5_HZ 0x10
276 #define C6DOFIMU15_ODR_G_26_HZ 0x20
277 #define C6DOFIMU15_ODR_G_52_HZ 0x30
278 #define C6DOFIMU15_ODR_G_104_HZ 0x40
279 #define C6DOFIMU15_ODR_G_208_HZ 0x50
280 #define C6DOFIMU15_ODR_G_417_HZ 0x60
281 #define C6DOFIMU15_ODR_G_833_HZ 0x70
282 #define C6DOFIMU15_ODR_G_1667_HZ 0x80
283 #define C6DOFIMU15_ODR_G_3333_HZ 0x90
284 #define C6DOFIMU15_ODR_G_6667_HZ 0xA0
285 #define C6DOFIMU15_FS_G_250_DPS 0x00
286 #define C6DOFIMU15_FS_G_500_DPS 0x04
287 #define C6DOFIMU15_FS_G_1000_DPS 0x08
288 #define C6DOFIMU15_FS_G_2000_DPS 0x0C
289 #define C6DOFIMU15_FS_125 0x02
290 #define C6DOFIMU15_FS_4000 0x01
291 
297 #define C6DOFIMU15_BOOT 0x80
298 #define C6DOFIMU15_BDU 0x40
299 #define C6DOFIMU15_H_LACTIVE 0x20
300 #define C6DOFIMU15_PP_OD 0x10
301 #define C6DOFIMU15_SIM 0x08
302 #define C6DOFIMU15_IF_INC 0x04
303 #define C6DOFIMU15_SW_RESET 0x01
304 
310 #define C6DOFIMU15_SLEEP_G 0x40
311 #define C6DOFIMU15_INT2_ON_INT1 0x20
312 #define C6DOFIMU15_DRDY_MASK 0x08
313 #define C6DOFIMU15_I2C_DIS 0x04
314 #define C6DOFIMU15_LPF1_SEL_G 0x02
315 
321 #define C6DOFIMU15_ROUNDING_NO 0x00
322 #define C6DOFIMU15_ROUNDING_XL 0x20
323 #define C6DOFIMU15_ROUNDING_G 0x40
324 #define C6DOFIMU15_ROUNDING_G_XL 0x60
325 #define C6DOFIMU15_ST_G_NOR_OP 0x00
326 #define C6DOFIMU15_ST_G_POS_SNG 0x04
327 #define C6DOFIMU15_ST_G_NEG_SNG 0x0C
328 #define C6DOFIMU15_ST_XL_NOR_OP 0x00
329 #define C6DOFIMU15_ST_XL_POS_SNG 0x01
330 #define C6DOFIMU15_ST_XL_NEG_SNG 0x02
331 
337 #define C6DOFIMU15_EDG_SENS_TRIG 0x80
338 #define C6DOFIMU15_LVL_SENS_TRIG 0x40
339 #define C6DOFIMU15_LVL_SENS_LTCH 0x60
340 #define C6DOFIMU15_LVL_SENS_FIFO_EN 0xC0
341 
347 #define C6DOFIMU15_HP_EN_G 0x40
348 #define C6DOFIMU15_HPM_G_16_MHZ 0x00
349 #define C6DOFIMU15_HPM_G_65_MHZ 0x10
350 #define C6DOFIMU15_HPM_G_260_MHZ 0x20
351 #define C6DOFIMU15_HPM_G_1_04_HZ 0x30
352 #define C6DOFIMU15_USR_OFF_ON_OUT 0x02
353 
359 #define C6DOFIMU15_DEN_X 0x80
360 #define C6DOFIMU15_DEN_Y 0x40
361 #define C6DOFIMU15_DEN_Z 0x20
362 #define C6DOFIMU15_DEN_XL_G 0x10
363 #define C6DOFIMU15_DEN_XL_EN 0x08
364 #define C6DOFIMU15_DEN_LH 0x04
365 #define C6DOFIMU15_DEV_CFG 0x02
366 
372 #define C6DOFIMU15_T_STAMP_EN 0x20
373 
379 #define C6DOFIMU15_T_STAMP_END_CNT 0x80
380 #define C6DOFIMU15_SLEP_CHN_IA 0x20
381 #define C6DOFIMU15_SRC_D6D_IA 0x10
382 #define C6DOFIMU15_SRC_WU_IA 0x02
383 #define C6DOFIMU15_SRC_FF_IA 0x01
384 
390 #define C6DOFIMU15_SLP_CHN_IA 0x40
391 #define C6DOFIMU15_INT_FF_IA 0x20
392 #define C6DOFIMU15_SLP_STAT 0x10
393 #define C6DOFIMU15_INT_WU_IA 0x08
394 #define C6DOFIMU15_X_WU 0x04
395 #define C6DOFIMU15_Y_WU 0x02
396 #define C6DOFIMU15_Z_WU 0x01
397 
403 #define C6DOFIMU15_DEN_DRDY 0x80
404 #define C6DOFIMU15_D6D_IA 0x40
405 #define C6DOFIMU15_Z_AXIS_HIGH 0x20
406 #define C6DOFIMU15_Z_AXIS_LOW 0x10
407 #define C6DOFIMU15_Y_AXIS_HIGH 0x08
408 #define C6DOFIMU15_Y_AXIS_LOW 0x04
409 #define C6DOFIMU15_X_AXIS_HIGH 0x02
410 #define C6DOFIMU15_X_AXIS_LOW 0x01
411 
417 #define C6DOFIMU15_TDA 0x04
418 #define C6DOFIMU15_GDA 0x02
419 #define C6DOFIMU15_XLDA 0x01
420 
426 #define C6DOFIMU15_INT_CLR_ON_READ 0x40
427 #define C6DOFIMU15_SLP_STAT_ON_INT 0x20
428 #define C6DOFIMU15_SLOPE_FDS 0x10
429 #define C6DOFIMU15_LIR 0x01
430 
436 #define C6DOFIMU15_INT_EN 0x80
437 #define C6DOFIMU15_STAIONARY_MODE 0x00
438 #define C6DOFIMU15_INA_ACL_12_5_GYR_N_CRG 0x20
439 #define C6DOFIMU15_INA_ACL_12_5_GYR_SLP 0x40
440 #define C6DOFIMU15_INA_ACL_12_5_GYR_P_DWN 0x60
441 
447 #define C6DOFIMU15_D4D_EN 0x80
448 #define C6DOFIMU15_SIXD_THS_80_DEG 0x00
449 #define C6DOFIMU15_SIXD_THS_70_DEG 0x20
450 #define C6DOFIMU15_SIXD_THS_60_DEG 0x40
451 #define C6DOFIMU15_SIXD_THS_50_DEG 0x60
452 
458 #define C6DOFIMU15_USR_OFF_ON_WU 0x40
459 
465 #define C6DOFIMU15_FF_DUR5 0x80
466 #define C6DOFIMU15_WAKE_THS_W 0x10
467 
473 #define C6DOFIMU15_FF_THS_500_MG 0x07
474 #define C6DOFIMU15_FF_THS_469_MG 0x06
475 #define C6DOFIMU15_FF_THS_406_MG 0x05
476 #define C6DOFIMU15_FF_THS_344_MG 0x04
477 #define C6DOFIMU15_FF_THS_312_MG 0x03
478 #define C6DOFIMU15_FF_THS_250_MG 0x02
479 #define C6DOFIMU15_FF_THS_219_MG 0x01
480 #define C6DOFIMU15_FF_THS_156_MG 0x00
481 
482 #define C6DOFIMU15_INT1_SLP_CHN 0x80
483 #define C6DOFIMU15_INT1_WU 0x20
484 #define C6DOFIMU15_INT1_FF 0x10
485 #define C6DOFIMU15_INT1_6D 0x04
486 
487 #define C6DOFIMU15_INT2_SLP_CHN 0x80
488 #define C6DOFIMU15_INT2_WU 0x20
489 #define C6DOFIMU15_INT2_FF 0x10
490 #define C6DOFIMU15_INT2_6D 0x04
491 #define C6DOFIMU15_INT2_T_STAMP 0x01
492 
498 #define C6DOFIMU15_TAG_SEN_GYRO 0x08
499 #define C6DOFIMU15_TAG_SEN_ACEL 0x10
500 #define C6DOFIMU15_TAG_SEN_TEMP 0x18
501 #define C6DOFIMU15_TAG_SEN_T_ST 0x20
502 #define C6DOFIMU15_TAG_SEN_CFG_CHN 0x28
503 
509 #define C6DOFIMU15_LA_FS_2_G 0.061
510 #define C6DOFIMU15_LA_FS_4_G 0.122
511 #define C6DOFIMU15_LA_FS_8_G 0.244
512 #define C6DOFIMU15_LA_FS_16_G 0.488
513 
519 #define C6DOFIMU15_G_FS_125_DPS 4.375
520 #define C6DOFIMU15_G_FS_250_DPS 8.75
521 #define C6DOFIMU15_G_FS_500_DPS 17.5
522 #define C6DOFIMU15_G_FS_1000_DPS 35.0
523 #define C6DOFIMU15_G_FS_2000_DPS 70.0
524 #define C6DOFIMU15_G_FS_4000_DPS 140.0
525 
531 #define C6DOFIMU15_ODR_COEF_FOR_ODR_12_5 512
532 #define C6DOFIMU15_ODR_COEF_FOR_ODR_26 256
533 #define C6DOFIMU15_ODR_COEF_FOR_ODR_52 12
534 #define C6DOFIMU15_ODR_COEF_FOR_ODR_104 64
535 #define C6DOFIMU15_ODR_COEF_FOR_ODR_208 32
536 #define C6DOFIMU15_ODR_COEF_FOR_ODR_416 16
537 #define C6DOFIMU15_ODR_COEF_FOR_ODR_833 8
538 #define C6DOFIMU15_ODR_COEF_FOR_ODR_1667 4
539 #define C6DOFIMU15_ODR_COEF_FOR_ODR_3333 2
540 #define C6DOFIMU15_ODR_COEF_FOR_ODR_6667 1
541 
547 #define C6DOFIMU15_PROP_DIS 0
548 #define C6DOFIMU15_PROP_EN 1
549 
555 #define C6DOFIMU15_RD_BIT_MASK 0x80
556 #define C6DOFIMU15_WR_BIT_MASK 0x7F
557  // End group macro
560 // --------------------------------------------------------------- PUBLIC TYPES
569 typedef uint8_t c6dofimu15_select_t;
570 
574 typedef void ( *c6dofimu15_master_io_t )( struct c6dofimu15_s*, uint8_t, uint8_t*, uint8_t );
575 
579 typedef struct c6dofimu15_s
580 {
581  // Output pins
582  digital_out_t cs;
583 
584  // Input pins
585 
586  digital_in_t int_pin;
587 
588  // Modules
589 
590  i2c_master_t i2c;
591  spi_master_t spi;
592 
593  // ctx variable
594 
595  uint8_t slave_address;
596  pin_name_t chip_select;
600 
601 } c6dofimu15_t;
602 
606 typedef struct
607 {
608  // Communication gpio pins
609 
610  pin_name_t scl;
611  pin_name_t sda;
612  pin_name_t miso;
613  pin_name_t mosi;
614  pin_name_t sck;
615  pin_name_t cs;
616 
617  // Additional gpio pins
618 
619  pin_name_t int_pin;
620 
621  // static variable
622 
623  uint32_t i2c_speed;
624  uint8_t i2c_address;
625 
626  uint32_t spi_speed;
627  spi_master_mode_t spi_mode;
628  spi_master_chip_select_polarity_t cs_polarity;
629 
631 
633  // End types group
635 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
641 #ifdef __cplusplus
642 extern "C"{
643 #endif
644 
654 
663 
672 
683 void c6dofimu15_generic_write ( c6dofimu15_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
684 
695 void c6dofimu15_generic_read ( c6dofimu15_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
696 
708 uint8_t c6dofimu15_check_int_pin ( c6dofimu15_t *ctx );
709 
719 int16_t c6dofimu15_read_gyro_x ( c6dofimu15_t *ctx );
720 
730 int16_t c6dofimu15_read_gyro_y ( c6dofimu15_t *ctx );
731 
741 int16_t c6dofimu15_read_gyro_z ( c6dofimu15_t *ctx );
742 
753 void c6dofimu15_read_gyroscope ( c6dofimu15_t *ctx, int16_t *gyro_x
754  , int16_t *gyro_y
755  , int16_t *gyro_z );
756 
768 void c6dofimu15_angular_rate ( c6dofimu15_t *ctx, float *x_ang_rte
769  , float *y_ang_rte
770  , float *z_ang_rte );
771 
781 int16_t c6dofimu15_read_accel_x ( c6dofimu15_t *ctx );
782 
792 int16_t c6dofimu15_read_accel_y ( c6dofimu15_t *ctx );
793 
803 int16_t c6dofimu15_read_accel_z ( c6dofimu15_t *ctx );
804 
815 void c6dofimu15_read_accelerometer ( c6dofimu15_t *ctx, int16_t *accel_x
816  , int16_t *accel_y
817  , int16_t *accel_z );
818 
830 void c6dofimu15_acceleration_rate ( c6dofimu15_t *ctx, float *x_acel_rte
831  , float *y_acel_rte
832  , float *z_acel_rte );
833 
844 
853 void c6dofimu15_i2c_disable ( c6dofimu15_t *ctx, uint8_t com_sel );
854 
863 void c6dofimu15_device_conf_set ( c6dofimu15_t *ctx, uint8_t dev_cfg );
864 
874 void c6dofimu15_auto_inc_set ( c6dofimu15_t *ctx, uint8_t inc_set );
875 
884 void c6dofimu15_sw_rst ( c6dofimu15_t *ctx, uint8_t rst_en );
885 
894 void c6dofimu15_block_data_update_set ( c6dofimu15_t *ctx, uint8_t blk_set );
895 
904 void c6dofimu15_fifo_mode_set ( c6dofimu15_t *ctx, uint8_t fifo_set );
905 
914 void c6dofimu15_accel_data_rate ( c6dofimu15_t *ctx, uint8_t data_rate );
915 
924 void c6dofimu15_accel_full_scale ( c6dofimu15_t *ctx, uint8_t fs_sel );
925 
934 void c6dofimu15_gyro_data_rate ( c6dofimu15_t *ctx, uint8_t data_rate );
935 
944 void c6dofimu15_gyro_full_scale ( c6dofimu15_t *ctx, uint8_t fs_sel );
945 
955 uint8_t c6dofimu15_accel_data_rdy ( c6dofimu15_t *ctx );
956 
966 uint8_t c6dofimu15_gyro_data_rdy ( c6dofimu15_t *ctx );
967 
977 uint8_t c6dofimu15_temp_data_rdy ( c6dofimu15_t *ctx );
978 
989 uint8_t c6dofimu15_who_im_i ( c6dofimu15_t *ctx );
990 
991 #ifdef __cplusplus
992 }
993 #endif
994 #endif // _C6DOFIMU15_H_
995  // End public_function group
998 
999 // ------------------------------------------------------------------------- END
c6dofimu15_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu15.h:627
c6dofimu15_who_im_i
uint8_t c6dofimu15_who_im_i(c6dofimu15_t *ctx)
Who Am I function.
c6dofimu15_read_accel_z
int16_t c6dofimu15_read_accel_z(c6dofimu15_t *ctx)
Read Accelerometer Z-axis data function.
c6dofimu15_s::master_sel
c6dofimu15_select_t master_sel
Definition: c6dofimu15.h:599
c6dofimu15_cfg_t::cs
pin_name_t cs
Definition: c6dofimu15.h:615
c6dofimu15_cfg_t::sck
pin_name_t sck
Definition: c6dofimu15.h:614
c6dofimu15_temp_data_rdy
uint8_t c6dofimu15_temp_data_rdy(c6dofimu15_t *ctx)
Temperature new data available function.
c6dofimu15_s::chip_select
pin_name_t chip_select
Definition: c6dofimu15.h:596
c6dofimu15_init
C6DOFIMU15_RETVAL c6dofimu15_init(c6dofimu15_t *ctx, c6dofimu15_cfg_t *cfg)
Initialization function.
c6dofimu15_read_temp_out
float c6dofimu15_read_temp_out(c6dofimu15_t *ctx)
Read temperture function.
c6dofimu15_cfg_t::sda
pin_name_t sda
Definition: c6dofimu15.h:611
c6dofimu15_read_gyro_x
int16_t c6dofimu15_read_gyro_x(c6dofimu15_t *ctx)
Read Gyroscope X-axis data function.
c6dofimu15_cfg_t::scl
pin_name_t scl
Definition: c6dofimu15.h:610
c6dofimu15_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu15.h:613
c6dofimu15_auto_inc_set
void c6dofimu15_auto_inc_set(c6dofimu15_t *ctx, uint8_t inc_set)
Enable register address incrementation function.
c6dofimu15_check_int_pin
uint8_t c6dofimu15_check_int_pin(c6dofimu15_t *ctx)
Check Interrupt state function.
c6dofimu15_s
Click ctx object definition.
Definition: c6dofimu15.h:579
c6dofimu15_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu15.h:623
c6dofimu15_accel_full_scale
void c6dofimu15_accel_full_scale(c6dofimu15_t *ctx, uint8_t fs_sel)
Accelerometer full-scale selection function.
c6dofimu15_block_data_update_set
void c6dofimu15_block_data_update_set(c6dofimu15_t *ctx, uint8_t blk_set)
Block Data Update function.
c6dofimu15_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu15.h:624
c6dofimu15_cfg_t
Click configuration structure definition.
Definition: c6dofimu15.h:606
c6dofimu15_accel_data_rate
void c6dofimu15_accel_data_rate(c6dofimu15_t *ctx, uint8_t data_rate)
Accelerometer data rate selection function.
c6dofimu15_s::i2c
i2c_master_t i2c
Definition: c6dofimu15.h:590
c6dofimu15_cfg_t::sel
c6dofimu15_select_t sel
Definition: c6dofimu15.h:630
c6dofimu15_read_accelerometer
void c6dofimu15_read_accelerometer(c6dofimu15_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z)
Read accelerometer data function.
c6dofimu15_generic_read
void c6dofimu15_generic_read(c6dofimu15_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
c6dofimu15_acceleration_rate
void c6dofimu15_acceleration_rate(c6dofimu15_t *ctx, float *x_acel_rte, float *y_acel_rte, float *z_acel_rte)
Read Acceleration Rate function.
c6dofimu15_cfg_setup
void c6dofimu15_cfg_setup(c6dofimu15_cfg_t *cfg)
Config Object Initialization function.
C6DOFIMU15_RETVAL
#define C6DOFIMU15_RETVAL
Definition: c6dofimu15.h:76
c6dofimu15_s::int_pin
digital_in_t int_pin
Definition: c6dofimu15.h:586
c6dofimu15_s::spi
spi_master_t spi
Definition: c6dofimu15.h:591
c6dofimu15_gyro_data_rdy
uint8_t c6dofimu15_gyro_data_rdy(c6dofimu15_t *ctx)
Gyroscope new data available function.
c6dofimu15_default_cfg
void c6dofimu15_default_cfg(c6dofimu15_t *ctx)
Click Default Configuration function.
c6dofimu15_i2c_disable
void c6dofimu15_i2c_disable(c6dofimu15_t *ctx, uint8_t com_sel)
Disable I2C block function.
c6dofimu15_accel_data_rdy
uint8_t c6dofimu15_accel_data_rdy(c6dofimu15_t *ctx)
Accelerometer new data available function.
c6dofimu15_s::cs
digital_out_t cs
Definition: c6dofimu15.h:582
c6dofimu15_angular_rate
void c6dofimu15_angular_rate(c6dofimu15_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte)
Read Angular Rate function.
c6dofimu15_cfg_t::int_pin
pin_name_t int_pin
Definition: c6dofimu15.h:619
c6dofimu15_read_accel_x
int16_t c6dofimu15_read_accel_x(c6dofimu15_t *ctx)
Read Accelerometer X-axis data function.
c6dofimu15_gyro_full_scale
void c6dofimu15_gyro_full_scale(c6dofimu15_t *ctx, uint8_t fs_sel)
Gyroscope full-scale selection function.
c6dofimu15_s::read_f
c6dofimu15_master_io_t read_f
Definition: c6dofimu15.h:598
c6dofimu15_device_conf_set
void c6dofimu15_device_conf_set(c6dofimu15_t *ctx, uint8_t dev_cfg)
Enable the proper device configuration function.
c6dofimu15_select_t
uint8_t c6dofimu15_select_t
Communication type.
Definition: c6dofimu15.h:569
c6dofimu15_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu15.h:628
c6dofimu15_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu15.h:626
c6dofimu15_cfg_t::miso
pin_name_t miso
Definition: c6dofimu15.h:612
c6dofimu15_read_accel_y
int16_t c6dofimu15_read_accel_y(c6dofimu15_t *ctx)
Read Accelerometer Y-axis data function.
c6dofimu15_read_gyro_z
int16_t c6dofimu15_read_gyro_z(c6dofimu15_t *ctx)
Read Gyroscope Z-axis data function.
c6dofimu15_sw_rst
void c6dofimu15_sw_rst(c6dofimu15_t *ctx, uint8_t rst_en)
Perform software reset function.
c6dofimu15_s::write_f
c6dofimu15_master_io_t write_f
Definition: c6dofimu15.h:597
c6dofimu15_fifo_mode_set
void c6dofimu15_fifo_mode_set(c6dofimu15_t *ctx, uint8_t fifo_set)
Set FIFO Mode function.
c6dofimu15_read_gyro_y
int16_t c6dofimu15_read_gyro_y(c6dofimu15_t *ctx)
Read Gyroscope Y-axis data function.
c6dofimu15_read_gyroscope
void c6dofimu15_read_gyroscope(c6dofimu15_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
Read gyroscope data function.
c6dofimu15_master_io_t
void(* c6dofimu15_master_io_t)(struct c6dofimu15_s *, uint8_t, uint8_t *, uint8_t)
Master Input/Output type.
Definition: c6dofimu15.h:574
c6dofimu15_gyro_data_rate
void c6dofimu15_gyro_data_rate(c6dofimu15_t *ctx, uint8_t data_rate)
Gyroscope data rate selection function.
c6dofimu15_generic_write
void c6dofimu15_generic_write(c6dofimu15_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
c6dofimu15_t
struct c6dofimu15_s c6dofimu15_t
Click ctx object definition.
c6dofimu15_s::slave_address
uint8_t slave_address
Definition: c6dofimu15.h:595