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 
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 C6DOFIMU6_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.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
72 
78 #define C6DOFIMU6_MASTER_I2C 0
79 #define C6DOFIMU6_MASTER_SPI 1
80 
86 #define C6DOFIMU6_RETVAL uint8_t
87 
88 #define C6DOFIMU6_OK 0x00
89 #define C6DOFIMU6_INIT_ERROR 0xFF
90 
96 #define C6DOFIMU6_I2C_SLAVE_ADR_GND 0x68
97 #define C6DOFIMU6_I2C_SLAVE_ADR_VCC 0x69
98 
104 #define C6DOFIMU6_READ_BIT_MASK 0x80
105 #define C6DOFIMU6_WRITE_BIT_MASK 0x7F
106 
112 #define C6DOFIMU6_SELF_TEST_X_GYRO 0x00
113 #define C6DOFIMU6_SELF_TEST_Y_GYRO 0x01
114 #define C6DOFIMU6_SELF_TEST_Z_GYRO 0x02
115 #define C6DOFIMU6_SELF_TEST_X_ACCEL 0x0D
116 #define C6DOFIMU6_SELF_TEST_Y_ACCEL 0x0E
117 #define C6DOFIMU6_SELF_TEST_Z_ACCEL 0x0F
118 #define C6DOFIMU6_XG_OFFS_USR_H 0x13
119 #define C6DOFIMU6_XG_OFFS_USR_L 0x14
120 #define C6DOFIMU6_YG_OFFS_USR_H 0x15
121 #define C6DOFIMU6_YG_OFFS_USR_L 0x16
122 #define C6DOFIMU6_ZG_OFFS_USR_H 0x17
123 #define C6DOFIMU6_ZG_OFFS_USR_L 0x18
124 #define C6DOFIMU6_SMPL_RT_DIV 0x19
125 #define C6DOFIMU6_CFG 0x1A
126 #define C6DOFIMU6_GYRO_CFG 0x1B
127 #define C6DOFIMU6_ACCEL_CFG 0x1C
128 #define C6DOFIMU6_ACCEL_CFG_2 0x1D
129 #define C6DOFIMU6_LP_MODE_CTL 0x1E
130 #define C6DOFIMU6_ACCEL_WOM_X_THR 0x20
131 #define C6DOFIMU6_ACCEL_WOM_Y_THR 0x21
132 #define C6DOFIMU6_ACCEL_WOM_Z_THR 0x22
133 #define C6DOFIMU6_FIFO_EN 0x23
134 #define C6DOFIMU6_INT_PIN_CFG 0x37
135 #define C6DOFIMU6_INT_ENABLE 0x38
136 #define C6DOFIMU6_DMP_INT_STAT 0x39
137 #define C6DOFIMU6_INT_STAT 0x3A
138 #define C6DOFIMU6_ACCEL_XOUT_H 0x3B
139 #define C6DOFIMU6_ACCEL_XOUT_L 0x3C
140 #define C6DOFIMU6_ACCEL_YOUT_H 0x3D
141 #define C6DOFIMU6_ACCEL_YOUT_L 0x3E
142 #define C6DOFIMU6_ACCEL_ZOUT_H 0x3F
143 #define C6DOFIMU6_ACCEL_ZOUT_L 0x40
144 #define C6DOFIMU6_TEMP_OUT_H 0x41
145 #define C6DOFIMU6_TEMP_OUT_L 0x42
146 #define C6DOFIMU6_GYRO_XOUT_H 0x43
147 #define C6DOFIMU6_GYRO_XOUT_L 0x44
148 #define C6DOFIMU6_GYRO_YOUT_H 0x45
149 #define C6DOFIMU6_GYRO_YOUT_L 0x46
150 #define C6DOFIMU6_GYRO_ZOUT_H 0x47
151 #define C6DOFIMU6_GYRO_ZOUT_L 0x48
152 #define C6DOFIMU6_SIGNAL_PATH_RST 0x68
153 #define C6DOFIMU6_ACCEL_INTEL_CTL 0x69
154 #define C6DOFIMU6_USER_CTL 0x6A
155 #define C6DOFIMU6_PWR_MGMT_1 0x6B
156 #define C6DOFIMU6_PWR_MGMT_2 0x6C
157 #define C6DOFIMU6_FIFO_CNT_H 0x72
158 #define C6DOFIMU6_FIFO_CNT_L 0x73
159 #define C6DOFIMU6_FIFO_R_W 0x74
160 #define C6DOFIMU6_WHO_AM_I 0x75
161 #define C6DOFIMU6_XA_OFFS_H 0x77
162 #define C6DOFIMU6_XA_OFFS_L 0x78
163 #define C6DOFIMU6_YA_OFFS_H 0x7A
164 #define C6DOFIMU6_YA_OFFS_L 0x7B
165 #define C6DOFIMU6_ZA_OFFS_H 0x7D
166 #define C6DOFIMU6_ZA_OFFS_L 0x7E
167 
173 #define C6DOFIMU6_CFG_FIFO_MODE 0x40
174 #define C6DOFIMU6_CFG_EXT_SYNC_SET_1 0x08
175 #define C6DOFIMU6_CFG_EXT_SYNC_SET_2 0x10
176 #define C6DOFIMU6_CFG_EXT_SYNC_SET_3 0x18
177 #define C6DOFIMU6_CFG_EXT_SYNC_SET_4 0x20
178 #define C6DOFIMU6_CFG_EXT_SYNC_SET_5 0x28
179 #define C6DOFIMU6_CFG_EXT_SYNC_SET_6 0x30
180 #define C6DOFIMU6_CFG_EXT_SYNC_SET_7 0x38
181 #define C6DOFIMU6_CFG_DLPF_CFG_0 0x00
182 #define C6DOFIMU6_CFG_DLPF_CFG_1 0x01
183 #define C6DOFIMU6_CFG_DLPF_CFG_2 0x02
184 #define C6DOFIMU6_CFG_DLPF_CFG_3 0x03
185 #define C6DOFIMU6_CFG_DLPF_CFG_4 0x04
186 #define C6DOFIMU6_CFG_DLPF_CFG_5 0x05
187 #define C6DOFIMU6_CFG_DLPF_CFG_6 0x06
188 #define C6DOFIMU6_CFG_DLPF_CFG_7 0x07
189 
195 #define C6DOFIMU6_GYRO_CFG_XGYRO_STEN 0x80
196 #define C6DOFIMU6_GYRO_CFG_YGYRO_STEN 0x40
197 #define C6DOFIMU6_GYRO_CFG_ZGYRO_STEN 0x20
198 #define C6DOFIMU6_GYRO_CFG_FS_SEL_2000 0x18
199 #define C6DOFIMU6_GYRO_CFG_FS_SEL_1000 0x10
200 #define C6DOFIMU6_GYRO_CFG_FS_SEL_500 0x08
201 #define C6DOFIMU6_GYRO_CFG_FS_SEL_250 0x00
202 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_2 0x02
203 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_1 0x01
204 #define C6DOFIMU6_GYRO_CFG_FCHOICE_B_0 0x00
205 
211 #define C6DOFIMU6_ACCEL_CFG_AX_ST_EN 0x80
212 #define C6DOFIMU6_ACCEL_CFG_AY_ST_EN 0x40
213 #define C6DOFIMU6_ACCEL_CFG_AZ_ST_EN 0x20
214 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_16G 0x18
215 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_8G 0x10
216 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_4G 0x08
217 #define C6DOFIMU6_ACCEL_CFG_FS_SEL_2G 0x00
218 
224 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_4KB 0x40
225 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_2KB 0x08
226 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_1KB 0x10
227 #define C6DOFIMU6_ACCEL2_CFG_FIFO_SIZE_512B 0x18
228 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_32 0x30
229 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_16 0x20
230 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_8 0x10
231 #define C6DOFIMU6_ACCEL2_CFG_DEC2_CFG_4 0x00
232 #define C6DOFIMU6_ACCEL2_CFG_FCHOICE_B 0x00
233 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_0 0x00
234 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_1 0x01
235 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_2 0x02
236 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_3 0x03
237 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_4 0x04
238 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_5 0x05
239 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_6 0x06
240 #define C6DOFIMU6_ACCEL2_CFG_A_DLPF_CFG_7 0x07
241 
247 #define C6DOFIMU6_FIFO_EN_TEMP_OUT 0x80
248 #define C6DOFIMU6_FIFO_EN_GYRO_XOUT 0x40
249 #define C6DOFIMU6_FIFO_EN_GYRO_YOUT 0x20
250 #define C6DOFIMU6_FIFO_EN_GYRO_ZOUT 0x10
251 #define C6DOFIMU6_FIFO_EN_ACCEL_XYZ_OUT 0x08
252 
258 #define C6DOFIMU6_INT_PIN_CFG_ACTL 0x80
259 #define C6DOFIMU6_INT_PIN_CFG_OPEN 0x40
260 #define C6DOFIMU6_INT_PIN_CFG_LATCH_INT_EN 0x20
261 #define C6DOFIMU6_INT_PIN_CFG_INT_ANYRD_2CLR 0x10
262 #define C6DOFIMU6_INT_PIN_CFG_ACTL_FSYNC 0x08
263 #define C6DOFIMU6_INT_PIN_CFG_FSYNC_INT_MODE_EN 0x04
264 #define C6DOFIMU6_INT_PIN_CFG_BYPASS_EN 0x02
265 
271 #define C6DOFIMU6_INT_ENABLE_WOM_X_INT_EN 0x80
272 #define C6DOFIMU6_INT_ENABLE_WOM_Y_INT_EN 0x40
273 #define C6DOFIMU6_INT_ENABLE_WOM_Z_INT_EN 0x20
274 #define C6DOFIMU6_INT_ENABLE_FIFO_OVF_EN 0x10
275 #define C6DOFIMU6_INT_ENABLE_GDRIVE_RDY_EN 0x04
276 #define C6DOFIMU6_INT_ENABLE_DMP_INT_EN 0x02
277 #define C6DOFIMU6_INT_ENABLE_RAW_RDY_EN 0x01
278 
284 #define C6DOFIMU6_INT_STAT_WOM_X_INT 0x80
285 #define C6DOFIMU6_INT_STAT_WOM_Y_INT 0x40
286 #define C6DOFIMU6_INT_STAT_WOM_Z_INT 0x20
287 #define C6DOFIMU6_INT_STAT_FIFO_OVF_INT 0x10
288 #define C6DOFIMU6_INT_STAT_GDRIVE_RDY_INT 0x04
289 #define C6DOFIMU6_INT_STAT_DMP_INT 0x02
290 #define C6DOFIMU6_INT_STAT_RAW_RDY_INT 0x01
291 
297 #define C6DOFIMU6_SIGNAL_PATH_RST_GYRO_RST 0x80
298 #define C6DOFIMU6_SIGNAL_PATH_RST_ACCEL_RST 0x40
299 #define C6DOFIMU6_SIGNAL_PATH_RST_TEMP_RST 0x20
300 
306 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_EN 0x80
307 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_MODE_PREV_SAMP 0x40
308 #define C6DOFIMU6_ACCEL_INTEL_CTL_INTEL_MODE_FIRST_SAMP 0x00
309 
315 #define C6DOFIMU6_USER_CTL_DMP_EN 0x80
316 #define C6DOFIMU6_USER_CTL_FIFO_EN 0x40
317 #define C6DOFIMU6_USER_CTL_I2C_IF_DIS 0x10
318 #define C6DOFIMU6_USER_CTL_DMP_RST 0x08
319 #define C6DOFIMU6_USER_CTL_FIFO_RST 0x04
320 #define C6DOFIMU6_USER_CTL_SIG_COND_RST 0x01
321 
327 #define C6DOFIMU6_PWR_MGMT_1_DEV_RST 0x80
328 #define C6DOFIMU6_PWR_MGMT_1_SLEEP 0x40
329 #define C6DOFIMU6_PWR_MGMT_1_ACCEL_CYC 0x20
330 #define C6DOFIMU6_PWR_MGMT_1_GYRO_STDBY 0x10
331 #define C6DOFIMU6_PWR_MGMT_1_TEMP_DIS 0x08
332 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_7 0x07
333 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_6 0x06
334 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_5 0x05
335 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_4 0x04
336 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_3 0x03
337 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_2 0x02
338 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_1 0x01
339 #define C6DOFIMU6_PWR_MGMT_1_CLKSEL_0 0x00
340 
346 #define C6DOFIMU6_PWR_MGMT_2_LP_DIS 0x80
347 #define C6DOFIMU6_PWR_MGMT_2_DMP_LP_DIS 0x40
348 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_XA 0x20
349 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_YA 0x10
350 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_ZA 0x08
351 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_XG 0x04
352 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_YG 0x02
353 #define C6DOFIMU6_PWR_MGMT_2_DISABLE_ZG 0x01
354 
360 #define C6DOFIMU6_WHO_AM_I_VAL 0x98
361 
367 #define C6DOFIMU6_POWER_ON 0x01
368 #define C6DOFIMU6_POWER_OFF 0x00
369 
375 #define C6DOFIMU6_GYRO_SENS_FS_SEL_2000 16.4
376 #define C6DOFIMU6_GYRO_SENS_FS_SEL_1000 32.8
377 #define C6DOFIMU6_GYRO_SENS_FS_SEL_500 65.5
378 #define C6DOFIMU6_GYRO_SENS_FS_SEL_250 131.0
379 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_16G 2048.0
380 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_8G 4096.0
381 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_4G 8192.0
382 #define C6DOFIMU6_ACCEL_SENS_FS_SEL_2G 16384.0
383  // End group macro
386 // --------------------------------------------------------------- PUBLIC TYPES
395 typedef uint8_t c6dofimu6_select_t;
396 
400 typedef void ( *c6dofimu6_master_io_t )( struct c6dofimu6_s*, uint8_t, uint8_t*, uint16_t );
401 
405 typedef struct c6dofimu6_s
406 {
407  // Output pins
408 
409  digital_out_t cs;
410 
411  // Input pins
412 
413  digital_in_t int_pin;
414 
415  // Modules
416 
417  i2c_master_t i2c;
418  spi_master_t spi;
419 
420  // ctx variable
421 
422  uint8_t slave_address;
423  pin_name_t chip_select;
427 
429 
433 typedef struct
434 {
435  // Communication gpio pins
436 
437  pin_name_t scl;
438  pin_name_t sda;
439  pin_name_t miso;
440  pin_name_t mosi;
441  pin_name_t sck;
442  pin_name_t cs;
443 
444  // Additional gpio pins
445 
446  pin_name_t int_pin;
447 
448  // static variable
449 
450  uint32_t i2c_speed;
451  uint8_t i2c_address;
452 
453  uint32_t spi_speed;
454  spi_master_mode_t spi_mode;
455  spi_master_chip_select_polarity_t cs_polarity;
456 
458 
460  // End types group
462 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
468 #ifdef __cplusplus
469 extern "C"{
470 #endif
471 
481 
491 
500 
511 void c6dofimu6_generic_write ( c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len );
512 
523 void c6dofimu6_generic_read ( c6dofimu6_t *ctx, uint8_t reg, uint8_t *data_buf, uint16_t len );
524 
534 void c6dofimu6_power ( c6dofimu6_t *ctx, uint8_t on_off );
535 
546 
557 
568 
579 void c6dofimu6_read_gyroscope ( c6dofimu6_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z );
580 
591 void c6dofimu6_angular_rate ( c6dofimu6_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte );
592 
603 
614 
625 
636 void c6dofimu6_read_accelerometer ( c6dofimu6_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z );
637 
648 void c6dofimu6_acceleration_rate ( c6dofimu6_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte );
649 
660 
671 
672 #ifdef __cplusplus
673 }
674 #endif
675 #endif // _C6DOFIMU6_H_
676  // End public_function group
679 
680 // ------------------------------------------------------------------------- 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:441
c6dofimu6_s::cs
digital_out_t cs
Definition: c6dofimu6.h:409
c6dofimu6_select_t
uint8_t c6dofimu6_select_t
Communication type.
Definition: c6dofimu6.h:395
c6dofimu6_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu6.h:450
c6dofimu6_cfg_t::cs
pin_name_t cs
Definition: c6dofimu6.h:442
c6dofimu6_cfg_t::sda
pin_name_t sda
Definition: c6dofimu6.h:438
c6dofimu6_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu6.h:440
C6DOFIMU6_RETVAL
#define C6DOFIMU6_RETVAL
Definition: c6dofimu6.h:86
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:455
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:457
c6dofimu6_s::int_pin
digital_in_t int_pin
Definition: c6dofimu6.h:413
c6dofimu6_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu6.h:453
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:439
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:446
c6dofimu6_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu6.h:451
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:423
c6dofimu6_s::read_f
c6dofimu6_master_io_t read_f
Definition: c6dofimu6.h:425
c6dofimu6_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu6.h:454
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:426
c6dofimu6_cfg_t
Click configuration structure definition.
Definition: c6dofimu6.h:434
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:417
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:406
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:424
c6dofimu6_cfg_t::scl
pin_name_t scl
Definition: c6dofimu6.h:437
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:418
c6dofimu6_s::slave_address
uint8_t slave_address
Definition: c6dofimu6.h:422
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:400