c6dofimu4  2.0.0.0
c6dofimu4.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 C6DOFIMU4_H
36 #define C6DOFIMU4_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
63 #define C6DOFIMU4_MAP_MIKROBUS( cfg, mikrobus ) \
64  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
65  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
66  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
67  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
68  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
69  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70  cfg.syn = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
71  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
72 
78 #define C6DOFIMU4_MASTER_I2C 0
79 #define C6DOFIMU4_MASTER_SPI 1
80 
86 #define C6DOFIMU4_RETVAL uint8_t
87 
88 #define C6DOFIMU4_OK 0x00
89 #define C6DOFIMU4_INIT_ERROR 0xFF
90 
96 #define C6DOFIMU4_DEVICE_ADDR 0x68
97 
103 #define C6DOFIMU4_XG_OFFS_TC_REG 0x04
104 #define C6DOFIMU4_YG_OFFS_TC_REG 0x07
105 #define C6DOFIMU4_ZG_OFFS_TC_REG 0x0A
106 #define C6DOFIMU4_SELF_TEST_X_REG 0x0D
107 #define C6DOFIMU4_SELF_TEST_Y_REG 0x0E
108 #define C6DOFIMU4_SELF_TEST_Z_REG 0x0F
109 #define C6DOFIMU4_XG_OFFS_USR_REG 0x13
110 #define C6DOFIMU4_YG_OFFS_USR_REG 0x15
111 #define C6DOFIMU4_ZG_OFFS_USR_REG 0x17
112 #define C6DOFIMU4_SMPLRT_DIV_REG 0x19
113 #define C6DOFIMU4_CONFIG_REG 0x1A
114 #define C6DOFIMU4_GYRO_CONFIG_REG 0x1B
115 #define C6DOFIMU4_ACCEL_CONFIG_REG 0x1C
116 #define C6DOFIMU4_ACCEL_CONFIG2_REG 0x1D
117 #define C6DOFIMU4_LP_MODE_CFG_REG 0x1E
118 #define C6DOFIMU4_ACCEL_WOM_X_THR_REG 0x20
119 #define C6DOFIMU4_ACCEL_WOM_Y_THR_REG 0x21
120 #define C6DOFIMU4_ACCEL_WOM_Z_THR_REG 0x22
121 #define C6DOFIMU4_FIFO_EN_REG 0x23
122 #define C6DOFIMU4_FSYNC_INT_REG 0x36
123 #define C6DOFIMU4_INT_PIN_CFG_REG 0x37
124 #define C6DOFIMU4_INT_ENABLE_REG 0x38
125 #define C6DOFIMU4_FIFO_WM_INT_STATUS_REG 0x39
126 #define C6DOFIMU4_INT_STATUS_REG 0x3A
127 #define C6DOFIMU4_ACCEL_XOUT_REG 0x3B
128 #define C6DOFIMU4_ACCEL_YOUT_REG 0x3D
129 #define C6DOFIMU4_ACCEL_ZOUT_REG 0x3F
130 #define C6DOFIMU4_TEMP_OUT_REG 0x41
131 #define C6DOFIMU4_GYRO_XOUT_REG 0x43
132 #define C6DOFIMU4_GYRO_YOUT_REG 0x45
133 #define C6DOFIMU4_GYRO_ZOUT_REG 0x47
134 #define C6DOFIMU4_SELF_TEST_X_GYRO_REG 0x50
135 #define C6DOFIMU4_SELF_TEST_Y_GYRO_REG 0x51
136 #define C6DOFIMU4_SELF_TEST_Z_GYRO_REG 0x52
137 #define C6DOFIMU4_FIFO_WM_TH_REG 0x60
138 #define C6DOFIMU4_SIGNAL_PATH_RESET_REG 0x68
139 #define C6DOFIMU4_ACCEL_INTEL_CTRL_REG 0x69
140 #define C6DOFIMU4_USER_CTRL_REG 0x6A
141 #define C6DOFIMU4_PWR_MGMT_1_REG 0x6B
142 #define C6DOFIMU4_PWR_MGMT_2_REG 0x6C
143 #define C6DOFIMU4_I2C_IF_REG 0x70
144 #define C6DOFIMU4_FIFO_COUNT_REG 0x72
145 #define C6DOFIMU4_FIFO_R_W_REG 0x74
146 #define C6DOFIMU4_WHO_AM_I_REG 0x75
147 #define C6DOFIMU4_XA_OFFSET_REG 0x77
148 #define C6DOFIMU4_YA_OFFSET_REG 0x7A
149 #define C6DOFIMU4_ZA_OFFSET_REG 0x7D
150 
156 #define C6DOFIMU4_FIFO_REPLACING_DIS 0x40
157 #define C6DOFIMU4_EXT_SYNC_FUNC_DIS 0x00
158 #define C6DOFIMU4_EXT_SYNC_TEMP_OUT_L 0x08
159 #define C6DOFIMU4_EXT_SYNC_GYRO_XOUT_L 0x10
160 #define C6DOFIMU4_EXT_SYNC_GYRO_YOUT_L 0x18
161 #define C6DOFIMU4_EXT_SYNC_GYRO_ZOUT_L 0x20
162 #define C6DOFIMU4_EXT_SYNC_ACCEL_XOUT_L 0x28
163 #define C6DOFIMU4_EXT_SYNC_ACCEL_YOUT_L 0x30
164 #define C6DOFIMU4_EXT_SYNC_ACCEL_ZOUT_L 0x38
165 #define C6DOFIMU4_FCHOICE_8173_HZ 0x01
166 #define C6DOFIMU4_GYRO_FCHOICE_3281_HZ 0x02
167 #define C6DOFIMU4_G_DLPF_CFG_250_HZ 0x00
168 #define C6DOFIMU4_G_DLPF_CFG_176_HZ 0x01
169 #define C6DOFIMU4_G_DLPF_CFG_92_HZ 0x02
170 #define C6DOFIMU4_G_DLPF_CFG_41_HZ 0x03
171 #define C6DOFIMU4_G_DLPF_CFG_20_HZ 0x04
172 #define C6DOFIMU4_G_DLPF_CFG_10_HZ 0x05
173 #define C6DOFIMU4_G_DLPF_CFG_5_HZ 0x06
174 #define C6DOFIMU4_G_DLPF_CFG_3281_HZ 0x07
175 #define C6DOFIMU4_XG_ST 0x80
176 #define C6DOFIMU4_YG_ST 0x40
177 #define C6DOFIMU4_ZG_ST 0x20
178 #define C6DOFIMU4_GYRO_FS_SEL_250_DPS 0x00
179 #define C6DOFIMU4_GYRO_FS_SEL_500_DPS 0x01
180 #define C6DOFIMU4_GYRO_FS_SEL_1000_DPS 0x02
181 #define C6DOFIMU4_GYRO_FS_SEL_2000_DPS 0x03
182 #define C6DOFIMU4_XA_ST 0x80
183 #define C6DOFIMU4_YA_ST 0x40
184 #define C6DOFIMU4_ZA_ST 0x20
185 #define C6DOFIMU4_ACCEL_FS_SEL_2_G 0x00
186 #define C6DOFIMU4_ACCEL_FS_SEL_4_G 0x01
187 #define C6DOFIMU4_ACCEL_FS_SEL_8_G 0x02
188 #define C6DOFIMU4_ACCEL_FS_SEL_16_G 0x03
189 #define C6DOFIMU4_ACCEL_AVRG_CFG_4_SAMPLES 0x00
190 #define C6DOFIMU4_ACCEL_AVRG_CFG_8_SAMPLES 0x10
191 #define C6DOFIMU4_ACCEL_AVRG_CFG_16_SAMPLES 0x20
192 #define C6DOFIMU4_ACCEL_AVRG_CFG_32_SAMPLES 0x30
193 #define C6DOFIMU4_ACCEL_FCHOICE_1046_HZ 0x08
194 #define C6DOFIMU4_A_DLPF_CFG_218_HZ 0x01
195 #define C6DOFIMU4_A_DLPF_CFG_99_HZ 0x02
196 #define C6DOFIMU4_A_DLPF_CFG_44_HZ 0x03
197 #define C6DOFIMU4_A_DLPF_CFG_21_HZ 0x04
198 #define C6DOFIMU4_A_DLPF_CFG_10_HZ 0x05
199 #define C6DOFIMU4_A_DLPF_CFG_5_HZ 0x06
200 #define C6DOFIMU4_A_DLPF_CFG_420_HZ 0x07
201 #define C6DOFIMU4_GYRO_LP_MODE_EN 0x80
202 #define C6DOFIMU4_G_AVGCFG_1X_622HZ 0x00
203 #define C6DOFIMU4_G_AVGCFG_2X_391HZ 0x10
204 #define C6DOFIMU4_G_AVGCFG_4X_211HZ 0x20
205 #define C6DOFIMU4_G_AVGCFG_8X_108HZ 0x30
206 #define C6DOFIMU4_G_AVGCFG_16X_54HZ 0x40
207 #define C6DOFIMU4_G_AVGCFG_32X_27HZ 0x50
208 #define C6DOFIMU4_G_AVGCFG_64X_14HZ 0x60
209 #define C6DOFIMU4_G_AVGCFG_128X_7HZ 0x70
210 #define C6DOFIMU4_GYRO_FIFO_EN 0x10
211 #define C6DOFIMU4_ACCEL_FIFO_EN 0x08
212 #define C6DOFIMU4_FSYNC_INT_MASK 0x80
213 #define C6DOFIMU4_FSYNC_INT_OCCURED 0x80
214 #define C6DOFIMU4_FSYNC_INT_NOT_OCCURED 0x00
215 #define C6DOFIMU4_INT_DRDY_PIN_ACT_LOW 0x80
216 #define C6DOFIMU4_INT_DRDY_PIN_ACT_HIGH 0x00
217 #define C6DOFIMU4_INT_DRDY_PIN_OPEN_DRAIN 0x40
218 #define C6DOFIMU4_INT_DRDY_PIN_PUSH_PULL 0x00
219 #define C6DOFIMU4_INT_DRDY_PIN_STAT_CLEARED 0x20
220 #define C6DOFIMU4_INT_DRDY_PIN_PULSE 0x00
221 #define C6DOFIMU4_INT_STAT_CLEARED_ANY_READ 0x10
222 #define C6DOFIMU4_INT_STAT_CLEARED_STAT_REG_READ 0x00
223 #define C6DOFIMU4_FSYNC_PIN_INT_ACT_LOW 0x08
224 #define C6DOFIMU4_FSYNC_PIN_INT_ACT_HIGH 0x00
225 #define C6DOFIMU4_FSYNC_INT_MODE_EN 0x04
226 #define C6DOFIMU4_FIFO_WM_INT_MASK 0x40
227 #define C6DOFIMU4_FIFO_WM_INT_OCCURED 0x40
228 #define C6DOFIMU4_FIFO_WM_INT_NOT_OCCURED 0x00
229 #define C6DOFIMU4_WOM_X_INT_MASK 0x80
230 #define C6DOFIMU4_WOM_X_INT_OCCURED 0x80
231 #define C6DOFIMU4_WOM_Y_INT_MASK 0x40
232 #define C6DOFIMU4_WOM_Y_INT_OCCURED 0x40
233 #define C6DOFIMU4_WOM_Z_INT_MASK 0x20
234 #define C6DOFIMU4_WOM_Z_INT_OCCURED 0x20
235 #define C6DOFIMU4_FIFO_OFLOW_INT_MASK 0x10
236 #define C6DOFIMU4_FIFO_OFLOW_INT_OCCURED 0x10
237 #define C6DOFIMU4_GDRIVE_INT_MASK 0x04
238 #define C6DOFIMU4_GDRIVE_INT_OCCURED 0x04
239 #define C6DOFIMU4_DATA_RDY_INT_MASK 0x01
240 #define C6DOFIMU4_DATA_RDY_INT_OCCURED 0x01
241 #define C6DOFIMU4_INT_STATUS_NOT_OCCURED 0x00
242 #define C6DOFIMU4_ACCEL_RST 0x02
243 #define C6DOFIMU4_TEMP_RST 0x01
244 #define C6DOFIMU4_ACCEL_INTEL_WOM_DET_LOGIC_EN 0x80
245 #define C6DOFIMU4_ACCEL_INTEL_MODE_NOT_USE 0x00
246 #define C6DOFIMU4_ACCEL_INTEL_MODE_COMPARE 0x40
247 #define C6DOFIMU4_OUTPUT_LIMIT_EN 0x02
248 #define C6DOFIMU4_WOM_TH_MODE_OR 0x00
249 #define C6DOFIMU4_WOM_TH_MODE_AND 0x01
250 #define C6DOFIMU4_FIFO_EN 0x40
251 #define C6DOFIMU4_FIFO_RST 0x04
252 #define C6DOFIMU4_ALL_DIG_SIG_PATH_RST 0x01
253 #define C6DOFIMU4_DEVICE_RST 0x80
254 #define C6DOFIMU4_SLEEP 0x40
255 #define C6DOFIMU4_CYCLE 0x20
256 #define C6DOFIMU4_GYRO_STANDBY 0x10
257 #define C6DOFIMU4_TEMP_DIS 0x08
258 #define C6DOFIMU4_CLKSEL_AUTO_SELECT 0x05
259 #define C6DOFIMU4_CLKSEL_INTERNAL_20_MHZ 0x06
260 #define C6DOFIMU4_CLKSEL_STOP_CLOCK 0x07
261 #define C6DOFIMU4_STBY_XA 0x20
262 #define C6DOFIMU4_STBY_YA 0x10
263 #define C6DOFIMU4_STBY_ZA 0x08
264 #define C6DOFIMU4_STBY_XG 0x04
265 #define C6DOFIMU4_STBY_YG 0x02
266 #define C6DOFIMU4_STBY_ZG 0x01
267 #define C6DOFIMU4_ALL_AXIS_EN 0x00
268 #define C6DOFIMU4_I2C_IF_DIS 0x40
269 #define C6DOFIMU4_I2C_IF_EN 0x00
270 
276 #define C6DOFIMU4_OK 0x00
277 #define C6DOFIMU4_INT_OCCURED 0x01
278 #define C6DOFIMU4_ADDR_ERROR 0x02
279 #define C6DOFIMU4_SENS_RESOLUTION_ERROR 0x03
280 
286 #define C6DOFIMU4_LOG_HIGH 0x01
287 #define C6DOFIMU4_LOG_LOW 0x00
288  // End group macro
291 // --------------------------------------------------------------- PUBLIC TYPES
300 typedef uint8_t c6dofimu4_select_t;
301 
305 typedef void ( *c6dofimu4_master_io_t )( struct c6dofimu4_s*, uint8_t, uint8_t*, uint8_t );
306 
307 typedef struct {
308 
309  double x;
310  double y;
311  double z;
312 
314 
318 typedef struct c6dofimu4_s
319 {
320  // Output pins
321 
322  digital_out_t syn;
323  digital_out_t cs;
324 
325  // Input pins
326 
327  digital_in_t int_pin;
328 
329  // Modules
330 
331  i2c_master_t i2c;
332  spi_master_t spi;
333 
334  // ctx variable
335 
336  uint8_t slave_address;
337  pin_name_t chip_select;
341 
342  uint8_t gyro_res;
343  uint8_t accel_res;
344 
346 
350 typedef struct
351 {
352  // Communication gpio pins
353 
354  pin_name_t scl;
355  pin_name_t sda;
356  pin_name_t miso;
357  pin_name_t mosi;
358  pin_name_t sck;
359  pin_name_t cs;
360 
361  // Additional gpio pins
362 
363  pin_name_t syn;
364  pin_name_t int_pin;
365 
366  // static variable
367 
368  uint32_t i2c_speed;
369  uint8_t i2c_address;
370  uint32_t spi_speed;
371  uint8_t spi_mode;
372  spi_master_chip_select_polarity_t cs_polarity;
373 
375 
376  uint8_t dev_gyro_res;
377  uint8_t dev_accel_res;
378 
380  // End types group
382 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
388 #ifdef __cplusplus
389 extern "C"{
390 #endif
391 
401 
411 
436 
447 void c6dofimu4_generic_write ( c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
448 
459 void c6dofimu4_generic_read ( c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
460 
472 uint8_t c6dofimu4_write_byte ( c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t data_in );
473 
485 uint8_t c6dofimu4_read_byte ( c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t *data_out );
486 
498 uint8_t c6dofimu4_write_word ( c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t data_in );
499 
511 uint8_t c6dofimu4_read_word( c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t *data_out );
512 
525 uint8_t c6dofimu4_write_bytes ( c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes );
526 
539 uint8_t c6dofimu4_read_bytes ( c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes );
540 
549 
558 void c6dofimu4_set_sync_pin ( c6dofimu4_t *ctx, uint8_t state );
559 
570 
581 uint8_t c6dofimu4_get_status ( c6dofimu4_t *ctx, uint8_t bit_mask );
582 
593 void c6dofimu4_get_data ( c6dofimu4_t *ctx, c6dofimu4_axis_t *accel_out, c6dofimu4_axis_t *gyro_out, int8_t *temp_out );
594 
606 uint8_t c6dofimu4_set_fsr ( c6dofimu4_t *ctx, uint8_t gyro_resol, uint8_t accel_resol );
607 
608 
609 #ifdef __cplusplus
610 }
611 #endif
612 #endif // _C6DOFIMU4_H_
613  // End public_function group
616 
617 // ------------------------------------------------------------------------- END
c6dofimu4_init
C6DOFIMU4_RETVAL c6dofimu4_init(c6dofimu4_t *ctx, c6dofimu4_cfg_t *cfg)
Initialization function.
c6dofimu4_cfg_t::i2c_address
uint8_t i2c_address
Definition: c6dofimu4.h:369
c6dofimu4_s::spi
spi_master_t spi
Definition: c6dofimu4.h:332
c6dofimu4_s
Click ctx object definition.
Definition: c6dofimu4.h:319
c6dofimu4_cfg_t::mosi
pin_name_t mosi
Definition: c6dofimu4.h:357
c6dofimu4_get_int_pin
uint8_t c6dofimu4_get_int_pin(c6dofimu4_t *ctx)
Int Pin Check function.
c6dofimu4_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: c6dofimu4.h:372
c6dofimu4_s::int_pin
digital_in_t int_pin
Definition: c6dofimu4.h:327
c6dofimu4_cfg_t::cs
pin_name_t cs
Definition: c6dofimu4.h:359
c6dofimu4_axis_t::z
double z
Definition: c6dofimu4.h:311
c6dofimu4_get_status
uint8_t c6dofimu4_get_status(c6dofimu4_t *ctx, uint8_t bit_mask)
Status Check function.
c6dofimu4_read_bytes
uint8_t c6dofimu4_read_bytes(c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_out, uint8_t n_bytes)
Generic Sequential Read function.
c6dofimu4_s::read_f
c6dofimu4_master_io_t read_f
Definition: c6dofimu4.h:339
c6dofimu4_write_bytes
uint8_t c6dofimu4_write_bytes(c6dofimu4_t *ctx, uint8_t start_addr, uint8_t *data_in, uint8_t n_bytes)
Generic Sequential Write function.
c6dofimu4_s::slave_address
uint8_t slave_address
Definition: c6dofimu4.h:336
c6dofimu4_generic_write
void c6dofimu4_generic_write(c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
c6dofimu4_s::master_sel
c6dofimu4_select_t master_sel
Definition: c6dofimu4.h:340
c6dofimu4_cfg_t
Click configuration structure definition.
Definition: c6dofimu4.h:351
c6dofimu4_cfg_setup
void c6dofimu4_cfg_setup(c6dofimu4_cfg_t *cfg)
Config Object Initialization function.
c6dofimu4_default_cfg
void c6dofimu4_default_cfg(c6dofimu4_t *ctx)
Click Default Configuration function.
c6dofimu4_s::cs
digital_out_t cs
Definition: c6dofimu4.h:323
c6dofimu4_axis_t::x
double x
Definition: c6dofimu4.h:309
c6dofimu4_axis_t
Definition: c6dofimu4.h:307
c6dofimu4_cfg_t::syn
pin_name_t syn
Definition: c6dofimu4.h:363
c6dofimu4_s::syn
digital_out_t syn
Definition: c6dofimu4.h:322
c6dofimu4_cfg_t::dev_gyro_res
uint8_t dev_gyro_res
Definition: c6dofimu4.h:376
c6dofimu4_t
struct c6dofimu4_s c6dofimu4_t
Click ctx object definition.
c6dofimu4_write_byte
uint8_t c6dofimu4_write_byte(c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t data_in)
Generic Single Byte Write function.
c6dofimu4_s::gyro_res
uint8_t gyro_res
Definition: c6dofimu4.h:342
c6dofimu4_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c6dofimu4.h:368
c6dofimu4_cfg_t::spi_mode
uint8_t spi_mode
Definition: c6dofimu4.h:371
c6dofimu4_select_t
uint8_t c6dofimu4_select_t
Communication type.
Definition: c6dofimu4.h:300
c6dofimu4_s::chip_select
pin_name_t chip_select
Definition: c6dofimu4.h:337
c6dofimu4_s::write_f
c6dofimu4_master_io_t write_f
Definition: c6dofimu4.h:338
c6dofimu4_set_sync_pin
void c6dofimu4_set_sync_pin(c6dofimu4_t *ctx, uint8_t state)
Sync Pin Setting function.
c6dofimu4_s::accel_res
uint8_t accel_res
Definition: c6dofimu4.h:343
C6DOFIMU4_RETVAL
#define C6DOFIMU4_RETVAL
Definition: c6dofimu4.h:86
c6dofimu4_s::i2c
i2c_master_t i2c
Definition: c6dofimu4.h:331
c6dofimu4_cfg_t::scl
pin_name_t scl
Definition: c6dofimu4.h:354
c6dofimu4_set_fsr
uint8_t c6dofimu4_set_fsr(c6dofimu4_t *ctx, uint8_t gyro_resol, uint8_t accel_resol)
Full Scale Setting function.
c6dofimu4_write_word
uint8_t c6dofimu4_write_word(c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t data_in)
Generic Word Write function.
c6dofimu4_cfg_t::miso
pin_name_t miso
Definition: c6dofimu4.h:356
c6dofimu4_cfg_t::sel
c6dofimu4_select_t sel
Definition: c6dofimu4.h:374
c6dofimu4_master_io_t
void(* c6dofimu4_master_io_t)(struct c6dofimu4_s *, uint8_t, uint8_t *, uint8_t)
Master Input/Output type.
Definition: c6dofimu4.h:305
c6dofimu4_cfg_t::spi_speed
uint32_t spi_speed
Definition: c6dofimu4.h:370
c6dofimu4_cfg_t::int_pin
pin_name_t int_pin
Definition: c6dofimu4.h:364
c6dofimu4_reset
void c6dofimu4_reset(c6dofimu4_t *ctx)
Device Reset function.
c6dofimu4_generic_read
void c6dofimu4_generic_read(c6dofimu4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
c6dofimu4_cfg_t::sck
pin_name_t sck
Definition: c6dofimu4.h:358
c6dofimu4_cfg_t::dev_accel_res
uint8_t dev_accel_res
Definition: c6dofimu4.h:377
c6dofimu4_read_byte
uint8_t c6dofimu4_read_byte(c6dofimu4_t *ctx, uint8_t reg_addr, uint8_t *data_out)
Generic Single Byte Read function.
c6dofimu4_get_data
void c6dofimu4_get_data(c6dofimu4_t *ctx, c6dofimu4_axis_t *accel_out, c6dofimu4_axis_t *gyro_out, int8_t *temp_out)
Data Get function.
c6dofimu4_read_word
uint8_t c6dofimu4_read_word(c6dofimu4_t *ctx, uint8_t reg_addr, uint16_t *data_out)
Generic Word Read function.
c6dofimu4_cfg_t::sda
pin_name_t sda
Definition: c6dofimu4.h:355
c6dofimu4_axis_t::y
double y
Definition: c6dofimu4.h:310