EmbeddedSystems/EmbeddedSystemsTHM/UART.h

30 lines
523 B
C

/*
* UART2.h
*
* Created: 25/11/2021 16:25:59
* Author: n0x
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#ifndef UART2_H_
#define UART2_H_
#define SIZE_BUFFER 500
typedef struct CircularBuffer CircularBuffer;
struct CircularBuffer{
volatile char data[SIZE_BUFFER];
volatile uint16_t Readpointer;
volatile uint16_t Writepointer;
};
void uart_init(void);
void uart_send_byte(char c);
void uart_send_string(char* string);
uint8_t uart_data_available(void);
char uart_get_data(void);
#endif /* UART2_H_ */