c6dofimu6  2.0.0.0
c6dofimu6.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 C6DOFIMU6_H
36 #define C6DOFIMU6_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 C6DOFIMU6_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.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
76 
82 #define C6DOFIMU6_MASTER_I2C 0
83 #define C6DOFIMU6_MASTER_SPI 1
84 
90 #define C6DOFIMU6_RETVAL uint8_t
91 
92 #define C6DOFIMU6_OK 0x00
93 #define C6DOFIMU6_INIT_ERROR 0xFF
94 
100 #define C6DOFIMU6_I2C_SLAVE_ADR_GND 0x68
101 #define C6DOFIMU6_I2C_SLAVE_ADR_VCC 0x69
102 
108 #define C6DOFIMU6_READ_BIT_MASK 0x80
109 #define C6DOFIMU6_WRITE_BIT_MASK 0x7F
110 
116 #define C6DOFIMU6_SELF_TEST_X_GYRO 0x00
117 #define C6DOFIMU6_SELF_TEST_Y_GYRO 0x01
118 #define C6DOFIMU6_SELF_TEST_Z_GYRO 0x02
119 #define C6DOFIMU6_SELF_TEST_X_ACCEL 0x0D
120 #define C6DOFIMU6_SELF_TEST_Y_ACCEL 0x0E
121 #define C6DOFIMU6_SELF_TEST_Z_ACCEL 0x0F
122 #define C6DOFIMU6_XG_OFFS_USR_H 0x13
123 #define C6DOFIMU6_XG_OFFS_USR_L 0x14
124 #define C6DOFIMU6_YG_OFFS_USR_H 0x15
125 #define C6DOFIMU6_YG_OFFS_USR_L 0x16
126 #define C6DOFIMU6_ZG_OFFS_USR_H 0x17
127 #define C6DOFIMU6_ZG_OFFS_USR_L 0x18
128 #define C6DOFIMU6_SMPL_RT_DIV 0x19
129 #define C6DOFIMU6_CFG 0x1A
130 #define C6DOFIMU6_GYRO_CFG 0x1B
131 #define C6DOFIMU6_ACCEL_CFG 0x1C
132 #define C6DOFIMU6_ACCEL_CFG_2 0x1D
133 #define C6DOFIMU6_LP_MODE_CTL 0x1E
134 #define C6DOFIMU6_ACCEL_WOM_X_THR 0x20
135 #define C6DOFIMU6_ACCEL_WOM_Y_THR 0x21
136 #define C6DOFIMU6_ACCEL_WOM_Z_THR 0x22
137 #define C6DOFIMU6_FIFO_EN 0x23
138 #define C6DOFIMU6_INT_PIN_CFG 0x37
139 #define C6DOFIMU6_INT_ENABLE 0x38
140 #define C6DOFIMU6_DMP_INT_STAT 0x39
141 #define C6DOFIMU6_INT_STAT 0x3A
142 #define C6DOFIMU6_ACCEL_XOUT_H 0x3B
143 #define C6DOFIMU6_ACCEL_XOUT_L 0x3C
144 #define C6DOFIMU6_ACCEL_YOUT_H 0x3D
145 #define C6DOFIMU6_ACCEL_YOUT_L 0x3E
146 #define C6DOFIMU6_ACCEL_ZOUT_H 0x3F
147 #define C6DOFIMU6_ACCEL_ZOUT_L 0x40
148 #define C6DOFIMU6_TEMP_OUT_H 0x41
149 #define C6DOFIMU6_TEMP_OUT_L 0x42
150 #define C6DOFIMU6_GYRO_XOUT_H 0x43
151 #define C6DOFIMU6_GYRO_XOUT_L 0x44
152 #define C6DOFIMU6_GYRO_YOUT_H 0x45
153 #define C6DOFIMU6_GYRO_YOUT_L 0x46
154 #define C6DOFIMU6_GYRO_ZOUT_H 0x47
155 #define C6DOFIMU6_GYRO_ZOUT_L 0x48
156 #define C6DOFIMU6_SIGNAL_PATH_RST 0x68
157 #define C6DOFIMU6_ACCEL_INTEL_CTL 0x69
158 #define C6DOFIMU6_USER_CTL 0x6A
159 #define C6DOFIMU6_PWR_MGMT_1 0x6B
160 #define C6DOFIMU6_PWR_MGMT_2 0x6C
161 #define C6DOFIMU6_FIFO_CNT_H 0x72
162 #define C6DOFIMU6_FIFO_CNT_L 0x73
163 #define C6DOFIMU6_FIFO_R_W 0x74
164 #define C6DOFIMU6_WHO_AM_I 0x75
165 #define C6DOFIMU6_XA_OFFS_H 0x77
166 #define C6DOFIMU6_XA_OFFS_L 0x78
167 #define C6DOFIMU6_YA_OFFS_H 0x7A
168 #define C6DOFIMU6_YA_OFFS_L 0x7B
169 #define C6DOFIMU6_ZA_OFFS_H 0x7D
170 #define C6DOFIMU6_ZA_OFFS_L 0x7E
171 
177 #define C6DOFIMU6_CFG_FIFO_MODE 0x40
178 #define C6DOFIMU6_CFG_EXT_SYNC_SET_1 0x08
179 #define C6DOFIMU6_CFG_EXT_SYNC_SET_2 0x10
180 #define C6DOFIMU6_CFG_EXT_SYNC_SET_3 0x18
181 #define C6DOFIMU6_CFG_EXT_SYNC_SET_4 0x20
182 #define C6DOFIMU6_CFG_EXT_SYNC_SET_5 0x28
183 #define C6DOFIMU6_CFG_EXT_SYNC_SET_6 0x30
184 #define C6DOFIMU6_CFG_EXT_SYNC_SET_7 0x38
185 #define C6DOFIMU6_CFG_DLPF_CFG_0 0x00
186 #define C6DOFIMU6_CFG_DLPF_CFG_1 0x01
187 #define C6DOFIMU6_CFG_DLPF_CFG_2 0x02
188 #define C6DOFIMU6_CFG_DLPF_CFG_3 0x03
189 #define C6DOFIMU6_CFG_DLPF_CFG_4 0x04
190 #define C6DOFIMU6_CFG_DLPF_CFG_5 0x05
191 #define C6DOFIMU6_CFG_DLPF_CFG_6 0x06
192 #define C6DOFIMU6_CFG_DLPF_CFG_7 0x07
193 
199 #define C6DOFIMU6_GYRO_CFG_XGYRO_STEN 0x80
200 #define C6DOFIMU6_GYRO_CFG_YGYRO_STEN 0x40
201 #define C6DOFIMU6_GYRO_CFG_ZGYRO_STEN 0x20
202 #define C6DOFIMU6_GYRO_CFG_FS_SEL_2000 0x18
203 #define C6DOFIMU6_GYRO_CFG_FS_SEL_1000 0x10
204 #define C6DOFIMU6_GYRO_CFG_FS_SEL_500 0x08
205 #define C6DOFIMU6_GYRO_CFG_FS_SEL_250 0x00
206 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_2 0x02
207 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_1 0x01
208 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_0 0x00
209 
215 #define C6DOFIMU6_ACCEL_CFG_AX_ST_EN 0x80
216 #define C6DOFIMU6_ACCEL_CFG_AY_ST_EN 0x40
217 #define C6DOFIMU6_ACCEL_CFG_AZ_ST_EN 0x20
218 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_16G 0x18
219 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_8G 0x10
220 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_4G 0x08
221 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_2G 0x00
222 
228 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_4KB 0x40
229 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_2KB 0x08
230 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_1KB 0x10
231 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_512B 0x18
232 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_32 0x30
233 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_16 0x20
234 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_8 0x10
235 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_4 0x00
236 #define C6DOFIMU6_ACCEL2_CFG_FCHOICE_B 0x00
237 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_0 0x00
238 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_1 0x01
239 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_2 0x02
240 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_3 0x03
241 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_4 0x04
242 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_5 0x05
243 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_6 0x06
244 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_7 0x07
245 
251 #define C6DOFIMU6_FIFO_EN_TEMP_OUT 0x80
252 #define C6DOFIMU6_FIFO_EN_GYRO_XOUT 0x40
253 #define C6DOFIMU6_FIFO_EN_GYRO_YOUT 0x20
254 #define C6DOFIMU6_FIFO_EN_GYRO_ZOUT 0x10
255 #define C6DOFIMU6_FIFO_EN_ACCEL_XYZ_OUT 0x08
256 
262 #define C6DOFIMU6_INT_PIN_CFG_ACTL 0x80
263 #define C6DOFIMU6_INT_PIN_CFG_OPEN 0x40
264 #define C6DOFIMU6_INT_PIN_CFG_LATCH_INT_EN 0x20
265 #define C6DOFIMU6_INT_PIN_CFG_INT_ANYRD_2CLR 0x10
266 #define C6DOFIMU6_INT_PIN_CFG_ACTL_FSYNC 0x08
267 #define C6DOFIMU6_INT_PIN_CFG_FSYNC_INT_MODE_EN 0x04
268 #define C6DOFIMU6_INT_PIN_CFG_BYPASS_EN 0x02
269 
275 #define C6DOFIMU6_INT_ENABLE_WOM_X_INT_EN 0x80
276 #define C6DOFIMU6_INT_ENABLE_WOM_Y_INT_EN 0x40
277 #define C6DOFIMU6_INT_ENABLE_WOM_Z_INT_EN 0x20
278 #define C6DOFIMU6_INT_ENABLE_FIFO_OVF_EN 0x10
279 #define C6DOFIMU6_INT_ENABLE_GDRIVE_RDY_EN 0x04
280 #define C6DOFIMU6_INT_ENABLE_DMP_INT_EN 0x02
281 #define C6DOFIMU6_INT_ENABLE_RAW_RDY_EN 0x01
282 
288 #define C6DOFIMU6_INT_STAT_WOM_X_INT 0x80
289 #define C6DOFIMU6_INT_STAT_WOM_Y_INT 0x40
290 #define C6DOFIMU6_INT_STAT_WOM_Z_INT 0x20
291 #define C6DOFIMU6_INT_STAT_FIFO_OVF_INT 0x10
292 #define C6DOFIMU6_INT_STAT_GDRIVE_RDY_INT 0x04
293 #define C6DOFIMU6_INT_STAT_DMP_INT 0x02
294 #define C6DOFIMU6_INT_STAT_RAW_RDY_INT 0x01
295 
301 #define C6DOFIMU6_SIGNAL_PATH_RST_GYRO_RST 0x80
302 #define C6DOFIMU6_SIGNAL_PATH_RST_ACCEL_RST 0x40
303 #define C6DOFIMU6_SIGNAL_PATH_RST_TEMP_RST 0x20
304 
310 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_EN 0x80
311 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_MODE_PREV_SAMP 0x40
312 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_MODE_FIRST_SAMP 0x00
313 
319 #define C6DOFIMU6_USER_CTL_DMP_EN 0x80
320 #define C6DOFIMU6_USER_CTL_FIFO_EN 0x40
321 #define C6DOFIMU6_USER_CTL_I2C_IF_DIS 0x10
322 #define C6DOFIMU6_USER_CTL_DMP_RST 0x08
323 #define C6DOFIMU6_USER_CTL_FIFO_RST 0x04
324 #define C6DOFIMU6_USER_CTL_SIG_COND_RST 0x01
325 
331 #define C6DOFIMU6_PWR_MGMT_1_DEV_RST 0x80
332 #define C6DOFIMU6_PWR_MGMT_1_SLEEP 0x40
333 #define C6DOFIMU6_PWR_MGMT_1_ACCEL_CYC 0x20
334 #define C6DOFIMU6_PWR_MGMT_1_GYRO_STDBY 0x10
335 #define C6DOFIMU6_PWR_MGMT_1_TEMP_DIS 0x08
336 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_7 0x07
337 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_6 0x06
338 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_5 0x05
339 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_4 0x04
340 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_3 0x03
341 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_2 0x02
342 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_1 0x01
343 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_0 0x00
344 
350 #define C6DOFIMU6_PWR_MGMT_2_LP_DIS 0x80
351 #define C6DOFIMU6_PWR_MGMT_2_DMP_LP_DIS 0x40
352 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_XA 0x20
353 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_YA 0x10
354 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_ZA 0x08
355 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_XG 0x04
356 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_YG 0x02
357 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_ZG 0x01
358 
364 #define C6DOFIMU6_WHO_AM_I_VAL 0x98
365 
371 #define C6DOFIMU6_POWER_ON 0x01
372 #define C6DOFIMU6_POWER_OFF 0x00
373 
379 #define C6DOFIMU6_GYRO_SENS_FS_SEL_2000 16.4
380 #define C6DOFIMU6_GYRO_SENS_FS_SEL_1000 32.8
381 #define C6DOFIMU6_GYRO_SENS_FS_SEL_500 65.5
382 #define C6DOFIMU6_GYRO_SENS_FS_SEL_250 131.0
383 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_16G 2048.0
384 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_8G 4096.0
385 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_4G 8192.0
386 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_2G 16384.0
387  // End group macro
390 // --------------------------------------------------------------- PUBLIC TYPES
399 typedef uint8_t c6dofimu6_select_t;
400 
404 typedef void ( *c6dofimu6_master_io_t )( struct c6dofimu6_s*, uint8_t, uint8_t*, uint16_t );
405 
409 typedef struct c6dofimu6_s
410 {
411  // Output pins
412 
413  digital_out_t cs;
414 
415  // Input pins
416 
417  digital_in_t int_pin;
418 
419  // Modules
420 
421  i2c_master_t i2c;
422  spi_master_t spi;
423 
424  // ctx variable
425 
426  uint8_t slave_address;
427  pin_name_t chip_select;
431 
433 
437 typedef struct
438 {
439  // Communication gpio pins
440 
441  pin_name_t scl;
442  pin_name_t sda;
443  pin_name_t miso;
444  pin_name_t mosi;
445  pin_name_t sck;
446  pin_name_t cs;
447 
448  // Additional gpio pins
449 
450  pin_name_t int_pin;
451 
452  // static variable
453 
454  uint32_t i2c_speed;
455  uint8_t i2c_address;
456 
457  uint32_t spi_speed;
458  spi_master_mode_t spi_mode;
459  spi_master_chip_select_polarity_t cs_polarity;
460 
462 
464  // End types group
466 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
472 #ifdef __cplusplus
473 extern "C"{
474 #endif
475 
485 
495 
504 
515 void c6dofimu6_generic_write ( c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len );
516 
527 void c6dofimu6_generic_read ( c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len );
528 
538 void c6dofimu6_power ( c6dofimu6_t *ctx, uint8_t on_off );
539 
550 
561 
572 
583 void c6dofimu6_read_gyroscope ( c6dofimu6_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z );
584 
595 void c6dofimu6_angular_rate ( c6dofimu6_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte );
596 
607 
618 
629 
640 void c6dofimu6_read_accelerometer ( c6dofimu6_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z );
641 
652 void c6dofimu6_acceleration_rate ( c6dofimu6_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte );
653 
664 
675 
676 #ifdef __cplusplus
677 }
678 #endif
679 #endif // _C6DOFIMU6_H_
680  // End public_function group
683 
684 // ------------------------------------------------------------------------- END
c6dofimu6_check_int_pin
uint8_t c6dofimu6_check_int_pin(c6dofimu6_t *ctx)
Check Interrupt state function.
c6dofimu6_cfg_t::sck
pin_name_t sck
Definition: c6dofimu6.h:445
c6dofimu6_s::cs
digital_out_t cs
Definition: c6dofimu6.h:413
c6dofimu6_select_t
uint8_t c6dofimu6_select_t
Communication type.
Definition: c6dofimu6.h:399
c6dofimu6_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu6.h:454
c6dofimu6_cfg_t::cs
pin_name_t cs
Definition: c6dofimu6.h:446
c6dofimu6_cfg_t::sda
pin_name_t sda
Definition: c6dofimu6.h:442
c6dofimu6_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu6.h:444
C6DOFIMU6_RETVAL
#define C6DOFIMU6_RETVAL
Definition: c6dofimu6.h:90
c6dofimu6_read_accel_z
int16_t c6dofimu6_read_accel_z(c6dofimu6_t *ctx)
Read Accelerometer Z-axis data function.
c6dofimu6_generic_write
void c6dofimu6_generic_write(c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len)
Generic write function.
c6dofimu6_default_cfg
void c6dofimu6_default_cfg(c6dofimu6_t *ctx)
Click Default Configuration function.
c6dofimu6_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu6.h:459
c6dofimu6_read_gyroscope
void c6dofimu6_read_gyroscope(c6dofimu6_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
Read gyroscope data function.
c6dofimu6_cfg_t::sel
c6dofimu6_select_t sel
Definition: c6dofimu6.h:461
c6dofimu6_s::int_pin
digital_in_t int_pin
Definition: c6dofimu6.h:417
c6dofimu6_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu6.h:457
c6dofimu6_acceleration_rate
void c6dofimu6_acceleration_rate(c6dofimu6_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte)
Read acceleration Rate function.
c6dofimu6_read_accelerometer
void c6dofimu6_read_accelerometer(c6dofimu6_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z)
Read accelerometer data function.
c6dofimu6_read_gyro_x
int16_t c6dofimu6_read_gyro_x(c6dofimu6_t *ctx)
Read Gyroscope X-axis data function.
c6dofimu6_t
struct c6dofimu6_s c6dofimu6_t
Click ctx object definition.
c6dofimu6_cfg_t::miso
pin_name_t miso
Definition: c6dofimu6.h:443
c6dofimu6_read_accel_x
int16_t c6dofimu6_read_accel_x(c6dofimu6_t *ctx)
Read Accelerometer X-axis data function.
c6dofimu6_cfg_t::int_pin
pin_name_t int_pin
Definition: c6dofimu6.h:450
c6dofimu6_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu6.h:455
c6dofimu6_cfg_setup
void c6dofimu6_cfg_setup(c6dofimu6_cfg_t *cfg)
Config Object Initialization function.
c6dofimu6_s::chip_select
pin_name_t chip_select
Definition: c6dofimu6.h:427
c6dofimu6_s::read_f
c6dofimu6_master_io_t read_f
Definition: c6dofimu6.h:429
c6dofimu6_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu6.h:458
c6dofimu6_read_gyro_y
int16_t c6dofimu6_read_gyro_y(c6dofimu6_t *ctx)
Read Gyroscope Y-axis data function.
c6dofimu6_s::master_sel
c6dofimu6_select_t master_sel
Definition: c6dofimu6.h:430
c6dofimu6_cfg_t
Click configuration structure definition.
Definition: c6dofimu6.h:438
c6dofimu6_read_temp_out
float c6dofimu6_read_temp_out(c6dofimu6_t *ctx)
Read temperture function.
c6dofimu6_s::i2c
i2c_master_t i2c
Definition: c6dofimu6.h:421
c6dofimu6_read_gyro_z
int16_t c6dofimu6_read_gyro_z(c6dofimu6_t *ctx)
Read Gyroscope Z-axis data function.
c6dofimu6_generic_read
void c6dofimu6_generic_read(c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len)
Generic read function.
c6dofimu6_angular_rate
void c6dofimu6_angular_rate(c6dofimu6_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte)
Read Angular Rate function.
c6dofimu6_s
Click ctx object definition.
Definition: c6dofimu6.h:410
c6dofimu6_power
void c6dofimu6_power(c6dofimu6_t *ctx, uint8_t on_off)
Power up function.
c6dofimu6_s::write_f
c6dofimu6_master_io_t write_f
Definition: c6dofimu6.h:428
c6dofimu6_cfg_t::scl
pin_name_t scl
Definition: c6dofimu6.h:441
c6dofimu6_init
C6DOFIMU6_RETVAL c6dofimu6_init(c6dofimu6_t *ctx, c6dofimu6_cfg_t *cfg)
Initialization function.
c6dofimu6_read_accel_y
int16_t c6dofimu6_read_accel_y(c6dofimu6_t *ctx)
Read Accelerometer Y-axis data function.
c6dofimu6_s::spi
spi_master_t spi
Definition: c6dofimu6.h:422
c6dofimu6_s::slave_address
uint8_t slave_address
Definition: c6dofimu6.h:426
c6dofimu6_master_io_t
void(* c6dofimu6_master_io_t)(struct c6dofimu6_s *, uint8_t, uint8_t *, uint16_t)
Master Input/Output type.
Definition: c6dofimu6.h:404