串口 (Usart)

方法

uart_init(u32 bound)

初始化串口USART1

参数类型注释
boundu32波特率 (常用: 9600/115200)

USART1_IRQHandler()

USART1中断处理函数

注意!

我们重写了printf()方法用于串口调试输出, 该方法相较于后面的发送函数更加方便

请优先使用printf()作为输出函数

USART1_Send_U8(uint8_t ch)

发送字符

参数类型注释
chuint8_t发送的字符

USART1_Send_ArrayU8(uint8_t *BufferPtr, uint16_t Length)

参数类型注释
BufferPtruint8_t字符串指针
Lengthuint16_t字符串长度