终版
This commit is contained in:
+11
-5
@@ -4,14 +4,20 @@
|
||||
#include <stdio.h>
|
||||
#include "stm32f10x.h"
|
||||
|
||||
void Serial_Init(void); // 初始化串口
|
||||
void Serial_SendByte(uint8_t Byte); // 发送一个字节
|
||||
void Serial_SendString(const char* String); // 发送字符串
|
||||
char* Serial_GetRxBuffer(void); // 获取接收缓冲区指针
|
||||
void Serial_ClearRxBuffer(void); // 清空接收缓冲区
|
||||
// 函数作用:初始化调试/通信串口及其接收缓冲区。
|
||||
void Serial_Init(void);
|
||||
// 函数作用:通过串口发送一个字节。
|
||||
void Serial_SendByte(uint8_t Byte);
|
||||
// 函数作用:通过串口连续发送以空字符结尾的字符串。
|
||||
void Serial_SendString(const char* String);
|
||||
// 函数作用:返回串口接收缓冲区指针,供主循环解析接收到的数据。
|
||||
char* Serial_GetRxBuffer(void);
|
||||
// 函数作用:清空串口接收缓冲区并复位接收状态。
|
||||
void Serial_ClearRxBuffer(void);
|
||||
|
||||
// 注意:Get_Time_ms() 函数与串口无关,应该在 `Delay.h` 中声明。
|
||||
// 我们暂时将它与串口放一起,但更规范的做法是分离。
|
||||
// 函数作用:返回系统启动以来经过的毫秒数。
|
||||
uint32_t Get_Time_ms(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user