From b766c4874440a1151091916ba116ac50b43fbe01 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Sat, 22 Oct 2016 16:40:38 +0200 Subject: [PATCH] [EFM32] Condense common header files First wave of squashing header files in order to get to a more sensible folder tree. * Moved header files with 100% similarity to common folder * Created a CommonPinNames.h header containing the base pin names P[A-F][0-15] and NC --- .../TARGET_EFM32GG_STK3700/PinNames.h | 66 +------------ .../TARGET_EFM32HG_STK3400/PinNames.h | 65 +------------ .../TARGET_EFM32HG_STK3400/PortNames.h | 44 --------- .../TARGET_EFM32HG_STK3400/device.h | 49 ---------- .../TARGET_EFM32LG_STK3600/PinNames.h | 65 +------------ .../TARGET_EFM32LG_STK3600/PortNames.h | 44 --------- .../TARGET_EFM32LG_STK3600/device.h | 44 --------- .../TARGET_EFM32PG_STK3401/PinNames.h | 60 +----------- .../TARGET_EFM32PG_STK3401/PortNames.h | 43 --------- .../TARGET_EFM32PG_STK3401/device.h | 44 --------- .../TARGET_EFM32WG_STK3800/PinNames.h | 65 +------------ .../TARGET_EFM32WG_STK3800/PortNames.h | 44 --------- .../TARGET_EFM32WG_STK3800/device.h | 44 --------- .../TARGET_EFM32ZG_STK3200/PinNames.h | 65 +------------ .../TARGET_EFM32ZG_STK3200/PortNames.h | 44 --------- .../TARGET_EFM32ZG_STK3200/device.h | 49 ---------- .../TARGET_EFM32/common/CommonPinNames.h | 94 +++++++++++++++++++ .../PortNames.h | 0 .../TARGET_EFM32/{ => common}/clocking.h | 0 .../device.h | 14 --- .../TARGET_EFM32/{ => common}/error.h | 0 .../{ => common}/mbed_overrides.c | 0 .../TARGET_EFM32/{ => common}/objects.h | 0 23 files changed, 112 insertions(+), 831 deletions(-) delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PortNames.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/device.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PortNames.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/device.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PortNames.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/device.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PortNames.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/device.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PortNames.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/device.h create mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/common/CommonPinNames.h rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{TARGET_EFM32GG_STK3700 => common}/PortNames.h (100%) rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{ => common}/clocking.h (100%) rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{TARGET_EFM32GG_STK3700 => common}/device.h (98%) rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{ => common}/error.h (100%) rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{ => common}/mbed_overrides.c (100%) rename targets/TARGET_Silicon_Labs/TARGET_EFM32/{ => common}/objects.h (100%) diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PinNames.h index 257fc52db7..d0404a0f4d 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PinNames.h @@ -23,30 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" -#include "Modules.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PE2, @@ -66,53 +50,9 @@ typedef enum { SERIAL_RX = PD1, USBTX = PE0, USBRX = PE1, - EFM_BC_EN = PF7, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PF7 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - // EFM32 pin modes - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - PushPullDrive = gpioModePushPullDrive, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - WiredAndDrive = gpioModeWiredAndDrive, - WiredAndDriveFilter = gpioModeWiredAndDriveFilter, - WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, - WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PinNames.h index 72f46f581e..d0b700aa76 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PinNames.h @@ -23,29 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PF4, @@ -65,53 +50,9 @@ typedef enum { SERIAL_RX = PE11, USBTX = PF2, USBRX = PA0, - EFM_BC_EN = PA9, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PA9 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - /* EFM32 pin modes */ - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - PushPullDrive = gpioModePushPullDrive, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - WiredAndDrive = gpioModeWiredAndDrive, - WiredAndDriveFilter = gpioModeWiredAndDriveFilter, - WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, - WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PortNames.h deleted file mode 100644 index 0504acd7e0..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PortNames.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file PortNames.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_PORTNAMES_H -#define MBED_PORTNAMES_H - -#include "em_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PortA = gpioPortA, /**< Port A */ - PortB = gpioPortB, /**< Port B */ - PortC = gpioPortC, /**< Port C */ - PortD = gpioPortD, /**< Port D */ - PortE = gpioPortE, /**< Port E */ - PortF = gpioPortF /**< Port F */ -} PortName; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/device.h deleted file mode 100644 index ea87df924c..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/device.h +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************//** - * @file device.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - - - - - - - - - - - - - - - -// Redefine OPEN_MAX from sys_limits.h to save on RAM. -// Effect: maximum amount of file handlers = OPEN_MAX -// This is not going to have an impact, since this is a RAM-limited part anyway. -#define OPEN_MAX 24 - -#include "objects.h" -#include "Modules.h" -#include "device_peripherals.h" - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PinNames.h index a1b5e958c7..d0404a0f4d 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PinNames.h @@ -23,29 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PE2, @@ -65,53 +50,9 @@ typedef enum { SERIAL_RX = PD1, USBTX = PE0, USBRX = PE1, - EFM_BC_EN = PF7, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PF7 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - /* EFM32 pin modes */ - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - PushPullDrive = gpioModePushPullDrive, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - WiredAndDrive = gpioModeWiredAndDrive, - WiredAndDriveFilter = gpioModeWiredAndDriveFilter, - WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, - WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PortNames.h deleted file mode 100644 index 0504acd7e0..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PortNames.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file PortNames.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_PORTNAMES_H -#define MBED_PORTNAMES_H - -#include "em_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PortA = gpioPortA, /**< Port A */ - PortB = gpioPortB, /**< Port B */ - PortC = gpioPortC, /**< Port C */ - PortD = gpioPortD, /**< Port D */ - PortE = gpioPortE, /**< Port E */ - PortF = gpioPortF /**< Port F */ -} PortName; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/device.h deleted file mode 100644 index 24f1a0e4ff..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/device.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file device.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - - - - - - - - - - - - - - - -#include "objects.h" -#include "Modules.h" -#include "device_peripherals.h" - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PinNames.h index 629a10b658..bfe41a2199 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PinNames.h @@ -23,29 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PF4, @@ -67,48 +52,9 @@ typedef enum { /* Board Controller UART (USB) + enable pin */ USBTX = PA0, USBRX = PA1, - EFM_BC_EN = PA5, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PA5 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - /* EFM32 pin modes */ - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PortNames.h deleted file mode 100644 index 370f960336..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/PortNames.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************//** - * @file PortNames.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_PORTNAMES_H -#define MBED_PORTNAMES_H - -#include "em_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PortA = gpioPortA, /**< Port A */ - PortB = gpioPortB, /**< Port B */ - PortC = gpioPortC, /**< Port C */ - PortD = gpioPortD, /**< Port D */ - PortF = gpioPortF /**< Port F */ -} PortName; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/device.h deleted file mode 100644 index 24f1a0e4ff..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/device.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file device.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - - - - - - - - - - - - - - - -#include "objects.h" -#include "Modules.h" -#include "device_peripherals.h" - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PinNames.h index a1b5e958c7..d0404a0f4d 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PinNames.h @@ -23,29 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PE2, @@ -65,53 +50,9 @@ typedef enum { SERIAL_RX = PD1, USBTX = PE0, USBRX = PE1, - EFM_BC_EN = PF7, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PF7 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - /* EFM32 pin modes */ - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - PushPullDrive = gpioModePushPullDrive, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - WiredAndDrive = gpioModeWiredAndDrive, - WiredAndDriveFilter = gpioModeWiredAndDriveFilter, - WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, - WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PortNames.h deleted file mode 100644 index 0504acd7e0..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PortNames.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file PortNames.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_PORTNAMES_H -#define MBED_PORTNAMES_H - -#include "em_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PortA = gpioPortA, /**< Port A */ - PortB = gpioPortB, /**< Port B */ - PortC = gpioPortC, /**< Port C */ - PortD = gpioPortD, /**< Port D */ - PortE = gpioPortE, /**< Port E */ - PortF = gpioPortF /**< Port F */ -} PortName; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/device.h deleted file mode 100644 index 24f1a0e4ff..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/device.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file device.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - - - - - - - - - - - - - - - -#include "objects.h" -#include "Modules.h" -#include "device_peripherals.h" - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PinNames.h index 75686cfc2e..01822926d2 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PinNames.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PinNames.h @@ -23,29 +23,14 @@ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H -#include "cmsis.h" -#include "em_gpio.h" +#include "CommonPinNames.h" #ifdef __cplusplus extern "C" { #endif typedef enum { - PIN_INPUT = 0, - PIN_OUTPUT = 1 -} PinDirection; - -typedef enum { - /* EFM32 Pin Names - * First 4 bits represent pin number, the remaining - * bits represent port number (A = 0, B = 1, ...) - */ - PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, - PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, - PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, - PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, - PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, - PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, + EFM32_STANDARD_PIN_DEFINITIONS, /* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */ LED0 = PC10, @@ -65,53 +50,9 @@ typedef enum { SERIAL_RX = PD6, USBTX = PD4, USBRX = PD5, - EFM_BC_EN = PA9, - - /* Not connected */ - NC = (int) 0xFFFFFFFF + EFM_BC_EN = PA9 } PinName; - -/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ -typedef enum { - /* EFM32 pin modes */ - Disabled = gpioModeDisabled, - DisabledPullUp = gpioModeDisabled | 0x10, - Input = gpioModeInput, - InputFilter = gpioModeInput | 0x10, - InputPullDown = gpioModeInputPull, - InputPullUp = gpioModeInputPull | 0x10, - InputPullFilterDown = gpioModeInputPullFilter, - InputPullFilterUp = gpioModeInputPullFilter | 0x10, - PushPull = gpioModePushPull, - PushPullDrive = gpioModePushPullDrive, - WiredOr = gpioModeWiredOr, - WiredOrPullDown = gpioModeWiredOrPullDown, - WiredAnd = gpioModeWiredAnd, - WiredAndFilter = gpioModeWiredAndFilter, - WiredAndPullUp = gpioModeWiredAndPullUp, - WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, - WiredAndDrive = gpioModeWiredAndDrive, - WiredAndDriveFilter = gpioModeWiredAndDriveFilter, - WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, - WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, - - /* mbed modes: - * PullUp, PullDown, PullNone, OpenDrain - * - * mbed default digital input mode: - * PullDefault - * - * mbed default digital output mode: - * PullNone - */ - PullUp = InputPullUp, - PullDown = InputPullDown, - OpenDrain = WiredAnd, - PullNone = PushPull, - PullDefault = PushPull -} PinMode; - #ifdef __cplusplus } #endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PortNames.h deleted file mode 100644 index 0504acd7e0..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/PortNames.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************//** - * @file PortNames.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_PORTNAMES_H -#define MBED_PORTNAMES_H - -#include "em_gpio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - PortA = gpioPortA, /**< Port A */ - PortB = gpioPortB, /**< Port B */ - PortC = gpioPortC, /**< Port C */ - PortD = gpioPortD, /**< Port D */ - PortE = gpioPortE, /**< Port E */ - PortF = gpioPortF /**< Port F */ -} PortName; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/device.h deleted file mode 100644 index 8a9638615b..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/device.h +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************//** - * @file device.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_DEVICE_H -#define MBED_DEVICE_H - - - - - - - - - - - - - - - -// Redefine OPEN_MAX from sys_limits.h to save on RAM. -// Effect: maximum amount of file handlers = OPEN_MAX -// This is not going to have an impact, since this is a RAM-limited part anyway. -#define OPEN_MAX 8 - -#include "objects.h" -#include "Modules.h" -#include "device_peripherals.h" - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/CommonPinNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/CommonPinNames.h new file mode 100644 index 0000000000..50589db004 --- /dev/null +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/CommonPinNames.h @@ -0,0 +1,94 @@ +/***************************************************************************//** + * @file PinNames.h + ******************************************************************************* + * @section License + * (C) Copyright 2015 Silicon Labs, http://www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ +#ifndef MBED_COMMONPINNAMES_H +#define MBED_COMMONPINNAMES_H + +#include "em_gpio.h" + +/* EFM32 Pin Names + * First 4 bits represent pin number, the remaining + * bits represent port number (A = 0, B = 1, ...) + */ +#define EFM32_STANDARD_PIN_DEFINITIONS \ + PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, \ + PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, \ + PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, \ + PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, \ + PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, \ + PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, \ + NC = (int) 0xFFFFFFFF + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + PIN_INPUT = 0, + PIN_OUTPUT = 1 +} PinDirection; + +/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */ +typedef enum { + /* EFM32 pin modes */ + Disabled = gpioModeDisabled, + DisabledPullUp = gpioModeDisabled | 0x10, + Input = gpioModeInput, + InputFilter = gpioModeInput | 0x10, + InputPullDown = gpioModeInputPull, + InputPullUp = gpioModeInputPull | 0x10, + InputPullFilterDown = gpioModeInputPullFilter, + InputPullFilterUp = gpioModeInputPullFilter | 0x10, + PushPull = gpioModePushPull, + PushPullDrive = gpioModePushPullDrive, + WiredOr = gpioModeWiredOr, + WiredOrPullDown = gpioModeWiredOrPullDown, + WiredAnd = gpioModeWiredAnd, + WiredAndFilter = gpioModeWiredAndFilter, + WiredAndPullUp = gpioModeWiredAndPullUp, + WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter, + WiredAndDrive = gpioModeWiredAndDrive, + WiredAndDriveFilter = gpioModeWiredAndDriveFilter, + WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp, + WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter, + + /* mbed modes: + * PullUp, PullDown, PullNone, OpenDrain + * + * mbed default digital input mode: + * PullDefault + * + * mbed default digital output mode: + * PullNone + */ + PullUp = InputPullUp, + PullDown = InputPullDown, + OpenDrain = WiredAnd, + PullNone = PushPull, + PullDefault = PushPull +} PinMode; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PortNames.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/PortNames.h similarity index 100% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PortNames.h rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/PortNames.h diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/clocking.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/clocking.h similarity index 100% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/clocking.h rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/clocking.h diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/device.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h similarity index 98% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/device.h rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h index a06b2684f3..8114bdfef7 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/device.h +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/device.h @@ -23,20 +23,6 @@ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H - - - - - - - - - - - - - - #include "objects.h" #include "device_peripherals.h" diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/error.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/error.h similarity index 100% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/error.h rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/error.h diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/mbed_overrides.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c similarity index 100% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/mbed_overrides.c rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/objects.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/objects.h similarity index 100% rename from targets/TARGET_Silicon_Labs/TARGET_EFM32/objects.h rename to targets/TARGET_Silicon_Labs/TARGET_EFM32/common/objects.h