1 /*
2  * Copyright (c) 2018 Christian Taedcke, Diego Sueiro
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 /** @file
7  * @brief Silabs EFR32MG MCU pin definitions.
8  *
9  * This file contains pin configuration data required by different MCU
10  * modules to correctly configure GPIO controller.
11  */
12 
13 #ifndef _SOC_PINMAP_H_
14 #define _SOC_PINMAP_H_
15 
16 #include <zephyr/devicetree.h>
17 #include <em_gpio.h>
18 
19 #define GPIO_NODE DT_INST(0, silabs_gecko_gpio)
20 #if DT_NODE_HAS_PROP(GPIO_NODE, location_swo)
21 #define SWO_LOCATION DT_PROP(GPIO_NODE, location_swo)
22 #endif
23 
24 /* Serial Wire Output (SWO) */
25 #if (SWO_LOCATION == 0)
26 #define PIN_SWO {gpioPortF, 2, gpioModePushPull, 1}
27 #elif (SWO_LOCATION == 1)
28 #define PIN_SWO {gpioPortB, 13, gpioModePushPull, 1}
29 #elif (SWO_LOCATION == 2)
30 #define PIN_SWO {gpioPortD, 15, gpioModePushPull, 1}
31 #elif (SWO_LOCATION == 3)
32 #define PIN_SWO {gpioPortC, 11, gpioModePushPull, 1}
33 #elif (SWO_LOCATION >= 4)
34 #error ("Invalid SWO pin location")
35 #endif
36 
37 #endif /* _SOC_PINMAP_H_ */
38