int fputc(int c, FILE* stream)
{
uint8_t ch[1] = {c};
HAL_UART_Transmit(&huart1, ch, 1, 0xFFFF);
return c;
}
int fgetc(FILE* stream)
{
uint8_t ch[1];
HAL_UART_Receive(&huart1, ch, 1, 0xFFFF);
return ch[0];
}
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/NBNB66666/article/details/136415786
|