c9dof3  2.0.0.0
c9dof3.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 C9DOF3_H
36 #define C9DOF3_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 C9DOF3_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.cs1 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
61  cfg.cs2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
62  cfg.cs3 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
63  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
64 
70 #define C9DOF3_MASTER_I2C 0
71 #define C9DOF3_MASTER_SPI 1
72 
78 #define C9DOF3_RETVAL uint8_t
79 
85 #define C9DOF3_ACC_I2C_SLAVE_ADDRESS 0x18
86 #define C9DOF3_GYRO_I2C_SLAVE_ADDRESS 0x68
87 #define C9DOF3_MAG_I2C_SLAVE_ADDRESS 0x10
88 
94 #define C9DOF3_ACC_DEVICE 0xFA
95 #define C9DOF3_GYRO_DEVICE 0x0F
96 #define C9DOF3_MAG_DEVICE 0x32
97 
103 #define C9DOF3_INITIATED_SOFT_RESET 0xB6
104 
110 #define C9DOF3_REG_ACC_WHO_AM_I 0x00
111 #define C9DOF3_REG_ACC_DATA_START 0x02
112 #define C9DOF3_REG_ACC_D_X_LSB 0x02
113 #define C9DOF3_REG_ACC_D_X_MSB 0x03
114 #define C9DOF3_REG_ACC_D_Y_LSB 0x04
115 #define C9DOF3_REG_ACC_D_Y_MSB 0x05
116 #define C9DOF3_REG_ACC_D_Z_LSB 0x06
117 #define C9DOF3_REG_ACC_D_Z_MSB 0x07
118 #define C9DOF3_REG_ACC_D_TEMP 0x08
119 #define C9DOF3_REG_ACC_INT_STATUS_0 0x09
120 #define C9DOF3_REG_ACC_INT_STATUS_1 0x0A
121 #define C9DOF3_REG_ACC_INT_STATUS_2 0x0B
122 #define C9DOF3_REG_ACC_INT_STATUS_3 0x0C
123 #define C9DOF3_REG_ACC_FIFO_STATUS 0x0E
124 #define C9DOF3_REG_ACC_PMU_RANGE 0x0F
125 #define C9DOF3_REG_ACC_PMU_BW 0x10
126 #define C9DOF3_REG_ACC_PMU_LPW 0x11
127 #define C9DOF3_REG_ACC_PMU_LOW_POWER 0x12
128 #define C9DOF3_REG_ACC_D_HBW 0x13
129 #define C9DOF3_REG_ACC_BGW_SOFTRESET 0x14
130 #define C9DOF3_REG_ACC_INT_EN_0 0x16
131 #define C9DOF3_REG_ACC_INT_EN_1 0x17
132 #define C9DOF3_REG_ACC_INT_EN_2 0x18
133 #define C9DOF3_REG_ACC_INT_MAP_0 0x19
134 #define C9DOF3_REG_ACC_INT_MAP_1 0x1A
135 #define C9DOF3_REG_ACC_INT_MAP_2 0x1B
136 #define C9DOF3_REG_ACC_INT_SRC 0x1E
137 #define C9DOF3_REG_ACC_INT_OUT_CTRL 0x20
138 #define C9DOF3_REG_ACC_INT_RST_LATCH 0x21
139 #define C9DOF3_REG_ACC_INT_0 0x22
140 #define C9DOF3_REG_ACC_INT_1 0x23
141 #define C9DOF3_REG_ACC_INT_2 0x24
142 #define C9DOF3_REG_ACC_INT_3 0x25
143 #define C9DOF3_REG_ACC_INT_4 0x26
144 #define C9DOF3_REG_ACC_INT_5 0x27
145 #define C9DOF3_REG_ACC_INT_6 0x28
146 #define C9DOF3_REG_ACC_INT_7 0x29
147 #define C9DOF3_REG_ACC_INT_8 0x2A
148 #define C9DOF3_REG_ACC_INT_9 0x2B
149 #define C9DOF3_REG_ACC_INT_A 0x2C
150 #define C9DOF3_REG_ACC_INT_B 0x2D
151 #define C9DOF3_REG_ACC_INT_C 0x2E
152 #define C9DOF3_REG_ACC_INT_D 0x2F
153 #define C9DOF3_REG_ACC_FIFO_CONFIG_0 0x30
154 #define C9DOF3_REG_ACC_PMU_SELF_TEST 0x32
155 #define C9DOF3_REG_ACC_TRIM_NVM_CTRL 0x33
156 #define C9DOF3_REG_ACC_BGW_SPI3_WDT 0x34
157 #define C9DOF3_REG_ACC_OFC_CTRL 0x36
158 #define C9DOF3_REG_ACC_OFC_SETTING 0x37
159 #define C9DOF3_REG_ACC_OFC_OFFSET_X 0x38
160 #define C9DOF3_REG_ACC_OFC_OFFSET_Y 0x39
161 #define C9DOF3_REG_ACC_OFC_OFFSET_Z 0x3A
162 #define C9DOF3_REG_ACC_TRIM_GPO 0x3B
163 #define C9DOF3_REG_ACC_TRIM_GP1 0x3C
164 #define C9DOF3_REG_ACC_FIFO_CONFIG_1 0x3E
165 #define C9DOF3_REG_ACC_FIFO_DATA 0x3F
166 
172 #define C9DOF3_REG_GYRO_WHO_AM_I 0x00
173 #define C9DOF3_REG_GYRO_DATA_START 0x02
174 #define C9DOF3_REG_GYRO_RATE_X_LSB 0x02
175 #define C9DOF3_REG_GYRO_RATE_X_MSB 0x03
176 #define C9DOF3_REG_GYRO_RATE_Y_LSB 0x04
177 #define C9DOF3_REG_GYRO_RATE_Y_MSB 0x05
178 #define C9DOF3_REG_GYRO_RATE_Z_LSB 0x06
179 #define C9DOF3_REG_GYRO_RATE_Z_MSB 0x07
180 #define C9DOF3_REG_GYRO_INT_STATUS_0 0x09
181 #define C9DOF3_REG_GYRO_INT_STATUS_1 0x0A
182 #define C9DOF3_REG_GYRO_INT_STATUS_2 0x0B
183 #define C9DOF3_REG_GYRO_INT_STATUS_3 0x0C
184 #define C9DOF3_REG_GYRO_FIFO_STATUS 0x0E
185 #define C9DOF3_REG_GYRO_RANGE 0x0F
186 #define C9DOF3_REG_GYRO_BW 0x10
187 #define C9DOF3_REG_GYRO_LPM1 0x11
188 #define C9DOF3_REG_GYRO_LPM2 0x12
189 #define C9DOF3_REG_GYRO_RATE_HBW 0x13
190 #define C9DOF3_REG_GYRO_BGW_SOFTRESET 0x14
191 #define C9DOF3_REG_GYRO_INT_EN_0 0x15
192 #define C9DOF3_REG_GYRO_INT_EN_1 0x16
193 #define C9DOF3_REG_GYRO_INT_MAP_0 0x17
194 #define C9DOF3_REG_GYRO_INT_MAP_1 0x18
195 #define C9DOF3_REG_GYRO_INT_MAP_2 0x19
196 #define C9DOF3_REG_GYRO_INT_SRC_1 0x1A
197 #define C9DOF3_REG_GYRO_INT_SRC_2 0x1B
198 #define C9DOF3_REG_GYRO_INT_SRC_3 0x1C
199 #define C9DOF3_REG_GYRO_FIFO_EN 0x1E
200 #define C9DOF3_REG_GYRO_INT_RST_LATCH 0x21
201 #define C9DOF3_REG_GYRO_HIGH_TH_X 0x22
202 #define C9DOF3_REG_GYRO_HIGH_DUR_X 0x23
203 #define C9DOF3_REG_GYRO_HIGH_TH_Y 0x24
204 #define C9DOF3_REG_GYRO_HIGH_DUR_Y 0x25
205 #define C9DOF3_REG_GYRO_HIGH_TH_Z 0x26
206 #define C9DOF3_REG_GYRO_HIGH_DUR_Z 0x27
207 #define C9DOF3_REG_GYRO_SOC 0x31
208 #define C9DOF3_REG_GYRO_A_FOC 0x32
209 #define C9DOF3_REG_GYRO_TRIM_NVM_CTRL 0x33
210 #define C9DOF3_REG_GYRO_BGW_SPI3_WDT 0x34
211 #define C9DOF3_REG_GYRO_OFC1 0x36
212 #define C9DOF3_REG_GYRO_OFC2 0x37
213 #define C9DOF3_REG_GYRO_OFC3 0x38
214 #define C9DOF3_REG_GYRO_OFC4 0x39
215 #define C9DOF3_REG_GYRO_TRIM_GP0 0x3A
216 #define C9DOF3_REG_GYRO_TRIM_GP1 0x3B
217 #define C9DOF3_REG_GYRO_BIST 0x3C
218 #define C9DOF3_REG_GYRO_FIFO_CONFIG_0 0x3D
219 #define C9DOF3_REG_GYRO_FIFO_CONFIG_1 0x3E
220 
226 #define C9DOF3_REG_MAG_WHO_AM_I 0x40
227 #define C9DOF3_REG_MAG_DATA_START 0x42
228 #define C9DOF3_REG_MAG_XOUT_LSB 0x42
229 #define C9DOF3_REG_MAG_XOUT_MSB 0x43
230 #define C9DOF3_REG_MAG_YOUT_LSB 0x44
231 #define C9DOF3_REG_MAG_YOUT_MSB 0x45
232 #define C9DOF3_REG_MAG_ZOUT_LSB 0x46
233 #define C9DOF3_REG_MAG_ZOUT_MSB 0x47
234 #define C9DOF3_REG_MAG_ROUT_LSB 0x48
235 #define C9DOF3_REG_MAG_ROUT_MSB 0x49
236 #define C9DOF3_REG_MAG_INT_STATUS 0x4A
237 #define C9DOF3_REG_MAG_PWR_CNTL1 0x4B
238 #define C9DOF3_REG_MAG_PWR_CNTL2 0x4C
239 #define C9DOF3_REG_MAG_INT_EN_1 0x4D
240 #define C9DOF3_REG_MAG_INT_EN_2 0x4E
241 #define C9DOF3_REG_MAG_LOW_THS 0x4F
242 #define C9DOF3_REG_MAG_HIGH_THS 0x50
243 #define C9DOF3_REG_MAG_REP_XY 0x51
244 #define C9DOF3_REG_MAG_REP_Z 0x52
245 
251 #define C9DOF3_ACC_RANGE_2 0x03
252 #define C9DOF3_ACC_RANGE_4 0x05
253 #define C9DOF3_ACC_RANGE_8 0x08
254 #define C9DOF3_ACC_RANGE_16 0x0C
255 
261 #define C9DOF3_ACC_PMU_BW_7_81 0x08
262 #define C9DOF3_ACC_PMU_BW_15_63 0x09
263 #define C9DOF3_ACC_PMU_BW_31_25 0x0A
264 #define C9DOF3_ACC_PMU_BW_62_5 0x0B
265 #define C9DOF3_ACC_PMU_BW_125 0x0C
266 #define C9DOF3_ACC_PMU_BW_250 0x0D
267 #define C9DOF3_ACC_PMU_BW_500 0x0E
268 #define C9DOF3_ACC_PMU_BW_1000 0x0F
269 
275 #define C9DOF3_ACC_PMU_LPW_MODE_NOMAL 0x00
276 #define C9DOF3_ACC_PMU_LPW_MODE_DEEP_SUSPEND 0x20
277 #define C9DOF3_ACC_PMU_LPW_MODE_LOW_POWER 0x40
278 #define C9DOF3_ACC_PMU_LPW_MODE_SUSPEND 0x80
279 
285 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_0_5MS 0x00
286 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_1MS 0x0C
287 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_2MS 0x0E
288 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_4MS 0x10
289 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_6MS 0x12
290 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_10MS 0x14
291 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_25MS 0x16
292 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_50MS 0x18
293 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_100MS 0x1A
294 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_500MS 0x1C
295 #define C9DOF3_ACC_PMU_LPW_SLEEP_DUR_1S 0x1E
296 
302 #define C9DOF3_GYRO_LPM1_MODE_NOMAL 0x00
303 #define C9DOF3_GYRO_LPM1_MODE_DEEP_SUSPEND 0x01
304 #define C9DOF3_GYRO_LPM1_MODE_SUSPEND 0x10
305 
311 #define C9DOF3_GYRO_RANGE_16_4 0x00
312 #define C9DOF3_GYRO_RANGE_32_8 0x01
313 #define C9DOF3_GYRO_RANGE_65_6 0x02
314 #define C9DOF3_GYRO_RANGE_131_2 0x03
315 #define C9DOF3_GYRO_RANGE_262_4 0x04
316 
322 #define C9DOF3_GYRO_BW_32 0x07
323 #define C9DOF3_GYRO_BW_64 0x06
324 #define C9DOF3_GYRO_BW_12 0x05
325 #define C9DOF3_GYRO_BW_23 0x04
326 #define C9DOF3_GYRO_BW_47 0x03
327 #define C9DOF3_GYRO_BW_116 0x02
328 #define C9DOF3_GYRO_BW_230 0x01
329 #define C9DOF3_GYRO_BW_523 0x00
330 
336 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_2MS 0x00
337 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_4MS 0x01
338 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_5MS 0x02
339 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_8MS 0x03
340 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_10MS 0x04
341 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_15MS 0x05
342 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_18MS 0x06
343 #define C9DOF3_GYRO_LPM1_SLEEP_DUR_20MS 0x07
344 
350 #define C9DOF3_MAG_POW_CTL_SOFT_RESET 0x82
351 #define C9DOF3_MAG_POW_CTL_SLEEP_MODE 0x01
352 #define C9DOF3_MAG_POW_CTL_SUSPEND_MODE 0x00
353 
359 #define C9DOF3_MAG_DATA_RATE_10 0x00
360 #define C9DOF3_MAG_DATA_RATE_2 0x08
361 #define C9DOF3_MAG_DATA_RATE_6 0x10
362 #define C9DOF3_MAG_DATA_RATE_8 0x18
363 #define C9DOF3_MAG_DATA_RATE_15 0x20
364 #define C9DOF3_MAG_DATA_RATE_20 0x28
365 #define C9DOF3_MAG_DATA_RATE_25 0x30
366 #define C9DOF3_MAG_DATA_RATE_30 0x38
367 
373 #define C9DOF3_MAG_XY_REPET_9 0x04
374 #define C9DOF3_MAG_Z_REPET_15 0x0F
375 
381 #define C9DOF3_BIT_MASK_SPI_CMD_WRITE 0x7F
382 #define C9DOF3_BIT_MASK_SPI_CMD_READ 0x80
383 #define C9DOF3_SPI_COMMUNICATION_DUMMY 0x00
384 
390 #define C9DOF3_ID_CHECK_ERROR 0x00
391 #define C9DOF3_ID_CHECK_SUCCESS 0x01
392 #define C9DOF3_ACC_COMM_ERROR 0x00
393 #define C9DOF3_ACC_COMM_SUCCESS 0x04
394 #define C9DOF3_GYRO_COMM_ERROR 0x00
395 #define C9DOF3_GYRO_COMM_SUCCESS 0x02
396 #define C9DOF3_MAG_COMM_ERROR 0x00
397 #define C9DOF3_MAG_COMM_SUCCESS 0x01
398 
404 #define COMMUNICATION_MODE_ACCEL 0x01
405 #define COMMUNICATION_MODE_GYRO 0x02
406 #define COMMUNICATION_MODE_MAG 0x03
407 
413 #define C9DOF3_PIN_STATE_LOW 0x00
414 #define C9DOF3_PIN_STATE_HIGH 0x01
415  // End group macro
418 // --------------------------------------------------------------- PUBLIC TYPES
428 typedef enum
429 {
433 
438 typedef void ( *c9dof3_master_io_t )( struct c9dof3_s*, uint8_t, uint8_t*, uint8_t );
443 typedef struct c9dof3_s
444 {
445  // Output pins
446 
447  digital_out_t cs1;
448  digital_out_t cs2;
449  digital_out_t cs3;
450 
451  // Input pins
452 
453  digital_in_t int_pin;
454 
455  // Modules
456 
457  i2c_master_t i2c;
458  spi_master_t spi;
460  // ctx variable
461 
462  uint8_t slave_address;
463  pin_name_t chip_select;
469  uint8_t sel_mode;
470 
472 
476 typedef struct
477 {
478  // Communication gpio pins
479 
480  pin_name_t scl;
481  pin_name_t sda;
482  pin_name_t miso;
483  pin_name_t mosi;
484  pin_name_t sck;
485  pin_name_t cs1;
486  pin_name_t cs2;
487  pin_name_t cs3;
488 
489  // Additional gpio pins
490 
491  pin_name_t int_pin;
492 
493  // static variable
494 
495  uint32_t i2c_speed;
496  uint8_t i2c_address;
498  uint32_t spi_speed;
499  spi_master_mode_t spi_mode;
500  spi_master_chip_select_polarity_t cs_polarity;
504 } c9dof3_cfg_t;
505 
506 typedef struct
507 {
508  int16_t x;
509  int16_t y;
510  int16_t z;
511 }
513 
514 typedef struct
515 {
516  int16_t x;
517  int16_t y;
518  int16_t z;
519 }
521 
522 typedef struct
523 {
524  int16_t x;
525  int16_t y;
526  int16_t z;
527 }
529 
534 typedef enum
535 {
537  C9DOF3_ERROR = -1
538 
540  // End types group
542 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
548 #ifdef __cplusplus
549 extern "C"{
550 #endif
551 
561 
577 
587 
609 
620 void c9dof3_generic_write ( c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
621 
632 void c9dof3_generic_read ( c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
633 
655 
666 
677 
688 
700 
711 
712 #ifdef __cplusplus
713 }
714 #endif
715 #endif // _C9DOF3_H_
716  // End public_function group
719 
720 // ------------------------------------------------------------------------- END
c9dof3_drv_interface_selection
void c9dof3_drv_interface_selection(c9dof3_cfg_t *cfg, c9dof3_drv_t drv_sel)
9DOF 3 driver interface setup function.
c9dof3_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c9dof3.h:495
c9dof3_cfg_t
Click configuration structure definition.
Definition: c9dof3.h:477
C9DOF3_DRV_SEL_SPI
@ C9DOF3_DRV_SEL_SPI
Definition: c9dof3.h:430
c9dof3_s::i2c
i2c_master_t i2c
Definition: c9dof3.h:457
c9dof3_cfg_t::sck
pin_name_t sck
Definition: c9dof3.h:484
c9dof3_cfg_t::i2c_address
uint8_t i2c_address
Definition: c9dof3.h:496
c9dof3_read_gyro_data
void c9dof3_read_gyro_data(c9dof3_t *ctx, c9dof3_gyro_t *gyro_data)
Read Gyro data function.
c9dof3_read_accel_data
void c9dof3_read_accel_data(c9dof3_t *ctx, c9dof3_accel_t *accel_data)
Read Accel data function.
C9DOF3_OK
@ C9DOF3_OK
Definition: c9dof3.h:536
c9dof3_gyro_t::x
int16_t x
Definition: c9dof3.h:516
c9dof3_s::write_f
c9dof3_master_io_t write_f
Definition: c9dof3.h:466
c9dof3_mag_t
Definition: c9dof3.h:523
c9dof3_cfg_t::drv_sel
c9dof3_drv_t drv_sel
Definition: c9dof3.h:502
c9dof3_drv_t
c9dof3_drv_t
9DOF 3 Click driver selector.
Definition: c9dof3.h:429
c9dof3_get_data
void c9dof3_get_data(c9dof3_t *ctx, c9dof3_accel_t *accel_data, c9dof3_gyro_t *gyro_data, c9dof3_mag_t *mag_data)
Read Accel, Gyro and Mag data function.
C9DOF3_ERROR
@ C9DOF3_ERROR
Definition: c9dof3.h:537
c9dof3_accel_t
Definition: c9dof3.h:507
gyro_data
c9dof3_gyro_t gyro_data
Definition: main.c:39
c9dof3_s::spi
spi_master_t spi
Definition: c9dof3.h:458
c9dof3_cfg_t::int_pin
pin_name_t int_pin
Definition: c9dof3.h:491
c9dof3_check_communication
uint8_t c9dof3_check_communication(c9dof3_t *ctx)
Check communication function.
c9dof3_mag_t::y
int16_t y
Definition: c9dof3.h:525
c9dof3_generic_read
void c9dof3_generic_read(c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
c9dof3_cfg_t::cs3
pin_name_t cs3
Definition: c9dof3.h:487
c9dof3_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c9dof3.h:499
c9dof3_mag_t::z
int16_t z
Definition: c9dof3.h:526
C9DOF3_DRV_SEL_I2C
@ C9DOF3_DRV_SEL_I2C
Definition: c9dof3.h:431
c9dof3_default_cfg
void c9dof3_default_cfg(c9dof3_t *ctx)
Click Default Configuration function.
c9dof3_gyro_t::z
int16_t z
Definition: c9dof3.h:518
c9dof3_return_value_t
c9dof3_return_value_t
9DOF 3 Click return value data.
Definition: c9dof3.h:535
c9dof3_t
struct c9dof3_s c9dof3_t
Click ctx object definition.
c9dof3_s::cs3
digital_out_t cs3
Definition: c9dof3.h:449
c9dof3_master_io_t
void(* c9dof3_master_io_t)(struct c9dof3_s *, uint8_t, uint8_t *, uint8_t)
9DOF 3 Click driver interface.
Definition: c9dof3.h:438
c9dof3_cfg_t::mosi
pin_name_t mosi
Definition: c9dof3.h:483
c9dof3_mag_t::x
int16_t x
Definition: c9dof3.h:524
c9dof3_s
Click ctx object definition.
Definition: c9dof3.h:444
c9dof3_cfg_t::cs1
pin_name_t cs1
Definition: c9dof3.h:485
c9dof3_init
C9DOF3_RETVAL c9dof3_init(c9dof3_t *ctx, c9dof3_cfg_t *cfg)
Initialization function.
c9dof3_gyro_t
Definition: c9dof3.h:515
c9dof3_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c9dof3.h:500
c9dof3_s::chip_select
pin_name_t chip_select
Definition: c9dof3.h:463
c9dof3_s::int_pin
digital_in_t int_pin
Definition: c9dof3.h:453
c9dof3_s::cs2
digital_out_t cs2
Definition: c9dof3.h:448
c9dof3_cfg_t::scl
pin_name_t scl
Definition: c9dof3.h:480
c9dof3_generic_write
void c9dof3_generic_write(c9dof3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
c9dof3_cfg_setup
void c9dof3_cfg_setup(c9dof3_cfg_t *cfg)
Config Object Initialization function.
c9dof3_gyro_t::y
int16_t y
Definition: c9dof3.h:517
c9dof3_s::read_f
c9dof3_master_io_t read_f
Definition: c9dof3.h:467
c9dof3_cfg_t::spi_speed
uint32_t spi_speed
Definition: c9dof3.h:498
c9dof3_cfg_t::cs2
pin_name_t cs2
Definition: c9dof3.h:486
c9dof3_cfg_t::miso
pin_name_t miso
Definition: c9dof3.h:482
c9dof3_s::slave_address
uint8_t slave_address
Definition: c9dof3.h:462
c9dof3_s::drv_sel
c9dof3_drv_t drv_sel
Definition: c9dof3.h:464
c9dof3_accel_t::z
int16_t z
Definition: c9dof3.h:510
c9dof3_read_mag_data
void c9dof3_read_mag_data(c9dof3_t *ctx, c9dof3_mag_t *mag_data)
Read Mag data function.
c9dof3_s::cs1
digital_out_t cs1
Definition: c9dof3.h:447
c9dof3_check_interrupt
uint8_t c9dof3_check_interrupt(c9dof3_t *ctx)
Check interrupt status function.
c9dof3_cfg_t::sda
pin_name_t sda
Definition: c9dof3.h:481
c9dof3_accel_t::x
int16_t x
Definition: c9dof3.h:508
c9dof3_s::sel_mode
uint8_t sel_mode
Definition: c9dof3.h:469
mag_data
c9dof3_mag_t mag_data
Definition: main.c:40
C9DOF3_RETVAL
#define C9DOF3_RETVAL
Definition: c9dof3.h:78
accel_data
c9dof3_accel_t accel_data
Definition: main.c:38
c9dof3_accel_t::y
int16_t y
Definition: c9dof3.h:509