Files
car_stm32f103vet6/Core/Bsp/bsp_uart.h
wangbeihong 8d2a0ea0c8 feat: 集成 EasyLogger 并更新 UART DMA 回调
- 集成 EasyLogger,增强日志功能。
- 更新 UART DMA 回调以使用 EasyLogger 记录日志。
- 重新格式化 README.md,提升可读性和清晰度。
- 添加新的 CMSIS DSP 和 FreeRTOS 源文件。
- 更新 CMake 配置以包含 EasyLogger 源文件。

此提交改进了日志功能,为后续开发做好了准备。
2026-04-02 00:27:58 +08:00

34 lines
911 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef BSP_UART_H
#define BSP_UART_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stm32f1xx_hal.h"
#include "usart.h"
#include <string.h>
#include <stdio.h>
#define UART1_RX_BUF_SIZE 256
/* 全局接收变量声明 */
extern uint8_t uart1_rx_buf[UART1_RX_BUF_SIZE]; /* DMA 接收缓冲区 */
extern volatile uint16_t uart1_rx_len; /* 最近一次接收到的数据长度 */
extern volatile uint8_t uart1_rx_flag; /* 接收完成标志1表示有新数据 */
/**
* @brief 使用 UART1 和 DMA 发送数据到 ESP12F 模块(用于 TCP 透传)
* @param data: 要发送的数据指针(以 \0 结尾)
* @return HAL_StatusTypeDef: HAL_OK 表示成功,其他值表示失败
*/
HAL_StatusTypeDef ESP12F_TCP_SendMessage(const char *data);
void BSP_UART1_Init(void);
void UART_IDLE_Callback(UART_HandleTypeDef *huart);
#ifdef __cplusplus
}
#endif
#endif /* BSP_UART_H */