#ifndef __UART_DMX_H
#define __UART_DMX_H

#include <stdint.h>
#include <stdbool.h>

/* UART Buffers */
#define UART_TX_BUF_SIZE 255                         /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE 255                         /**< UART RX buffer size. */

extern struct DMX512{
	/* DMX512 Tripple buffering */
	uint8_t buffer_0[515+UART_RX_BUF_SIZE];
	uint8_t buffer_1[515+UART_RX_BUF_SIZE];
	uint8_t buffer_2[515+UART_RX_BUF_SIZE];
	/* DMX512 Buffers pointers */
	uint8_t * read;
	uint8_t * read_prev;
	uint8_t * write;
	uint8_t * write_prev;
}DMX512_buffers;
extern uint16_t DMX_received_bytes;
extern uint16_t DMX512_write_counter;



void init_UART(uint8_t UART_DMX, bool UART_TX_EXT);

#endif // __UART_DMX_H

