在 FOC 控制器中新增 `update_power` 方法,用于实时获取母线电压, 提升控制系统对电源状态的感知能力。 feat(CAN): 优化 CAN 配置与通信处理 将 CAN 相关宏定义改为 constexpr 常量,并引入角度转换因子。 修正接收数据解析方式,增强通信稳定性与精度。 feat(angle_sensor): 实现角度累积与绕回处理 重写角度传感器驱动,支持角度连续测量与自动绕回处理。 新增 `update`、`getAngle` 和 `reset` 接口,提高角度读取准确性。 feat(main): 增加角度传感器磁感应强度测试 在主函数初始化阶段调用磁感应强度检测函数,辅助判断传感器工作状态。
27 lines
479 B
C
27 lines
479 B
C
#ifndef _INITIAL_H
|
|
#define _INITIAL_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include "stdint.h"
|
|
#include <stdio.h>
|
|
#include "gd32c10x_eval.h"
|
|
|
|
void rcu_config(void);
|
|
static volatile uint32_t timer_delay_count = 0; // volatile 很重要!
|
|
int fputc(int ch, FILE *f); // 声明fputc函数以重载标准库实现
|
|
|
|
u8 tle5210b_init(void);
|
|
u8 USART0_init(void);
|
|
u8 watchdog_init(u32 time);
|
|
void driver_init(void);
|
|
void angsens_MG_test(void);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|