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 
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 C6DOFIMU8_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.it2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
62  cfg.it1 = MIKROBUS( mikrobus, MIKROBUS_INT );
63 
69 #define C6DOFIMU8_MASTER_I2C 0
70 #define C6DOFIMU8_MASTER_SPI 1
71 
77 #define C6DOFIMU8_RETVAL uint8_t
78 
79 #define C6DOFIMU8_OK 0x00
80 #define C6DOFIMU8_INIT_ERROR 0xFF
81 
87 #define C6DOFIMU8_DEVICE_ADDR_LSB_LOW 0x6A
88 #define C6DOFIMU8_DEVICE_ADDR_LSB_HIGH 0x6B
89 
95 #define C6DOFIMU8_FUNC_CFG_ACCESS_REG 0x01
96 #define C6DOFIMU8_SENS_SYNC_TIME_FRAME_REG 0x04
97 #define C6DOFIMU8_SENS_SYNC_RES_RATIO_REG 0x05
98 #define C6DOFIMU8_FIFO_CTRL1_REG 0x06
99 #define C6DOFIMU8_FIFO_CTRL2_REG 0x07
100 #define C6DOFIMU8_FIFO_CTRL3_REG 0x08
101 #define C6DOFIMU8_FIFO_CTRL4_REG 0x09
102 #define C6DOFIMU8_FIFO_CTRL5_REG 0x0A
103 #define C6DOFIMU8_DRDY_PULSE_CFG_REG 0x0B
104 #define C6DOFIMU8_INT1_CTRL_REG 0x0D
105 #define C6DOFIMU8_INT2_CTRL_REG 0x0E
106 #define C6DOFIMU8_WHO_AM_I_REG 0x0F
107 #define C6DOFIMU8_CTRL1_XL_REG 0x10
108 #define C6DOFIMU8_CTRL2_G_REG 0x11
109 #define C6DOFIMU8_CTRL3_C_REG 0x12
110 #define C6DOFIMU8_CTRL4_C_REG 0x13
111 #define C6DOFIMU8_CTRL5_C_REG 0x14
112 #define C6DOFIMU8_CTRL6_C_REG 0x15
113 #define C6DOFIMU8_CTRL7_G_REG 0x16
114 #define C6DOFIMU8_CTRL8_XL_REG 0x17
115 #define C6DOFIMU8_CTRL9_XL_REG 0x18
116 #define C6DOFIMU8_CTRL10_C_REG 0x19
117 #define C6DOFIMU8_MASTER_CFG_REG 0x1A
118 #define C6DOFIMU8_WAKE_UP_SRC_REG 0x1B
119 #define C6DOFIMU8_TAP_SRC_REG 0x1C
120 #define C6DOFIMU8_D6D_SRC_REG 0x1D
121 #define C6DOFIMU8_STATUS_REG 0x1E
122 #define C6DOFIMU8_OUT_TEMP_REG 0x20
123 #define C6DOFIMU8_OUTX_G_REG 0x22
124 #define C6DOFIMU8_OUTY_G_REG 0x24
125 #define C6DOFIMU8_OUTZ_G_REG 0x26
126 #define C6DOFIMU8_OUTX_XL_REG 0x28
127 #define C6DOFIMU8_OUTY_XL_REG 0x2A
128 #define C6DOFIMU8_OUTZ_XL_REG 0x2C
129 #define C6DOFIMU8_SENS_HUB1_REG 0x2E
130 #define C6DOFIMU8_SENS_HUB2_REG 0x2F
131 #define C6DOFIMU8_SENS_HUB3_REG 0x30
132 #define C6DOFIMU8_SENS_HUB4_REG 0x31
133 #define C6DOFIMU8_SENS_HUB5_REG 0x32
134 #define C6DOFIMU8_SENS_HUB6_REG 0x33
135 #define C6DOFIMU8_SENS_HUB7_REG 0x34
136 #define C6DOFIMU8_SENS_HUB8_REG 0x35
137 #define C6DOFIMU8_SENS_HUB9_REG 0x36
138 #define C6DOFIMU8_SENS_HUB10_REG 0x37
139 #define C6DOFIMU8_SENS_HUB11_REG 0x38
140 #define C6DOFIMU8_SENS_HUB12_REG 0x39
141 #define C6DOFIMU8_FIFO_STATUS1_REG 0x3A
142 #define C6DOFIMU8_FIFO_STATUS2_REG 0x3B
143 #define C6DOFIMU8_FIFO_STATUS3_REG 0x3C
144 #define C6DOFIMU8_FIFO_STATUS4_REG 0x3D
145 #define C6DOFIMU8_FIFO_DATA_OUT_REG 0x3E
146 #define C6DOFIMU8_TIMESTAMP0_REG 0x40
147 #define C6DOFIMU8_TIMESTAMP1_REG 0x41
148 #define C6DOFIMU8_TIMESTAMP2_REG 0x42
149 #define C6DOFIMU8_SENS_HUB13_REG 0x4D
150 #define C6DOFIMU8_SENS_HUB14_REG 0x4E
151 #define C6DOFIMU8_SENS_HUB15_REG 0x4F
152 #define C6DOFIMU8_SENS_HUB16_REG 0x50
153 #define C6DOFIMU8_SENS_HUB17_REG 0x51
154 #define C6DOFIMU8_SENS_HUB18_REG 0x52
155 #define C6DOFIMU8_FUNC_SRC1_REG 0x53
156 #define C6DOFIMU8_FUNC_SRC2_REG 0x54
157 #define C6DOFIMU8_TAP_CFG_REG 0x58
158 #define C6DOFIMU8_TAP_THS_6D_REG 0x59
159 #define C6DOFIMU8_INT_DUR2_REG 0x5A
160 #define C6DOFIMU8_WAKE_UP_THS_REG 0x5B
161 #define C6DOFIMU8_WAKE_UP_DUR_REG 0x5C
162 #define C6DOFIMU8_FREE_FALL_REG 0x5D
163 #define C6DOFIMU8_MD1_CFG_REG 0x5E
164 #define C6DOFIMU8_MD2_CFG_REG 0x5F
165 #define C6DOFIMU8_MASTER_CMD_CODE_REG 0x60
166 #define C6DOFIMU8_SENS_SYNC_SPI_ERR_CODE_REG 0x61
167 #define C6DOFIMU8_OUT_MAG_RAW_X_REG 0x66
168 #define C6DOFIMU8_OUT_MAG_RAW_Y_REG 0x68
169 #define C6DOFIMU8_OUT_MAG_RAW_Z_REG 0x6A
170 #define C6DOFIMU8_INT_OIS_REG 0x6F
171 #define C6DOFIMU8_CTRL1_OIS_REG 0x70
172 #define C6DOFIMU8_CTRL2_OIS_REG 0x71
173 #define C6DOFIMU8_CTRL3_OIS_REG 0x72
174 #define C6DOFIMU8_X_OFS_USR_REG 0x73
175 #define C6DOFIMU8_Y_OFS_USR_REG 0x74
176 #define C6DOFIMU8_Z_OFS_USR_REG 0x75
177 
183 #define C6DOFIMU8_REG_ACCESS_EN 0x80
184 
190 #define C6DOFIMU8_DEC_FIFO_XL_SENS_NOT_IN_FIFO 0x00
191 #define C6DOFIMU8_DEC_FIFO_XL_NO_DEC 0x01
192 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR2 0x02
193 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR3 0x03
194 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR4 0x04
195 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR8 0x05
196 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR16 0x06
197 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR32 0x07
198 #define C6DOFIMU8_DEC_FIFO_G_SENS_NOT_IN_FIFO 0x00
199 #define C6DOFIMU8_DEC_FIFO_G_NO_DEC 0x08
200 #define C6DOFIMU8_DEC_FIFO_G_FACTOR2 0x10
201 #define C6DOFIMU8_DEC_FIFO_G_FACTOR3 0x18
202 #define C6DOFIMU8_DEC_FIFO_G_FACTOR4 0x20
203 #define C6DOFIMU8_DEC_FIFO_G_FACTOR8 0x28
204 #define C6DOFIMU8_DEC_FIFO_G_FACTOR16 0x30
205 #define C6DOFIMU8_DEC_FIFO_G_FACTOR32 0x38
206 
212 #define C6DOFIMU8_FIFO_ODR_DIS 0x00
213 #define C6DOFIMU8_FIFO_ODR_12_5_HZ 0x08
214 #define C6DOFIMU8_FIFO_ODR_26_HZ 0x10
215 #define C6DOFIMU8_FIFO_ODR_52_HZ 0x18
216 #define C6DOFIMU8_FIFO_ODR_104_HZ 0x20
217 #define C6DOFIMU8_FIFO_ODR_208_HZ 0x28
218 #define C6DOFIMU8_FIFO_ODR_416_HZ 0x30
219 #define C6DOFIMU8_FIFO_ODR_833_HZ 0x38
220 #define C6DOFIMU8_FIFO_ODR_1660_HZ 0x40
221 #define C6DOFIMU8_FIFO_ODR_3330_HZ 0x48
222 #define C6DOFIMU8_FIFO_ODR_6660_HZ 0x50
223 #define C6DOFIMU8_FIFO_BYPASS1_MODE 0x00
224 #define C6DOFIMU8_FIFO_FIFO_MODE 0x01
225 #define C6DOFIMU8_FIFO_CONT1_MODE 0x03
226 #define C6DOFIMU8_FIFO_BYPASS2_MODE 0x04
227 #define C6DOFIMU8_FIFO_CONT2_MODE 0x06
228 
234 #define C6DOFIMU8_DRDY_LATCHED_MODE 0x00
235 #define C6DOFIMU8_DRDY_PULSED_MODE 0x80
236 
242 #define C6DOFIMU8_INT_PIN_FIFO_FULL_FLAG_EN 0x20
243 #define C6DOFIMU8_INT_PIN_FIFO_OVERRUN_FLAG_EN 0x10
244 #define C6DOFIMU8_INT_PIN_FIFO_THRESH_FLAG_EN 0x08
245 #define C6DOFIMU8_INT1_PIN_BOOT_STATUS_FLAG_EN 0x04
246 #define C6DOFIMU8_INT2_PIN_TEMP_DRDY_FLAG_EN 0x04
247 #define C6DOFIMU8_INT_PIN_G_DRDY_FLAG_EN 0x02
248 #define C6DOFIMU8_INT_PIN_XL_DRDY_FLAG_EN 0x01
249 
255 #define C6DOFIMU8_ODR_POWER_DOWN 0x00
256 #define C6DOFIMU8_ODR_1_6_HZ 0x0B
257 #define C6DOFIMU8_ODR_12_5_HZ 0x01
258 #define C6DOFIMU8_ODR_26_HZ 0x02
259 #define C6DOFIMU8_ODR_52_HZ 0x03
260 #define C6DOFIMU8_ODR_104_HZ 0x04
261 #define C6DOFIMU8_ODR_208_HZ 0x05
262 #define C6DOFIMU8_ODR_416_HZ 0x06
263 #define C6DOFIMU8_ODR_833_HZ 0x07
264 #define C6DOFIMU8_ODR_1660_HZ 0x08
265 #define C6DOFIMU8_ODR_3330_HZ 0x09
266 #define C6DOFIMU8_ODR_6660_HZ 0x0A
267 #define C6DOFIMU8_FS_XL_2G 0x00
268 #define C6DOFIMU8_FS_XL_16G 0x01
269 #define C6DOFIMU8_FS_XL_4G 0x02
270 #define C6DOFIMU8_FS_XL_8G 0x03
271 #define C6DOFIMU8_FS_G_250DPS 0x00
272 #define C6DOFIMU8_FS_G_500DPS 0x01
273 #define C6DOFIMU8_FS_G_1000DPS 0x02
274 #define C6DOFIMU8_FS_G_2000DPS 0x03
275 #define C6DOFIMU8_FS_G_125DPS 0x04
276 #define C6DOFIMU8_BW_XL_1500_HZ 0x00
277 #define C6DOFIMU8_BW_XL_400_HZ 0x01
278 
284 #define C6DOFIMU8_NORMAL_MODE 0x00
285 #define C6DOFIMU8_REBOOT_MEM_CONTENT 0x80
286 #define C6DOFIMU8_CONT_UPDATE 0x00
287 #define C6DOFIMU8_READ_UPDATE 0x40
288 #define C6DOFIMU8_INT_OUT_PADS_ACT_HIGH 0x00
289 #define C6DOFIMU8_INT_OUT_PADS_ACT_LOW 0x20
290 #define C6DOFIMU8_PADS_PUSH_PULL_MODE 0x00
291 #define C6DOFIMU8_PADS_OPEN_DRAIN_MODE 0x10
292 #define C6DOFIMU8_SPI_4_WIRE_INTER 0x00
293 #define C6DOFIMU8_SPI_3_WIRE_INTER 0x08
294 #define C6DOFIMU8_REG_ADDR_AUTO_INC_EN 0x04
295 #define C6DOFIMU8_DATA_LSB 0x00
296 #define C6DOFIMU8_DATA_MSB 0x02
297 #define C6DOFIMU8_SW_RESET_CMD 0x01
298 
304 #define C6DOFIMU8_DEN_XL_EN 0x80
305 #define C6DOFIMU8_G_SLEEP_MODE_EN 0x40
306 #define C6DOFIMU8_INT1_PAD_ONLY_EN 0x20
307 #define C6DOFIMU8_DEN_DRDY_INT1_EN 0x10
308 #define C6DOFIMU8_DA_TIMER_EN 0x08
309 #define C6DOFIMU8_I2C_INTER_DIS 0x04
310 #define C6DOFIMU8_LPF1_SEL_G_EN 0x02
311 
317 #define C6DOFIMU8_NO_ROUNDING 0x00
318 #define C6DOFIMU8_ROUND_XL_ONLY 0x20
319 #define C6DOFIMU8_ROUND_G_ONLY 0x40
320 #define C6DOFIMU8_ROUND_G_AND_XL 0x60
321 #define C6DOFIMU8_DEN_ACT_LOW 0x00
322 #define C6DOFIMU8_DEN_ACT_HIGH 0x10
323 #define C6DOFIMU8_ST_G_NORMAL_MODE 0x00
324 #define C6DOFIMU8_ST_G_POS_SIGN 0x04
325 #define C6DOFIMU8_ST_G_NEG_SIGN 0x0C
326 #define C6DOFIMU8_ST_XL_NORMAL_MODE 0x00
327 #define C6DOFIMU8_ST_XL_POS_SIGN 0x01
328 #define C6DOFIMU8_ST_XL_NEG_SIGN 0x02
329 
335 #define C6DOFIMU8_G_HP_OP_MODE_DIS 0x80
336 #define C6DOFIMU8_G_HPF_EN 0x40
337 #define C6DOFIMU8_G_HPF_16_MILLI_HZ 0x00
338 #define C6DOFIMU8_G_HPF_65_MILLI_HZ 0x10
339 #define C6DOFIMU8_G_HPF_260_MILLI_HZ 0x20
340 #define C6DOFIMU8_G_HPF_1040_MILLI_HZ 0x30
341 #define C6DOFIMU8_ROUNDING_EN 0x04
342 
348 #define C6DOFIMU8_DEN_X_LSB_STORED 0x80
349 #define C6DOFIMU8_DEN_Y_LSB_STORED 0x40
350 #define C6DOFIMU8_DEN_Z_LSB_STORED 0x20
351 #define C6DOFIMU8_DEN_G_STAMPED 0x00
352 #define C6DOFIMU8_DEN_XL_STAMPED 0x10
353 #define C6DOFIMU8_SOFT_IRON_CORR_ALGO_EN 0x04
354 
360 #define C6DOFIMU8_FREE_FALL_EVENT_MASK 0x20
361 #define C6DOFIMU8_SLEEP_EVENT_MASK 0x10
362 #define C6DOFIMU8_WAKE_UP_EVENT_MASK 0x08
363 #define C6DOFIMU8_X_WAKEUP_EVENT_MASK 0x04
364 #define C6DOFIMU8_Y_WAKEUP_EVENT_MASK 0x02
365 #define C6DOFIMU8_Z_WAKEUP_EVENT_MASK 0x01
366 
367 #define C6DOFIMU8_TAP_EVENT_MASK 0x40
368 #define C6DOFIMU8_SINGLE_TAP_EVENT_MASK 0x20
369 #define C6DOFIMU8_DOUBLE_TAP_EVENT_MASK 0x10
370 #define C6DOFIMU8_TAP_SIGN_EVENT_MASK 0x08
371 #define C6DOFIMU8_X_TAP_EVENT_MASK 0x04
372 #define C6DOFIMU8_Y_TAP_EVENT_MASK 0x02
373 #define C6DOFIMU8_Z_TAP_EVENT_MASK 0x01
374 
380 #define C6DOFIMU8_TEMP_DRDY_MASK 0x04
381 #define C6DOFIMU8_G_DRDY_MASK 0x02
382 #define C6DOFIMU8_XL_DRDY_MASK 0x01
383 
389 #define C6DOFIMU8_FIFO_WATERMARK_STATUS_MASK 0x80
390 #define C6DOFIMU8_FIFO_OVERRUN_STATUS_MASK 0x40
391 #define C6DOFIMU8_FIFO_FULL_SMART_STATUS_MASK 0x20
392 #define C6DOFIMU8_FIFO_EMPTY_STATUS_MASK 0x10
393 
399 #define C6DOFIMU8_BASIC_INTERR_EN 0x80
400 #define C6DOFIMU8_SLOPE_FILTER_APPLIED 0x00
401 #define C6DOFIMU8_HPF_APPLIED 0x10
402 #define C6DOFIMU8_TAP_X_EN 0x08
403 #define C6DOFIMU8_TAP_Y_EN 0x04
404 #define C6DOFIMU8_TAP_Z_EN 0x02
405 #define C6DOFIMU8_INTERR_REQ_LATCHED 0x01
406 
412 #define C6DOFIMU8_EVENT_NOT_DETECTED 0x00
413 #define C6DOFIMU8_EVENT_DETECTED 0x01
414 
420 #define C6DOFIMU8_INT_OCCURED 0x01
421 #define C6DOFIMU8_ADDR_ERROR 0x02
422 #define C6DOFIMU8_FULL_SCALE_ERROR 0x03
423 #define C6DOFIMU8_DATA_RATE_ERROR 0x04
424 
430 #define C6DOFIMU8_LOG_HIGH 0x01
431 #define C6DOFIMU8_LOG_LOW 0x00
432 
438 #define SPI_DRIVER 0
439 #define I2C_DRIVER 1
440 #define DUMMY_BYTE 0
441 #define SPI_RD_CMD 0x80
442 #define TEMP_LSB_RES 326.8
443 #define TEMP_OFFSET 25
444  // End group macro
447 // --------------------------------------------------------------- PUBLIC TYPES
456 typedef uint8_t c6dofimu8_select_t;
457 
461 typedef void ( *c6dofimu8_master_io_t )( struct c6dofimu8_s*, uint8_t, uint8_t*, uint8_t );
462 
463 typedef struct {
464 
465  double x;
466  double y;
467  double z;
468 
470 
474 typedef struct c6dofimu8_s
475 {
476  // Input pins
477 
478  digital_in_t it2;
479  digital_in_t it1;
480  digital_out_t cs;
481 
482  // Modules
483 
484  i2c_master_t i2c;
485  spi_master_t spi;
486 
487  // ctx variable
488 
489  uint8_t slave_address;
490  pin_name_t chip_select;
494 
495  uint8_t driver_sel;
496  uint8_t gyro_res;
497  uint8_t accel_res;
498 
500 
501 } c6dofimu8_t;
502 
506 typedef struct
507 {
508  // Communication gpio pins
509 
510  pin_name_t scl;
511  pin_name_t sda;
512  pin_name_t miso;
513  pin_name_t mosi;
514  pin_name_t sck;
515  pin_name_t cs;
516 
517  // Additional gpio pins
518 
519  pin_name_t it2;
520  pin_name_t it1;
521 
522  // static variable
523 
524  uint32_t i2c_speed;
525  uint8_t i2c_address;
526  uint32_t spi_speed;
527  uint8_t spi_mode;
528  spi_master_chip_select_polarity_t cs_polarity;
529 
531 
533  // End types group
535 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
541 #ifdef __cplusplus
542 extern "C"{
543 #endif
544 
554 
563 
571 void c6dofimu8_default_cfg ( c6dofimu8_t *ctx );
572 
583 void c6dofimu8_generic_write ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
584 
595 void c6dofimu8_generic_read ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
596 
606 uint8_t c6dofimu8_write_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t data_in );
607 
617 uint8_t c6dofimu8_read_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t *data_out );
618 
628 uint8_t c6dofimu8_write_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t data_in );
629 
639 uint8_t c6dofimu8_read_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t *data_out );
640 
651 uint8_t c6dofimu8_write_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes );
652 
663 uint8_t c6dofimu8_read_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes );
664 
672 void c6dofimu8_reset ( c6dofimu8_t *ctx );
673 
681 uint8_t c6dofimu8_get_int_1_pin ( c6dofimu8_t *ctx );
682 
690 uint8_t c6dofimu8_get_int_2_pin ( c6dofimu8_t *ctx );
691 
700 uint8_t c6dofimu8_get_drdy_status ( c6dofimu8_t *ctx, uint8_t bit_mask );
701 
712 void c6dofimu8_get_data ( c6dofimu8_t *ctx, t_c6dofimu8_axis *accel_out, t_c6dofimu8_axis *gyro_out, int8_t *temp_out );
713 
723 uint8_t c6dofimu8_set_fsr ( c6dofimu8_t *ctx, uint8_t gyro_fsr, uint8_t accel_fsr );
724 
734 uint8_t c6dofimu8_set_odr ( c6dofimu8_t *ctx, uint8_t gyro_odr, uint8_t accel_odr );
735 
745 
746 #ifdef __cplusplus
747 }
748 #endif
749 #endif // _C6DOFIMU8_H_
750  // End public_function group
753 
754 // ------------------------------------------------------------------------- END
t_c6dofimu8_axis::x
double x
Definition: c6dofimu8.h:465
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:511
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:499
c6dofimu8_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu8.h:525
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:513
c6dofimu8_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu8.h:528
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:485
c6dofimu8_s::gyro_res
uint8_t gyro_res
Definition: c6dofimu8.h:496
c6dofimu8_cfg_t::cs
pin_name_t cs
Definition: c6dofimu8.h:515
c6dofimu8_default_cfg
void c6dofimu8_default_cfg(c6dofimu8_t *ctx)
Click Default Configuration function.
c6dofimu8_cfg_t
Click configuration structure definition.
Definition: c6dofimu8.h:506
c6dofimu8_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu8.h:524
c6dofimu8_cfg_t::spi_mode
uint8_t spi_mode
Definition: c6dofimu8.h:527
c6dofimu8_s::chip_select
pin_name_t chip_select
Definition: c6dofimu8.h:490
c6dofimu8_select_t
uint8_t c6dofimu8_select_t
Communication type.
Definition: c6dofimu8.h:456
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:497
c6dofimu8_s::it1
digital_in_t it1
Definition: c6dofimu8.h:479
c6dofimu8_s::i2c
i2c_master_t i2c
Definition: c6dofimu8.h:484
c6dofimu8_s::slave_address
uint8_t slave_address
Definition: c6dofimu8.h:489
t_c6dofimu8_axis::z
double z
Definition: c6dofimu8.h:467
c6dofimu8_s::read_f
c6dofimu8_master_io_t read_f
Definition: c6dofimu8.h:492
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.
t_c6dofimu8_axis::y
double y
Definition: c6dofimu8.h:466
c6dofimu8_s::cs
digital_out_t cs
Definition: c6dofimu8.h:480
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:512
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:461
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:493
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:530
c6dofimu8_cfg_t::it1
pin_name_t it1
Definition: c6dofimu8.h:520
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:77
c6dofimu8_cfg_t::scl
pin_name_t scl
Definition: c6dofimu8.h:510
c6dofimu8_s::write_f
c6dofimu8_master_io_t write_f
Definition: c6dofimu8.h:491
t_c6dofimu8_axis
Definition: c6dofimu8.h:463
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:495
c6dofimu8_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu8.h:526
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:519
c6dofimu8_s
Click ctx object definition.
Definition: c6dofimu8.h:474
c6dofimu8_cfg_t::sck
pin_name_t sck
Definition: c6dofimu8.h:514
c6dofimu8_s::it2
digital_in_t it2
Definition: c6dofimu8.h:478
c6dofimu8_t
struct c6dofimu8_s c6dofimu8_t
Click ctx object definition.