Skip to content

Compatibility Mode with a ESP32 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SparkFun MPU-9250 Digital Motion Processor (DMP) Arduino Library
========================================

### I have forked this repository to edit and make changes for the ESP32. Will submit a PR when ready. This is a Work in Progress

[![SparkFun MPU-9250](https://cdn.sparkfun.com//assets/parts/1/1/3/0/6/13762-00a.jpg)](https://www.sparkfun.com/products/13762)

[*SparkFun MPU-9250 (SEN-13762)*](https://www.sparkfun.com/products/13762)
Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_Basic/MPU9250_Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
7 changes: 6 additions & 1 deletion examples/MPU9250_Basic_Interrupt/MPU9250_Basic_Interrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

#define INTERRUPT_PIN 4

MPU9250_DMP imu;
Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_DMP_Gyro_Cal/MPU9250_DMP_Gyro_Cal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_DMP_Orientation/MPU9250_DMP_Orientation.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_DMP_Pedometer/MPU9250_DMP_Pedometer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_DMP_Quaternion/MPU9250_DMP_Quaternion.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_DMP_Tap/MPU9250_DMP_Tap.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
6 changes: 5 additions & 1 deletion examples/MPU9250_FIFO_Basic/MPU9250_FIFO_Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ Supported Platforms:
*************************************************************/
#include <SparkFunMPU9250-DMP.h>

#define SerialPort SerialUSB
#ifdef defined(SAMD)
#define SerialPort SerialUSB
#else
#define SerialPort Serial
#endif

MPU9250_DMP imu;

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sentence=Driver for InvenSense's MPU-9250 9-DOF IMU (3-axis gyroscope, 3-axis ac
paragraph=The <a href="https://www.invensense.com/products/motion-tracking/9-axis/mpu-9250/">MPU-9250</a> is a system-in-package featuring acceleration full-scales of ±2 / ±4 / ±8 / ±16 (g), rotational full-scales of ±250 / ±500 / ±1000 / ±2000 (°/sec) and a magnetic field full scale of ±4800 µT. The MPU-9250 includes an I<sup>2</sup>C serial bus interface that supports speeds up to 400 kHz.
category=Sensors
url=https://github.com/sparkfun/MPU-9250_Breakout
architectures=samd
architectures=samd, esp32
3 changes: 3 additions & 0 deletions src/util/inv_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#define i2c_read(a, b, c, d) arduino_i2c_read(a, b, c, d)
#define delay_ms arduino_delay_ms
#define get_ms arduino_get_clock_ms
// Added by rupin to enable ESP32 compatibility
#define min(a,b) a<b ? a : b

#define log_i _MLPrintLog
#define log_e _MLPrintLog
static inline int reg_int_cb(struct int_param_s *int_param)
Expand Down