- 集成 EasyLogger,增强日志功能。 - 更新 UART DMA 回调以使用 EasyLogger 记录日志。 - 重新格式化 README.md,提升可读性和清晰度。 - 添加新的 CMSIS DSP 和 FreeRTOS 源文件。 - 更新 CMake 配置以包含 EasyLogger 源文件。 此提交改进了日志功能,为后续开发做好了准备。
34 lines
911 B
C
34 lines
911 B
C
#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 */ |