c6dofimu5  2.0.0.0
c6dofimu5.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 C6DOFIMU5_H
36 #define C6DOFIMU5_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 C6DOFIMU5_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 C6DOFIMU5_RETVAL uint8_t
83 
84 #define C6DOFIMU5_OK 0x00
85 #define C6DOFIMU5_INIT_ERROR 0xFF
86 
92 #define C6DOFIMU5_I2C_SLAVE_ADR 0x63
93 
99 #define C6DOFIMU5_READ_BIT_MASK 0x80
100 #define C6DOFIMU5_WRITE_BIT_MASK 0x7F
101 
107 #define C6DOFIMU5_SELF_TEST_X_GYRO 0x00
108 #define C6DOFIMU5_SELF_TEST_Y_GYRO 0x01
109 #define C6DOFIMU5_SELF_TEST_Z_GYRO 0x02
110 #define C6DOFIMU5_SELF_TEST_X_ACCEL 0x0D
111 #define C6DOFIMU5_SELF_TEST_Y_ACCEL 0x0E
112 #define C6DOFIMU5_SELF_TEST_Z_ACCEL 0x0F
113 #define C6DOFIMU5_XG_OFFS_USR_H 0x13
114 #define C6DOFIMU5_XG_OFFS_USR_L 0x14
115 #define C6DOFIMU5_YG_OFFS_USR_H 0x15
116 #define C6DOFIMU5_YG_OFFS_USR_L 0x16
117 #define C6DOFIMU5_ZG_OFFS_USR_H 0x17
118 #define C6DOFIMU5_ZG_OFFS_USR_L 0x18
119 #define C6DOFIMU5_SMPL_RT_DIV 0x19
120 #define C6DOFIMU5_CFG 0x1A
121 #define C6DOFIMU5_GYRO_CFG 0x1B
122 #define C6DOFIMU5_ACCEL_CFG 0x1C
123 #define C6DOFIMU5_ACCEL_CFG_2 0x1D
124 #define C6DOFIMU5_LP_MODE_CTL 0x1E
125 #define C6DOFIMU5_ACCEL_WOM_X_THR 0x20
126 #define C6DOFIMU5_ACCEL_WOM_Y_THR 0x21
127 #define C6DOFIMU5_ACCEL_WOM_Z_THR 0x22
128 #define C6DOFIMU5_FIFO_EN 0x23
129 #define C6DOFIMU5_INT_PIN_CFG 0x37
130 #define C6DOFIMU5_INT_ENABLE 0x38
131 #define C6DOFIMU5_DMP_INT_STAT 0x39
132 #define C6DOFIMU5_INT_STAT 0x3A
133 #define C6DOFIMU5_ACCEL_XOUT_H 0x3B
134 #define C6DOFIMU5_ACCEL_XOUT_L 0x3C
135 #define C6DOFIMU5_ACCEL_YOUT_H 0x3D
136 #define C6DOFIMU5_ACCEL_YOUT_L 0x3E
137 #define C6DOFIMU5_ACCEL_ZOUT_H 0x3F
138 #define C6DOFIMU5_ACCEL_ZOUT_L 0x40
139 #define C6DOFIMU5_TEMP_OUT_H 0x41
140 #define C6DOFIMU5_TEMP_OUT_L 0x42
141 #define C6DOFIMU5_GYRO_XOUT_H 0x43
142 #define C6DOFIMU5_GYRO_XOUT_L 0x44
143 #define C6DOFIMU5_GYRO_YOUT_H 0x45
144 #define C6DOFIMU5_GYRO_YOUT_L 0x46
145 #define C6DOFIMU5_GYRO_ZOUT_H 0x47
146 #define C6DOFIMU5_GYRO_ZOUT_L 0x48
147 #define C6DOFIMU5_SIGNAL_PATH_RST 0x68
148 #define C6DOFIMU5_ACCEL_INTEL_CTL 0x69
149 #define C6DOFIMU5_USER_CTL 0x6A
150 #define C6DOFIMU5_PWR_MGMT_1 0x6B
151 #define C6DOFIMU5_PWR_MGMT_2 0x6C
152 #define C6DOFIMU5_FIFO_CNT_H 0x72
153 #define C6DOFIMU5_FIFO_CNT_L 0x73
154 #define C6DOFIMU5_FIFO_R_W 0x74
155 #define C6DOFIMU5_WHO_AM_I 0x75
156 #define C6DOFIMU5_XA_OFFS_H 0x77
157 #define C6DOFIMU5_XA_OFFS_L 0x78
158 #define C6DOFIMU5_YA_OFFS_H 0x7A
159 #define C6DOFIMU5_YA_OFFS_L 0x7B
160 #define C6DOFIMU5_ZA_OFFS_H 0x7D
161 #define C6DOFIMU5_ZA_OFFS_L 0x7E
162 
168 #define C6DOFIMU5_CFG_FIFO_MODE 0x40
169 #define C6DOFIMU5_CFG_EXT_SYNC_SET_1 0x08
170 #define C6DOFIMU5_CFG_EXT_SYNC_SET_2 0x10
171 #define C6DOFIMU5_CFG_EXT_SYNC_SET_3 0x18
172 #define C6DOFIMU5_CFG_EXT_SYNC_SET_4 0x20
173 #define C6DOFIMU5_CFG_EXT_SYNC_SET_5 0x28
174 #define C6DOFIMU5_CFG_EXT_SYNC_SET_6 0x30
175 #define C6DOFIMU5_CFG_EXT_SYNC_SET_7 0x38
176 #define C6DOFIMU5_CFG_DLPF_CFG_0 0x00
177 #define C6DOFIMU5_CFG_DLPF_CFG_1 0x01
178 #define C6DOFIMU5_CFG_DLPF_CFG_2 0x02
179 #define C6DOFIMU5_CFG_DLPF_CFG_3 0x03
180 #define C6DOFIMU5_CFG_DLPF_CFG_4 0x04
181 #define C6DOFIMU5_CFG_DLPF_CFG_5 0x05
182 #define C6DOFIMU5_CFG_DLPF_CFG_6 0x06
183 #define C6DOFIMU5_CFG_DLPF_CFG_7 0x07
184 
190 #define C6DOFIMU5_GYRO_CFG_XGYRO_STEN 0x80
191 #define C6DOFIMU5_GYRO_CFG_YGYRO_STEN 0x40
192 #define C6DOFIMU5_GYRO_CFG_ZGYRO_STEN 0x20
193 #define C6DOFIMU5_GYRO_CFG_FS_SEL_2000 0x18
194 #define C6DOFIMU5_GYRO_CFG_FS_SEL_1000 0x10
195 #define C6DOFIMU5_GYRO_CFG_FS_SEL_500 0x08
196 #define C6DOFIMU5_GYRO_CFG_FS_SEL_250 0x00
197 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_2 0x02
198 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_1 0x01
199 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_0 0x00
200 
206 #define C6DOFIMU5_ACCEL_CFG_AX_ST_EN 0x80
207 #define C6DOFIMU5_ACCEL_CFG_AY_ST_EN 0x40
208 #define C6DOFIMU5_ACCEL_CFG_AZ_ST_EN 0x20
209 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_16G 0x18
210 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_8G 0x10
211 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_4G 0x08
212 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_2G 0x00
213 
219 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_4KB 0x40
220 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_2KB 0x08
221 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_1KB 0x10
222 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_512B 0x18
223 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_32 0x30
224 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_16 0x20
225 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_8 0x10
226 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_4 0x00
227 #define C6DOFIMU5_ACCEL2_CFG_FCHOICE_B 0x00
228 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_0 0x00
229 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_1 0x01
230 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_2 0x02
231 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_3 0x03
232 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_4 0x04
233 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_5 0x05
234 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_6 0x06
235 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_7 0x07
236 
242 #define C6DOFIMU5_FIFO_EN_TEMP_OUT 0x80
243 #define C6DOFIMU5_FIFO_EN_GYRO_XOUT 0x40
244 #define C6DOFIMU5_FIFO_EN_GYRO_YOUT 0x20
245 #define C6DOFIMU5_FIFO_EN_GYRO_ZOUT 0x10
246 #define C6DOFIMU5_FIFO_EN_ACCEL_XYZ_OUT 0x08
247 
253 #define C6DOFIMU5_INT_PIN_CFG_ACTL 0x80
254 #define C6DOFIMU5_INT_PIN_CFG_OPEN 0x40
255 #define C6DOFIMU5_INT_PIN_CFG_LATCH_INT_EN 0x20
256 #define C6DOFIMU5_INT_PIN_CFG_INT_ANYRD_2CLR 0x10
257 #define C6DOFIMU5_INT_PIN_CFG_ACTL_FSYNC 0x08
258 #define C6DOFIMU5_INT_PIN_CFG_FSYNC_INT_MODE_EN 0x04
259 #define C6DOFIMU5_INT_PIN_CFG_BYPASS_EN 0x02
260 
266 #define C6DOFIMU5_INT_ENABLE_WOM_X_INT_EN 0x80
267 #define C6DOFIMU5_INT_ENABLE_WOM_Y_INT_EN 0x40
268 #define C6DOFIMU5_INT_ENABLE_WOM_Z_INT_EN 0x20
269 #define C6DOFIMU5_INT_ENABLE_FIFO_OVF_EN 0x10
270 #define C6DOFIMU5_INT_ENABLE_GDRIVE_RDY_EN 0x04
271 #define C6DOFIMU5_INT_ENABLE_DMP_INT_EN 0x02
272 #define C6DOFIMU5_INT_ENABLE_RAW_RDY_EN 0x01
273 
279 #define C6DOFIMU5_INT_STAT_WOM_X_INT 0x80
280 #define C6DOFIMU5_INT_STAT_WOM_Y_INT 0x40
281 #define C6DOFIMU5_INT_STAT_WOM_Z_INT 0x20
282 #define C6DOFIMU5_INT_STAT_FIFO_OVF_INT 0x10
283 #define C6DOFIMU5_INT_STAT_GDRIVE_RDY_INT 0x04
284 #define C6DOFIMU5_INT_STAT_DMP_INT 0x02
285 #define C6DOFIMU5_INT_STAT_RAW_RDY_INT 0x01
286 
292 #define C6DOFIMU5_SIGNAL_PATH_RST_GYRO_RST 0x80
293 #define C6DOFIMU5_SIGNAL_PATH_RST_ACCEL_RST 0x40
294 #define C6DOFIMU5_SIGNAL_PATH_RST_TEMP_RST 0x20
295 
301 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_EN 0x80
302 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_PREV_SAMP 0x40
303 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_FIRST_SAMP 0x00
304 
310 #define C6DOFIMU5_USER_CTL_DMP_EN 0x80
311 #define C6DOFIMU5_USER_CTL_FIFO_EN 0x40
312 #define C6DOFIMU5_USER_CTL_I2C_IF_DIS 0x10
313 #define C6DOFIMU5_USER_CTL_DMP_RST 0x08
314 #define C6DOFIMU5_USER_CTL_FIFO_RST 0x04
315 #define C6DOFIMU5_USER_CTL_SIG_COND_RST 0x01
316 
322 #define C6DOFIMU5_PWR_MGMT_1_DEV_RST 0x80
323 #define C6DOFIMU5_PWR_MGMT_1_SLEEP 0x40
324 #define C6DOFIMU5_PWR_MGMT_1_ACCEL_CYC 0x20
325 #define C6DOFIMU5_PWR_MGMT_1_GYRO_STDBY 0x10
326 #define C6DOFIMU5_PWR_MGMT_1_TEMP_DIS 0x08
327 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_7 0x07
328 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_6 0x06
329 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_5 0x05
330 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_4 0x04
331 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_3 0x03
332 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_2 0x02
333 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_1 0x01
334 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_0 0x00
335 
341 #define C6DOFIMU5_PWR_MGMT_2_LP_DIS 0x80
342 #define C6DOFIMU5_PWR_MGMT_2_DMP_LP_DIS 0x40
343 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_XA 0x20
344 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_YA 0x10
345 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZA 0x08
346 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_XG 0x04
347 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_YG 0x02
348 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZG 0x01
349 
355 #define C6DOFIMU5_WHO_AM_I_VAL 0x03
356 
362 #define C6DOFIMU5_MEAS_CMD_LP_TRANS_T_FIRST 0x609C
363 #define C6DOFIMU5_MEAS_CMD_N_TRANS_T_FIRST 0x6825
364 #define C6DOFIMU5_MEAS_CMD_LN_TRANS_T_FIRST 0x70DF
365 #define C6DOFIMU5_MEAS_CMD_ULN_TRANS_T_FIRST 0x7866
366 #define C6DOFIMU5_MEAS_CMD_LP_TRANS_P_FIRST 0x401A
367 #define C6DOFIMU5_MEAS_CMD_N_TRANS_P_FIRST 0x48A3
368 #define C6DOFIMU5_MEAS_CMD_LN_TRANS_P_FIRST 0x5059
369 #define C6DOFIMU5_MEAS_CMD_ULN_TRANS_P_FIRST 0x58E0
370 #define C6DOFIMU5_DEVICE_SOFT_RESET_CMD 0x805D
371 #define C6DOFIMU5_READ_ID_REGISTER 0xEFC8
372 #define C6DOFIMU5_INCREMENTAL_READ 0xC7F7
373 #define C6DOFIMU5_ADR_REG_MOVE_POINTER 0xC595
374 
380 #define C6DOFIMU5_POWER_ON 0x01
381 #define C6DOFIMU5_POWER_OFF 0x00
382 
388 #define C6DOFIMU5_GYRO_SENS_FS_SEL_2000 16.4
389 #define C6DOFIMU5_GYRO_SENS_FS_SEL_1000 32.8
390 #define C6DOFIMU5_GYRO_SENS_FS_SEL_500 65.5
391 #define C6DOFIMU5_GYRO_SENS_FS_SEL_250 131.0
392 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_16G 2048.0
393 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_8G 4096.0
394 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_4G 8192.0
395 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_2G 16384.0
396 
402 #define C6DOFIMU5_LUT_LOWER 3670016.0
403 #define C6DOFIMU5_LUT_UPPER 12058624.0
404 #define C6DOFIMU5_QUADR_FACTOR 0.000000059604644775390625
405 #define C6DOFIMU5_OFFST_FACTOR 2048.0
406 #define C6DOFIMU5_P_PA_CALIB_0 45000.0
407 #define C6DOFIMU5_P_PA_CALIB_1 80000.0
408 #define C6DOFIMU5_P_PA_CALIB_2 105000.0
409  // End group macro
412 // --------------------------------------------------------------- PUBLIC TYPES
418 typedef struct
419 {
420  uint32_t p_raw;
421  uint16_t t_raw;
422  float pressure;
423  float temperature;
425 
429 typedef struct c6dofimu5_s
430 {
431  // Input pins
432 
433  digital_out_t cs;
434  digital_in_t int_pin;
435 
436  // Modules
437 
438  i2c_master_t i2c;
439  spi_master_t spi;
440 
441  // ctx variable
442 
443  uint8_t slave_address;
444  pin_name_t chip_select;
445 
450 
452 
456 typedef struct
457 {
458  // Communication gpio pins
459 
460  pin_name_t scl;
461  pin_name_t sda;
462  pin_name_t miso;
463  pin_name_t mosi;
464  pin_name_t sck;
465  pin_name_t cs;
466 
467  // Additional gpio pins
468 
469  pin_name_t int_pin;
470 
471  // static variable
472 
473  uint32_t i2c_speed;
474  uint8_t i2c_address;
475 
476  uint32_t spi_speed;
477  spi_master_mode_t spi_mode;
478  spi_master_chip_select_polarity_t cs_polarity;
479 
481  // End types group
483 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
489 #ifdef __cplusplus
490 extern "C"{
491 #endif
492 
502 
512 
521 
533 void c6dofimu5_write_bytes ( c6dofimu5_t *ctx, uint8_t reg, uint8_t *wr_data, uint16_t n_bytes );
534 
546 void c6dofimu5_read_bytes ( c6dofimu5_t *ctx, uint8_t reg, uint8_t *rd_data, uint16_t n_bytes );
547 
557 void c6dofimu5_power ( c6dofimu5_t *ctx, uint8_t on_off );
558 
567 
576 
585 
596 void c6dofimu5_read_gyroscope ( c6dofimu5_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z );
597 
608 void c6dofimu5_angular_rate ( c6dofimu5_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte );
609 
618 
627 
636 
647 void c6dofimu5_read_accelerometer ( c6dofimu5_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z );
648 
659 void c6dofimu5_acceleration_rate ( c6dofimu5_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte );
660 
669 
680 void c6dofimu5_baro_read ( c6dofimu5_t *ctx, uint16_t cmd, uint8_t *data_out, uint16_t n_bytes );
681 
691 void c6dofimu5_baro_write ( c6dofimu5_t *ctx, uint8_t *data_in, uint16_t n_bytes );
692 
703 
712 
721 
732 
742 void c6dofimu5_read_raw_data ( c6dofimu5_t *ctx, uint32_t *pres, uint16_t *temp );
743 
752 
753 #ifdef __cplusplus
754 }
755 #endif
756 #endif // _C6DOFIMU5_H_
757  // End public_function group
760 
761 // ------------------------------------------------------------------------- END
c6dofimu5_s::chip_select
pin_name_t chip_select
Definition: c6dofimu5.h:444
c6dofimu5_power
void c6dofimu5_power(c6dofimu5_t *ctx, uint8_t on_off)
Power up function.
c6dofimu5_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu5.h:478
c6dofimu5_baro_read
void c6dofimu5_baro_read(c6dofimu5_t *ctx, uint16_t cmd, uint8_t *data_out, uint16_t n_bytes)
Barometer Read function.
c6dofimu5_s
Click ctx object definition.
Definition: c6dofimu5.h:430
c6dofimu5_read_gyro_z
int16_t c6dofimu5_read_gyro_z(c6dofimu5_t *ctx)
Read Gyroscope Z-axis data function.
c6dofimu5_read_raw_data
void c6dofimu5_read_raw_data(c6dofimu5_t *ctx, uint32_t *pres, uint16_t *temp)
Read raw data function.
c6dofimu5_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: c6dofimu5.h:477
c6dofimu5_baro_write
void c6dofimu5_baro_write(c6dofimu5_t *ctx, uint8_t *data_in, uint16_t n_bytes)
Barometer Write function.
c6dofimu5_process_data_t::temperature
float temperature
Definition: c6dofimu5.h:423
c6dofimu5_s::i2c
i2c_master_t i2c
Definition: c6dofimu5.h:438
c6dofimu5_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu5.h:463
c6dofimu5_read_bytes
void c6dofimu5_read_bytes(c6dofimu5_t *ctx, uint8_t reg, uint8_t *rd_data, uint16_t n_bytes)
Generic read function.
c6dofimu5_read_gyro_x
int16_t c6dofimu5_read_gyro_x(c6dofimu5_t *ctx)
Read Gyroscope X-axis data function.
c6dofimu5_process_data_t
Definition: c6dofimu5.h:419
c6dofimu5_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu5.h:473
c6dofimu5_read_temp_out
float c6dofimu5_read_temp_out(c6dofimu5_t *ctx)
Read temperture function.
c6dofimu5_default_cfg
void c6dofimu5_default_cfg(c6dofimu5_t *ctx)
Click Default Configuration function.
c6dofimu5_s::sens_const_1
float sens_const_1
Definition: c6dofimu5.h:447
c6dofimu5_angular_rate
void c6dofimu5_angular_rate(c6dofimu5_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte)
Read Angular Rate function.
c6dofimu5_read_accelerometer
void c6dofimu5_read_accelerometer(c6dofimu5_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z)
Read accelerometer data function.
c6dofimu5_write_bytes
void c6dofimu5_write_bytes(c6dofimu5_t *ctx, uint8_t reg, uint8_t *wr_data, uint16_t n_bytes)
Generic write function.
c6dofimu5_s::sens_const_2
float sens_const_2
Definition: c6dofimu5.h:448
c6dofimu5_cfg_t
Click configuration structure definition.
Definition: c6dofimu5.h:457
c6dofimu5_process_data
void c6dofimu5_process_data(c6dofimu5_t *ctx, c6dofimu5_process_data_t *process_d)
Process data function.
c6dofimu5_process_data_t::pressure
float pressure
Definition: c6dofimu5.h:422
c6dofimu5_baro_soft_rst
void c6dofimu5_baro_soft_rst(c6dofimu5_t *ctx)
Soft Reset Command function.
c6dofimu5_process_data_t::t_raw
uint16_t t_raw
Definition: c6dofimu5.h:421
c6dofimu5_cfg_t::cs
pin_name_t cs
Definition: c6dofimu5.h:465
c6dofimu5_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu5.h:476
c6dofimu5_baro_id_read
uint8_t c6dofimu5_baro_id_read(c6dofimu5_t *ctx)
Barometer ID Readout function.
c6dofimu5_read_accel_x
int16_t c6dofimu5_read_accel_x(c6dofimu5_t *ctx)
Read Accelerometer X-axis data function.
c6dofimu5_cfg_t::sda
pin_name_t sda
Definition: c6dofimu5.h:461
c6dofimu5_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu5.h:474
c6dofimu5_process_data_t::p_raw
uint32_t p_raw
Definition: c6dofimu5.h:420
c6dofimu5_baro_settings
void c6dofimu5_baro_settings(c6dofimu5_t *ctx)
I2C Barometer Settings function.
c6dofimu5_cfg_setup
void c6dofimu5_cfg_setup(c6dofimu5_cfg_t *cfg)
Config Object Initialization function.
c6dofimu5_s::spi
spi_master_t spi
Definition: c6dofimu5.h:439
c6dofimu5_cfg_t::scl
pin_name_t scl
Definition: c6dofimu5.h:460
c6dofimu5_cfg_t::sck
pin_name_t sck
Definition: c6dofimu5.h:464
c6dofimu5_read_accel_y
int16_t c6dofimu5_read_accel_y(c6dofimu5_t *ctx)
Read Accelerometer Y-axis data function.
c6dofimu5_cfg_t::miso
pin_name_t miso
Definition: c6dofimu5.h:462
c6dofimu5_read_gyro_y
int16_t c6dofimu5_read_gyro_y(c6dofimu5_t *ctx)
Read Gyroscope Y-axis data function.
c6dofimu5_s::sens_const_0
float sens_const_0
Definition: c6dofimu5.h:446
c6dofimu5_read_accel_z
int16_t c6dofimu5_read_accel_z(c6dofimu5_t *ctx)
Read Accelerometer Z-axis data function.
c6dofimu5_read_gyroscope
void c6dofimu5_read_gyroscope(c6dofimu5_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
Read gyroscope data function.
c6dofimu5_s::slave_address
uint8_t slave_address
Definition: c6dofimu5.h:443
c6dofimu5_s::int_pin
digital_in_t int_pin
Definition: c6dofimu5.h:434
C6DOFIMU5_RETVAL
#define C6DOFIMU5_RETVAL
Definition: c6dofimu5.h:82
c6dofimu5_s::cs
digital_out_t cs
Definition: c6dofimu5.h:433
c6dofimu5_s::sens_const_3
float sens_const_3
Definition: c6dofimu5.h:449
c6dofimu5_acceleration_rate
void c6dofimu5_acceleration_rate(c6dofimu5_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte)
Read acceleration Rate function.
c6dofimu5_t
struct c6dofimu5_s c6dofimu5_t
Click ctx object definition.
c6dofimu5_init
C6DOFIMU5_RETVAL c6dofimu5_init(c6dofimu5_t *ctx, c6dofimu5_cfg_t *cfg)
Initialization function.
c6dofimu5_cfg_t::int_pin
pin_name_t int_pin
Definition: c6dofimu5.h:469
c6dofimu5_check_int_pin
uint8_t c6dofimu5_check_int_pin(c6dofimu5_t *ctx)
Check Interrupt state function.