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 "mikrosdk_version.h"
39 
40 #ifdef __GNUC__
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
43 #else
44 #include "delays.h"
45 #endif
46 #endif
47 
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
50 #include "drv_i2c_master.h"
51 #include "drv_spi_master.h"
52 
53 // -------------------------------------------------------------- PUBLIC MACROS
64 #define C6DOFIMU8_MAP_MIKROBUS( cfg, mikrobus ) \
65  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
66  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
67  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71  cfg.it2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
72  cfg.it1 = MIKROBUS( mikrobus, MIKROBUS_INT );
73 
79 #define C6DOFIMU8_MASTER_I2C 0
80 #define C6DOFIMU8_MASTER_SPI 1
81 
87 #define C6DOFIMU8_RETVAL uint8_t
88 
89 #define C6DOFIMU8_OK 0x00
90 #define C6DOFIMU8_INIT_ERROR 0xFF
91 
97 #define C6DOFIMU8_DEVICE_ADDR_LSB_LOW 0x6A
98 #define C6DOFIMU8_DEVICE_ADDR_LSB_HIGH 0x6B
99 
105 #define C6DOFIMU8_FUNC_CFG_ACCESS_REG 0x01
106 #define C6DOFIMU8_SENS_SYNC_TIME_FRAME_REG 0x04
107 #define C6DOFIMU8_SENS_SYNC_RES_RATIO_REG 0x05
108 #define C6DOFIMU8_FIFO_CTRL1_REG 0x06
109 #define C6DOFIMU8_FIFO_CTRL2_REG 0x07
110 #define C6DOFIMU8_FIFO_CTRL3_REG 0x08
111 #define C6DOFIMU8_FIFO_CTRL4_REG 0x09
112 #define C6DOFIMU8_FIFO_CTRL5_REG 0x0A
113 #define C6DOFIMU8_DRDY_PULSE_CFG_REG 0x0B
114 #define C6DOFIMU8_INT1_CTRL_REG 0x0D
115 #define C6DOFIMU8_INT2_CTRL_REG 0x0E
116 #define C6DOFIMU8_WHO_AM_I_REG 0x0F
117 #define C6DOFIMU8_CTRL1_XL_REG 0x10
118 #define C6DOFIMU8_CTRL2_G_REG 0x11
119 #define C6DOFIMU8_CTRL3_C_REG 0x12
120 #define C6DOFIMU8_CTRL4_C_REG 0x13
121 #define C6DOFIMU8_CTRL5_C_REG 0x14
122 #define C6DOFIMU8_CTRL6_C_REG 0x15
123 #define C6DOFIMU8_CTRL7_G_REG 0x16
124 #define C6DOFIMU8_CTRL8_XL_REG 0x17
125 #define C6DOFIMU8_CTRL9_XL_REG 0x18
126 #define C6DOFIMU8_CTRL10_C_REG 0x19
127 #define C6DOFIMU8_MASTER_CFG_REG 0x1A
128 #define C6DOFIMU8_WAKE_UP_SRC_REG 0x1B
129 #define C6DOFIMU8_TAP_SRC_REG 0x1C
130 #define C6DOFIMU8_D6D_SRC_REG 0x1D
131 #define C6DOFIMU8_STATUS_REG 0x1E
132 #define C6DOFIMU8_OUT_TEMP_REG 0x20
133 #define C6DOFIMU8_OUTX_G_REG 0x22
134 #define C6DOFIMU8_OUTY_G_REG 0x24
135 #define C6DOFIMU8_OUTZ_G_REG 0x26
136 #define C6DOFIMU8_OUTX_XL_REG 0x28
137 #define C6DOFIMU8_OUTY_XL_REG 0x2A
138 #define C6DOFIMU8_OUTZ_XL_REG 0x2C
139 #define C6DOFIMU8_SENS_HUB1_REG 0x2E
140 #define C6DOFIMU8_SENS_HUB2_REG 0x2F
141 #define C6DOFIMU8_SENS_HUB3_REG 0x30
142 #define C6DOFIMU8_SENS_HUB4_REG 0x31
143 #define C6DOFIMU8_SENS_HUB5_REG 0x32
144 #define C6DOFIMU8_SENS_HUB6_REG 0x33
145 #define C6DOFIMU8_SENS_HUB7_REG 0x34
146 #define C6DOFIMU8_SENS_HUB8_REG 0x35
147 #define C6DOFIMU8_SENS_HUB9_REG 0x36
148 #define C6DOFIMU8_SENS_HUB10_REG 0x37
149 #define C6DOFIMU8_SENS_HUB11_REG 0x38
150 #define C6DOFIMU8_SENS_HUB12_REG 0x39
151 #define C6DOFIMU8_FIFO_STATUS1_REG 0x3A
152 #define C6DOFIMU8_FIFO_STATUS2_REG 0x3B
153 #define C6DOFIMU8_FIFO_STATUS3_REG 0x3C
154 #define C6DOFIMU8_FIFO_STATUS4_REG 0x3D
155 #define C6DOFIMU8_FIFO_DATA_OUT_REG 0x3E
156 #define C6DOFIMU8_TIMESTAMP0_REG 0x40
157 #define C6DOFIMU8_TIMESTAMP1_REG 0x41
158 #define C6DOFIMU8_TIMESTAMP2_REG 0x42
159 #define C6DOFIMU8_SENS_HUB13_REG 0x4D
160 #define C6DOFIMU8_SENS_HUB14_REG 0x4E
161 #define C6DOFIMU8_SENS_HUB15_REG 0x4F
162 #define C6DOFIMU8_SENS_HUB16_REG 0x50
163 #define C6DOFIMU8_SENS_HUB17_REG 0x51
164 #define C6DOFIMU8_SENS_HUB18_REG 0x52
165 #define C6DOFIMU8_FUNC_SRC1_REG 0x53
166 #define C6DOFIMU8_FUNC_SRC2_REG 0x54
167 #define C6DOFIMU8_TAP_CFG_REG 0x58
168 #define C6DOFIMU8_TAP_THS_6D_REG 0x59
169 #define C6DOFIMU8_INT_DUR2_REG 0x5A
170 #define C6DOFIMU8_WAKE_UP_THS_REG 0x5B
171 #define C6DOFIMU8_WAKE_UP_DUR_REG 0x5C
172 #define C6DOFIMU8_FREE_FALL_REG 0x5D
173 #define C6DOFIMU8_MD1_CFG_REG 0x5E
174 #define C6DOFIMU8_MD2_CFG_REG 0x5F
175 #define C6DOFIMU8_MASTER_CMD_CODE_REG 0x60
176 #define C6DOFIMU8_SENS_SYNC_SPI_ERR_CODE_REG 0x61
177 #define C6DOFIMU8_OUT_MAG_RAW_X_REG 0x66
178 #define C6DOFIMU8_OUT_MAG_RAW_Y_REG 0x68
179 #define C6DOFIMU8_OUT_MAG_RAW_Z_REG 0x6A
180 #define C6DOFIMU8_INT_OIS_REG 0x6F
181 #define C6DOFIMU8_CTRL1_OIS_REG 0x70
182 #define C6DOFIMU8_CTRL2_OIS_REG 0x71
183 #define C6DOFIMU8_CTRL3_OIS_REG 0x72
184 #define C6DOFIMU8_X_OFS_USR_REG 0x73
185 #define C6DOFIMU8_Y_OFS_USR_REG 0x74
186 #define C6DOFIMU8_Z_OFS_USR_REG 0x75
187 
193 #define C6DOFIMU8_REG_ACCESS_EN 0x80
194 
200 #define C6DOFIMU8_DEC_FIFO_XL_SENS_NOT_IN_FIFO 0x00
201 #define C6DOFIMU8_DEC_FIFO_XL_NO_DEC 0x01
202 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR2 0x02
203 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR3 0x03
204 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR4 0x04
205 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR8 0x05
206 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR16 0x06
207 #define C6DOFIMU8_DEC_FIFO_XL_FACTOR32 0x07
208 #define C6DOFIMU8_DEC_FIFO_G_SENS_NOT_IN_FIFO 0x00
209 #define C6DOFIMU8_DEC_FIFO_G_NO_DEC 0x08
210 #define C6DOFIMU8_DEC_FIFO_G_FACTOR2 0x10
211 #define C6DOFIMU8_DEC_FIFO_G_FACTOR3 0x18
212 #define C6DOFIMU8_DEC_FIFO_G_FACTOR4 0x20
213 #define C6DOFIMU8_DEC_FIFO_G_FACTOR8 0x28
214 #define C6DOFIMU8_DEC_FIFO_G_FACTOR16 0x30
215 #define C6DOFIMU8_DEC_FIFO_G_FACTOR32 0x38
216 
222 #define C6DOFIMU8_FIFO_ODR_DIS 0x00
223 #define C6DOFIMU8_FIFO_ODR_12_5_HZ 0x08
224 #define C6DOFIMU8_FIFO_ODR_26_HZ 0x10
225 #define C6DOFIMU8_FIFO_ODR_52_HZ 0x18
226 #define C6DOFIMU8_FIFO_ODR_104_HZ 0x20
227 #define C6DOFIMU8_FIFO_ODR_208_HZ 0x28
228 #define C6DOFIMU8_FIFO_ODR_416_HZ 0x30
229 #define C6DOFIMU8_FIFO_ODR_833_HZ 0x38
230 #define C6DOFIMU8_FIFO_ODR_1660_HZ 0x40
231 #define C6DOFIMU8_FIFO_ODR_3330_HZ 0x48
232 #define C6DOFIMU8_FIFO_ODR_6660_HZ 0x50
233 #define C6DOFIMU8_FIFO_BYPASS1_MODE 0x00
234 #define C6DOFIMU8_FIFO_FIFO_MODE 0x01
235 #define C6DOFIMU8_FIFO_CONT1_MODE 0x03
236 #define C6DOFIMU8_FIFO_BYPASS2_MODE 0x04
237 #define C6DOFIMU8_FIFO_CONT2_MODE 0x06
238 
244 #define C6DOFIMU8_DRDY_LATCHED_MODE 0x00
245 #define C6DOFIMU8_DRDY_PULSED_MODE 0x80
246 
252 #define C6DOFIMU8_INT_PIN_FIFO_FULL_FLAG_EN 0x20
253 #define C6DOFIMU8_INT_PIN_FIFO_OVERRUN_FLAG_EN 0x10
254 #define C6DOFIMU8_INT_PIN_FIFO_THRESH_FLAG_EN 0x08
255 #define C6DOFIMU8_INT1_PIN_BOOT_STATUS_FLAG_EN 0x04
256 #define C6DOFIMU8_INT2_PIN_TEMP_DRDY_FLAG_EN 0x04
257 #define C6DOFIMU8_INT_PIN_G_DRDY_FLAG_EN 0x02
258 #define C6DOFIMU8_INT_PIN_XL_DRDY_FLAG_EN 0x01
259 
265 #define C6DOFIMU8_ODR_POWER_DOWN 0x00
266 #define C6DOFIMU8_ODR_1_6_HZ 0x0B
267 #define C6DOFIMU8_ODR_12_5_HZ 0x01
268 #define C6DOFIMU8_ODR_26_HZ 0x02
269 #define C6DOFIMU8_ODR_52_HZ 0x03
270 #define C6DOFIMU8_ODR_104_HZ 0x04
271 #define C6DOFIMU8_ODR_208_HZ 0x05
272 #define C6DOFIMU8_ODR_416_HZ 0x06
273 #define C6DOFIMU8_ODR_833_HZ 0x07
274 #define C6DOFIMU8_ODR_1660_HZ 0x08
275 #define C6DOFIMU8_ODR_3330_HZ 0x09
276 #define C6DOFIMU8_ODR_6660_HZ 0x0A
277 #define C6DOFIMU8_FS_XL_2G 0x00
278 #define C6DOFIMU8_FS_XL_16G 0x01
279 #define C6DOFIMU8_FS_XL_4G 0x02
280 #define C6DOFIMU8_FS_XL_8G 0x03
281 #define C6DOFIMU8_FS_G_250DPS 0x00
282 #define C6DOFIMU8_FS_G_500DPS 0x01
283 #define C6DOFIMU8_FS_G_1000DPS 0x02
284 #define C6DOFIMU8_FS_G_2000DPS 0x03
285 #define C6DOFIMU8_FS_G_125DPS 0x04
286 #define C6DOFIMU8_BW_XL_1500_HZ 0x00
287 #define C6DOFIMU8_BW_XL_400_HZ 0x01
288 
294 #define C6DOFIMU8_NORMAL_MODE 0x00
295 #define C6DOFIMU8_REBOOT_MEM_CONTENT 0x80
296 #define C6DOFIMU8_CONT_UPDATE 0x00
297 #define C6DOFIMU8_READ_UPDATE 0x40
298 #define C6DOFIMU8_INT_OUT_PADS_ACT_HIGH 0x00
299 #define C6DOFIMU8_INT_OUT_PADS_ACT_LOW 0x20
300 #define C6DOFIMU8_PADS_PUSH_PULL_MODE 0x00
301 #define C6DOFIMU8_PADS_OPEN_DRAIN_MODE 0x10
302 #define C6DOFIMU8_SPI_4_WIRE_INTER 0x00
303 #define C6DOFIMU8_SPI_3_WIRE_INTER 0x08
304 #define C6DOFIMU8_REG_ADDR_AUTO_INC_EN 0x04
305 #define C6DOFIMU8_DATA_LSB 0x00
306 #define C6DOFIMU8_DATA_MSB 0x02
307 #define C6DOFIMU8_SW_RESET_CMD 0x01
308 
314 #define C6DOFIMU8_DEN_XL_EN 0x80
315 #define C6DOFIMU8_G_SLEEP_MODE_EN 0x40
316 #define C6DOFIMU8_INT1_PAD_ONLY_EN 0x20
317 #define C6DOFIMU8_DEN_DRDY_INT1_EN 0x10
318 #define C6DOFIMU8_DA_TIMER_EN 0x08
319 #define C6DOFIMU8_I2C_INTER_DIS 0x04
320 #define C6DOFIMU8_LPF1_SEL_G_EN 0x02
321 
327 #define C6DOFIMU8_NO_ROUNDING 0x00
328 #define C6DOFIMU8_ROUND_XL_ONLY 0x20
329 #define C6DOFIMU8_ROUND_G_ONLY 0x40
330 #define C6DOFIMU8_ROUND_G_AND_XL 0x60
331 #define C6DOFIMU8_DEN_ACT_LOW 0x00
332 #define C6DOFIMU8_DEN_ACT_HIGH 0x10
333 #define C6DOFIMU8_ST_G_NORMAL_MODE 0x00
334 #define C6DOFIMU8_ST_G_POS_SIGN 0x04
335 #define C6DOFIMU8_ST_G_NEG_SIGN 0x0C
336 #define C6DOFIMU8_ST_XL_NORMAL_MODE 0x00
337 #define C6DOFIMU8_ST_XL_POS_SIGN 0x01
338 #define C6DOFIMU8_ST_XL_NEG_SIGN 0x02
339 
345 #define C6DOFIMU8_G_HP_OP_MODE_DIS 0x80
346 #define C6DOFIMU8_G_HPF_EN 0x40
347 #define C6DOFIMU8_G_HPF_16_MILLI_HZ 0x00
348 #define C6DOFIMU8_G_HPF_65_MILLI_HZ 0x10
349 #define C6DOFIMU8_G_HPF_260_MILLI_HZ 0x20
350 #define C6DOFIMU8_G_HPF_1040_MILLI_HZ 0x30
351 #define C6DOFIMU8_ROUNDING_EN 0x04
352 
358 #define C6DOFIMU8_DEN_X_LSB_STORED 0x80
359 #define C6DOFIMU8_DEN_Y_LSB_STORED 0x40
360 #define C6DOFIMU8_DEN_Z_LSB_STORED 0x20
361 #define C6DOFIMU8_DEN_G_STAMPED 0x00
362 #define C6DOFIMU8_DEN_XL_STAMPED 0x10
363 #define C6DOFIMU8_SOFT_IRON_CORR_ALGO_EN 0x04
364 
370 #define C6DOFIMU8_FREE_FALL_EVENT_MASK 0x20
371 #define C6DOFIMU8_SLEEP_EVENT_MASK 0x10
372 #define C6DOFIMU8_WAKE_UP_EVENT_MASK 0x08
373 #define C6DOFIMU8_X_WAKEUP_EVENT_MASK 0x04
374 #define C6DOFIMU8_Y_WAKEUP_EVENT_MASK 0x02
375 #define C6DOFIMU8_Z_WAKEUP_EVENT_MASK 0x01
376 
377 #define C6DOFIMU8_TAP_EVENT_MASK 0x40
378 #define C6DOFIMU8_SINGLE_TAP_EVENT_MASK 0x20
379 #define C6DOFIMU8_DOUBLE_TAP_EVENT_MASK 0x10
380 #define C6DOFIMU8_TAP_SIGN_EVENT_MASK 0x08
381 #define C6DOFIMU8_X_TAP_EVENT_MASK 0x04
382 #define C6DOFIMU8_Y_TAP_EVENT_MASK 0x02
383 #define C6DOFIMU8_Z_TAP_EVENT_MASK 0x01
384 
390 #define C6DOFIMU8_TEMP_DRDY_MASK 0x04
391 #define C6DOFIMU8_G_DRDY_MASK 0x02
392 #define C6DOFIMU8_XL_DRDY_MASK 0x01
393 
399 #define C6DOFIMU8_FIFO_WATERMARK_STATUS_MASK 0x80
400 #define C6DOFIMU8_FIFO_OVERRUN_STATUS_MASK 0x40
401 #define C6DOFIMU8_FIFO_FULL_SMART_STATUS_MASK 0x20
402 #define C6DOFIMU8_FIFO_EMPTY_STATUS_MASK 0x10
403 
409 #define C6DOFIMU8_BASIC_INTERR_EN 0x80
410 #define C6DOFIMU8_SLOPE_FILTER_APPLIED 0x00
411 #define C6DOFIMU8_HPF_APPLIED 0x10
412 #define C6DOFIMU8_TAP_X_EN 0x08
413 #define C6DOFIMU8_TAP_Y_EN 0x04
414 #define C6DOFIMU8_TAP_Z_EN 0x02
415 #define C6DOFIMU8_INTERR_REQ_LATCHED 0x01
416 
422 #define C6DOFIMU8_EVENT_NOT_DETECTED 0x00
423 #define C6DOFIMU8_EVENT_DETECTED 0x01
424 
430 #define C6DOFIMU8_INT_OCCURED 0x01
431 #define C6DOFIMU8_ADDR_ERROR 0x02
432 #define C6DOFIMU8_FULL_SCALE_ERROR 0x03
433 #define C6DOFIMU8_DATA_RATE_ERROR 0x04
434 
440 #define C6DOFIMU8_LOG_HIGH 0x01
441 #define C6DOFIMU8_LOG_LOW 0x00
442 
448 #define SPI_DRIVER 0
449 #define I2C_DRIVER 1
450 #define DUMMY_BYTE 0
451 #define SPI_RD_CMD 0x80
452 #define TEMP_LSB_RES 326.8
453 #define TEMP_OFFSET 25
454  // End group macro
457 // --------------------------------------------------------------- PUBLIC TYPES
466 typedef uint8_t c6dofimu8_select_t;
467 
471 typedef void ( *c6dofimu8_master_io_t )( struct c6dofimu8_s*, uint8_t, uint8_t*, uint8_t );
472 
473 typedef struct {
474 
475  double x;
476  double y;
477  double z;
478 
480 
484 typedef struct c6dofimu8_s
485 {
486  // Input pins
487 
488  digital_in_t it2;
489  digital_in_t it1;
490  digital_out_t cs;
491 
492  // Modules
493 
494  i2c_master_t i2c;
495  spi_master_t spi;
496 
497  // ctx variable
498 
499  uint8_t slave_address;
500  pin_name_t chip_select;
504 
505  uint8_t driver_sel;
506  uint8_t gyro_res;
507  uint8_t accel_res;
508 
510 
512 
516 typedef struct
517 {
518  // Communication gpio pins
519 
520  pin_name_t scl;
521  pin_name_t sda;
522  pin_name_t miso;
523  pin_name_t mosi;
524  pin_name_t sck;
525  pin_name_t cs;
526 
527  // Additional gpio pins
528 
529  pin_name_t it2;
530  pin_name_t it1;
531 
532  // static variable
533 
534  uint32_t i2c_speed;
535  uint8_t i2c_address;
536  uint32_t spi_speed;
537  spi_master_mode_t spi_mode;
538  spi_master_chip_select_polarity_t cs_polarity;
539 
541 
543  // End types group
545 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
551 #ifdef __cplusplus
552 extern "C"{
553 #endif
554 
564 
573 
582 
593 void c6dofimu8_generic_write ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
594 
605 void c6dofimu8_generic_read ( c6dofimu8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
606 
616 uint8_t c6dofimu8_write_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t data_in );
617 
627 uint8_t c6dofimu8_read_byte ( c6dofimu8_t *ctx, uint8_t reg_addr, uint8_t *data_out );
628 
638 uint8_t c6dofimu8_write_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t data_in );
639 
649 uint8_t c6dofimu8_read_word ( c6dofimu8_t *ctx, uint8_t reg_addr, uint16_t *data_out );
650 
661 uint8_t c6dofimu8_write_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes );
662 
673 uint8_t c6dofimu8_read_bytes ( c6dofimu8_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes );
674 
683 
692 
701 
710 uint8_t c6dofimu8_get_drdy_status ( c6dofimu8_t *ctx, uint8_t bit_mask );
711 
722 void c6dofimu8_get_data ( c6dofimu8_t *ctx, t_c6dofimu8_axis *accel_out, t_c6dofimu8_axis *gyro_out, int8_t *temp_out );
723 
733 uint8_t c6dofimu8_set_fsr ( c6dofimu8_t *ctx, uint8_t gyro_fsr, uint8_t accel_fsr );
734 
744 uint8_t c6dofimu8_set_odr ( c6dofimu8_t *ctx, uint8_t gyro_odr, uint8_t accel_odr );
745 
755 
756 #ifdef __cplusplus
757 }
758 #endif
759 #endif // _C6DOFIMU8_H_
760  // End public_function group
763 
764 // ------------------------------------------------------------------------- END
t_c6dofimu8_axis::x
double x
Definition: c6dofimu8.h:475
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:521
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:509
c6dofimu8_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu8.h:535
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:523
c6dofimu8_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu8.h:537
c6dofimu8_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu8.h:538
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:495
c6dofimu8_s::gyro_res
uint8_t gyro_res
Definition: c6dofimu8.h:506
c6dofimu8_cfg_t::cs
pin_name_t cs
Definition: c6dofimu8.h:525
c6dofimu8_default_cfg
void c6dofimu8_default_cfg(c6dofimu8_t *ctx)
Click Default Configuration function.
c6dofimu8_cfg_t
Click configuration structure definition.
Definition: c6dofimu8.h:517
c6dofimu8_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu8.h:534
c6dofimu8_s::chip_select
pin_name_t chip_select
Definition: c6dofimu8.h:500
c6dofimu8_select_t
uint8_t c6dofimu8_select_t
Communication type.
Definition: c6dofimu8.h:466
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:507
c6dofimu8_s::it1
digital_in_t it1
Definition: c6dofimu8.h:489
c6dofimu8_s::i2c
i2c_master_t i2c
Definition: c6dofimu8.h:494
c6dofimu8_s::slave_address
uint8_t slave_address
Definition: c6dofimu8.h:499
t_c6dofimu8_axis::z
double z
Definition: c6dofimu8.h:477
c6dofimu8_s::read_f
c6dofimu8_master_io_t read_f
Definition: c6dofimu8.h:502
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:476
c6dofimu8_s::cs
digital_out_t cs
Definition: c6dofimu8.h:490
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:522
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:471
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:503
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:540
c6dofimu8_cfg_t::it1
pin_name_t it1
Definition: c6dofimu8.h:530
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:87
c6dofimu8_cfg_t::scl
pin_name_t scl
Definition: c6dofimu8.h:520
c6dofimu8_s::write_f
c6dofimu8_master_io_t write_f
Definition: c6dofimu8.h:501
t_c6dofimu8_axis
Definition: c6dofimu8.h:473
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:505
c6dofimu8_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu8.h:536
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:529
c6dofimu8_s
Click ctx object definition.
Definition: c6dofimu8.h:485
c6dofimu8_cfg_t::sck
pin_name_t sck
Definition: c6dofimu8.h:524
c6dofimu8_s::it2
digital_in_t it2
Definition: c6dofimu8.h:488