usart.h 854 B

12345678910111213141516171819202122232425262728
  1. #ifndef __DEBUG_USART_H
  2. #define __DEBUG_USART_H
  3. #include "stm32f2xx.h"
  4. #include <stdio.h>
  5. #include "sys_data.h"
  6. #define USART_BAUDRATE 9600 //´®¿Ú²¨ÌØÂÊ
  7. #define USART3_RX_GPIO_PORT GPIOD
  8. #define USART3_RX_GPIO_CLK RCC_AHB1Periph_GPIOD
  9. #define USART3_RX_PIN GPIO_Pin_8
  10. #define USART3_RX_AF GPIO_AF_USART3
  11. #define USART3_RX_SOURCE GPIO_PinSource8
  12. #define USART3_TX_GPIO_PORT GPIOD
  13. #define USART3_TX_GPIO_CLK RCC_AHB1Periph_GPIOD
  14. #define USART3_TX_PIN GPIO_Pin_9
  15. #define USART3_TX_AF GPIO_AF_USART3
  16. #define USART3_TX_SOURCE GPIO_PinSource9
  17. #define USART_232 USART3
  18. void USART3_config(void);
  19. #endif /* __USART1_H */