IMU_DUAL/ASM330LHH/user_asm330lhh.h
2023-10-23 13:20:32 +08:00

40 lines
735 B
C

#ifndef USER_ASM330LHH
#define USER_ASM330LHH
#define SPI1_CS_PORT GPIOA
#define SPI1_CS_PIN GPIO_PIN_4
#include <string.h>
#include <stdio.h>
#include "asm330lhh_reg.h"
#include "stm32f1xx_hal.h"
#include "rtklib.h"
#define IMU_READY 1
#define IMU_NOT_READY 1
#define IMU_LOCK 1
#define IMU_UNLOCK 0
typedef struct
{
int16_t x_a; //加速度值原始数据
int16_t y_a;
int16_t z_a;
int16_t x_g; //角速度值原始数据
int16_t y_g;
int16_t z_g;
float x_acc; //转换为真实加速度
float y_acc;
float z_acc;
float x_gyro; //转换为真实角速度
float y_gyro;
float z_gyro;
} asm_value;
extern asm_value asm330;
void user_dev_init();
void asm_sample();
extern stmdev_ctx_t spi1_dev;
#endif