RobotHardware-UESTC/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.1/STM32/BSPLIB/usart.h

25 lines
621 B
C
Raw Normal View History

2024-01-24 20:47:03 +08:00
#ifndef USART_H
#define USART_H
#ifdef __cplusplus
extern "C"
{
#endif
#include "stm32f10x.h"
#include "stdarg.h"
#include "stdio.h"
// Initilaize the serial, First Parameter:USART1,USART2,USART3; 2nd Para:bits rate; 3rd: IO reuse
void USART_InitGPIO(uint8_t USART_Channel, uint32_t BaudRate, uint8_t GPIO_AF);
void USART_PutChar(uint8_t USART_Channel, uint8_t Tx_Byte); // USARTx to print 1 byte
void USART_printf(USART_TypeDef *USARTx, uint8_t *Data, ...); // format output as printf in C standard library
// int fputc(int ch, FILE *f);
#ifdef __cplusplus
}
#endif
#endif // #ifndef USART_H