c6dofimu8  2.0.0.0
c6dofimu8.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 C6DOFIMU8_H
36 #define C6DOFIMU8_H
37 
42 #ifdef PREINIT_SUPPORTED
43 #include "preinit.h"
44 #endif
45 
46 #ifdef MikroCCoreVersion
47  #if MikroCCoreVersion >= 1
48  #include "delays.h"
49  #endif
50 #endif
51 
52 #include "drv_digital_out.h"
53 #include "drv_digital_in.h"
54 #include "drv_i2c_master.h"
55 #include "drv_spi_master.h"
56 
57 // -------------------------------------------------------------- PUBLIC MACROS
68 #define C6DOFIMU8_MAP_MIKROBUS( cfg, mikrobus ) \
69  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
70  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
71  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
72  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
73  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
74  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
75  cfg.it2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
76  cfg.it1 = MIKROBUS( mikrobus, MIKROBUS_INT );
77 
83 #define C6DOFIMU8_MASTER_I2C 0
84 #define C6DOFIMU8_MASTER_SPI 1
85 
91 #define C6DOFIMU8_RETVAL uint8_t
92 
93 #define C6DOFIMU8_OK 0x00
94 #define C6DOFIMU8_INIT_ERROR 0xFF
95 
101 #define C6DOFIMU8_DEVICE_ADDR_LSB_LOW 0x6A
102 #define C6DOFIMU8_DEVICE_ADDR_LSB_HIGH 0x6B
103 
109 #define C6DOFIMU8_FUNC_CFG_ACCESS_REG 0x01
110 #define C6DOFIMU8_SENS_SYNC_TIME_FRAME_REG 0x04
111 #define C6DOFIMU8_SENS_SYNC_RES_RATIO_REG 0x05
112 #define C6DOFIMU8_FIFO_CTRL1_REG 0x06
113 #define C6DOFIMU8_FIFO_CTRL2_REG 0x07
114 #define C6DOFIMU8_FIFO_CTRL3_REG 0x08
115 #define C6DOFIMU8_FIFO_CTRL4_REG 0x09
116 #define C6DOFIMU8_FIFO_CTRL5_REG 0x0A
117 #define C6DOFIMU8_DRDY_PULSE_CFG_REG 0x0B
118 #define C6DOFIMU8_INT1_CTRL_REG 0x0D
119 #define C6DOFIMU8_INT2_CTRL_REG 0x0E
120 #define C6DOFIMU8_WHO_AM_I_REG 0x0F
121 #define C6DOFIMU8_CTRL1_XL_REG 0x10
122 #define C6DOFIMU8_CTRL2_G_REG 0x11
123 #define C6DOFIMU8_CTRL3_C_REG 0x12
124 #define C6DOFIMU8_CTRL4_C_REG 0x13
125 #define C6DOFIMU8_CTRL5_C_REG 0x14
126 #define C6DOFIMU8_CTRL6_C_REG 0x15
127 #define C6DOFIMU8_CTRL7_G_REG 0x16
128 #define C6DOFIMU8_CTRL8_XL_REG 0x17
129 #define C6DOFIMU8_CTRL9_XL_REG 0x18
130 #define C6DOFIMU8_CTRL10_C_REG 0x19
131 #define C6DOFIMU8_MASTER_CFG_REG 0x1A
132 #define C6DOFIMU8_WAKE_UP_SRC_REG 0x1B
133 #define C6DOFIMU8_TAP_SRC_REG 0x1C
134 #define C6DOFIMU8_D6D_SRC_REG 0x1D
135 #define C6DOFIMU8_STATUS_REG 0x1E
136 #define C6DOFIMU8_OUT_TEMP_REG 0x20
137 #define C6DOFIMU8_OUTX_G_REG 0x22
138 #define C6DOFIMU8_OUTY_G_REG 0x24
139 #define C6DOFIMU8_OUTZ_G_REG 0x26
140 #define C6DOFIMU8_OUTX_XL_REG 0x28
141 #define C6DOFIMU8_OUTY_XL_REG 0x2A
142 #define C6DOFIMU8_OUTZ_XL_REG 0x2C
143 #define C6DOFIMU8_SENS_HUB1_REG 0x2E
144 #define C6DOFIMU8_SENS_HUB2_REG 0x2F
145 #define C6DOFIMU8_SENS_HUB3_REG 0x30
146 #define C6DOFIMU8_SENS_HUB4_REG 0x31
147 #define C6DOFIMU8_SENS_HUB5_REG 0x32
148 #define C6DOFIMU8_SENS_HUB6_REG 0x33
149 #define C6DOFIMU8_SENS_HUB7_REG 0x34
150 #define C6DOFIMU8_SENS_HUB8_REG 0x35
151 #define C6DOFIMU8_SENS_HUB9_REG 0x36
152 #define C6DOFIMU8_SENS_HUB10_REG 0x37
153 #define C6DOFIMU8_SENS_HUB11_REG 0x38
154 #define C6DOFIMU8_SENS_HUB12_REG 0x39
155 #define C6DOFIMU8_FIFO_STATUS1_REG 0x3A
156 #define C6DOFIMU8_FIFO_STATUS2_REG 0x3B
157 #define C6DOFIMU8_FIFO_STATUS3_REG 0x3C
158 #define C6DOFIMU8_FIFO_STATUS4_REG 0x3D
159 #define C6DOFIMU8_FIFO_DATA_OUT_REG 0x3E
160 #define C6DOFIMU8_TIMESTAMP0_REG 0x40
161 #define C6DOFIMU8_TIMESTAMP1_REG 0x41
162 #define C6DOFIMU8_TIMESTAMP2_REG 0x42
163 #define C6DOFIMU8_SENS_HUB13_REG 0x4D
164 #define C6DOFIMU8_SENS_HUB14_REG 0x4E
165 #define C6DOFIMU8_SENS_HUB15_REG 0x4F
166 #define C6DOFIMU8_SENS_HUB16_REG 0x50
167 #define C6DOFIMU8_SENS_HUB17_REG 0x51
168 #define C6DOFIMU8_SENS_HUB18_REG 0x52
169 #define C6DOFIMU8_FUNC_SRC1_REG 0x53
170 #define C6DOFIMU8_FUNC_SRC2_REG 0x54
171 #define C6DOFIMU8_TAP_CFG_REG 0x58
172 #define C6DOFIMU8_TAP_THS_6D_REG 0x59
173 #define C6DOFIMU8_INT_DUR2_REG 0x5A
174 #define C6DOFIMU8_WAKE_UP_THS_REG 0x5B
175 #define C6DOFIMU8_WAKE_UP_DUR_REG 0x5C
176 #define C6DOFIMU8_FREE_FALL_REG 0x5D
177 #define C6DOFIMU8_MD1_CFG_REG 0x5E
178 #define C6DOFIMU8_MD2_CFG_REG 0x5F
179 #define C6DOFIMU8_MASTER_CMD_CODE_REG 0x60
180 #define C6DOFIMU8_SENS_SYNC_SPI_ERR_CODE_REG 0x61
181 #define C6DOFIMU8_OUT_MAG_RAW_X_REG 0x66
182 #define C6DOFIMU8_OUT_MAG_RAW_Y_REG 0x68
183 #define C6DOFIMU8_OUT_MAG_RAW_Z_REG 0x6A
184 #define C6DOFIMU8_INT_OIS_REG 0x6F
185 #define C6DOFIMU8_CTRL1_OIS_REG 0x70
186 #define C6DOFIMU8_CTRL2_OIS_REG 0x71
187 #define C6DOFIMU8_CTRL3_OIS_REG 0x72
188 #define C6DOFIMU8_X_OFS_USR_REG 0x73
189 #define C6DOFIMU8_Y_OFS_USR_REG 0x74
190 #define C6DOFIMU8_Z_OFS_USR_REG 0x75
191 
197 #define C6DOFIMU8_REG_ACCESS_EN 0x80
198 
204 #define C6DOFIMU8_DEC_FIFO_XL_SENS_NOT_IN_FIFO 0x00
205 #define C6DOFIMU8_DEC_FIFO_XL_NO_DEC 0x01
206 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR2 0x02
207 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR3 0x03
208 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR4 0x04
209 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR8 0x05
210 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR16 0x06
211 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR32 0x07
212 #define C6DOFIMU8_DEC_FIFO_G_SENS_NOT_IN_FIFO 0x00
213 #define C6DOFIMU8_DEC_FIFO_G_NO_DEC 0x08
214 #define C6DOFIMU8_DEC_FIFO_G_FACTOR2 0x10
215 #define C6DOFIMU8_DEC_FIFO_G_FACTOR3 0x18
216 #define C6DOFIMU8_DEC_FIFO_G_FACTOR4 0x20
217 #define C6DOFIMU8_DEC_FIFO_G_FACTOR8 0x28
218 #define C6DOFIMU8_DEC_FIFO_G_FACTOR16 0x30
219 #define C6DOFIMU8_DEC_FIFO_G_FACTOR32 0x38
220 
226 #define C6DOFIMU8_FIFO_ODR_DIS 0x00
227 #define C6DOFIMU8_FIFO_ODR_12_5_HZ 0x08
228 #define C6DOFIMU8_FIFO_ODR_26_HZ 0x10
229 #define C6DOFIMU8_FIFO_ODR_52_HZ 0x18
230 #define C6DOFIMU8_FIFO_ODR_104_HZ 0x20
231 #define C6DOFIMU8_FIFO_ODR_208_HZ 0x28
232 #define C6DOFIMU8_FIFO_ODR_416_HZ 0x30
233 #define C6DOFIMU8_FIFO_ODR_833_HZ 0x38
234 #define C6DOFIMU8_FIFO_ODR_1660_HZ 0x40
235 #define C6DOFIMU8_FIFO_ODR_3330_HZ 0x48
236 #define C6DOFIMU8_FIFO_ODR_6660_HZ 0x50
237 #define C6DOFIMU8_FIFO_BYPASS1_MODE 0x00
238 #define C6DOFIMU8_FIFO_FIFO_MODE 0x01
239 #define C6DOFIMU8_FIFO_CONT1_MODE 0x03
240 #define C6DOFIMU8_FIFO_BYPASS2_MODE 0x04
241 #define C6DOFIMU8_FIFO_CONT2_MODE 0x06
242 
248 #define C6DOFIMU8_DRDY_LATCHED_MODE 0x00
249 #define C6DOFIMU8_DRDY_PULSED_MODE 0x80
250 
256 #define C6DOFIMU8_INT_PIN_FIFO_FULL_FLAG_EN 0x20
257 #define C6DOFIMU8_INT_PIN_FIFO_OVERRUN_FLAG_EN 0x10
258 #define C6DOFIMU8_INT_PIN_FIFO_THRESH_FLAG_EN 0x08
259 #define C6DOFIMU8_INT1_PIN_BOOT_STATUS_FLAG_EN 0x04
260 #define C6DOFIMU8_INT2_PIN_TEMP_DRDY_FLAG_EN 0x04
261 #define C6DOFIMU8_INT_PIN_G_DRDY_FLAG_EN 0x02
262 #define C6DOFIMU8_INT_PIN_XL_DRDY_FLAG_EN 0x01
263 
269 #define C6DOFIMU8_ODR_POWER_DOWN 0x00
270 #define C6DOFIMU8_ODR_1_6_HZ 0x0B
271 #define C6DOFIMU8_ODR_12_5_HZ 0x01
272 #define C6DOFIMU8_ODR_26_HZ 0x02
273 #define C6DOFIMU8_ODR_52_HZ 0x03
274 #define C6DOFIMU8_ODR_104_HZ 0x04
275 #define C6DOFIMU8_ODR_208_HZ 0x05
276 #define C6DOFIMU8_ODR_416_HZ 0x06
277 #define C6DOFIMU8_ODR_833_HZ 0x07
278 #define C6DOFIMU8_ODR_1660_HZ 0x08
279 #define C6DOFIMU8_ODR_3330_HZ 0x09
280 #define C6DOFIMU8_ODR_6660_HZ 0x0A
281 #define C6DOFIMU8_FS_XL_2G 0x00
282 #define C6DOFIMU8_FS_XL_16G 0x01
283 #define C6DOFIMU8_FS_XL_4G 0x02
284 #define C6DOFIMU8_FS_XL_8G 0x03
285 #define C6DOFIMU8_FS_G_250DPS 0x00
286 #define C6DOFIMU8_FS_G_500DPS 0x01
287 #define C6DOFIMU8_FS_G_1000DPS 0x02
288 #define C6DOFIMU8_FS_G_2000DPS 0x03
289 #define C6DOFIMU8_FS_G_125DPS 0x04
290 #define C6DOFIMU8_BW_XL_1500_HZ 0x00
291 #define C6DOFIMU8_BW_XL_400_HZ 0x01
292 
298 #define C6DOFIMU8_NORMAL_MODE 0x00
299 #define C6DOFIMU8_REBOOT_MEM_CONTENT 0x80
300 #define C6DOFIMU8_CONT_UPDATE 0x00
301 #define C6DOFIMU8_READ_UPDATE 0x40
302 #define C6DOFIMU8_INT_OUT_PADS_ACT_HIGH 0x00
303 #define C6DOFIMU8_INT_OUT_PADS_ACT_LOW 0x20
304 #define C6DOFIMU8_PADS_PUSH_PULL_MODE 0x00
305 #define C6DOFIMU8_PADS_OPEN_DRAIN_MODE 0x10
306 #define C6DOFIMU8_SPI_4_WIRE_INTER 0x00
307 #define C6DOFIMU8_SPI_3_WIRE_INTER 0x08
308 #define C6DOFIMU8_REG_ADDR_AUTO_INC_EN 0x04
309 #define C6DOFIMU8_DATA_LSB 0x00
310 #define C6DOFIMU8_DATA_MSB 0x02
311 #define C6DOFIMU8_SW_RESET_CMD 0x01
312 
318 #define C6DOFIMU8_DEN_XL_EN 0x80
319 #define C6DOFIMU8_G_SLEEP_MODE_EN 0x40
320 #define C6DOFIMU8_INT1_PAD_ONLY_EN 0x20
321 #define C6DOFIMU8_DEN_DRDY_INT1_EN 0x10
322 #define C6DOFIMU8_DA_TIMER_EN 0x08
323 #define C6DOFIMU8_I2C_INTER_DIS 0x04
324 #define C6DOFIMU8_LPF1_SEL_G_EN 0x02
325 
331 #define C6DOFIMU8_NO_ROUNDING 0x00
332 #define C6DOFIMU8_ROUND_XL_ONLY 0x20
333 #define C6DOFIMU8_ROUND_G_ONLY 0x40
334 #define C6DOFIMU8_ROUND_G_AND_XL 0x60
335 #define C6DOFIMU8_DEN_ACT_LOW 0x00
336 #define C6DOFIMU8_DEN_ACT_HIGH 0x10
337 #define C6DOFIMU8_ST_G_NORMAL_MODE 0x00
338 #define C6DOFIMU8_ST_G_POS_SIGN 0x04
339 #define C6DOFIMU8_ST_G_NEG_SIGN 0x0C
340 #define C6DOFIMU8_ST_XL_NORMAL_MODE 0x00
341 #define C6DOFIMU8_ST_XL_POS_SIGN 0x01
342 #define C6DOFIMU8_ST_XL_NEG_SIGN 0x02
343 
349 #define C6DOFIMU8_G_HP_OP_MODE_DIS 0x80
350 #define C6DOFIMU8_G_HPF_EN 0x40
351 #define C6DOFIMU8_G_HPF_16_MILLI_HZ 0x00
352 #define C6DOFIMU8_G_HPF_65_MILLI_HZ 0x10
353 #define C6DOFIMU8_G_HPF_260_MILLI_HZ 0x20
354 #define C6DOFIMU8_G_HPF_1040_MILLI_HZ 0x30
355 #define C6DOFIMU8_ROUNDING_EN 0x04
356 
362 #define C6DOFIMU8_DEN_X_LSB_STORED 0x80
363 #define C6DOFIMU8_DEN_Y_LSB_STORED 0x40
364 #define C6DOFIMU8_DEN_Z_LSB_STORED 0x20
365 #define C6DOFIMU8_DEN_G_STAMPED 0x00
366 #define C6DOFIMU8_DEN_XL_STAMPED 0x10
367 #define C6DOFIMU8_SOFT_IRON_CORR_ALGO_EN 0x04
368 
374 #define C6DOFIMU8_FREE_FALL_EVENT_MASK 0x20
375 #define C6DOFIMU8_SLEEP_EVENT_MASK 0x10
376 #define C6DOFIMU8_WAKE_UP_EVENT_MASK 0x08
377 #define C6DOFIMU8_X_WAKEUP_EVENT_MASK 0x04
378 #define C6DOFIMU8_Y_WAKEUP_EVENT_MASK 0x02
379 #define C6DOFIMU8_Z_WAKEUP_EVENT_MASK 0x01
380 
381 #define C6DOFIMU8_TAP_EVENT_MASK 0x40
382 #define C6DOFIMU8_SINGLE_TAP_EVENT_MASK 0x20
383 #define C6DOFIMU8_DOUBLE_TAP_EVENT_MASK 0x10
384 #define C6DOFIMU8_TAP_SIGN_EVENT_MASK 0x08
385 #define C6DOFIMU8_X_TAP_EVENT_MASK 0x04
386 #define C6DOFIMU8_Y_TAP_EVENT_MASK 0x02
387 #define C6DOFIMU8_Z_TAP_EVENT_MASK 0x01
388 
394 #define C6DOFIMU8_TEMP_DRDY_MASK 0x04
395 #define C6DOFIMU8_G_DRDY_MASK 0x02
396 #define C6DOFIMU8_XL_DRDY_MASK 0x01
397 
403 #define C6DOFIMU8_FIFO_WATERMARK_STATUS_MASK 0x80
404 #define C6DOFIMU8_FIFO_OVERRUN_STATUS_MASK 0x40
405 #define C6DOFIMU8_FIFO_FULL_SMART_STATUS_MASK 0x20
406 #define C6DOFIMU8_FIFO_EMPTY_STATUS_MASK 0x10
407 
413 #define C6DOFIMU8_BASIC_INTERR_EN 0x80
414 #define C6DOFIMU8_SLOPE_FILTER_APPLIED 0x00
415 #define C6DOFIMU8_HPF_APPLIED 0x10
416 #define C6DOFIMU8_TAP_X_EN 0x08
417 #define C6DOFIMU8_TAP_Y_EN 0x04
418 #define C6DOFIMU8_TAP_Z_EN 0x02
419 #define C6DOFIMU8_INTERR_REQ_LATCHED 0x01
420 
426 #define C6DOFIMU8_EVENT_NOT_DETECTED 0x00
427 #define C6DOFIMU8_EVENT_DETECTED 0x01
428 
434 #define C6DOFIMU8_INT_OCCURED 0x01
435 #define C6DOFIMU8_ADDR_ERROR 0x02
436 #define C6DOFIMU8_FULL_SCALE_ERROR 0x03
437 #define C6DOFIMU8_DATA_RATE_ERROR 0x04
438 
444 #define C6DOFIMU8_LOG_HIGH 0x01
445 #define C6DOFIMU8_LOG_LOW 0x00
446 
452 #define SPI_DRIVER 0
453 #define I2C_DRIVER 1
454 #define DUMMY_BYTE 0
455 #define SPI_RD_CMD 0x80
456 #define TEMP_LSB_RES 326.8
457 #define TEMP_OFFSET 25
458  // End group macro
461 // --------------------------------------------------------------- PUBLIC TYPES
470 typedef uint8_t c6dofimu8_select_t;
471 
475 typedef void ( *c6dofimu8_master_io_t )( struct c6dofimu8_s*, uint8_t, uint8_t*, uint8_t );
476 
477 typedef struct {
478 
479  double x;
480  double y;
481  double z;
482 
484 
488 typedef struct c6dofimu8_s
489 {
490  // Input pins
491 
492  digital_in_t it2;
493  digital_in_t it1;
494  digital_out_t cs;
495 
496  // Modules
497 
498  i2c_master_t i2c;
499  spi_master_t spi;
500 
501  // ctx variable
502 
503  uint8_t slave_address;
504  pin_name_t chip_select;
508 
509  uint8_t driver_sel;
510  uint8_t gyro_res;
511  uint8_t accel_res;
512 
514 
516 
520 typedef struct
521 {
522  // Communication gpio pins
523 
524  pin_name_t scl;
525  pin_name_t sda;
526  pin_name_t miso;
527  pin_name_t mosi;
528  pin_name_t sck;
529  pin_name_t cs;
530 
531  // Additional gpio pins
532 
533  pin_name_t it2;
534  pin_name_t it1;
535 
536  // static variable
537 
538  uint32_t i2c_speed;
539  uint8_t i2c_address;
540  uint32_t spi_speed;
541  spi_master_mode_t spi_mode;
542  spi_master_chip_select_polarity_t cs_polarity;
543 
545 
547  // End types group
549 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
555 #ifdef __cplusplus
556 extern "C"{
557 #endif
558 
568 
577 
586 
597 void c6dofimu8_generic_write ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
598 
609 void c6dofimu8_generic_read ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
610 
620 uint8_t c6dofimu8_write_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t data_in );
621 
631 uint8_t c6dofimu8_read_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t *data_out );
632 
642 uint8_t c6dofimu8_write_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t data_in );
643 
653 uint8_t c6dofimu8_read_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t *data_out );
654 
665 uint8_t c6dofimu8_write_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes );
666 
677 uint8_t c6dofimu8_read_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes );
678 
687 
696 
705 
714 uint8_t c6dofimu8_get_drdy_status ( c6dofimu8_t *ctx, uint8_t bit_mask );
715 
726 void c6dofimu8_get_data ( c6dofimu8_t *ctx, t_c6dofimu8_axis *accel_out, t_c6dofimu8_axis *gyro_out, int8_t *temp_out );
727 
737 uint8_t c6dofimu8_set_fsr ( c6dofimu8_t *ctx, uint8_t gyro_fsr, uint8_t accel_fsr );
738 
748 uint8_t c6dofimu8_set_odr ( c6dofimu8_t *ctx, uint8_t gyro_odr, uint8_t accel_odr );
749 
759 
760 #ifdef __cplusplus
761 }
762 #endif
763 #endif // _C6DOFIMU8_H_
764  // End public_function group
767 
768 // ------------------------------------------------------------------------- END
t_c6dofimu8_axis::x
double x
Definition: c6dofimu8.h:479
c6dofimu8_generic_write
void c6dofimu8_generic_write(c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
c6dofimu8_cfg_t::sda
pin_name_t sda
Definition: c6dofimu8.h:525
c6dofimu8_write_byte
uint8_t c6dofimu8_write_byte(c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t data_in)
Single Byte Write functions.
c6dofimu8_init
C6DOFIMU8_RETVAL c6dofimu8_init(c6dofimu8_t *ctx, c6dofimu8_cfg_t *cfg)
Initialization function.
c6dofimu8_read_word
uint8_t c6dofimu8_read_word(c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t *data_out)
Word Read function.
c6dofimu8_s::dev_axis
t_c6dofimu8_axis dev_axis
Definition: c6dofimu8.h:513
c6dofimu8_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu8.h:539
c6dofimu8_get_data
void c6dofimu8_get_data(c6dofimu8_t *ctx, t_c6dofimu8_axis *accel_out, t_c6dofimu8_axis *gyro_out, int8_t *temp_out)
Data Get function.
c6dofimu8_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu8.h:527
c6dofimu8_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu8.h:541
c6dofimu8_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu8.h:542
c6dofimu8_set_odr
uint8_t c6dofimu8_set_odr(c6dofimu8_t *ctx, uint8_t gyro_odr, uint8_t accel_odr)
Data Rate Setting function.
c6dofimu8_s::spi
spi_master_t spi
Definition: c6dofimu8.h:499
c6dofimu8_s::gyro_res
uint8_t gyro_res
Definition: c6dofimu8.h:510
c6dofimu8_cfg_t::cs
pin_name_t cs
Definition: c6dofimu8.h:529
c6dofimu8_default_cfg
void c6dofimu8_default_cfg(c6dofimu8_t *ctx)
Click Default Configuration function.
c6dofimu8_cfg_t
Click configuration structure definition.
Definition: c6dofimu8.h:521
c6dofimu8_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu8.h:538
c6dofimu8_s::chip_select
pin_name_t chip_select
Definition: c6dofimu8.h:504
c6dofimu8_select_t
uint8_t c6dofimu8_select_t
Communication type.
Definition: c6dofimu8.h:470
c6dofimu8_set_fsr
uint8_t c6dofimu8_set_fsr(c6dofimu8_t *ctx, uint8_t gyro_fsr, uint8_t accel_fsr)
Full Scale Setting function.
c6dofimu8_s::accel_res
uint8_t accel_res
Definition: c6dofimu8.h:511
c6dofimu8_s::it1
digital_in_t it1
Definition: c6dofimu8.h:493
c6dofimu8_s::i2c
i2c_master_t i2c
Definition: c6dofimu8.h:498
c6dofimu8_s::slave_address
uint8_t slave_address
Definition: c6dofimu8.h:503
t_c6dofimu8_axis::z
double z
Definition: c6dofimu8.h:481
c6dofimu8_s::read_f
c6dofimu8_master_io_t read_f
Definition: c6dofimu8.h:506
c6dofimu8_get_drdy_status
uint8_t c6dofimu8_get_drdy_status(c6dofimu8_t *ctx, uint8_t bit_mask)
Status Check function.
c6dofimu8_generic_read
void c6dofimu8_generic_read(c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
c6dofimu8_t
struct c6dofimu8_s c6dofimu8_t
Click ctx object definition.
t_c6dofimu8_axis::y
double y
Definition: c6dofimu8.h:480
c6dofimu8_s::cs
digital_out_t cs
Definition: c6dofimu8.h:494
c6dofimu8_read_bytes
uint8_t c6dofimu8_read_bytes(c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
equential Read function.
c6dofimu8_cfg_t::miso
pin_name_t miso
Definition: c6dofimu8.h:526
c6dofimu8_master_io_t
void(* c6dofimu8_master_io_t)(struct c6dofimu8_s *, uint8_t, uint8_t *, uint8_t)
Master Input/Output type.
Definition: c6dofimu8.h:475
c6dofimu8_write_word
uint8_t c6dofimu8_write_word(c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t data_in)
Word Write function.
c6dofimu8_get_int_2_pin
uint8_t c6dofimu8_get_int_2_pin(c6dofimu8_t *ctx)
INT2 Pin Check function.
c6dofimu8_get_magnetometer_data
void c6dofimu8_get_magnetometer_data(c6dofimu8_t *ctx, t_c6dofimu8_axis *magneto_out)
Magnetometer Data Get function.
c6dofimu8_s::master_sel
c6dofimu8_select_t master_sel
Definition: c6dofimu8.h:507
c6dofimu8_cfg_setup
void c6dofimu8_cfg_setup(c6dofimu8_cfg_t *cfg)
Config Object Initialization function.
c6dofimu8_cfg_t::sel
c6dofimu8_select_t sel
Definition: c6dofimu8.h:544
c6dofimu8_cfg_t::it1
pin_name_t it1
Definition: c6dofimu8.h:534
c6dofimu8_get_int_1_pin
uint8_t c6dofimu8_get_int_1_pin(c6dofimu8_t *ctx)
INT1 Pin Check function.
C6DOFIMU8_RETVAL
#define C6DOFIMU8_RETVAL
Definition: c6dofimu8.h:91
c6dofimu8_cfg_t::scl
pin_name_t scl
Definition: c6dofimu8.h:524
c6dofimu8_s::write_f
c6dofimu8_master_io_t write_f
Definition: c6dofimu8.h:505
t_c6dofimu8_axis
Definition: c6dofimu8.h:477
c6dofimu8_write_bytes
uint8_t c6dofimu8_write_bytes(c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
Sequential Write function.
c6dofimu8_reset
void c6dofimu8_reset(c6dofimu8_t *ctx)
Device SW Reset function.
c6dofimu8_s::driver_sel
uint8_t driver_sel
Definition: c6dofimu8.h:509
c6dofimu8_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu8.h:540
c6dofimu8_read_byte
uint8_t c6dofimu8_read_byte(c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t *data_out)
Single Byte Read function.
c6dofimu8_cfg_t::it2
pin_name_t it2
Definition: c6dofimu8.h:533
c6dofimu8_s
Click ctx object definition.
Definition: c6dofimu8.h:489
c6dofimu8_cfg_t::sck
pin_name_t sck
Definition: c6dofimu8.h:528
c6dofimu8_s::it2
digital_in_t it2
Definition: c6dofimu8.h:492