You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineGetPort( x ) ( ((g_APinDescription[x].ulPortPin) >> 5) & 0x07 )
128
+
#defineGetPin( x ) ( (g_APinDescription[x].ulPortPin) & 0x1F )
129
+
#else
130
+
#defineGetPort( x ) g_APinDescription[x].ulPort
131
+
#defineGetPin( x ) g_APinDescription[x].ulPin
132
+
#endif
133
+
134
+
/* Definitions and types for pins */
135
+
typedefenum_EAnalogChannel
136
+
{
137
+
ADC_Channel0=0,
138
+
ADC_Channel1=1,
139
+
ADC_Channel2=2,
140
+
ADC_Channel3=3,
141
+
ADC_Channel4=4,
142
+
ADC_Channel5=5,
143
+
ADC_Channel6=6,
144
+
ADC_Channel7=7,
145
+
ADC_Channel8=8,
146
+
ADC_Channel9=9,
147
+
ADC_Channel10=10,
148
+
ADC_Channel11=11,
149
+
ADC_Channel12=12,
150
+
ADC_Channel13=13,
151
+
ADC_Channel14=14,
152
+
#if defined(PIN_DESCRIPTION_TABLE_SIMPLE)
153
+
No_ADC_Channel=15,
154
+
#else
155
+
ADC_Channel15=15,
156
+
ADC_Channel16=16,
157
+
ADC_Channel17=17,
158
+
ADC_Channel18=18,
159
+
ADC_Channel19=19,
160
+
DAC_Channel0,
161
+
DAC_Channel1,
162
+
No_ADC_Channel,
163
+
#endif
164
+
} EAnalogChannel ;
165
+
149
166
typedefenum
150
167
{
151
168
EXTERNAL_INT_0=0,
@@ -163,13 +180,31 @@ typedef enum
163
180
EXTERNAL_INT_12,
164
181
EXTERNAL_INT_13,
165
182
EXTERNAL_INT_14,
183
+
#if defined(PIN_DESCRIPTION_TABLE_SIMPLE)
184
+
NOT_AN_INTERRUPT=15,
185
+
EXTERNAL_NUM_INTERRUPTS=NOT_AN_INTERRUPT,
186
+
#else
166
187
EXTERNAL_INT_15,
167
188
EXTERNAL_INT_NMI,
168
189
EXTERNAL_NUM_INTERRUPTS,
169
-
NOT_AN_INTERRUPT=-1,
190
+
NOT_AN_INTERRUPT,
191
+
#endif
170
192
EXTERNAL_INT_NONE=NOT_AN_INTERRUPT,
171
193
} EExt_Interrupts ;
172
194
195
+
// When PIN_DESCRIPTION_TABLE_SIMPLE defined, the ExtInt and ADCChannelNumber fields are combined into one single byte element (ulExtIntADC) rather than two
196
+
// Because of this, only interrupts 0 through 14 are supported (15 = NOT_AN_INTERRUPT) and only ADC channels 0 through 14 are supported (15 = No_ADC_Channel)
#error "The PinDescription table in the variant.cpp file of your board variant must be updated (MATTAIRTECH_ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10618) in order to use PIN_DESCRIPTION_TABLE_SIMPLE. See VARIANT_COMPLIANCE_CHANGELOG."
359
+
#endif
360
+
#if !(SAMD11)
361
+
#error "PIN_DESCRIPTION_TABLE_SIMPLE is currently only supported by the D11 variants (although you can still add support yourself, see the variant.cpp of a D11 variant for an example)."
362
+
#endif
363
+
// This struct MUST be 4 bytes long (elements are ordered to prevent unaligned access).
364
+
typedefstruct_PinDescription
365
+
{
366
+
uint8_tulPortPin ; // Must be 8 bits
367
+
uint8_tulPeripheralAttribute ; // Must be 8 bit bitfield
368
+
uint8_tulTCChannel ; // Must be 8 bits
369
+
uint8_tulExtIntADC ; // Must be 8 bits
370
+
} PinDescription ;
371
+
372
+
#else
373
+
// This struct MUST be 12 bytes long (elements are ordered to prevent unaligned access).
#error "The PinDescription table in the variant.cpp file of your board variant must be updated so that MATTAIRTECH_ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10608. See VARIANT_COMPLIANCE_CHANGELOG."
339
-
// uint16_t ulTCChannel ; // Must be 16 bits
340
-
// uint8_t ulADCChannelNumber ; // Must be 8 bits
388
+
// uint16_t ulTCChannel ; // Must be 16 bits
389
+
// uint8_t ulADCChannelNumber ; // Must be 8 bits
341
390
// uint8_t ulExtInt ; // Must be 8 bits
342
391
#endif
343
392
} PinDescription ;
393
+
#endif
344
394
345
395
/* Pins table to be instantiated into variant.cpp */
0 commit comments