mirror of
https://github.com/goldenfishs/MRobot.git
synced 2026-02-04 18:00:19 +08:00
主要更改: - 将所有BSP外设文件移动到独立子文件夹(can/, fdcan/, uart/等) - 将所有Component文件移动到独立子文件夹(pid/, filter/, cmd/等) - 将所有Device文件移动到独立子文件夹(dr16/, bmi088/等) - 更新代码生成器以支持新的文件夹结构 - 保持向后兼容性,支持从子文件夹或根目录加载模板 - 添加STRUCTURE.md文档说明新的目录结构 优势: ✅ 更好的代码组织和管理 ✅ 便于添加、删除、修改模板 ✅ 清晰的模块划分 ✅ 向后兼容现有结构
50 lines
1.2 KiB
C
50 lines
1.2 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ----------------------------------------------------------------- */
|
|
#include <cmsis_os2.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "component/ahrs.h"
|
|
#include "device/device.h"
|
|
|
|
/* Exported constants ------------------------------------------------------- */
|
|
/* Exported macro ----------------------------------------------------------- */
|
|
/* Exported types ----------------------------------------------------------- */
|
|
typedef struct {
|
|
struct {
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} magn_offset; /* 磁力计偏置 */
|
|
|
|
struct {
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} magn_scale; /* 磁力计缩放 */
|
|
} IST8310_Cali_t; /* IST8310校准数据 */
|
|
|
|
typedef struct {
|
|
DEVICE_Header_t header;
|
|
AHRS_Magn_t magn;
|
|
const IST8310_Cali_t *cali;
|
|
} IST8310_t;
|
|
|
|
/* Exported functions prototypes -------------------------------------------- */
|
|
int8_t IST8310_Init(IST8310_t *ist8310, const IST8310_Cali_t *cali);
|
|
int8_t IST8310_Restart(void);
|
|
|
|
bool IST8310_WaitNew(uint32_t timeout);
|
|
int8_t IST8310_StartDmaRecv();
|
|
uint32_t IST8310_WaitDmaCplt();
|
|
int8_t IST8310_Parse(IST8310_t *ist8310);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|