30 lines
731 B
C
30 lines
731 B
C
#ifndef IMU_PROCESSING_H
|
|
#define IMU_PROCESSING_H
|
|
|
|
#include "imu.h"
|
|
|
|
|
|
#define ACCEL_SENS_SCALE_FACTOR 4096.0f
|
|
#define GYRO_SENS_SCALE_FACTOR 16.384f
|
|
#define PI 3.14159265359f
|
|
#define DEG2RAD PI / 180.0f
|
|
|
|
typedef struct
|
|
{
|
|
float ax, ay, az; // g
|
|
float gx, gy, gz; // dps
|
|
} imu_scaled_t;
|
|
|
|
void imu_processing_init();
|
|
|
|
void imu_process_raw(imu_scaled_t* out, imu_raw_t* raw, const uint8_t* allowed_calib);
|
|
void imu_read_scaled(imu_scaled_t* out, const uint8_t* allowed_calib);
|
|
void imu_calib(imu_raw_t* imu, long gyrLim, long accZero, long accMax);
|
|
uint16_t Rev16(uint16_t v);
|
|
|
|
void imu_accel_calibrate();
|
|
|
|
float normalize(float value, float scale, float min, float max);
|
|
long absl(long value);
|
|
|
|
#endif |