添加了完整的Doxygen文档注释到FOC算法模块的所有函数、类和变量,提升了代码可读性和维护性。同时优化了SVPWM算法实现,将atan2f替换为符号法扇区判断,显著提升计算效率(约15周期vs atan2f 300周期),并改进了arm_sin_cos_f32替代sqrtf提高性能。 feat(FOC): 统一电气角度计算避免重复运算 重构代码以统一电气角度计算,在各个控制循环中只计算一次电气角度并传递给需要的函数,避免了多次重复的fmodf运算和角度归一化操作,提升了实时控制性能。 refactor(Filter): 改进α-β观测器角度处理精度 修改角度卡尔曼滤波器在归一化角度空间[0,360)内工作,避免大累积角度的浮点精度损失问题,确保静止状态下不会产生虚假速度,同时保持与下游代码的兼容性。 refactor: 为算法模块添加完整文档注释 为所有算法模块(FOC、Filter、pid、thermal)添加了详细的Doxygen文档注释,包括函数说明、参数描述、返回值说明等,便于代码理解和API文档生成。
108 lines
3.1 KiB
C
108 lines
3.1 KiB
C
/**
|
|
* @file RTE/Device/GD32C103CB/regions_GD32C103CB.h
|
|
* @brief GD32 RTE 外设库或运行时配置源文件
|
|
* @note 本文件仅补充 Doxygen 文档注释,不改变代码逻辑。
|
|
*/
|
|
|
|
#ifndef REGIONS_GD32C103CB_H
|
|
#define REGIONS_GD32C103CB_H
|
|
|
|
|
|
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
|
|
//------ With VS Code: Open Preview for Configuration Wizard -------------------
|
|
|
|
// <n> Auto-generated using information from packs
|
|
// <i> Device Family Pack (DFP): GigaDevice::GD32C10x_DFP@1.0.1
|
|
|
|
// <h> ROM Configuration
|
|
// =======================
|
|
// <h> __ROM0 (is rx memory: IROM1 from DFP)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region. Default: 0x08000000
|
|
// <i> Contains Startup and Vector Table
|
|
#define __ROM0_BASE 0x08012000
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region. Default: 0x00020000
|
|
#define __ROM0_SIZE 0x0000C000
|
|
// </h>
|
|
|
|
// <h> __ROM1 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __ROM1_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __ROM1_SIZE 0x0
|
|
// </h>
|
|
|
|
// <h> __ROM2 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __ROM2_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __ROM2_SIZE 0x0
|
|
// </h>
|
|
|
|
// <h> __ROM3 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __ROM3_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __ROM3_SIZE 0x0
|
|
// </h>
|
|
|
|
// </h>
|
|
|
|
// <h> RAM Configuration
|
|
// =======================
|
|
// <h> __RAM0 (is rwx memory: IRAM1 from DFP)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region. Default: 0x20000000
|
|
// <i> Contains uninitialized RAM, Stack, and Heap
|
|
#define __RAM0_BASE 0x20000000
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region. Default: 0x00008000
|
|
#define __RAM0_SIZE 0x00008000
|
|
// </h>
|
|
|
|
// <h> __RAM1 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __RAM1_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __RAM1_SIZE 0x0
|
|
// </h>
|
|
|
|
// <h> __RAM2 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __RAM2_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __RAM2_SIZE 0x0
|
|
// </h>
|
|
|
|
// <h> __RAM3 (unused)
|
|
// <o> Base address <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines base address of memory region.
|
|
#define __RAM3_BASE 0x0
|
|
// <o> Region size [bytes] <0x0-0xFFFFFFFF:8>
|
|
// <i> Defines size of memory region.
|
|
#define __RAM3_SIZE 0x0
|
|
// </h>
|
|
|
|
// </h>
|
|
|
|
// <h> Stack / Heap Configuration
|
|
// <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
|
// <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
|
#define __STACK_SIZE 0x00000200
|
|
#define __HEAP_SIZE 0x00000C00
|
|
// </h>
|
|
|
|
|
|
#endif /* REGIONS_GD32C103CB_H */
|