forked from logzhan/RobotHardware-UESTC
25 lines
621 B
C
25 lines
621 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);
|
||
|
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
|