1 /* 2 * Copyright (c) 2020 Rafael Dias Menezes 3 * SPDX-License-Identifier: Apache-2.0 4 */ 5 6 /** @file 7 * @brief Silabs EFM32PG1B 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 _SILABS_EFM32PG1B_SOC_PINMAP_H_ 14 #define _SILABS_EFM32PG1B_SOC_PINMAP_H_ 15 16 #include <zephyr/devicetree.h> 17 #include <soc.h> 18 #include <em_gpio.h> 19 20 #define GPIO_NODE DT_INST(0, silabs_gecko_gpio) 21 #if DT_NODE_HAS_PROP(GPIO_NODE, location_swo) 22 #define SWO_LOCATION DT_PROP(GPIO_NODE, location_swo) 23 #endif 24 25 /* Serial Wire Output (SWO) */ 26 #if (SWO_LOCATION == 0) 27 #define PIN_SWO {gpioPortF, 2, gpioModePushPull, 1} 28 #elif (SWO_LOCATION == 1) 29 #define PIN_SWO {gpioPortB, 13, gpioModePushPull, 1} 30 #elif (SWO_LOCATION == 2) 31 #define PIN_SWO {gpioPortD, 15, gpioModePushPull, 1} 32 #elif (SWO_LOCATION == 3) 33 #define PIN_SWO {gpioPortC, 11, gpioModePushPull, 1} 34 #elif (SWO_LOCATION >= 4) 35 #error ("Invalid SWO pin location") 36 #endif 37 38 #endif /* _SILABS_EFM32PG1B_SOC_PINMAP_H_ */ 39