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

29 lines
620 B
C

#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);
// USARTx to print 1 byte
void USART_PutChar(uint8_t USART_Channel, uint8_t Tx_Byte);
// format output as printf in C standard library
void USART_printf(USART_TypeDef *USARTx, uint8_t *Data, ...);
// int fputc(int ch, FILE *f);
#ifdef __cplusplus
}
#endif
#endif // #ifndef __USART_H__