main_ubi_sdk v 0.1.3
This is UBI4 documentation
uart_port.h
Go to the documentation of this file.
1/*
2 ******************************************************************************
3 * @file uart_port.h
4 * @author A.Alborov
5 ******************************************************************************
6*/
7
8#ifndef UART_PORT_H_
9#define UART_PORT_H_
10
11
13
14#ifdef UBI_SDK_TARGET_ESP32
15
16#include "stdint.h"
17#include "driver/uart.h"
18
19#include "freertos/FreeRTOS.h"
20#include "freertos/task.h"
21
22
23
24
25typedef struct
26{
27 int uart_port_num;
28 int uart_rx_pin;
29 int uart_tx_pin;
30
31 uint8_t* rx_buffer;
32 uint16_t rx_buffer_size;
33
34 uint8_t* tx_buffer;
35 uint16_t tx_buffer_size;
36
37 uart_config_t uart_config;
38
39 ports_enum port_type;
40
41
42}uart_init_port_struct;
43
44
45
46typedef struct
47{
49 TaskHandle_t ReceiveTask;
50 bool enableRecieverTask;
51 uart_init_port_struct* init_struct;
52
53 xSemaphoreHandle rx_task_semaphore;
54 uint32_t wait_time_ms;
55 int receive_size;
56 int last_rx_delta_size;
57
58}uart_port_struct;
59
60
61void uart_port_init(uart_init_port_struct* init_struct, uart_port_struct** out_port_struct);
62
63#endif
64#endif /* MAIN_ONE_WIRE_PORT_H_ */
ports_enum
Definition a_port.h:47
Definition a_port.h:99