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