2021-11-18 19:34:41 +01:00
|
|
|
/*
|
2021-12-04 23:11:51 +01:00
|
|
|
* UART2.h
|
2021-11-18 19:34:41 +01:00
|
|
|
*
|
2021-12-04 23:11:51 +01:00
|
|
|
* Created: 25/11/2021 16:25:59
|
2021-11-18 19:34:41 +01:00
|
|
|
* Author: n0x
|
|
|
|
*/
|
|
|
|
|
2021-12-04 23:11:51 +01:00
|
|
|
#include <avr/io.h>
|
|
|
|
#include <avr/interrupt.h>
|
2021-11-18 19:34:41 +01:00
|
|
|
|
2021-12-04 23:11:51 +01:00
|
|
|
#ifndef UART2_H_
|
|
|
|
#define UART2_H_
|
2021-11-18 19:34:41 +01:00
|
|
|
|
2022-01-20 17:22:50 +01:00
|
|
|
#define SIZE_BUFFER 500
|
|
|
|
|
|
|
|
typedef struct CircularBuffer CircularBuffer;
|
|
|
|
struct CircularBuffer{
|
|
|
|
volatile char data[SIZE_BUFFER];
|
|
|
|
volatile uint16_t Readpointer;
|
|
|
|
volatile uint16_t Writepointer;
|
|
|
|
};
|
|
|
|
|
2021-11-18 19:34:41 +01:00
|
|
|
void uart_init(void);
|
2021-12-04 23:11:51 +01:00
|
|
|
void uart_send_byte(char c);
|
|
|
|
void uart_send_string(char* string);
|
2021-11-18 19:34:41 +01:00
|
|
|
|
2021-12-04 23:11:51 +01:00
|
|
|
uint8_t uart_data_available(void);
|
|
|
|
char uart_get_data(void);
|
2021-11-18 19:34:41 +01:00
|
|
|
|
2021-12-04 23:11:51 +01:00
|
|
|
#endif /* UART2_H_ */
|