Job_SignsPads/ESP32/software/main/inc/drv_usart.h
2025-04-22 10:29:37 +08:00

60 lines
1.5 KiB
C

/*
* @Date: 2024-07-18 13:45:02
* @LastEditors: lzc56 563451665@qq.com
* @LastEditTime: 2024-12-24 17:24:44
* @FilePath: \software\main\inc\drv_usart.h
*/
/* MQTT (over TCP) Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#ifndef __DRV_USART_H__
#define __DRV_USART_H__
#include <main.h>
#include "driver/uart.h"
#include "driver/gpio.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define BUF_SIZE (1024)
//------------------------------------------- BLE
#define BLE_TEST_TXD (4)
#define BLE_TEST_RXD (5)
#define BLE_TEST_RTS (UART_PIN_NO_CHANGE)
#define BLE_TEST_CTS (UART_PIN_NO_CHANGE)
#define BLE_UART_PORT_NUM (UART_NUM_1)
#define BLE_UART_BAUD_RATE (115200)
#define BLE_TASK_STACK_SIZE (1024 * 4)
//------------------------------------------- COM
#define COM_TEST_TXD (17)
#define COM_TEST_RXD (16)
#define COM_TEST_RTS (UART_PIN_NO_CHANGE)
#define COM_TEST_CTS (UART_PIN_NO_CHANGE)
#define COM_UART_PORT_NUM (UART_NUM_1)
#define COM_UART_BAUD_RATE (115200)
#define COM_TASK_STACK_SIZE (1024 * 4)
// extern TaskHandle_t MQTT_TaskHandle;
void drv_uartInit(void);
void uart_TestTask(void);
void Init_COM_Port(void);
void Device_System_StartReset(void);
int com_SendData(const char *data, const int len);
#ifdef __cplusplus
}
#endif
#endif /* __DRV_USART_H__ */