Danke für deine Hilfe! Hat leider nicht ganz so geklappt, meine Lösung:
1 | #if BOARD == EVK1100
|
2 | # define _USART_ (&AVR32_USART1)
|
3 | # define _USART_RX_PIN AVR32_USART1_RXD_0_PIN
|
4 | # define _USART_RX_FUNCTION AVR32_USART1_RXD_0_FUNCTION
|
5 | # define _USART_TX_PIN AVR32_USART1_TXD_0_PIN
|
6 | # define _USART_TX_FUNCTION AVR32_USART1_TXD_0_FUNCTION
|
7 | #endif
|
8 |
|
9 | //
|
10 | ...
|
11 | //
|
12 |
|
13 | static const gpio_map_t USART_GPIO_MAP = {
|
14 | { _USART_RX_PIN, _USART_RX_FUNCTION },
|
15 | { _USART_TX_PIN, _USART_TX_FUNCTION }
|
16 | };
|
17 |
|
18 | // USART options.
|
19 | static const usart_options_t USART_OPTIONS = {
|
20 | .baudrate = 57600,
|
21 | .charlength = 8,
|
22 | .paritytype = USART_NO_PARITY,
|
23 | .stopbits = USART_1_STOPBIT,
|
24 | .channelmode = USART_NORMAL_CHMODE
|
25 | };
|
26 |
|
27 | // Switch main clock to external oscillator 0 (crystal).
|
28 | pm_switch_to_osc0(&AVR32_PM, FOSC0, OSC0_STARTUP);
|
29 |
|
30 | // Initialize the USART
|
31 | set_usart_base( ( void * ) _USART_ );
|
32 |
|
33 | // Initialize USART in RS232 mode.
|
34 | usart_init_rs232(_USART_, &USART_OPTIONS, FOSC0);
|
35 |
|
36 | gpio_enable_module(USART_GPIO_MAP, sizeof(USART_GPIO_MAP )
|
37 | / sizeof(USART_GPIO_MAP[0] ));
|
38 |
|
39 | //
|
40 | ...
|
41 | //
|
42 | printf("write something\n\r");
|
Wie kann ich aber nun etwas empfangen? ähnlich scanf? Ich dachte das
müsste nun auch funktionieren...
LG