aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/hal/xmega/uart.h
blob: b7a6be69a0271c3ea48e78d9154fbf80f793bcf4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef UART_H_
#define UART_H_

#include "usart_driver.h"
#include "avr_compiler.h"


//Init UART0, set to baud rate as defined in header file
void init_uart0(void);

//Input a char on UART0 and store it to data, however if no char is recieved
//within timeout, then abort and return TIMEOUT, otherwise return BYTE_REC
//(note: timeout is NOT a reliable value, as it uses a simple C loop that
//will change with different compiler settings likely
unsigned char input_ch_w_timeout_0(char * data, unsigned int timeout);

//wait forever for a char on UART 0 and return it
char input_ch_0(void);

//output char data on UART0
void output_ch_0(char data);

#endif //UART_H_