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 
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 C6DOFIMU5_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.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
61  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
62 
68 #define C6DOFIMU5_RETVAL uint8_t
69 
70 #define C6DOFIMU5_OK 0x00
71 #define C6DOFIMU5_INIT_ERROR 0xFF
72 
78 #define C6DOFIMU5_I2C_SLAVE_ADR 0x63
79 
85 #define C6DOFIMU5_READ_BIT_MASK 0x80
86 #define C6DOFIMU5_WRITE_BIT_MASK 0x7F
87 
93 #define C6DOFIMU5_SELF_TEST_X_GYRO 0x00
94 #define C6DOFIMU5_SELF_TEST_Y_GYRO 0x01
95 #define C6DOFIMU5_SELF_TEST_Z_GYRO 0x02
96 #define C6DOFIMU5_SELF_TEST_X_ACCEL 0x0D
97 #define C6DOFIMU5_SELF_TEST_Y_ACCEL 0x0E
98 #define C6DOFIMU5_SELF_TEST_Z_ACCEL 0x0F
99 #define C6DOFIMU5_XG_OFFS_USR_H 0x13
100 #define C6DOFIMU5_XG_OFFS_USR_L 0x14
101 #define C6DOFIMU5_YG_OFFS_USR_H 0x15
102 #define C6DOFIMU5_YG_OFFS_USR_L 0x16
103 #define C6DOFIMU5_ZG_OFFS_USR_H 0x17
104 #define C6DOFIMU5_ZG_OFFS_USR_L 0x18
105 #define C6DOFIMU5_SMPL_RT_DIV 0x19
106 #define C6DOFIMU5_CFG 0x1A
107 #define C6DOFIMU5_GYRO_CFG 0x1B
108 #define C6DOFIMU5_ACCEL_CFG 0x1C
109 #define C6DOFIMU5_ACCEL_CFG_2 0x1D
110 #define C6DOFIMU5_LP_MODE_CTL 0x1E
111 #define C6DOFIMU5_ACCEL_WOM_X_THR 0x20
112 #define C6DOFIMU5_ACCEL_WOM_Y_THR 0x21
113 #define C6DOFIMU5_ACCEL_WOM_Z_THR 0x22
114 #define C6DOFIMU5_FIFO_EN 0x23
115 #define C6DOFIMU5_INT_PIN_CFG 0x37
116 #define C6DOFIMU5_INT_ENABLE 0x38
117 #define C6DOFIMU5_DMP_INT_STAT 0x39
118 #define C6DOFIMU5_INT_STAT 0x3A
119 #define C6DOFIMU5_ACCEL_XOUT_H 0x3B
120 #define C6DOFIMU5_ACCEL_XOUT_L 0x3C
121 #define C6DOFIMU5_ACCEL_YOUT_H 0x3D
122 #define C6DOFIMU5_ACCEL_YOUT_L 0x3E
123 #define C6DOFIMU5_ACCEL_ZOUT_H 0x3F
124 #define C6DOFIMU5_ACCEL_ZOUT_L 0x40
125 #define C6DOFIMU5_TEMP_OUT_H 0x41
126 #define C6DOFIMU5_TEMP_OUT_L 0x42
127 #define C6DOFIMU5_GYRO_XOUT_H 0x43
128 #define C6DOFIMU5_GYRO_XOUT_L 0x44
129 #define C6DOFIMU5_GYRO_YOUT_H 0x45
130 #define C6DOFIMU5_GYRO_YOUT_L 0x46
131 #define C6DOFIMU5_GYRO_ZOUT_H 0x47
132 #define C6DOFIMU5_GYRO_ZOUT_L 0x48
133 #define C6DOFIMU5_SIGNAL_PATH_RST 0x68
134 #define C6DOFIMU5_ACCEL_INTEL_CTL 0x69
135 #define C6DOFIMU5_USER_CTL 0x6A
136 #define C6DOFIMU5_PWR_MGMT_1 0x6B
137 #define C6DOFIMU5_PWR_MGMT_2 0x6C
138 #define C6DOFIMU5_FIFO_CNT_H 0x72
139 #define C6DOFIMU5_FIFO_CNT_L 0x73
140 #define C6DOFIMU5_FIFO_R_W 0x74
141 #define C6DOFIMU5_WHO_AM_I 0x75
142 #define C6DOFIMU5_XA_OFFS_H 0x77
143 #define C6DOFIMU5_XA_OFFS_L 0x78
144 #define C6DOFIMU5_YA_OFFS_H 0x7A
145 #define C6DOFIMU5_YA_OFFS_L 0x7B
146 #define C6DOFIMU5_ZA_OFFS_H 0x7D
147 #define C6DOFIMU5_ZA_OFFS_L 0x7E
148 
154 #define C6DOFIMU5_CFG_FIFO_MODE 0x40
155 #define C6DOFIMU5_CFG_EXT_SYNC_SET_1 0x08
156 #define C6DOFIMU5_CFG_EXT_SYNC_SET_2 0x10
157 #define C6DOFIMU5_CFG_EXT_SYNC_SET_3 0x18
158 #define C6DOFIMU5_CFG_EXT_SYNC_SET_4 0x20
159 #define C6DOFIMU5_CFG_EXT_SYNC_SET_5 0x28
160 #define C6DOFIMU5_CFG_EXT_SYNC_SET_6 0x30
161 #define C6DOFIMU5_CFG_EXT_SYNC_SET_7 0x38
162 #define C6DOFIMU5_CFG_DLPF_CFG_0 0x00
163 #define C6DOFIMU5_CFG_DLPF_CFG_1 0x01
164 #define C6DOFIMU5_CFG_DLPF_CFG_2 0x02
165 #define C6DOFIMU5_CFG_DLPF_CFG_3 0x03
166 #define C6DOFIMU5_CFG_DLPF_CFG_4 0x04
167 #define C6DOFIMU5_CFG_DLPF_CFG_5 0x05
168 #define C6DOFIMU5_CFG_DLPF_CFG_6 0x06
169 #define C6DOFIMU5_CFG_DLPF_CFG_7 0x07
170 
176 #define C6DOFIMU5_GYRO_CFG_XGYRO_STEN 0x80
177 #define C6DOFIMU5_GYRO_CFG_YGYRO_STEN 0x40
178 #define C6DOFIMU5_GYRO_CFG_ZGYRO_STEN 0x20
179 #define C6DOFIMU5_GYRO_CFG_FS_SEL_2000 0x18
180 #define C6DOFIMU5_GYRO_CFG_FS_SEL_1000 0x10
181 #define C6DOFIMU5_GYRO_CFG_FS_SEL_500 0x08
182 #define C6DOFIMU5_GYRO_CFG_FS_SEL_250 0x00
183 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_2 0x02
184 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_1 0x01
185 #define C6DOFIMU5_GYRO_CFG_FCHOICE_B_0 0x00
186 
192 #define C6DOFIMU5_ACCEL_CFG_AX_ST_EN 0x80
193 #define C6DOFIMU5_ACCEL_CFG_AY_ST_EN 0x40
194 #define C6DOFIMU5_ACCEL_CFG_AZ_ST_EN 0x20
195 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_16G 0x18
196 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_8G 0x10
197 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_4G 0x08
198 #define C6DOFIMU5_ACCEL_CFG_FS_SEL_2G 0x00
199 
205 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_4KB 0x40
206 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_2KB 0x08
207 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_1KB 0x10
208 #define C6DOFIMU5_ACCEL2_CFG_FIFO_SIZE_512B 0x18
209 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_32 0x30
210 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_16 0x20
211 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_8 0x10
212 #define C6DOFIMU5_ACCEL2_CFG_DEC2_CFG_4 0x00
213 #define C6DOFIMU5_ACCEL2_CFG_FCHOICE_B 0x00
214 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_0 0x00
215 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_1 0x01
216 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_2 0x02
217 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_3 0x03
218 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_4 0x04
219 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_5 0x05
220 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_6 0x06
221 #define C6DOFIMU5_ACCEL2_CFG_A_DLPF_CFG_7 0x07
222 
228 #define C6DOFIMU5_FIFO_EN_TEMP_OUT 0x80
229 #define C6DOFIMU5_FIFO_EN_GYRO_XOUT 0x40
230 #define C6DOFIMU5_FIFO_EN_GYRO_YOUT 0x20
231 #define C6DOFIMU5_FIFO_EN_GYRO_ZOUT 0x10
232 #define C6DOFIMU5_FIFO_EN_ACCEL_XYZ_OUT 0x08
233 
239 #define C6DOFIMU5_INT_PIN_CFG_ACTL 0x80
240 #define C6DOFIMU5_INT_PIN_CFG_OPEN 0x40
241 #define C6DOFIMU5_INT_PIN_CFG_LATCH_INT_EN 0x20
242 #define C6DOFIMU5_INT_PIN_CFG_INT_ANYRD_2CLR 0x10
243 #define C6DOFIMU5_INT_PIN_CFG_ACTL_FSYNC 0x08
244 #define C6DOFIMU5_INT_PIN_CFG_FSYNC_INT_MODE_EN 0x04
245 #define C6DOFIMU5_INT_PIN_CFG_BYPASS_EN 0x02
246 
252 #define C6DOFIMU5_INT_ENABLE_WOM_X_INT_EN 0x80
253 #define C6DOFIMU5_INT_ENABLE_WOM_Y_INT_EN 0x40
254 #define C6DOFIMU5_INT_ENABLE_WOM_Z_INT_EN 0x20
255 #define C6DOFIMU5_INT_ENABLE_FIFO_OVF_EN 0x10
256 #define C6DOFIMU5_INT_ENABLE_GDRIVE_RDY_EN 0x04
257 #define C6DOFIMU5_INT_ENABLE_DMP_INT_EN 0x02
258 #define C6DOFIMU5_INT_ENABLE_RAW_RDY_EN 0x01
259 
265 #define C6DOFIMU5_INT_STAT_WOM_X_INT 0x80
266 #define C6DOFIMU5_INT_STAT_WOM_Y_INT 0x40
267 #define C6DOFIMU5_INT_STAT_WOM_Z_INT 0x20
268 #define C6DOFIMU5_INT_STAT_FIFO_OVF_INT 0x10
269 #define C6DOFIMU5_INT_STAT_GDRIVE_RDY_INT 0x04
270 #define C6DOFIMU5_INT_STAT_DMP_INT 0x02
271 #define C6DOFIMU5_INT_STAT_RAW_RDY_INT 0x01
272 
278 #define C6DOFIMU5_SIGNAL_PATH_RST_GYRO_RST 0x80
279 #define C6DOFIMU5_SIGNAL_PATH_RST_ACCEL_RST 0x40
280 #define C6DOFIMU5_SIGNAL_PATH_RST_TEMP_RST 0x20
281 
287 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_EN 0x80
288 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_PREV_SAMP 0x40
289 #define C6DOFIMU5_ACCEL_INTEL_CTL_INTEL_MODE_FIRST_SAMP 0x00
290 
296 #define C6DOFIMU5_USER_CTL_DMP_EN 0x80
297 #define C6DOFIMU5_USER_CTL_FIFO_EN 0x40
298 #define C6DOFIMU5_USER_CTL_I2C_IF_DIS 0x10
299 #define C6DOFIMU5_USER_CTL_DMP_RST 0x08
300 #define C6DOFIMU5_USER_CTL_FIFO_RST 0x04
301 #define C6DOFIMU5_USER_CTL_SIG_COND_RST 0x01
302 
308 #define C6DOFIMU5_PWR_MGMT_1_DEV_RST 0x80
309 #define C6DOFIMU5_PWR_MGMT_1_SLEEP 0x40
310 #define C6DOFIMU5_PWR_MGMT_1_ACCEL_CYC 0x20
311 #define C6DOFIMU5_PWR_MGMT_1_GYRO_STDBY 0x10
312 #define C6DOFIMU5_PWR_MGMT_1_TEMP_DIS 0x08
313 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_7 0x07
314 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_6 0x06
315 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_5 0x05
316 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_4 0x04
317 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_3 0x03
318 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_2 0x02
319 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_1 0x01
320 #define C6DOFIMU5_PWR_MGMT_1_CLKSEL_0 0x00
321 
327 #define C6DOFIMU5_PWR_MGMT_2_LP_DIS 0x80
328 #define C6DOFIMU5_PWR_MGMT_2_DMP_LP_DIS 0x40
329 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_XA 0x20
330 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_YA 0x10
331 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZA 0x08
332 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_XG 0x04
333 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_YG 0x02
334 #define C6DOFIMU5_PWR_MGMT_2_DISABLE_ZG 0x01
335 
341 #define C6DOFIMU5_WHO_AM_I_VAL 0x03
342 
348 #define C6DOFIMU5_MEAS_CMD_LP_TRANS_T_FIRST 0x609C
349 #define C6DOFIMU5_MEAS_CMD_N_TRANS_T_FIRST 0x6825
350 #define C6DOFIMU5_MEAS_CMD_LN_TRANS_T_FIRST 0x70DF
351 #define C6DOFIMU5_MEAS_CMD_ULN_TRANS_T_FIRST 0x7866
352 #define C6DOFIMU5_MEAS_CMD_LP_TRANS_P_FIRST 0x401A
353 #define C6DOFIMU5_MEAS_CMD_N_TRANS_P_FIRST 0x48A3
354 #define C6DOFIMU5_MEAS_CMD_LN_TRANS_P_FIRST 0x5059
355 #define C6DOFIMU5_MEAS_CMD_ULN_TRANS_P_FIRST 0x58E0
356 #define C6DOFIMU5_DEVICE_SOFT_RESET_CMD 0x805D
357 #define C6DOFIMU5_READ_ID_REGISTER 0xEFC8
358 #define C6DOFIMU5_INCREMENTAL_READ 0xC7F7
359 #define C6DOFIMU5_ADR_REG_MOVE_POINTER 0xC595
360 
366 #define C6DOFIMU5_POWER_ON 0x01
367 #define C6DOFIMU5_POWER_OFF 0x00
368 
374 #define C6DOFIMU5_GYRO_SENS_FS_SEL_2000 16.4
375 #define C6DOFIMU5_GYRO_SENS_FS_SEL_1000 32.8
376 #define C6DOFIMU5_GYRO_SENS_FS_SEL_500 65.5
377 #define C6DOFIMU5_GYRO_SENS_FS_SEL_250 131.0
378 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_16G 2048.0
379 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_8G 4096.0
380 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_4G 8192.0
381 #define C6DOFIMU5_ACCEL_SENS_FS_SEL_2G 16384.0
382 
388 #define C6DOFIMU5_LUT_LOWER 3670016.0
389 #define C6DOFIMU5_LUT_UPPER 12058624.0
390 #define C6DOFIMU5_QUADR_FACTOR 0.000000059604644775390625
391 #define C6DOFIMU5_OFFST_FACTOR 2048.0
392 #define C6DOFIMU5_P_PA_CALIB_0 45000.0
393 #define C6DOFIMU5_P_PA_CALIB_1 80000.0
394 #define C6DOFIMU5_P_PA_CALIB_2 105000.0
395  // End group macro
398 // --------------------------------------------------------------- PUBLIC TYPES
404 typedef struct
405 {
406  uint32_t p_raw;
407  uint16_t t_raw;
408  float pressure;
409  float temperature;
411 
415 typedef struct c6dofimu5_s
416 {
417  // Input pins
418 
419  digital_out_t cs;
420  digital_in_t int_pin;
421 
422  // Modules
423 
424  i2c_master_t i2c;
425  spi_master_t spi;
426 
427  // ctx variable
428 
429  uint8_t slave_address;
430  pin_name_t chip_select;
431 
436 
437 } c6dofimu5_t;
438 
442 typedef struct
443 {
444  // Communication gpio pins
445 
446  pin_name_t scl;
447  pin_name_t sda;
448  pin_name_t miso;
449  pin_name_t mosi;
450  pin_name_t sck;
451  pin_name_t cs;
452 
453  // Additional gpio pins
454 
455  pin_name_t int_pin;
456 
457  // static variable
458 
459  uint32_t i2c_speed;
460  uint8_t i2c_address;
461 
462  uint32_t spi_speed;
463  spi_master_mode_t spi_mode;
464  spi_master_chip_select_polarity_t cs_polarity;
465 
467  // End types group
469 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
475 #ifdef __cplusplus
476 extern "C"{
477 #endif
478 
488 
498 
506 void c6dofimu5_default_cfg ( c6dofimu5_t *ctx );
507 
519 void c6dofimu5_write_bytes ( c6dofimu5_t *ctx, uint8_t reg, uint8_t *wr_data, uint16_t n_bytes );
520 
532 void c6dofimu5_read_bytes ( c6dofimu5_t *ctx, uint8_t reg, uint8_t *rd_data, uint16_t n_bytes );
533 
543 void c6dofimu5_power ( c6dofimu5_t *ctx, uint8_t on_off );
544 
552 int16_t c6dofimu5_read_gyro_x ( c6dofimu5_t *ctx );
553 
561 int16_t c6dofimu5_read_gyro_y ( c6dofimu5_t *ctx );
562 
570 int16_t c6dofimu5_read_gyro_z ( c6dofimu5_t *ctx );
571 
582 void c6dofimu5_read_gyroscope ( c6dofimu5_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z );
583 
594 void c6dofimu5_angular_rate ( c6dofimu5_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte );
595 
603 int16_t c6dofimu5_read_accel_x ( c6dofimu5_t *ctx );
604 
612 int16_t c6dofimu5_read_accel_y ( c6dofimu5_t *ctx );
613 
621 int16_t c6dofimu5_read_accel_z ( c6dofimu5_t *ctx );
622 
633 void c6dofimu5_read_accelerometer ( c6dofimu5_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z );
634 
645 void c6dofimu5_acceleration_rate ( c6dofimu5_t *ctx, float *x_accel_rte, float *y_accel_rte, float *z_accel_rte );
646 
654 float c6dofimu5_read_temp_out ( c6dofimu5_t *ctx );
655 
666 void c6dofimu5_baro_read ( c6dofimu5_t *ctx, uint16_t cmd, uint8_t *data_out, uint16_t n_bytes );
667 
677 void c6dofimu5_baro_write ( c6dofimu5_t *ctx, uint8_t *data_in, uint16_t n_bytes );
678 
689 
697 uint8_t c6dofimu5_baro_id_read ( c6dofimu5_t *ctx );
698 
707 
718 
728 void c6dofimu5_read_raw_data ( c6dofimu5_t *ctx, uint32_t *pres, uint16_t *temp );
729 
737 uint8_t c6dofimu5_check_int_pin ( c6dofimu5_t *ctx );
738 
739 #ifdef __cplusplus
740 }
741 #endif
742 #endif // _C6DOFIMU5_H_
743  // End public_function group
746 
747 // ------------------------------------------------------------------------- END
c6dofimu5_s::chip_select
pin_name_t chip_select
Definition: c6dofimu5.h:430
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:464
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:415
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:463
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:409
c6dofimu5_s::i2c
i2c_master_t i2c
Definition: c6dofimu5.h:424
c6dofimu5_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu5.h:449
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:404
c6dofimu5_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu5.h:459
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:433
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:434
c6dofimu5_cfg_t
Click configuration structure definition.
Definition: c6dofimu5.h:442
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:408
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:407
c6dofimu5_cfg_t::cs
pin_name_t cs
Definition: c6dofimu5.h:451
c6dofimu5_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu5.h:462
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:447
c6dofimu5_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu5.h:460
c6dofimu5_process_data_t::p_raw
uint32_t p_raw
Definition: c6dofimu5.h:406
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:425
c6dofimu5_cfg_t::scl
pin_name_t scl
Definition: c6dofimu5.h:446
c6dofimu5_cfg_t::sck
pin_name_t sck
Definition: c6dofimu5.h:450
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:448
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:432
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:429
c6dofimu5_s::int_pin
digital_in_t int_pin
Definition: c6dofimu5.h:420
C6DOFIMU5_RETVAL
#define C6DOFIMU5_RETVAL
Definition: c6dofimu5.h:68
c6dofimu5_s::cs
digital_out_t cs
Definition: c6dofimu5.h:419
c6dofimu5_s::sens_const_3
float sens_const_3
Definition: c6dofimu5.h:435
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:455
c6dofimu5_check_int_pin
uint8_t c6dofimu5_check_int_pin(c6dofimu5_t *ctx)
Check Interrupt state function.