]> git.cryptolib.org Git - avr-crypto-lib.git/blob - uart.h
new, derived from old avr/crypto + cast5
[avr-crypto-lib.git] / uart.h
1 #ifndef UART_H
2 #define UART_H
3
4 /**
5  * UART Library
6  *
7  * #define F_CPU 16000000         // Oszillator-Frequenz in Hz
8  * #define UART_INTERRUPT 1
9  * #define UART_BAUD_RATE 19200
10  * #define UART_RXBUFSIZE 16
11  * #define UART_TXBUFSIZE 16
12  * #define UART_LINE_BUFFER_SIZE 40
13  * #define UART_LEDS             // LED1 and LED2 toggle on tx and rx interrupt
14  *
15  */
16
17
18 #include "config.h"
19 #include <inttypes.h>
20 #include <avr/pgmspace.h>
21
22 void uart_init(void);
23
24 void uart_putc(char c);
25 void uart_putstr(char * str);
26 void uart_putstr_P(PGM_P str);
27 void uart_hexdump(void* buf, int len);
28
29 char uart_getc(void);
30 char uart_getc_nb(char *c);             // returns 1 on success
31
32 //get one Cariage return terminated line
33 //echo charakters back on Uart
34 //returns buffer with zero terminated line on success, 0 pointer otherwise
35 char * uart_getline_nb(void);
36
37 #endif