File tree 23 files changed +49
-50
lines changed
23 files changed +49
-50
lines changed Original file line number Diff line number Diff line change 25
25
// Include board variant
26
26
#include "variant.h"
27
27
28
+ // Avoid pins number misalignment
29
+ _Static_assert (NUM_DIGITAL_PINS == PEND , "NUM_DIGITAL_PINS and PEND differ!" );
30
+ _Static_assert (NUM_ANALOG_INPUTS == (AEND - A0 ), "NUM_DIGITAL_PINS and (AEND-A0) differ!" );
31
+
28
32
#ifdef __cplusplus
29
33
extern "C" {
30
34
#endif
31
35
32
36
#define NOT_AN_INTERRUPT NC // -1
33
37
#define DEND NUM_DIGITAL_PINS
34
38
35
- #ifdef __cplusplus
36
- static_assert (NUM_DIGITAL_PINS == ((uint32_t )PEND ));
37
- static_assert (NUM_ANALOG_INPUTS == ((uint32_t )(AEND - A0 )));
38
- #endif
39
-
40
39
// Convert a digital pin number Dxx to a PinName PX_n
41
40
// Note: Analog pin is also a digital pin.
42
41
#define digitalPinToPinName (p ) (((uint32_t)p < NUM_DIGITAL_PINS) ? digitalPin[p] : NC)
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ enum {
104
104
PB1_2 ,//D62/A15 = D15
105
105
PEND
106
106
};
107
-
107
+
108
108
// This must be a literal with the same value as PEND
109
- #define NUM_DIGITAL_PINS 63
109
+ #define NUM_DIGITAL_PINS 63
110
110
111
111
enum {
112
112
A_START_AFTER = D46 ,
@@ -116,7 +116,7 @@ enum {
116
116
};
117
117
118
118
// This must be a literal with the same value as AEND-A0
119
- #define NUM_ANALOG_INPUTS 16
119
+ #define NUM_ANALOG_INPUTS 16
120
120
121
121
// On-board LED pin number
122
122
#define LED_BUILTIN PC9
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ enum {
132
132
};
133
133
134
134
// This must be a literal with the same value as PEND
135
- #define NUM_DIGITAL_PINS 87
135
+ #define NUM_DIGITAL_PINS 87
136
136
137
137
enum {
138
138
A_START_AFTER = D78 ,
@@ -141,7 +141,7 @@ enum {
141
141
};
142
142
143
143
// This must be a literal with the same value as AEND-A0
144
- #define NUM_ANALOG_INPUTS 8
144
+ #define NUM_ANALOG_INPUTS 8
145
145
146
146
// On-board LED pin number
147
147
#define LED_BUILTIN PD12
Original file line number Diff line number Diff line change 64
64
};
65
65
66
66
// This must be a literal with the same value as PEND
67
- #define NUM_DIGITAL_PINS 25
67
+ #define NUM_DIGITAL_PINS 25
68
68
69
69
enum {
70
70
A_START_AFTER = D15 ,
73
73
};
74
74
75
75
// This must be a literal with the same value as AEND-A0
76
- #define NUM_ANALOG_INPUTS 6
76
+ #define NUM_ANALOG_INPUTS 6
77
77
78
78
// On-board LED pin number
79
79
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change 74
74
};
75
75
76
76
// This must be a literal with the same value as PEND
77
- #define NUM_DIGITAL_PINS 33
77
+ #define NUM_DIGITAL_PINS 33
78
78
79
79
enum {
80
80
A_START_AFTER = D25 ,
83
83
};
84
84
85
85
// This must be a literal with the same value as AEND-A0
86
- #define NUM_ANALOG_INPUTS 7
86
+ #define NUM_ANALOG_INPUTS 7
87
87
88
88
// On-board LED pin number
89
89
#define LED_BUILTIN PA5
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ enum {
133
133
};
134
134
135
135
// This must be a literal with the same value as PEND
136
- #define NUM_DIGITAL_PINS 85
136
+ #define NUM_DIGITAL_PINS 85
137
137
138
138
enum {
139
139
A_START_AFTER = D68 ,
@@ -143,7 +143,7 @@ enum {
143
143
};
144
144
145
145
// This must be a literal with the same value as AEND-A0
146
- #define NUM_ANALOG_INPUTS 16
146
+ #define NUM_ANALOG_INPUTS 16
147
147
148
148
// On-board LED pin number
149
149
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ enum {
106
106
};
107
107
108
108
// This must be a literal with the same value as PEND
109
- #define NUM_DIGITAL_PINS 61
109
+ #define NUM_DIGITAL_PINS 61
110
110
111
111
enum {
112
112
A_START_AFTER = D48 ,
@@ -116,7 +116,7 @@ enum {
116
116
};
117
117
118
118
// This must be a literal with the same value as AEND-A0
119
- #define NUM_ANALOG_INPUTS 12
119
+ #define NUM_ANALOG_INPUTS 12
120
120
121
121
// On-board LED pin number
122
122
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ enum {
103
103
};
104
104
105
105
// This must be a literal with the same value as PEND
106
- #define NUM_DIGITAL_PINS 58
106
+ #define NUM_DIGITAL_PINS 58
107
107
108
108
enum {
109
109
A_START_AFTER = D45 ,
@@ -113,7 +113,7 @@ enum {
113
113
};
114
114
115
115
// This must be a literal with the same value as AEND-A0
116
- #define NUM_ANALOG_INPUTS 12
116
+ #define NUM_ANALOG_INPUTS 12
117
117
118
118
// On-board LED pin number
119
119
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ enum {
105
105
};
106
106
107
107
// This must be a literal with the same value as PEND
108
- #define NUM_DIGITAL_PINS 60
108
+ #define NUM_DIGITAL_PINS 60
109
109
110
110
enum {
111
111
A_START_AFTER = D45 ,
@@ -115,7 +115,7 @@ enum {
115
115
};
116
116
117
117
// This must be a literal with the same value as AEND-A0
118
- #define NUM_ANALOG_INPUTS 14
118
+ #define NUM_ANALOG_INPUTS 14
119
119
120
120
// On-board LED pin number
121
121
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ enum {
149
149
};
150
150
151
151
// This must be a literal with the same value as PEND
152
- #define NUM_DIGITAL_PINS 96
152
+ #define NUM_DIGITAL_PINS 96
153
153
154
154
// Enum defining Arduino style alias for analog pin number --> Ax
155
155
enum {
@@ -160,7 +160,7 @@ enum {
160
160
};
161
161
162
162
// This must be a literal with the same value as AEND-A0
163
- #define NUM_ANALOG_INPUTS 18
163
+ #define NUM_ANALOG_INPUTS 18
164
164
165
165
// On-board LED pin number
166
166
#define LED_BUILTIN PB0
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ enum {
103
103
};
104
104
105
105
// This must be a literal with the same value as PEND
106
- #define NUM_DIGITAL_PINS 58
106
+ #define NUM_DIGITAL_PINS 58
107
107
108
108
enum {
109
109
A_START_AFTER = D45 ,
@@ -113,7 +113,7 @@ enum {
113
113
};
114
114
115
115
// This must be a literal with the same value as AEND-A0
116
- #define NUM_ANALOG_INPUTS 12
116
+ #define NUM_ANALOG_INPUTS 12
117
117
118
118
// On-board LED pin number
119
119
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change 62
62
};
63
63
64
64
// This must be a literal with the same value as PEND
65
- #define NUM_DIGITAL_PINS 23
65
+ #define NUM_DIGITAL_PINS 23
66
66
67
67
enum {
68
68
A_START_AFTER = D13 ,
71
71
};
72
72
73
73
// This must be a literal with the same value as AEND-A0
74
- #define NUM_ANALOG_INPUTS 7
74
+ #define NUM_ANALOG_INPUTS 7
75
75
76
76
// On-board LED pin number
77
77
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ enum {
105
105
};
106
106
107
107
// This must be a literal with the same value as PEND
108
- #define NUM_DIGITAL_PINS 60
108
+ #define NUM_DIGITAL_PINS 60
109
109
110
110
enum {
111
111
A_START_AFTER = D45 ,
@@ -115,7 +115,7 @@ enum {
115
115
};
116
116
117
117
// This must be a literal with the same value as AEND-A0
118
- #define NUM_ANALOG_INPUTS 14
118
+ #define NUM_ANALOG_INPUTS 14
119
119
120
120
// On-board LED pin number
121
121
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ enum {
104
104
};
105
105
106
106
// This must be a literal with the same value as PEND
107
- #define NUM_DIGITAL_PINS 59
107
+ #define NUM_DIGITAL_PINS 59
108
108
109
109
enum {
110
110
A_START_AFTER = D45 ,
@@ -114,7 +114,7 @@ enum {
114
114
};
115
115
116
116
// This must be a literal with the same value as AEND-A0
117
- #define NUM_ANALOG_INPUTS 13
117
+ #define NUM_ANALOG_INPUTS 13
118
118
119
119
// On-board LED pin number
120
120
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ enum {
104
104
};
105
105
106
106
// This must be a literal with the same value as PEND
107
- #define NUM_DIGITAL_PINS 59
107
+ #define NUM_DIGITAL_PINS 59
108
108
109
109
enum {
110
110
A_START_AFTER = D45 ,
@@ -114,7 +114,7 @@ enum {
114
114
};
115
115
116
116
// This must be a literal with the same value as AEND-A0
117
- #define NUM_ANALOG_INPUTS 13
117
+ #define NUM_ANALOG_INPUTS 13
118
118
119
119
// On-board LED pin number
120
120
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ enum {
136
136
};
137
137
138
138
// This must be a literal with the same value as PEND
139
- #define NUM_DIGITAL_PINS 96
139
+ #define NUM_DIGITAL_PINS 96
140
140
141
141
enum {
142
142
A_START_AFTER = D77 ,
@@ -146,7 +146,7 @@ enum {
146
146
};
147
147
148
148
// This must be a literal with the same value as AEND-A0
149
- #define NUM_ANALOG_INPUTS 18
149
+ #define NUM_ANALOG_INPUTS 18
150
150
151
151
// On-board LED pin number
152
152
#define LED_BUILTIN PB0
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ enum {
105
105
};
106
106
107
107
// This must be a literal with the same value as PEND
108
- #define NUM_DIGITAL_PINS 60
108
+ #define NUM_DIGITAL_PINS 60
109
109
110
110
enum {
111
111
A_START_AFTER = D45 ,
@@ -115,7 +115,7 @@ enum {
115
115
};
116
116
117
117
// This must be a literal with the same value as AEND-A0
118
- #define NUM_ANALOG_INPUTS 14
118
+ #define NUM_ANALOG_INPUTS 14
119
119
120
120
// On-board LED pin number
121
121
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change 74
74
};
75
75
76
76
// This must be a literal with the same value as PEND
77
- #define NUM_DIGITAL_PINS 23
77
+ #define NUM_DIGITAL_PINS 23
78
78
79
79
enum {
80
80
A_START_AFTER = D13 ,
83
83
};
84
84
85
85
// This must be a literal with the same value as AEND-A0
86
- #define NUM_ANALOG_INPUTS 7
86
+ #define NUM_ANALOG_INPUTS 7
87
87
88
88
// On-board LED pin number
89
89
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ enum {
103
103
};
104
104
105
105
// This must be a literal with the same value as PEND
106
- #define NUM_DIGITAL_PINS 58
106
+ #define NUM_DIGITAL_PINS 58
107
107
108
108
enum {
109
109
A_START_AFTER = D45 ,
@@ -113,7 +113,7 @@ enum {
113
113
};
114
114
115
115
// This must be a literal with the same value as AEND-A0
116
- #define NUM_ANALOG_INPUTS 12
116
+ #define NUM_ANALOG_INPUTS 12
117
117
118
118
// On-board LED pin number
119
119
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ enum {
108
108
};
109
109
110
110
// This must be a literal with the same value as PEND
111
- #define NUM_DIGITAL_PINS 63
111
+ #define NUM_DIGITAL_PINS 63
112
112
113
113
enum {
114
114
A_START_AFTER = D45 ,
@@ -118,7 +118,7 @@ enum {
118
118
};
119
119
120
120
// This must be a literal with the same value as AEND-A0
121
- #define NUM_ANALOG_INPUTS 17
121
+ #define NUM_ANALOG_INPUTS 17
122
122
123
123
124
124
// On-board LED pin number
Original file line number Diff line number Diff line change 62
62
};
63
63
64
64
// This must be a literal with the same value as PEND
65
- #define NUM_DIGITAL_PINS 23
65
+ #define NUM_DIGITAL_PINS 23
66
66
67
67
enum {
68
68
A_START_AFTER = D13 ,
71
71
};
72
72
73
73
// This must be a literal with the same value as AEND-A0
74
- #define NUM_ANALOG_INPUTS 7
74
+ #define NUM_ANALOG_INPUTS 7
75
75
76
76
// On-board LED pin number
77
77
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ enum {
103
103
};
104
104
105
105
// This must be a literal with the same value as PEND
106
- #define NUM_DIGITAL_PINS 58
106
+ #define NUM_DIGITAL_PINS 58
107
107
108
108
enum {
109
109
A_START_AFTER = D45 ,
@@ -113,7 +113,7 @@ enum {
113
113
};
114
114
115
115
// This must be a literal with the same value as AEND-A0
116
- #define NUM_ANALOG_INPUTS 12
116
+ #define NUM_ANALOG_INPUTS 12
117
117
118
118
// On-board LED pin number
119
119
#define LED_BUILTIN 13
Original file line number Diff line number Diff line change 61
61
// This must be a literal with the same value as PEND
62
62
// It is used with preprocessor tests (i.e. #if NUM_DIGITAL_PINS > 3)
63
63
// so an enum will not work.
64
- #define NUM_DIGITAL_PINS 0
64
+ #define NUM_DIGITAL_PINS 0
65
65
66
66
// Enum defining Arduino style alias for analog pin number --> Ax
67
67
// !!!
78
78
// This must be a literal with the same value as AEND-A0
79
79
// It is used with preprocessor tests (i.e. #if NUM_ANALOG_INPUTS > 3)
80
80
// so an enum will not work.
81
- #define NUM_ANALOG_INPUTS 18
81
+ #define NUM_ANALOG_INPUTS 18
82
82
83
83
// Below ADC, DAC and PWM definitions already done in the core
84
84
// Could be redefined here if needed
You can’t perform that action at this time.
0 commit comments