| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef __Arduino_ICM20948_H__
- #define __Arduino_ICM20948_H__
- //#include <stdint.h>
- #include "main.h"
- #include "stm32l0xx_hal.h"
- #include "HAL_STM32_config.h"
- /*************************************************************************
- Defines
- *************************************************************************/
- #ifdef __cplusplus
- typedef struct {
- int i2c_speed;
- uint8_t is_SPI;
- int cs_pin;
- int spi_speed;
- int mode;
- uint8_t enable_gyroscope;
- uint8_t enable_accelerometer;
- uint8_t enable_magnetometer;
- uint8_t enable_gravity;
- uint8_t enable_linearAcceleration;
- uint8_t enable_quaternion6;
- uint8_t enable_quaternion9;
- uint8_t enable_har;
- uint8_t enable_steps;
- int gyroscope_frequency;
- int accelerometer_frequency;
- int magnetometer_frequency;
- int gravity_frequency;
- int linearAcceleration_frequency;
- int quaternion6_frequency;
- int quaternion9_frequency;
- int har_frequency;
- int steps_frequency;
- } DMP_ICM20948Settings;
- /*************************************************************************
- Class
- *************************************************************************/
- class DMP_ICM20948
- {
- public:
- DMP_ICM20948();
- //void init(TwoWire *theWire = &Wire, JTICM20948Settings settings);
- void init(DMP_ICM20948Settings settings);
- void task();
- bool gyroDataIsReady();
- bool accelDataIsReady();
- bool magDataIsReady();
- bool gravDataIsReady();
- bool linearAccelDataIsReady();
- bool quat6DataIsReady();
- bool euler6DataIsReady();
- bool quat9DataIsReady();
- bool euler9DataIsReady();
- bool harDataIsReady();
- bool stepsDataIsReady();
- void readGyroData(float *x, float *y, float *z);
- void readAccelData(float *x, float *y, float *z);
- void readMagData(float *x, float *y, float *z);
- void readGravData(float* x, float* y, float* z);
- void readLinearAccelData(float* x, float* y, float* z);
- void readQuat6Data(float *w, float *x, float *y, float *z);
- void readEuler6Data(float *roll, float *pitch, float *yaw);
- void readQuat9Data(float* w, float* x, float* y, float* z);
- void readEuler9Data(float* roll, float* pitch, float* yaw);
- void readHarData(char* activity);
- void readStepsData(unsigned long* steps_count);
- };
- #endif
- #endif
|