38 lines
888 B
C
38 lines
888 B
C
|
|
#ifndef __ICM20600_H
|
||
|
|
#define __ICM20600_H
|
||
|
|
|
||
|
|
#include "SPIDevice.h"
|
||
|
|
#include "GPIO_EXTI.h"
|
||
|
|
|
||
|
|
typedef struct Imu_ICM20600{
|
||
|
|
const char *name;
|
||
|
|
SPI_DEV_t *_dev;
|
||
|
|
GPIO_EXIT_t *exti;
|
||
|
|
|
||
|
|
float Accx; //从ICM20600读出来的Ax
|
||
|
|
float Accy; //从ICM20600读出来的Ay
|
||
|
|
float Accz; //从ICM20600读出来的Az
|
||
|
|
|
||
|
|
float Gyrox; //从ICM20600读出来的Ax
|
||
|
|
float Gyroy; //从ICM20600读出来的Ay
|
||
|
|
float Gyroz; //从ICM20600读出来的Az
|
||
|
|
|
||
|
|
int32_t At; //从ICM20600读出来的温度
|
||
|
|
int read_cnt;
|
||
|
|
|
||
|
|
float gyro_lsb_per_deg_sec;
|
||
|
|
float acc_lsb_per_g;
|
||
|
|
|
||
|
|
// statics
|
||
|
|
int cnt;
|
||
|
|
int last_cnt;
|
||
|
|
int pps;
|
||
|
|
} Imu_ICM20600_t;
|
||
|
|
|
||
|
|
int Imu_ICM20600_init(Imu_ICM20600_t *Acc, const char *name, SPI_DEV_t *dev, GPIO_EXIT_t *exti);
|
||
|
|
bool Imu_ICM20600_update(Imu_ICM20600_t *Acc);
|
||
|
|
void Imu_ICM20600_stats(Imu_ICM20600_t *Acc);
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|