Files
motor/Common/spi/InertialSensor_ADIS1647x.h
T
2024-09-26 22:32:20 +08:00

53 lines
1.1 KiB
C

#ifndef __INERTIALSENSOR_ADIS1647x_H__
#define __INERTIALSENSOR_ADIS1647x_H__
#include "SPIDevice.h"
#include "GPIO_EXTI.h"
#include <stdint.h>
#include <stdbool.h>
typedef struct
{
const char *name;
bool success;
int crc_err;
int seq_err;
int comm_err;
int good_cnt;
int crc_pps;
int seq_pps;
int comm_pps;
int good_pps;
SPI_DEV_t *dev;
GPIO_EXIT_t *drdy;
uint16_t last_counter;
bool done_first_read;
float temp_sum;
uint8_t temp_count;
float accel_scale;
float gyro_scale;
float _clip_limit;
float accel[3];
float gyro[3];
float temp;
uint8_t seq;
} InertialSensor_ADIS1647x_t;
bool InertialSensor_ADIS1647x_init(InertialSensor_ADIS1647x_t *imu,
const char *name,
SPI_DEV_t *dev,
GPIO_EXIT_t *drdy);
void InertialSensor_ADIS1647x_loop(InertialSensor_ADIS1647x_t *imu);
void InertialSensor_ADIS1647x_update(InertialSensor_ADIS1647x_t *imu);
void InertialSensor_ADIS1647x_monitor(InertialSensor_ADIS1647x_t *imu);
#endif /* __INERTIALSENSOR_ADIS1647x_H__ */