pcb and initial code from https://github.com/das-labor/borgware-2d.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
805 B
36 lines
805 B
16 years ago
|
#ifndef UART_H
|
||
|
#define UART_H
|
||
|
|
||
|
/**
|
||
|
* UART Library
|
||
|
*
|
||
|
* #define F_CPU 16000000 // Oszillator-Frequenz in Hz
|
||
|
* #define UART_INTERRUPT 1
|
||
|
* #define UART_BAUD_RATE 19200
|
||
|
* #define UART_RXBUFSIZE 16
|
||
|
* #define UART_TXBUFSIZE 16
|
||
|
* #define UART_LINE_BUFFER_SIZE 40
|
||
|
* #define UART_LEDS // LED1 and LED2 toggle on tx and rx interrupt
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include <inttypes.h>
|
||
|
#include <avr/pgmspace.h>
|
||
|
|
||
|
void uart_init();
|
||
|
|
||
|
void uart_putc(char c);
|
||
|
void uart_putstr(char * str);
|
||
|
void uart_putstr_P(PGM_P str);
|
||
|
void uart_hexdump(char *buf, int len);
|
||
|
|
||
|
char uart_getc();
|
||
|
char uart_getc_nb(char *c); // returns 1 on success
|
||
|
|
||
|
//get one Cariage return terminated line
|
||
|
//echo charakters back on Uart
|
||
|
//returns buffer with zero terminated line on success, 0 pointer otherwise
|
||
|
char * uart_getline_nb();
|
||
|
|
||
|
#endif
|