Advertisement
jiapei100

bsp_debug_usart.h

May 22nd, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.27 KB | None | 0 0
  1. #ifndef __DEBUG_USART_H
  2. #define __DEBUG_USART_H
  3.  
  4. #include "stm32f7xx.h"
  5. #include <stdio.h>
  6.  
  7.  
  8.  
  9. // pin definition
  10. /*******************************************************/
  11. #define DEBUG_USART                             USART1
  12. #define DEBUG_USART_CLK_ENABLE()                __USART1_CLK_ENABLE();
  13.  
  14. #define DEBUG_USART_RX_GPIO_PORT                GPIOA
  15. #define DEBUG_USART_RX_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOA_CLK_ENABLE()
  16. #define DEBUG_USART_RX_PIN                      GPIO_PIN_10
  17. #define DEBUG_USART_RX_AF                       GPIO_AF7_USART1
  18.  
  19.  
  20. #define DEBUG_USART_TX_GPIO_PORT                GPIOA
  21. #define DEBUG_USART_TX_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOA_CLK_ENABLE()
  22. #define DEBUG_USART_TX_PIN                      GPIO_PIN_9
  23. #define DEBUG_USART_TX_AF                       GPIO_AF7_USART1
  24.  
  25. #define DEBUG_USART_IRQHandler                  USART1_IRQHandler
  26. #define DEBUG_USART_IRQ                         USART1_IRQn
  27. /************************************************************/
  28.  
  29.  
  30. // serial port's baudrate
  31. #define DEBUG_USART_BAUDRATE                    115200
  32.  
  33. void Usart_SendString( USART_TypeDef * pUSARTx, uint8_t *str);
  34. void DEBUG_USART_Config(void);
  35. //int fputc(int ch, FILE *f);
  36. extern UART_HandleTypeDef UartHandle;
  37. #endif /* __USART1_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement