-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for I2C QMI8658 IMU
Signed-off-by: Daniël van de Giessen <[email protected]>
- Loading branch information
1 parent
d1cf81a
commit b0180ac
Showing
16 changed files
with
1,357 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _I2C_QMI8658_H | ||
#define _I2C_QMI8658_H | ||
|
||
extern "C" { | ||
#include "QMI8658.h" | ||
} | ||
|
||
#include "gpaddon.h" | ||
|
||
#include "GamepadEnums.h" | ||
#include "peripheralmanager.h" | ||
|
||
#ifndef I2C_QMI8658_ENABLED | ||
#define I2C_QMI8658_ENABLED 0 | ||
#endif | ||
|
||
// Analog Module Name | ||
#define I2C_QMI8658_Name "I2C_QMI8658" | ||
|
||
class I2CQMI8658Input : public GPAddon { | ||
public: | ||
virtual bool available(); | ||
virtual void setup(); | ||
virtual void preprocess() {} | ||
virtual void process(); | ||
virtual std::string name() { return I2C_QMI8658_Name; } | ||
private: | ||
PeripheralI2C *i2c; | ||
uint32_t uIntervalMS; | ||
uint32_t nextTimer; | ||
int16_t acc[3]; | ||
int16_t gyro[3]; | ||
}; | ||
|
||
#endif // _I2C_QMI8658_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_library(QMI8658 QMI8658.c) | ||
target_link_libraries(QMI8658 PUBLIC PicoPeripherals) | ||
target_include_directories(QMI8658 INTERFACE .) | ||
target_include_directories(QMI8658 PUBLIC . PicoPeripherals) |
Oops, something went wrong.