50 lines
1.5 KiB
C
50 lines
1.5 KiB
C
|
/*
|
||
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||
|
*
|
||
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
*
|
||
|
* Change Logs:
|
||
|
* Date Author Notes
|
||
|
* 2025-07-21 Administrator the first version
|
||
|
*/
|
||
|
#ifndef APPLICATIONS_USART_USART_H_
|
||
|
#define APPLICATIONS_USART_USART_H_
|
||
|
|
||
|
|
||
|
#include "stm32h7xx.h"
|
||
|
#include <stdio.h>
|
||
|
|
||
|
|
||
|
|
||
|
//引脚定义
|
||
|
/*******************************************************/
|
||
|
#define DEBUG_USART USART1
|
||
|
#define DEBUG_USART_CLK_ENABLE() __USART1_CLK_ENABLE();
|
||
|
|
||
|
#define DEBUG_USART_RX_GPIO_PORT GPIOA
|
||
|
#define DEBUG_USART_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||
|
#define DEBUG_USART_RX_PIN GPIO_PIN_10
|
||
|
#define DEBUG_USART_RX_AF GPIO_AF7_USART1
|
||
|
|
||
|
|
||
|
#define DEBUG_USART_TX_GPIO_PORT GPIOA
|
||
|
#define DEBUG_USART_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||
|
#define DEBUG_USART_TX_PIN GPIO_PIN_9
|
||
|
#define DEBUG_USART_TX_AF GPIO_AF7_USART1
|
||
|
|
||
|
#define DEBUG_USART_IRQHandler USART1_IRQHandler
|
||
|
#define DEBUG_USART_IRQ USART1_IRQn
|
||
|
/************************************************************/
|
||
|
|
||
|
|
||
|
//串口波特率
|
||
|
#define DEBUG_USART_BAUDRATE 115200
|
||
|
|
||
|
void Usart_SendString( USART_TypeDef * pUSARTx, uint8_t *str);
|
||
|
void DEBUG_USART_Config(void);
|
||
|
//int fputc(int ch, FILE *f);
|
||
|
extern UART_HandleTypeDef UartHandle;
|
||
|
|
||
|
|
||
|
#endif /* APPLICATIONS_USART_USART_H_ */
|