#include "driver/uart.h"
#include "driver/gpio.h"

TaskHandle_t Uart1Handle = NULL;
#define UART_BUF_SIZE        (1024)


//********************************
//********************************
//********** INITIALISE **********
//********************************
//********************************
	//----- INIT UART1 -----
	uart_config_t uart_config = {
		.baud_rate = 115200,
		.data_bits = UART_DATA_8_BITS,
		.parity    = UART_PARITY_DISABLE,
		.stop_bits = UART_STOP_BITS_1,
		.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,	//UART_HW_FLOWCTRL_CTS
		.source_clk = UART_SCLK_APB,
		.rx_flow_ctrl_thresh = 100
	};

	uart_driver_install(UART_NUM_1, UART_BUF_SIZE * 2, 0, 0, NULL, ((CONFIG_UART_ISR_IN_IRAM)?ESP_INTR_FLAG_IRAM:0));
	uart_param_config(UART_NUM_1, &uart_config);
	uart_set_pin(UART_NUM_1, 17, 16, 0, 0);


	//Create task for reading data received from the LTE
	xTaskCreate(UartRxTask, "UartRxTask", (UART_BUF_SIZE * 2), NULL, 8, &Uart1Handle);
Receive handler

//*****************************
//*****************************
//********** UART RX **********
//*****************************
//*****************************
static void UartRxTask (void *arg)
{


}

Transmit

	uart_write_bytes(UART_NUM_1, MyDataBuffer, strlen(MyDataBuffer));
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published. Required fields are marked *