配置

GPIO

USART

中断

发送

接收

printf

1
2
3
4
5
6
7
#include <stdio.h>
#include <stm32g0xx_hal.h>

int fputc(int ch, FILE *f) {
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, HAL_MAX_DELAY);
return ch;
}

『 下里巴人 』
海纳百川,文以载道
hywing技术自留地
总访问 113701 次 | 本页访问 326