MAV'RIC
uart_default_config.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file uart_default_config.h
34  *
35  * \author MAV'RIC Team
36  *
37  * \brief Default configuration for uarts
38  *
39  ******************************************************************************/
40 
41 #ifndef UART_DEFAULT_CONFIG_H_
42 #define UART_DEFAULT_CONFIG_H_
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 #include "uart_int.h"
49 
50 static const usart_config_t usart_default_config_console =
51 {
52  .mode = UART_IN_OUT,
53  .uart_device.uart = (avr32_usart_t *)&AVR32_USART4,
54  .uart_device.IRQ = AVR32_USART4_IRQ,
55  .uart_device.receive_stream = NULL,
56  .options =
57  {
58  .baudrate = 57600,
59  .charlength = 8,
60  .paritytype = USART_NO_PARITY,
61  .stopbits = USART_1_STOPBIT,
62  .channelmode = USART_NORMAL_CHMODE
63  },
64  .rx_pin_map = {AVR32_USART4_RXD_2_PIN, AVR32_USART4_RXD_2_FUNCTION},
65  .tx_pin_map = {AVR32_USART4_TXD_2_PIN, AVR32_USART4_TXD_2_FUNCTION}
66 };
67 
68 
69 static const usart_config_t usart_default_config_gps =
70 {
71  .mode = UART_IN_OUT,
72  .uart_device.uart = (avr32_usart_t *)&AVR32_USART3,
73  .uart_device.IRQ = AVR32_USART3_IRQ,
74  .uart_device.receive_stream = NULL,
75  .options =
76  {
77  .baudrate = 38400,
78  .charlength = 8,
79  .paritytype = USART_NO_PARITY,
80  .stopbits = USART_1_STOPBIT,
81  .channelmode = USART_NORMAL_CHMODE
82  },
83  .rx_pin_map = {AVR32_USART3_RXD_0_0_PIN, AVR32_USART3_RXD_0_0_FUNCTION},
84  .tx_pin_map = {AVR32_USART3_TXD_0_0_PIN, AVR32_USART3_TXD_0_0_FUNCTION}
85 };
86 
87 
88 static const usart_config_t usart_default_config_spektrum =
89 {
90  .mode = UART_IN_OUT,
91  .uart_device.uart = (avr32_usart_t *)&AVR32_USART1,
92  .uart_device.IRQ = AVR32_USART1_IRQ,
93  .uart_device.receive_stream = NULL,
94  .options =
95  {
96  .baudrate = 115200,
97  .charlength = 8,
98  .paritytype = USART_NO_PARITY,
99  .stopbits = USART_1_STOPBIT,
100  .channelmode = USART_NORMAL_CHMODE
101  },
102  .rx_pin_map = { AVR32_USART1_RXD_0_1_PIN, AVR32_USART1_RXD_0_1_FUNCTION },
103  .tx_pin_map = { AVR32_USART1_TXD_0_1_PIN, AVR32_USART1_TXD_0_1_FUNCTION }
104 };
105 
106 
107 static const usart_config_t usart_default_config_xbee =
108 {
109  .mode = UART_IN_OUT,
110  .uart_device.uart = (avr32_usart_t *)&AVR32_USART0,
111  .uart_device.IRQ = AVR32_USART0_IRQ,
112  .uart_device.receive_stream = NULL,
113  .options =
114  {
115  .baudrate = 57600,
116  .charlength = 8,
117  .paritytype = USART_NO_PARITY,
118  .stopbits = USART_1_STOPBIT,
119  .channelmode = USART_NORMAL_CHMODE
120  },
121  .rx_pin_map = {AVR32_USART0_RXD_0_0_PIN, AVR32_USART0_RXD_0_0_FUNCTION},
122  .tx_pin_map = {AVR32_USART0_TXD_0_0_PIN, AVR32_USART0_TXD_0_0_FUNCTION}
123 };
124 
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif // UART_DEFAULT_CONFIG_H_
int32_t mode
UART mode.
Definition: uart_int.h:82
UART configuration structure.
Definition: uart_int.h:80