Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
112 | mikeljo | 1 | #ifndef rs232_h |
2 | #define rs232_h |
||
3 | |||
4 | void RS232_init (void); |
||
5 | uint8_t RS232_get (void); |
||
6 | void RS232_send (uint8_t data); |
||
7 | void RS232_text (uint8_t *text); |
||
114 | mikeljo | 8 | |
9 | #define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
||
112 | mikeljo | 10 | |
11 | #endif |
||
12 | |||
13 | //Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
||
14 | #if defined (__AVR_ATmega128__) |
||
15 | #define USR UCSR0A |
||
16 | #define UCR UCSR0B |
||
17 | #define UDR UDR0 |
||
18 | #define UBRR UBRR0L |
||
19 | #define EICR EICRB |
||
20 | #endif |
||
21 | |||
22 | #if defined (__AVR_ATmega32__) |
||
23 | #define USR UCSRA |
||
24 | #define UCR UCSRB |
||
25 | #define UBRR UBRRL |
||
26 | #define EICR EICRB |
||
27 | #define INT_VEC_RX SIG_UART_RECV |
||
28 | #define INT_VEC_TX SIG_UART_TRANS |
||
29 | #endif |
||
30 | |||
31 | #if defined (__AVR_ATmega644__) |
||
32 | #define USR UCSR0A |
||
33 | #define UCR UCSR0B |
||
34 | #define UDR UDR0 |
||
35 | #define UBRR UBRR0L |
||
36 | #define EICR EICR0B |
||
37 | #define TXEN TXEN0 |
||
38 | #define RXEN RXEN0 |
||
39 | #define RXCIE RXCIE0 |
||
40 | #define TXCIE TXCIE0 |
||
41 | #define U2X U2X0 |
||
42 | #define UCSRB UCSR0B |
||
43 | #define UDRE UDRE0 |
||
44 | #define INT_VEC_RX SIG_USART_RECV |
||
45 | #define INT_VEC_TX SIG_USART_TRANS |
||
46 | |||
47 | #define USART_RXC_vect SIG_USART_RECV |
||
48 | #endif |
||
49 | |||
50 | #if defined (__AVR_ATmega644P__) |
||
51 | #define USR UCSR0A |
||
52 | #define UCR UCSR0B |
||
53 | #define UDR UDR0 |
||
54 | #define UBRR UBRR0L |
||
55 | #define EICR EICR0B |
||
56 | #define TXEN TXEN0 |
||
57 | #define RXEN RXEN0 |
||
58 | #define RXCIE RXCIE0 |
||
59 | #define TXCIE TXCIE0 |
||
60 | #define U2X U2X0 |
||
61 | #define UCSRB UCSR0B |
||
62 | #define UDRE UDRE0 |
||
63 | #define INT_VEC_RX SIG_USART_RECV |
||
64 | #define INT_VEC_TX SIG_USART_TRANS |
||
65 | |||
66 | #define USART_RXC_vect SIG_USART_RECV |
||
67 | #endif |