Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
serial_communication.h File Reference

Hardware Application Layer for Serial Communication. More...

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/uart.h"
#include <string.h>
Include dependency graph for serial_communication.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SerialComm
 Custom SerialComm structure for UART adaptablity. More...
 

Macros

#define UART_0_RX   3
 
#define UART_0_TX   1
 
#define UART_1_RX   9
 
#define UART_1_TX   10
 
#define UART_2_TX   17
 
#define UART_2_RX   16
 
#define UART_BUFFER_SIZE   1024
 
#define UART_0   UART_NUM_0
 
#define UART_1   UART_NUM_1
 
#define UART_2   UART_NUM_2
 
#define NO_PIN   UART_PIN_NO_CHANGE
 
#define FIVE_BITS   UART_DATA_5_BITS
 
#define SIX_BITS   UART_DATA_6_BITS
 
#define SEVEN_BITS   UART_DATA_7_BITS
 
#define EIGHT_BITS   UART_DATA_8_BITS
 
#define ONE_STOP_BIT   UART_STOP_BITS_1
 
#define ONE_HALF_STOP_BIT   UART_STOP_BITS_1_5
 
#define TWO_STOP_BIT   UART_STOP_BITS_2
 

Typedefs

typedef struct SerialComm SerialComm
 

Functions

void serialCommInit (SerialComm *serial)
 serialCommInit will intialize external serial communication More...
 
void serial_write (SerialComm *serial, char *str, int size)
 serial_write will write the bytes that will be sent via serial communication More...
 

Detailed Description

Hardware Application Layer for Serial Communication.

Author
Jesus Minjares (https://github.com/jminjares4)
Version
0.1
Date
2021-11-27

Macro Definition Documentation

◆ EIGHT_BITS

#define EIGHT_BITS   UART_DATA_8_BITS

◆ FIVE_BITS

#define FIVE_BITS   UART_DATA_5_BITS

◆ NO_PIN

#define NO_PIN   UART_PIN_NO_CHANGE

◆ ONE_HALF_STOP_BIT

#define ONE_HALF_STOP_BIT   UART_STOP_BITS_1_5

◆ ONE_STOP_BIT

#define ONE_STOP_BIT   UART_STOP_BITS_1

◆ SEVEN_BITS

#define SEVEN_BITS   UART_DATA_7_BITS

◆ SIX_BITS

#define SIX_BITS   UART_DATA_6_BITS

◆ TWO_STOP_BIT

#define TWO_STOP_BIT   UART_STOP_BITS_2

◆ UART_0

#define UART_0   UART_NUM_0

◆ UART_0_RX

#define UART_0_RX   3

◆ UART_0_TX

#define UART_0_TX   1

◆ UART_1

#define UART_1   UART_NUM_1

◆ UART_1_RX

#define UART_1_RX   9

◆ UART_1_TX

#define UART_1_TX   10

◆ UART_2

#define UART_2   UART_NUM_2

◆ UART_2_RX

#define UART_2_RX   16

◆ UART_2_TX

#define UART_2_TX   17

◆ UART_BUFFER_SIZE

#define UART_BUFFER_SIZE   1024

Typedef Documentation

◆ SerialComm

typedef struct SerialComm SerialComm

Function Documentation

◆ serial_write()

void serial_write ( SerialComm serial,
char *  str,
int  size 
)

serial_write will write the bytes that will be sent via serial communication

Parameters
serialpass a SerialComm by reference
strstring that will be sent via the serial communication
sizelength of string
Parameters
serialpass a SerialComm by reference
strstring that will be sent via the serial communication
sizelength of string

◆ serialCommInit()

void serialCommInit ( SerialComm serial)

serialCommInit will intialize external serial communication

Parameters
serialpass a SerialComm by reference
Returns
None
Parameters
serialpass a SerialComm by reference
Returns
None