1 /**************************************************************************//**
2  * @file
3  * @brief efm32g_af_ports Register and Bit Field definitions
4  * @author Energy Micro AS
5  * @version 3.0.0
6  ******************************************************************************
7  * @section License
8  * <b>(C) Copyright 2012 Energy Micro AS, http://www.energymicro.com</b>
9  ******************************************************************************
10  *
11  * Permission is granted to anyone to use this software for any purpose,
12  * including commercial applications, and to alter it and redistribute it
13  * freely, subject to the following restrictions:
14  *
15  * 1. The origin of this software must not be misrepresented; you must not
16  *    claim that you wrote the original software.
17  * 2. Altered source versions must be plainly marked as such, and must not be
18  *    misrepresented as being the original software.
19  * 3. This notice may not be removed or altered from any source distribution.
20  *
21  * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
22  * obligation to support this Software. Energy Micro AS is providing the
23  * Software "AS IS", with no express or implied warranties of any kind,
24  * including, but not limited to, any implied warranties of merchantability
25  * or fitness for any particular purpose or warranties against infringement
26  * of any proprietary rights of a third party.
27  *
28  * Energy Micro AS will not be liable for any consequential, incidental, or
29  * special damages, or any other relief, or for any claim by any third party,
30  * arising from your use of this Software.
31  *
32  *****************************************************************************/
33 /**************************************************************************//**
34  * @defgroup EFM32G_AF_Ports
35  * @{
36  *****************************************************************************/
37 
38 /** AF port for function f */
39 #define AF_CMU_CLK0_PORT(f)         ((f) == 0 ? 0 : (f) == 1 ? 2 :  -1)
40 #define AF_CMU_CLK1_PORT(f)         ((f) == 0 ? 0 : (f) == 1 ? 3 :  -1)
41 #define AF_EBI_AD00_PORT(f)         ((f) == 0 ? 4 :  -1)
42 #define AF_EBI_AD01_PORT(f)         ((f) == 0 ? 4 :  -1)
43 #define AF_EBI_AD02_PORT(f)         ((f) == 0 ? 4 :  -1)
44 #define AF_EBI_AD03_PORT(f)         ((f) == 0 ? 4 :  -1)
45 #define AF_EBI_AD04_PORT(f)         ((f) == 0 ? 4 :  -1)
46 #define AF_EBI_AD05_PORT(f)         ((f) == 0 ? 4 :  -1)
47 #define AF_EBI_AD06_PORT(f)         ((f) == 0 ? 4 :  -1)
48 #define AF_EBI_AD07_PORT(f)         ((f) == 0 ? 4 :  -1)
49 #define AF_EBI_AD08_PORT(f)         ((f) == 0 ? 0 :  -1)
50 #define AF_EBI_AD09_PORT(f)         ((f) == 0 ? 0 :  -1)
51 #define AF_EBI_AD10_PORT(f)         ((f) == 0 ? 0 :  -1)
52 #define AF_EBI_AD11_PORT(f)         ((f) == 0 ? 0 :  -1)
53 #define AF_EBI_AD12_PORT(f)         ((f) == 0 ? 0 :  -1)
54 #define AF_EBI_AD13_PORT(f)         ((f) == 0 ? 0 :  -1)
55 #define AF_EBI_AD14_PORT(f)         ((f) == 0 ? 0 :  -1)
56 #define AF_EBI_AD15_PORT(f)         ((f) == 0 ? 0 :  -1)
57 #define AF_EBI_CS0_PORT(f)          ((f) == 0 ? 3 :  -1)
58 #define AF_EBI_CS1_PORT(f)          ((f) == 0 ? 3 :  -1)
59 #define AF_EBI_CS2_PORT(f)          ((f) == 0 ? 3 :  -1)
60 #define AF_EBI_CS3_PORT(f)          ((f) == 0 ? 3 :  -1)
61 #define AF_EBI_WEn_PORT(f)          ((f) == 0 ? 5 :  -1)
62 #define AF_EBI_REn_PORT(f)          ((f) == 0 ? 5 :  -1)
63 #define AF_EBI_ARDY_PORT(f)         ((f) == 0 ? 5 :  -1)
64 #define AF_EBI_ALE_PORT(f)          ((f) == 0 ? 5 :  -1)
65 #define AF_TIMER0_CC0_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 5 : (f) == 3 ? 3 :  -1)
66 #define AF_TIMER0_CC1_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 5 : (f) == 3 ? 3 :  -1)
67 #define AF_TIMER0_CC2_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 5 : (f) == 3 ? 3 :  -1)
68 #define AF_TIMER0_CDTI0_PORT(f)     ((f) == 0 ? 0 : (f) == 1 ? 2 : (f) == 2 ? 5 : (f) == 3 ? 2 :  -1)
69 #define AF_TIMER0_CDTI1_PORT(f)     ((f) == 0 ? 0 : (f) == 1 ? 2 : (f) == 2 ? 5 : (f) == 3 ? 2 :  -1)
70 #define AF_TIMER0_CDTI2_PORT(f)     ((f) == 0 ? 0 : (f) == 1 ? 2 : (f) == 2 ? 5 : (f) == 3 ? 2 :  -1)
71 #define AF_TIMER1_CC0_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 4 : (f) == 2 ? 1 :  -1)
72 #define AF_TIMER1_CC1_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 4 : (f) == 2 ? 1 :  -1)
73 #define AF_TIMER1_CC2_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 4 : (f) == 2 ? 1 :  -1)
74 #define AF_TIMER1_CDTI0_PORT(f)     (-1)
75 #define AF_TIMER1_CDTI1_PORT(f)     (-1)
76 #define AF_TIMER1_CDTI2_PORT(f)     (-1)
77 #define AF_TIMER2_CC0_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 2 :  -1)
78 #define AF_TIMER2_CC1_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 2 :  -1)
79 #define AF_TIMER2_CC2_PORT(f)       ((f) == 0 ? 0 : (f) == 1 ? 0 : (f) == 2 ? 2 :  -1)
80 #define AF_TIMER2_CDTI0_PORT(f)     (-1)
81 #define AF_TIMER2_CDTI1_PORT(f)     (-1)
82 #define AF_TIMER2_CDTI2_PORT(f)     (-1)
83 #define AF_USART0_TX_PORT(f)        ((f) == 0 ? 4 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
84 #define AF_USART0_RX_PORT(f)        ((f) == 0 ? 4 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
85 #define AF_USART0_CLK_PORT(f)       ((f) == 0 ? 4 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
86 #define AF_USART0_CS_PORT(f)        ((f) == 0 ? 4 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
87 #define AF_USART1_TX_PORT(f)        ((f) == 0 ? 2 : (f) == 1 ? 3 :  -1)
88 #define AF_USART1_RX_PORT(f)        ((f) == 0 ? 2 : (f) == 1 ? 3 :  -1)
89 #define AF_USART1_CLK_PORT(f)       ((f) == 0 ? 1 : (f) == 1 ? 3 :  -1)
90 #define AF_USART1_CS_PORT(f)        ((f) == 0 ? 1 : (f) == 1 ? 3 :  -1)
91 #define AF_USART2_TX_PORT(f)        ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
92 #define AF_USART2_RX_PORT(f)        ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
93 #define AF_USART2_CLK_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
94 #define AF_USART2_CS_PORT(f)        ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
95 #define AF_UART0_TX_PORT(f)         ((f) == 0 ? 5 : (f) == 1 ? 4 : (f) == 2 ? 0 : (f) == 3 ? 2 :  -1)
96 #define AF_UART0_RX_PORT(f)         ((f) == 0 ? 5 : (f) == 1 ? 4 : (f) == 2 ? 0 : (f) == 3 ? 2 :  -1)
97 #define AF_UART0_CLK_PORT(f)        (-1)
98 #define AF_UART0_CS_PORT(f)         (-1)
99 #define AF_LEUART0_TX_PORT(f)       ((f) == 0 ? 3 : (f) == 1 ? 1 : (f) == 2 ? 4 :  -1)
100 #define AF_LEUART0_RX_PORT(f)       ((f) == 0 ? 3 : (f) == 1 ? 1 : (f) == 2 ? 4 :  -1)
101 #define AF_LEUART1_TX_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 0 :  -1)
102 #define AF_LEUART1_RX_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 0 :  -1)
103 #define AF_LETIMER0_OUT0_PORT(f)    ((f) == 0 ? 3 : (f) == 1 ? 1 : (f) == 2 ? 5 : (f) == 3 ? 2 :  -1)
104 #define AF_LETIMER0_OUT1_PORT(f)    ((f) == 0 ? 3 : (f) == 1 ? 1 : (f) == 2 ? 5 : (f) == 3 ? 2 :  -1)
105 #define AF_PCNT0_S0IN_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
106 #define AF_PCNT0_S1IN_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 4 : (f) == 2 ? 2 :  -1)
107 #define AF_PCNT1_S0IN_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
108 #define AF_PCNT1_S1IN_PORT(f)       ((f) == 0 ? 2 : (f) == 1 ? 1 :  -1)
109 #define AF_PCNT2_S0IN_PORT(f)       ((f) == 0 ? 3 : (f) == 1 ? 4 :  -1)
110 #define AF_PCNT2_S1IN_PORT(f)       ((f) == 0 ? 3 : (f) == 1 ? 4 :  -1)
111 #define AF_I2C0_SDA_PORT(f)         ((f) == 0 ? 0 : (f) == 1 ? 3 : (f) == 2 ? 2 : (f) == 3 ? 3 :  -1)
112 #define AF_I2C0_SCL_PORT(f)         ((f) == 0 ? 0 : (f) == 1 ? 3 : (f) == 2 ? 2 : (f) == 3 ? 3 :  -1)
113 #define AF_ACMP0_OUT_PORT(f)        ((f) == 0 ? 4 : (f) == 1 ? 4 :  -1)
114 #define AF_ACMP1_OUT_PORT(f)        ((f) == 0 ? 5 : (f) == 1 ? 4 :  -1)
115 #define AF_DBG_SWO_PORT(f)          ((f) == 0 ? 5 : (f) == 1 ? 2 :  -1)
116 #define AF_DBG_SWDIO_PORT(f)        ((f) == 0 ? 5 : (f) == 1 ? 5 :  -1)
117 #define AF_DBG_SWCLK_PORT(f)        ((f) == 0 ? 5 : (f) == 1 ? 5 :  -1)
118 
119 /** @} End of group EFM32G_AF_Ports */
120 
121 
122