Files
GD32E50X_BOOT/GD32E50X_BOOT/sys/initial.h
T
cbb 3377a2e58a refactor(device): 移除未使用的CAN DMA初始化函数和SPI中断处理
移除了CAN模块中未启用的DMA初始化相关代码,包括can_dma_init函数
和相关的调用。同时移除了SPI OTA模块中已废弃的中断处理函数和C风格
兼容包装函数,这些功能已被DMA方式替代。
BREAKING CHANGE: 移除了can_dma_init函数和spi_ota_irq_handler等C风格API。
2026-07-15 01:56:38 +08:00

72 lines
1.5 KiB
C++

#ifndef _INITIAL_H
#define _INITIAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdint.h>
#include "gd32e50x_fmc.h"
#include "sys/config.h"
/**
* @brief Bootloader 调试串口模块。
*
* 负责 USART0 初始化与 printf 输出重定向。
*/
class BootDebugUart {
public:
/** @brief 初始化 USART0 调试串口。 */
static u8 init();
/** @brief 输出单个字符。 */
static int putChar(int ch, FILE *f);
};
/**
* @brief Bootloader 睡眠与唤醒管理模块。
*
* 负责深度睡眠进入、睡眠配置检查以及 EXTI5_9 唤醒路径处理。
*/
class BootSleepManager {
public:
/** @brief 进入深度睡眠模式。 */
static void enterDeepSleep();
/** @brief 检查睡眠配置并决定是否进入深睡。 */
static int check();
/** @brief 处理 EXTI5_9 中断实际逻辑。 */
static void onExtiInterrupt();
private:
/** @brief 向指定 Flash 地址写入一个 32 位字。 */
static fmc_state_enum writeAddress(u32 address, u32 data);
};
/**
* @brief printf 重定向输出函数。
*
* @param ch 待输出字符。
* @param f 目标文件流,当前实现未使用。
* @return 输出的字符值。
*/
int fputc(int ch, FILE *f) throw();
/**
* @brief EXTI5_9 中断服务函数。
*
* @return 无。
*/
void EXTI5_9_IRQHandler(void);
/**
* @brief EXTI10_15 中断服务函数。
* @return 无。
*/
void EXTI10_15_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif