mirror of
https://gitee.com/moluo-tech/CodeBrick.git
synced 2025-01-30 04:42:53 +08:00
增加串口初始化操作
This commit is contained in:
parent
6bb9546232
commit
92fce520cb
@ -38,8 +38,10 @@ static void uart_init(int baudrate)
|
||||
ring_buf_init(&rbsend, txbuf, sizeof(txbuf));/*<2A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD> */
|
||||
ring_buf_init(&rbrecv, rxbuf, sizeof(rxbuf));
|
||||
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA , ENABLE);
|
||||
|
||||
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);
|
||||
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
|
||||
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
|
||||
|
||||
gpio_conf(GPIOA, GPIO_Mode_AF, GPIO_PuPd_NOPULL,
|
||||
GPIO_Pin_9 | GPIO_Pin_10);
|
||||
|
Loading…
x
Reference in New Issue
Block a user