Skip to content

Commit 9f479e1

Browse files
stevew817adbridge
authored andcommitted
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
1 parent 67878fc commit 9f479e1

File tree

23 files changed

+112
-831
lines changed

23 files changed

+112
-831
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/PinNames.h

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,14 @@
2323
#ifndef MBED_PINNAMES_H
2424
#define MBED_PINNAMES_H
2525

26-
#include "cmsis.h"
27-
#include "em_gpio.h"
28-
#include "Modules.h"
26+
#include "CommonPinNames.h"
2927

3028
#ifdef __cplusplus
3129
extern "C" {
3230
#endif
3331

3432
typedef enum {
35-
PIN_INPUT = 0,
36-
PIN_OUTPUT = 1
37-
} PinDirection;
38-
39-
typedef enum {
40-
/* EFM32 Pin Names
41-
* First 4 bits represent pin number, the remaining
42-
* bits represent port number (A = 0, B = 1, ...)
43-
*/
44-
PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
45-
PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
46-
PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
47-
PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
48-
PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
49-
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
33+
EFM32_STANDARD_PIN_DEFINITIONS,
5034

5135
/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
5236
LED0 = PE2,
@@ -66,53 +50,9 @@ typedef enum {
6650
SERIAL_RX = PD1,
6751
USBTX = PE0,
6852
USBRX = PE1,
69-
EFM_BC_EN = PF7,
70-
71-
/* Not connected */
72-
NC = (int) 0xFFFFFFFF
53+
EFM_BC_EN = PF7
7354
} PinName;
7455

75-
76-
/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
77-
typedef enum {
78-
// EFM32 pin modes
79-
Disabled = gpioModeDisabled,
80-
DisabledPullUp = gpioModeDisabled | 0x10,
81-
Input = gpioModeInput,
82-
InputFilter = gpioModeInput | 0x10,
83-
InputPullDown = gpioModeInputPull,
84-
InputPullUp = gpioModeInputPull | 0x10,
85-
InputPullFilterDown = gpioModeInputPullFilter,
86-
InputPullFilterUp = gpioModeInputPullFilter | 0x10,
87-
PushPull = gpioModePushPull,
88-
PushPullDrive = gpioModePushPullDrive,
89-
WiredOr = gpioModeWiredOr,
90-
WiredOrPullDown = gpioModeWiredOrPullDown,
91-
WiredAnd = gpioModeWiredAnd,
92-
WiredAndFilter = gpioModeWiredAndFilter,
93-
WiredAndPullUp = gpioModeWiredAndPullUp,
94-
WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
95-
WiredAndDrive = gpioModeWiredAndDrive,
96-
WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
97-
WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
98-
WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
99-
100-
/* mbed modes:
101-
* PullUp, PullDown, PullNone, OpenDrain
102-
*
103-
* mbed default digital input mode:
104-
* PullDefault
105-
*
106-
* mbed default digital output mode:
107-
* PullNone
108-
*/
109-
PullUp = InputPullUp,
110-
PullDown = InputPullDown,
111-
OpenDrain = WiredAnd,
112-
PullNone = PushPull,
113-
PullDefault = PushPull
114-
} PinMode;
115-
11656
#ifdef __cplusplus
11757
}
11858
#endif

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PinNames.h

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,14 @@
2323
#ifndef MBED_PINNAMES_H
2424
#define MBED_PINNAMES_H
2525

26-
#include "cmsis.h"
27-
#include "em_gpio.h"
26+
#include "CommonPinNames.h"
2827

2928
#ifdef __cplusplus
3029
extern "C" {
3130
#endif
3231

3332
typedef enum {
34-
PIN_INPUT = 0,
35-
PIN_OUTPUT = 1
36-
} PinDirection;
37-
38-
typedef enum {
39-
/* EFM32 Pin Names
40-
* First 4 bits represent pin number, the remaining
41-
* bits represent port number (A = 0, B = 1, ...)
42-
*/
43-
PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
44-
PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
45-
PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
46-
PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
47-
PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
48-
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
33+
EFM32_STANDARD_PIN_DEFINITIONS,
4934

5035
/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
5136
LED0 = PF4,
@@ -65,53 +50,9 @@ typedef enum {
6550
SERIAL_RX = PE11,
6651
USBTX = PF2,
6752
USBRX = PA0,
68-
EFM_BC_EN = PA9,
69-
70-
/* Not connected */
71-
NC = (int) 0xFFFFFFFF
53+
EFM_BC_EN = PA9
7254
} PinName;
7355

74-
75-
/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
76-
typedef enum {
77-
/* EFM32 pin modes */
78-
Disabled = gpioModeDisabled,
79-
DisabledPullUp = gpioModeDisabled | 0x10,
80-
Input = gpioModeInput,
81-
InputFilter = gpioModeInput | 0x10,
82-
InputPullDown = gpioModeInputPull,
83-
InputPullUp = gpioModeInputPull | 0x10,
84-
InputPullFilterDown = gpioModeInputPullFilter,
85-
InputPullFilterUp = gpioModeInputPullFilter | 0x10,
86-
PushPull = gpioModePushPull,
87-
PushPullDrive = gpioModePushPullDrive,
88-
WiredOr = gpioModeWiredOr,
89-
WiredOrPullDown = gpioModeWiredOrPullDown,
90-
WiredAnd = gpioModeWiredAnd,
91-
WiredAndFilter = gpioModeWiredAndFilter,
92-
WiredAndPullUp = gpioModeWiredAndPullUp,
93-
WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
94-
WiredAndDrive = gpioModeWiredAndDrive,
95-
WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
96-
WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
97-
WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
98-
99-
/* mbed modes:
100-
* PullUp, PullDown, PullNone, OpenDrain
101-
*
102-
* mbed default digital input mode:
103-
* PullDefault
104-
*
105-
* mbed default digital output mode:
106-
* PullNone
107-
*/
108-
PullUp = InputPullUp,
109-
PullDown = InputPullDown,
110-
OpenDrain = WiredAnd,
111-
PullNone = PushPull,
112-
PullDefault = PushPull
113-
} PinMode;
114-
11556
#ifdef __cplusplus
11657
}
11758
#endif

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/PortNames.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/device.h

Lines changed: 0 additions & 49 deletions
This file was deleted.

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/PinNames.h

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,14 @@
2323
#ifndef MBED_PINNAMES_H
2424
#define MBED_PINNAMES_H
2525

26-
#include "cmsis.h"
27-
#include "em_gpio.h"
26+
#include "CommonPinNames.h"
2827

2928
#ifdef __cplusplus
3029
extern "C" {
3130
#endif
3231

3332
typedef enum {
34-
PIN_INPUT = 0,
35-
PIN_OUTPUT = 1
36-
} PinDirection;
37-
38-
typedef enum {
39-
/* EFM32 Pin Names
40-
* First 4 bits represent pin number, the remaining
41-
* bits represent port number (A = 0, B = 1, ...)
42-
*/
43-
PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
44-
PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
45-
PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
46-
PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
47-
PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
48-
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
33+
EFM32_STANDARD_PIN_DEFINITIONS,
4934

5035
/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
5136
LED0 = PE2,
@@ -65,53 +50,9 @@ typedef enum {
6550
SERIAL_RX = PD1,
6651
USBTX = PE0,
6752
USBRX = PE1,
68-
EFM_BC_EN = PF7,
69-
70-
/* Not connected */
71-
NC = (int) 0xFFFFFFFF
53+
EFM_BC_EN = PF7
7254
} PinName;
7355

74-
75-
/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
76-
typedef enum {
77-
/* EFM32 pin modes */
78-
Disabled = gpioModeDisabled,
79-
DisabledPullUp = gpioModeDisabled | 0x10,
80-
Input = gpioModeInput,
81-
InputFilter = gpioModeInput | 0x10,
82-
InputPullDown = gpioModeInputPull,
83-
InputPullUp = gpioModeInputPull | 0x10,
84-
InputPullFilterDown = gpioModeInputPullFilter,
85-
InputPullFilterUp = gpioModeInputPullFilter | 0x10,
86-
PushPull = gpioModePushPull,
87-
PushPullDrive = gpioModePushPullDrive,
88-
WiredOr = gpioModeWiredOr,
89-
WiredOrPullDown = gpioModeWiredOrPullDown,
90-
WiredAnd = gpioModeWiredAnd,
91-
WiredAndFilter = gpioModeWiredAndFilter,
92-
WiredAndPullUp = gpioModeWiredAndPullUp,
93-
WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
94-
WiredAndDrive = gpioModeWiredAndDrive,
95-
WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
96-
WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
97-
WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
98-
99-
/* mbed modes:
100-
* PullUp, PullDown, PullNone, OpenDrain
101-
*
102-
* mbed default digital input mode:
103-
* PullDefault
104-
*
105-
* mbed default digital output mode:
106-
* PullNone
107-
*/
108-
PullUp = InputPullUp,
109-
PullDown = InputPullDown,
110-
OpenDrain = WiredAnd,
111-
PullNone = PushPull,
112-
PullDefault = PushPull
113-
} PinMode;
114-
11556
#ifdef __cplusplus
11657
}
11758
#endif

0 commit comments

Comments
 (0)