|
31 | 31 | #define MBED_PINNAMES_H
|
32 | 32 |
|
33 | 33 | #include "cmsis.h"
|
| 34 | +#include "PinNamesTypes.h" |
34 | 35 |
|
35 | 36 | #ifdef __cplusplus
|
36 | 37 | extern "C" {
|
37 | 38 | #endif
|
38 | 39 |
|
39 |
| -#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\ |
40 |
| - ((PUPD & 0x07) << 4) |\ |
41 |
| - ((AFNUM & 0x0F) << 7))) |
42 |
| - |
43 |
| -#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\ |
44 |
| - ((PUPD & 0x07) << 4) |\ |
45 |
| - ((AFNUM & 0x0F) << 7) |\ |
46 |
| - ((CHANNEL & 0x1F) << 11) |\ |
47 |
| - ((INVERTED & 0x01) << 16))) |
48 |
| - |
49 |
| -#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) |
50 |
| -#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) |
51 |
| -#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) |
52 |
| -#define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x1F) |
53 |
| -#define STM_PIN_INVERTED(X) (((X) >> 16) & 0x01) |
54 |
| - |
55 |
| -#define STM_MODE_INPUT (0) |
56 |
| -#define STM_MODE_OUTPUT_PP (1) |
57 |
| -#define STM_MODE_OUTPUT_OD (2) |
58 |
| -#define STM_MODE_AF_PP (3) |
59 |
| -#define STM_MODE_AF_OD (4) |
60 |
| -#define STM_MODE_ANALOG (5) |
61 |
| -#define STM_MODE_ANALOG_ADC_CONTROL (6) |
62 |
| -#define STM_MODE_IT_RISING (7) |
63 |
| -#define STM_MODE_IT_FALLING (8) |
64 |
| -#define STM_MODE_IT_RISING_FALLING (9) |
65 |
| -#define STM_MODE_EVT_RISING (10) |
66 |
| -#define STM_MODE_EVT_FALLING (11) |
67 |
| -#define STM_MODE_EVT_RISING_FALLING (12) |
68 |
| -#define STM_MODE_IT_EVT_RESET (13) |
69 |
| - |
70 |
| -// High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) |
71 |
| -// Low nibble = pin number |
72 |
| -#define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) |
73 |
| -#define STM_PIN(X) ((uint32_t)(X) & 0xF) |
74 |
| - |
75 |
| -typedef enum { |
76 |
| - PIN_INPUT, |
77 |
| - PIN_OUTPUT |
78 |
| -} PinDirection; |
79 |
| - |
80 | 40 | typedef enum {
|
81 | 41 | PA_0 = 0x00,
|
82 | 42 | PA_1 = 0x01,
|
@@ -217,14 +177,6 @@ typedef enum {
|
217 | 177 | NC = (int)0xFFFFFFFF
|
218 | 178 | } PinName;
|
219 | 179 |
|
220 |
| -typedef enum { |
221 |
| - PullNone = 0, |
222 |
| - PullUp = 1, |
223 |
| - PullDown = 2, |
224 |
| - OpenDrain = 3, |
225 |
| - PullDefault = PullNone |
226 |
| -} PinMode; |
227 |
| - |
228 | 180 | #ifdef __cplusplus
|
229 | 181 | }
|
230 | 182 | #endif
|
|
0 commit comments