1 /*
2  * Copyright 2018-2019 NXP.
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef _PIN_MUX_H_
9 #define _PIN_MUX_H_
10 
11 /*!
12  * @addtogroup pin_mux
13  * @{
14  */
15 
16 /***********************************************************************************************************************
17  * API
18  **********************************************************************************************************************/
19 
20 #if defined(__cplusplus)
21 extern "C" {
22 #endif
23 
24 /*!
25  * @brief Calls initialization functions.
26  *
27  */
28 void BOARD_InitBootPins(void);
29 
30 /*!
31  * @brief Configures pin routing and optionally pin electrical features.
32  *
33  */
34 void BOARD_InitPins(void);
35 
36 /*! @name PORTA1 (number 23), J2[4]/RED_LED
37   @{ */
38 #define BOARD_LEDRGB_RED_GPIO GPIOA /*!<@brief GPIO device name: GPIOA */
39 #define BOARD_LEDRGB_RED_PORT PORTA /*!<@brief PORT device name: PORTA */
40 #define BOARD_LEDRGB_RED_PIN 1U     /*!<@brief PORTA pin index: 1 */
41                                     /* @} */
42 
43 /*! @name PORTA2 (number 24), J1[8]/GREEN_LED
44   @{ */
45 #define BOARD_LEDRGB_GREEN_GPIO GPIOA /*!<@brief GPIO device name: GPIOA */
46 #define BOARD_LEDRGB_GREEN_PORT PORTA /*!<@brief PORT device name: PORTA */
47 #define BOARD_LEDRGB_GREEN_PIN 2U     /*!<@brief PORTA pin index: 2 */
48                                       /* @} */
49 
50 /*! @name PORTD5 (number 62), J2[12]/BLUE_LED
51   @{ */
52 #define BOARD_LEDRGB_BLUE_GPIO GPIOD /*!<@brief GPIO device name: GPIOD */
53 #define BOARD_LEDRGB_BLUE_PORT PORTD /*!<@brief PORT device name: PORTD */
54 #define BOARD_LEDRGB_BLUE_PIN 5U     /*!<@brief PORTD pin index: 5 */
55                                      /* @} */
56 
57 /*!
58  * @brief Configures pin routing and optionally pin electrical features.
59  *
60  */
61 void BOARD_InitLEDsPins(void);
62 
63 /*! @name PORTB17 (number 40), PUSH_BUTTON1
64   @{ */
65 #define BOARD_SW3_GPIO GPIOB /*!<@brief GPIO device name: GPIOB */
66 #define BOARD_SW3_PORT PORTB /*!<@brief PORT device name: PORTB */
67 #define BOARD_SW3_PIN 17U    /*!<@brief PORTB pin index: 17 */
68                              /* @} */
69 
70 /*! @name PORTC1 (number 44), J24[6]/LLWU_P6/ADC0_SE15/PUSH_BUTTON2
71   @{ */
72 #define BOARD_SW2_GPIO GPIOC /*!<@brief GPIO device name: GPIOC */
73 #define BOARD_SW2_PORT PORTC /*!<@brief PORT device name: PORTC */
74 #define BOARD_SW2_PIN 1U     /*!<@brief PORTC pin index: 1 */
75                              /* @} */
76 
77 /*!
78  * @brief Configures pin routing and optionally pin electrical features.
79  *
80  */
81 void BOARD_InitButtonsPins(void);
82 
83 #define SOPT5_UART1TXSRC_UART_TX 0x00u /*!<@brief UART 1 transmit data source select: UART1_TX pin */
84 
85 /*! @name PORTE1 (number 2), J2[20]/UART1_RX_TGTMCU
86   @{ */
87 #define BOARD_DEBUG_UART_RX_PORT PORTE /*!<@brief PORT device name: PORTE */
88 #define BOARD_DEBUG_UART_RX_PIN 1U     /*!<@brief PORTE pin index: 1 */
89                                        /* @} */
90 
91 /*! @name PORTE0 (number 1), J2[18]/UART1_TX_TGTMCU
92   @{ */
93 #define BOARD_DEBUG_UART_TX_PORT PORTE /*!<@brief PORT device name: PORTE */
94 #define BOARD_DEBUG_UART_TX_PIN 0U     /*!<@brief PORTE pin index: 0 */
95                                        /* @} */
96 
97 /*!
98  * @brief Configures pin routing and optionally pin electrical features.
99  *
100  */
101 void BOARD_InitDEBUG_UARTPins(void);
102 
103 /*! @name PORTB2 (number 37), J24[12]/U8[4]/ADC0_SE12/I2C0_SCL/AUD/ACCEL_I2C/POT_5K
104   @{ */
105 #define BOARD_ACCEL_SCL_PORT PORTB /*!<@brief PORT device name: PORTB */
106 #define BOARD_ACCEL_SCL_PIN 2U     /*!<@brief PORTB pin index: 2 */
107                                    /* @} */
108 
109 /*! @name PORTB3 (number 38), J24[10]/U8[6]/ADC0_SE13/I2C0_SDA/AUD/ACCEL_I2C
110   @{ */
111 #define BOARD_ACCEL_SDA_PORT PORTB /*!<@brief PORT device name: PORTB */
112 #define BOARD_ACCEL_SDA_PIN 3U     /*!<@brief PORTB pin index: 3 */
113                                    /* @} */
114 
115 /*! @name PORTD0 (number 57), U8[11]/LLWU_P12/ACCEL_INT1
116   @{ */
117 #define BOARD_ACCEL_INT1_GPIO GPIOD /*!<@brief GPIO device name: GPIOD */
118 #define BOARD_ACCEL_INT1_PORT PORTD /*!<@brief PORT device name: PORTD */
119 #define BOARD_ACCEL_INT1_PIN 0U     /*!<@brief PORTD pin index: 0 */
120                                     /* @} */
121 
122 /*! @name PORTD1 (number 58), U8[9]/J8[P5]/SPI0_SCK/uSD_SPI_CL/ACCEL_INT2
123   @{ */
124 #define BOARD_ACCEL_INT2_GPIO GPIOD /*!<@brief GPIO device name: GPIOD */
125 #define BOARD_ACCEL_INT2_PORT PORTD /*!<@brief PORT device name: PORTD */
126 #define BOARD_ACCEL_INT2_PIN 1U     /*!<@brief PORTD pin index: 1 */
127                                     /* @} */
128 
129 /*!
130  * @brief Configures pin routing and optionally pin electrical features.
131  *
132  */
133 void BOARD_InitAccelPins(void);
134 
135 /*! @name PORTC4 (number 49), J8[P2]/J24[9]/uSD_card_CS
136   @{ */
137 #define BOARD_SD_CARD_DAT3_PORT PORTC /*!<@brief PORT device name: PORTC */
138 #define BOARD_SD_CARD_DAT3_PIN 4U     /*!<@brief PORTC pin index: 4 */
139                                       /* @} */
140 
141 /*! @name PORTD1 (number 58), U8[9]/J8[P5]/SPI0_SCK/uSD_SPI_CL/ACCEL_INT2
142   @{ */
143 #define BOARD_SD_CARD_CLK_PORT PORTD /*!<@brief PORT device name: PORTD */
144 #define BOARD_SD_CARD_CLK_PIN 1U     /*!<@brief PORTD pin index: 1 */
145                                      /* @} */
146 
147 /*! @name PORTD2 (number 59), J1[2]/J8[P3]/uSD_SPI_MOSI
148   @{ */
149 #define BOARD_SD_CARD_CMD_PORT PORTD /*!<@brief PORT device name: PORTD */
150 #define BOARD_SD_CARD_CMD_PIN 2U     /*!<@brief PORTD pin index: 2 */
151                                      /* @} */
152 
153 /*! @name PORTD3 (number 60), J1[4]/J8[P7]/SPI0_SIN/uSD_SPI_MISO
154   @{ */
155 #define BOARD_SD_CARD_DAT0_PORT PORTD /*!<@brief PORT device name: PORTD */
156 #define BOARD_SD_CARD_DAT0_PIN 3U     /*!<@brief PORTD pin index: 3 */
157                                       /* @} */
158 
159 /*! @name PORTB16 (number 39), J1[6]/J8[G1]/SD_CARD_DETECT
160   @{ */
161 #define BOARD_SD_CARD_DETECT_GPIO GPIOB /*!<@brief GPIO device name: GPIOB */
162 #define BOARD_SD_CARD_DETECT_PORT PORTB /*!<@brief PORT device name: PORTB */
163 #define BOARD_SD_CARD_DETECT_PIN 16U    /*!<@brief PORTB pin index: 16 */
164                                         /* @} */
165 
166 /*!
167  * @brief Configures pin routing and optionally pin electrical features.
168  *
169  */
170 void BOARD_InitSDHCPins(void);
171 
172 /*! @name PORTA18 (number 32), Y1[3]/EXTAL
173   @{ */
174 #define BOARD_EXTAL0_PORT PORTA /*!<@brief PORT device name: PORTA */
175 #define BOARD_EXTAL0_PIN 18U    /*!<@brief PORTA pin index: 18 */
176                                 /* @} */
177 
178 /*! @name PORTA19 (number 33), Y1[1]/XTAL
179   @{ */
180 #define BOARD_XTAL0_PORT PORTA /*!<@brief PORT device name: PORTA */
181 #define BOARD_XTAL0_PIN 19U    /*!<@brief PORTA pin index: 19 */
182                                /* @} */
183 
184 /*!
185  * @brief Configures pin routing and optionally pin electrical features.
186  *
187  */
188 void BOARD_InitOSCPins(void);
189 
190 /*! @name PORTB2 (number 37), J24[12]/U8[4]/ADC0_SE12/I2C0_SCL/AUD/ACCEL_I2C/POT_5K
191   @{ */
192 #define BOARD_POT_5K_PORT PORTB /*!<@brief PORT device name: PORTB */
193 #define BOARD_POT_5K_PIN 2U     /*!<@brief PORTB pin index: 2 */
194                                 /* @} */
195 
196 /*!
197  * @brief Configures pin routing and optionally pin electrical features.
198  *
199  */
200 void BOARD_InitPOTPins(void);
201 
202 /*! @name ADC0_DP3 (number 11), J24[5]/ADC0_DP3/ADC0_SE3/LIGHT_SNSR
203   @{ */
204 /* @} */
205 
206 /*!
207  * @brief Configures pin routing and optionally pin electrical features.
208  *
209  */
210 void BOARD_InitLSENSEPins(void);
211 
212 #if defined(__cplusplus)
213 }
214 #endif
215 
216 /*!
217  * @}
218  */
219 #endif /* _PIN_MUX_H_ */
220 
221 /***********************************************************************************************************************
222  * EOF
223  **********************************************************************************************************************/
224