Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
111 | 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); |
||
8 | |||
9 | #endif |
||
10 | |||
11 | //Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
||
12 | #if defined (__AVR_ATmega128__) |
||
13 | #define USR UCSR0A |
||
14 | #define UCR UCSR0B |
||
15 | #define UDR UDR0 |
||
16 | #define UBRR UBRR0L |
||
17 | #define EICR EICRB |
||
18 | #endif |
||
19 | |||
20 | #if defined (__AVR_ATmega32__) |
||
21 | #define USR UCSRA |
||
22 | #define UCR UCSRB |
||
23 | #define UBRR UBRRL |
||
24 | #define EICR EICRB |
||
25 | #define INT_VEC_RX SIG_UART_RECV |
||
26 | #define INT_VEC_TX SIG_UART_TRANS |
||
27 | #endif |
||
28 | |||
29 | #if defined (__AVR_ATmega644__) |
||
30 | #define USR UCSR0A |
||
31 | #define UCR UCSR0B |
||
32 | #define UDR UDR0 |
||
33 | #define UBRR UBRR0L |
||
34 | #define EICR EICR0B |
||
35 | #define TXEN TXEN0 |
||
36 | #define RXEN RXEN0 |
||
37 | #define RXCIE RXCIE0 |
||
38 | #define TXCIE TXCIE0 |
||
39 | #define U2X U2X0 |
||
40 | #define UCSRB UCSR0B |
||
41 | #define UDRE UDRE0 |
||
42 | #define INT_VEC_RX SIG_USART_RECV |
||
43 | #define INT_VEC_TX SIG_USART_TRANS |
||
44 | |||
45 | #define USART_RXC_vect SIG_USART_RECV |
||
46 | #endif |