| LibDriver MPU9250 1.0.0 MPU9250 full function driver

driver_mpu9250_interface_template.c
Go to the documentation of this file.
1
37 #include "driver_mpu9250_interface.h"
38
46 uint8_t mpu9250_interface_iic_init(void)
47 {
48 return 0;
49 }
50
58 uint8_t mpu9250_interface_iic_deinit(void)
59 {
60 return 0;
61 }
62
74 uint8_t mpu9250_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
75 {
76 return 0;
77 }
78
90 uint8_t mpu9250_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
91 {
92 return 0;
93 }
94
102 uint8_t mpu9250_interface_spi_init(void)
103 {
104 return 0;
105 }
106
114 uint8_t mpu9250_interface_spi_deinit(void)
115 {
116 return 0;
117 }
118
129 uint8_t mpu9250_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
130 {
131 return 0;
132 }
133
144 uint8_t mpu9250_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
145 {
146 return 0;
147 }
148
154 void mpu9250_interface_delay_ms(uint32_t ms)
155 {
156
157 }
158
164 void mpu9250_interface_debug_print(const char *const fmt, ...)
165 {
166
167 }
168
174 void mpu9250_interface_receive_callback(uint8_t type)
175 {
176 switch (type)
177 {
178 case MPU9250_INTERRUPT_MOTION :
179 {
180 mpu9250_interface_debug_print("mpu9250: irq motion.\n");
181
182 break;
183 }
184 case MPU9250_INTERRUPT_FIFO_OVERFLOW :
185 {
186 mpu9250_interface_debug_print("mpu9250: irq fifo overflow.\n");
187
188 break;
189 }
190 case MPU9250_INTERRUPT_FSYNC_INT :
191 {
192 mpu9250_interface_debug_print("mpu9250: irq fsync int.\n");
193
194 break;
195 }
196 case MPU9250_INTERRUPT_DMP :
197 {
198 mpu9250_interface_debug_print("mpu9250: irq dmp\n");
199
200 break;
201 }
202 case MPU9250_INTERRUPT_DATA_READY :
203 {
204 mpu9250_interface_debug_print("mpu9250: irq data ready\n");
205
206 break;
207 }
208 default :
209 {
210 mpu9250_interface_debug_print("mpu9250: irq unknown code.\n");
211
212 break;
213 }
214 }
215 }
216
223 void mpu9250_interface_dmp_tap_callback(uint8_t count, uint8_t direction)
224 {
225 switch (direction)
226 {
227 case MPU9250_DMP_TAP_X_UP :
228 {
229 mpu9250_interface_debug_print("mpu9250: tap irq x up with %d.\n", count);
230
231 break;
232 }
233 case MPU9250_DMP_TAP_X_DOWN :
234 {
235 mpu9250_interface_debug_print("mpu9250: tap irq x down with %d.\n", count);
236
237 break;
238 }
239 case MPU9250_DMP_TAP_Y_UP :
240 {
241 mpu9250_interface_debug_print("mpu9250: tap irq y up with %d.\n", count);
242
243 break;
244 }
245 case MPU9250_DMP_TAP_Y_DOWN :
246 {
247 mpu9250_interface_debug_print("mpu9250: tap irq y down with %d.\n", count);
248
249 break;
250 }
251 case MPU9250_DMP_TAP_Z_UP :
252 {
253 mpu9250_interface_debug_print("mpu9250: tap irq z up with %d.\n", count);
254
255 break;
256 }
257 case MPU9250_DMP_TAP_Z_DOWN :
258 {
259 mpu9250_interface_debug_print("mpu9250: tap irq z down with %d.\n", count);
260
261 break;
262 }
263 default :
264 {
265 mpu9250_interface_debug_print("mpu9250: tap irq unknown code.\n");
266
267 break;
268 }
269 }
270 }
271
277 void mpu9250_interface_dmp_orient_callback(uint8_t orientation)
278 {
279 switch (orientation)
280 {
281 case MPU9250_DMP_ORIENT_PORTRAIT :
282 {
283 mpu9250_interface_debug_print("mpu9250: orient irq portrait.\n");
284
285 break;
286 }
287 case MPU9250_DMP_ORIENT_LANDSCAPE :
288 {
289 mpu9250_interface_debug_print("mpu9250: orient irq landscape.\n");
290
291 break;
292 }
293 case MPU9250_DMP_ORIENT_REVERSE_PORTRAIT :
294 {
295 mpu9250_interface_debug_print("mpu9250: orient irq reverse portrait.\n");
296
297 break;
298 }
299 case MPU9250_DMP_ORIENT_REVERSE_LANDSCAPE :
300 {
301 mpu9250_interface_debug_print("mpu9250: orient irq reverse landscape.\n");
302
303 break;
304 }
305 default :
306 {
307 mpu9250_interface_debug_print("mpu9250: orient irq unknown code.\n");
308
309 break;
310 }
311 }
312 }
driver_mpu9250_interface.h
driver mpu9250 interface header file
MPU9250_INTERRUPT_MOTION
@ MPU9250_INTERRUPT_MOTION
Definition: driver_mpu9250.h:263
MPU9250_INTERRUPT_DATA_READY
@ MPU9250_INTERRUPT_DATA_READY
Definition: driver_mpu9250.h:267
MPU9250_INTERRUPT_FSYNC_INT
@ MPU9250_INTERRUPT_FSYNC_INT
Definition: driver_mpu9250.h:265
MPU9250_INTERRUPT_DMP
@ MPU9250_INTERRUPT_DMP
Definition: driver_mpu9250.h:266
MPU9250_INTERRUPT_FIFO_OVERFLOW
@ MPU9250_INTERRUPT_FIFO_OVERFLOW
Definition: driver_mpu9250.h:264
MPU9250_DMP_ORIENT_REVERSE_PORTRAIT
@ MPU9250_DMP_ORIENT_REVERSE_PORTRAIT
Definition: driver_mpu9250.h:485
MPU9250_DMP_ORIENT_REVERSE_LANDSCAPE
@ MPU9250_DMP_ORIENT_REVERSE_LANDSCAPE
Definition: driver_mpu9250.h:486
MPU9250_DMP_ORIENT_PORTRAIT
@ MPU9250_DMP_ORIENT_PORTRAIT
Definition: driver_mpu9250.h:483
MPU9250_DMP_ORIENT_LANDSCAPE
@ MPU9250_DMP_ORIENT_LANDSCAPE
Definition: driver_mpu9250.h:484
MPU9250_DMP_TAP_X_DOWN
@ MPU9250_DMP_TAP_X_DOWN
Definition: driver_mpu9250.h:471
MPU9250_DMP_TAP_X_UP
@ MPU9250_DMP_TAP_X_UP
Definition: driver_mpu9250.h:470
MPU9250_DMP_TAP_Y_DOWN
@ MPU9250_DMP_TAP_Y_DOWN
Definition: driver_mpu9250.h:473
MPU9250_DMP_TAP_Z_UP
@ MPU9250_DMP_TAP_Z_UP
Definition: driver_mpu9250.h:474
MPU9250_DMP_TAP_Z_DOWN
@ MPU9250_DMP_TAP_Z_DOWN
Definition: driver_mpu9250.h:475
MPU9250_DMP_TAP_Y_UP
@ MPU9250_DMP_TAP_Y_UP
Definition: driver_mpu9250.h:472
mpu9250_interface_dmp_orient_callback
void mpu9250_interface_dmp_orient_callback(uint8_t orientation)
interface dmp orient callback
Definition: driver_mpu9250_interface_template.c:277
mpu9250_interface_debug_print
void mpu9250_interface_debug_print(const char *const fmt,...)
interface print format data
Definition: driver_mpu9250_interface_template.c:164
mpu9250_interface_dmp_tap_callback
void mpu9250_interface_dmp_tap_callback(uint8_t count, uint8_t direction)
interface dmp tap callback
Definition: driver_mpu9250_interface_template.c:223
mpu9250_interface_spi_write
uint8_t mpu9250_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
Definition: driver_mpu9250_interface_template.c:144
mpu9250_interface_iic_deinit
uint8_t mpu9250_interface_iic_deinit(void)
interface iic bus deinit
Definition: driver_mpu9250_interface_template.c:58
mpu9250_interface_iic_write
uint8_t mpu9250_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
Definition: driver_mpu9250_interface_template.c:90
mpu9250_interface_iic_read
uint8_t mpu9250_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
Definition: driver_mpu9250_interface_template.c:74
mpu9250_interface_iic_init
uint8_t mpu9250_interface_iic_init(void)
interface iic bus init
Definition: driver_mpu9250_interface_template.c:46
mpu9250_interface_spi_read
uint8_t mpu9250_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
Definition: driver_mpu9250_interface_template.c:129
mpu9250_interface_spi_init
uint8_t mpu9250_interface_spi_init(void)
interface spi bus init
Definition: driver_mpu9250_interface_template.c:102
mpu9250_interface_receive_callback
void mpu9250_interface_receive_callback(uint8_t type)
interface receive callback
Definition: driver_mpu9250_interface_template.c:174
mpu9250_interface_delay_ms
void mpu9250_interface_delay_ms(uint32_t ms)
interface delay ms
Definition: driver_mpu9250_interface_template.c:154
mpu9250_interface_spi_deinit
uint8_t mpu9250_interface_spi_deinit(void)
interface spi bus deinit
Definition: driver_mpu9250_interface_template.c:114