18 lines
634 B
C
18 lines
634 B
C
#ifndef __SERIAL_H
|
|
#define __SERIAL_H
|
|
|
|
#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); // 清空接收缓冲区
|
|
|
|
// 注意:Get_Time_ms() 函数与串口无关,应该在 `Delay.h` 中声明。
|
|
// 我们暂时将它与串口放一起,但更规范的做法是分离。
|
|
uint32_t Get_Time_ms(void);
|
|
|
|
#endif
|