Rev 112 |
Blame |
Last modification |
View Log
| RSS feed
#ifndef rs232_h
#define rs232_h
void RS232_init (void);
uint8_t RS232_get (void);
void RS232_send (uint8_t data);
void RS232_text (uint8_t *text);
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle
#endif
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird
#if defined (__AVR_ATmega128__)
#define USR UCSR0A
#define UCR UCSR0B
#define UDR UDR0
#define UBRR UBRR0L
#define EICR EICRB
#endif
#if defined (__AVR_ATmega32__)
#define USR UCSRA
#define UCR UCSRB
#define UBRR UBRRL
#define EICR EICRB
#define INT_VEC_RX SIG_UART_RECV
#define INT_VEC_TX SIG_UART_TRANS
#endif
#if defined (__AVR_ATmega644__)
#define USR UCSR0A
#define UCR UCSR0B
#define UDR UDR0
#define UBRR UBRR0L
#define EICR EICR0B
#define TXEN TXEN0
#define RXEN RXEN0
#define RXCIE RXCIE0
#define TXCIE TXCIE0
#define U2X U2X0
#define UCSRB UCSR0B
#define UDRE UDRE0
#define INT_VEC_RX SIG_USART_RECV
#define INT_VEC_TX SIG_USART_TRANS
#define USART_RXC_vect SIG_USART_RECV
#endif
#if defined (__AVR_ATmega644P__)
#define USR UCSR0A
#define UCR UCSR0B
#define UDR UDR0
#define UBRR UBRR0L
#define EICR EICR0B
#define TXEN TXEN0
#define RXEN RXEN0
#define RXCIE RXCIE0
#define TXCIE TXCIE0
#define U2X U2X0
#define UCSRB UCSR0B
#define UDRE UDRE0
#define INT_VEC_RX SIG_USART_RECV
#define INT_VEC_TX SIG_USART_TRANS
#define USART_RXC_vect SIG_USART_RECV
#endif