My Project
serial.h
1 /*
2  * serial.h
3  *
4  * Created on: Feb 4, 2016
5  * Author: jordi
6  */
7 
8 #ifndef SERIAL_H_
9 #define SERIAL_H_
10 
11 #include "uart.h"
12 
13 
14 #define SERIAL_TX_BUFFER 1000
15 #define SERIAL_RX_BUFFER 1000
16 
17 
18 #define SERIAL_PORT0 UART_PORT0
19 #define SERIAL_PORT1 UART_PORT1
20 #define SERIAL_PORT2 UART_PORT2
21 #define SERIAL_PORT3 UART_PORT3
22 #define SERIAL_MAX_PORT 4
23 
24 
25 
26 
27 typedef enum serial_baudrates {
28  BAUD_9600,
29  BAUD_19200,
30  BAUD_57600,
31  BAUD_115200,
32  BAUD_UNSUPORTED,
33 } serial_baudrate;
34 
35 
43 uint_fast8_t Serial_start( uint_fast8_t port, serial_baudrate baudRate );
44 
45 
46 uint_fast16_t Serial_send(uint_fast8_t port, char * format, ...);
47 
48 
49 #endif /* SERIAL_H_ */