18 lines
519 B
C
18 lines
519 B
C
#pragma once
|
|
#include "config.h"
|
|
#include "LSM6DS3.h"
|
|
|
|
extern LSM6DS3 imu;
|
|
|
|
// Roll-compensation rotation matrix coefficients (computed in calibrateGyroBias).
|
|
// Rotate device-frame [gz, gy] → world-frame [screenX, screenY].
|
|
extern float rollSin; // sin of device yaw on table
|
|
extern float rollCos; // cos of device yaw on table
|
|
|
|
void imuWriteReg(uint8_t reg, uint8_t val);
|
|
uint8_t imuReadReg(uint8_t reg);
|
|
float readIMUTemp();
|
|
void calibrateGyroBias();
|
|
float applyCurve(float v);
|
|
float applyAcceleration(float d);
|