2016-11-03 18:50:59 -04:00
|
|
|
#include "shared-bindings/microcontroller/Pin.h"
|
|
|
|
|
|
|
|
#include "samd21_pins.h"
|
|
|
|
|
2016-12-01 16:47:18 -05:00
|
|
|
#define SERCOM(p_sercom, p_pad) \
|
2016-11-03 18:50:59 -04:00
|
|
|
{ \
|
|
|
|
.sercom = p_sercom, \
|
2016-12-01 16:47:18 -05:00
|
|
|
.pad = p_pad \
|
2016-11-03 18:50:59 -04:00
|
|
|
}
|
|
|
|
|
2016-12-01 16:47:18 -05:00
|
|
|
#define NO_SERCOM SERCOM(0, 0)
|
2016-11-03 18:50:59 -04:00
|
|
|
|
2016-12-01 16:47:18 -05:00
|
|
|
#define TCC(p_tcc, p_channel, p_wave_output) \
|
2016-11-03 18:50:59 -04:00
|
|
|
{ \
|
|
|
|
.tcc = p_tcc, \
|
2016-12-01 16:47:18 -05:00
|
|
|
.is_tc = false, \
|
|
|
|
.channel = p_channel, \
|
|
|
|
.wave_output = p_wave_output \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TC(p_tc, p_channel, p_wave_output) \
|
|
|
|
{ \
|
|
|
|
.tc = p_tc, \
|
|
|
|
.is_tc = true, \
|
2016-11-03 18:50:59 -04:00
|
|
|
.channel = p_channel, \
|
2016-12-01 16:47:18 -05:00
|
|
|
.wave_output = p_wave_output \
|
2016-11-03 18:50:59 -04:00
|
|
|
}
|
|
|
|
|
2016-12-01 16:47:18 -05:00
|
|
|
#define NO_TIMER TCC(0, 0, 0)
|
2016-11-03 18:50:59 -04:00
|
|
|
|
2016-12-06 21:39:18 -05:00
|
|
|
#define TOUCH(y_line) \
|
|
|
|
.has_touch = true, \
|
|
|
|
.touch_y_line = y_line,
|
|
|
|
|
|
|
|
#define NO_TOUCH \
|
|
|
|
.has_touch = false,
|
|
|
|
|
2017-03-13 16:55:11 -04:00
|
|
|
#define EXTINT_CHANNEL(channel) \
|
|
|
|
.has_extint = true, \
|
|
|
|
.extint_channel = channel,
|
|
|
|
|
|
|
|
#define NO_EXTINT \
|
|
|
|
.has_extint = false,
|
|
|
|
|
2016-12-06 21:39:18 -05:00
|
|
|
#define ADC_INPUT(input) \
|
|
|
|
.has_adc = true, \
|
|
|
|
.adc_input = input,
|
|
|
|
|
|
|
|
#define NO_ADC \
|
|
|
|
.has_adc = false,
|
|
|
|
|
2016-11-03 18:50:59 -04:00
|
|
|
// This macro is used to simplify pin definition in boards/<board>/pins.c
|
2017-03-13 16:55:11 -04:00
|
|
|
#define PIN(p_name, p_adc, p_extint, p_touch, p_primary_timer, \
|
|
|
|
p_secondary_timer, p_primary_sercom, p_secondary_sercom) \
|
2016-11-03 18:50:59 -04:00
|
|
|
const mcu_pin_obj_t pin_## p_name = { \
|
|
|
|
{ &mcu_pin_type }, \
|
|
|
|
.name = MP_QSTR_ ## p_name, \
|
|
|
|
.pin = (PIN_## p_name), \
|
2017-03-13 16:55:11 -04:00
|
|
|
p_extint \
|
2016-12-06 21:39:18 -05:00
|
|
|
p_adc \
|
|
|
|
p_touch \
|
2016-11-03 18:50:59 -04:00
|
|
|
.primary_timer = p_primary_timer, \
|
|
|
|
.secondary_timer = p_secondary_timer, \
|
|
|
|
.sercom = {p_primary_sercom, p_secondary_sercom}, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NO_ADC_INPUT (0)
|
2016-10-26 20:57:47 -04:00
|
|
|
|
|
|
|
// Pins in datasheet order.
|
2017-01-26 21:05:46 -05:00
|
|
|
// NOTE(tannewt): TC wave out 0 is commented out because the first channel is
|
|
|
|
// used to vary the 16 bit timer's frequency.
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef PIN_PA00
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA00, EXTINT_CHANNEL(0), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC2, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2017-01-18 17:51:36 -05:00
|
|
|
NO_SERCOM,
|
|
|
|
SERCOM(SERCOM1, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA01
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA01, EXTINT_CHANNEL(1), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC2, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2017-01-18 17:51:36 -05:00
|
|
|
NO_SERCOM,
|
|
|
|
SERCOM(SERCOM1, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA02
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA02, EXTINT_CHANNEL(2), ADC_INPUT(ADC_POSITIVE_INPUT_PIN0), TOUCH(0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA03
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA03, EXTINT_CHANNEL(3), ADC_INPUT(ADC_POSITIVE_INPUT_PIN1), TOUCH(1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB04
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB04, EXTINT_CHANNEL(4), ADC_INPUT(ADC_POSITIVE_INPUT_PIN12), TOUCH(10),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB05
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB05, EXTINT_CHANNEL(5), ADC_INPUT(ADC_POSITIVE_INPUT_PIN13), TOUCH(11),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB06
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB06, EXTINT_CHANNEL(6), ADC_INPUT(ADC_POSITIVE_INPUT_PIN14), TOUCH(12),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB07
|
2017-08-22 15:19:05 -04:00
|
|
|
PIN(PB07, EXTINT_CHANNEL(7), ADC_INPUT(ADC_POSITIVE_INPUT_PIN15), TOUCH(13),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB08
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB08, EXTINT_CHANNEL(8), ADC_INPUT(ADC_POSITIVE_INPUT_PIN2), TOUCH(14),
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC4, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB09
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB09, EXTINT_CHANNEL(9), ADC_INPUT(ADC_POSITIVE_INPUT_PIN3), TOUCH(15),
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC4, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA04
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA04, EXTINT_CHANNEL(4), ADC_INPUT(ADC_POSITIVE_INPUT_PIN4), TOUCH(2),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM0, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA05
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA05, EXTINT_CHANNEL(5), ADC_INPUT(ADC_POSITIVE_INPUT_PIN5), TOUCH(3),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM0, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA06
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA06, EXTINT_CHANNEL(6), ADC_INPUT(ADC_POSITIVE_INPUT_PIN6), TOUCH(4),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2017-01-18 18:04:35 -05:00
|
|
|
NO_SERCOM,
|
|
|
|
SERCOM(SERCOM0, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA07
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA07, EXTINT_CHANNEL(7), ADC_INPUT(ADC_POSITIVE_INPUT_PIN7), TOUCH(5),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2017-01-18 18:04:35 -05:00
|
|
|
NO_SERCOM,
|
|
|
|
SERCOM(SERCOM0, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA08
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA08, NO_EXTINT, ADC_INPUT(ADC_POSITIVE_INPUT_PIN16), NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 0),
|
2017-06-12 18:36:09 -04:00
|
|
|
TCC(TCC1, 0, 2),
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM0, 0),
|
|
|
|
SERCOM(SERCOM2, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA09
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA09, EXTINT_CHANNEL(9), ADC_INPUT(ADC_POSITIVE_INPUT_PIN17), NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 1, 1),
|
2017-06-12 18:36:09 -04:00
|
|
|
TCC(TCC1, 1, 3),
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM0, 1),
|
|
|
|
SERCOM(SERCOM2, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA10
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA10, EXTINT_CHANNEL(10), ADC_INPUT(ADC_POSITIVE_INPUT_PIN18), NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 0, 0),
|
|
|
|
TCC(TCC0, 2, 2),
|
|
|
|
SERCOM(SERCOM0, 2),
|
|
|
|
SERCOM(SERCOM2, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA11
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA11, EXTINT_CHANNEL(11), ADC_INPUT(ADC_POSITIVE_INPUT_PIN19), NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 1, 1),
|
|
|
|
TCC(TCC0, 3, 3),
|
|
|
|
SERCOM(SERCOM0, 3),
|
|
|
|
SERCOM(SERCOM2, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB10
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB10, EXTINT_CHANNEL(10), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC5, 0, 0),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 4),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB11
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB11, EXTINT_CHANNEL(11), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC5, 1, 1),
|
|
|
|
TCC(TCC0, 1, 5),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB12
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB12, EXTINT_CHANNEL(12), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC4, 0, 0),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 2, 6),
|
|
|
|
SERCOM(SERCOM4, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB13
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB13, EXTINT_CHANNEL(13), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC4, 1, 1),
|
|
|
|
TCC(TCC0, 3, 7),
|
|
|
|
SERCOM(SERCOM4, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB14
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB14, EXTINT_CHANNEL(14), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC5, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 2),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Second page.
|
|
|
|
#ifdef PIN_PB15
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB15, EXTINT_CHANNEL(15), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC5, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 3),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA12
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA12, EXTINT_CHANNEL(12), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC2, 0, 0),
|
|
|
|
TCC(TCC0, 2, 6),
|
|
|
|
SERCOM(SERCOM2, 0),
|
|
|
|
SERCOM(SERCOM4, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA13
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA13, EXTINT_CHANNEL(13), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC2, 1, 1),
|
|
|
|
TCC(TCC0, 3, 7),
|
|
|
|
SERCOM(SERCOM2, 1),
|
|
|
|
SERCOM(SERCOM4, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA14
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA14, EXTINT_CHANNEL(14), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC3, 0, 0),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 4),
|
|
|
|
SERCOM(SERCOM2, 2),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM4
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 2)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA15
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA15, EXTINT_CHANNEL(15), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC3, 1, 1),
|
|
|
|
TCC(TCC0, 1, 5),
|
|
|
|
SERCOM(SERCOM2, 3),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM4
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM4, 3)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA16
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA16, EXTINT_CHANNEL(0), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC2, 0, 0),
|
|
|
|
TCC(TCC0, 2, 6),
|
|
|
|
SERCOM(SERCOM1, 0),
|
|
|
|
SERCOM(SERCOM3, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA17
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA17, EXTINT_CHANNEL(1), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
TCC(TCC2, 1, 1),
|
|
|
|
TCC(TCC0, 3, 7),
|
|
|
|
SERCOM(SERCOM1, 1),
|
|
|
|
SERCOM(SERCOM3, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA18
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA18, EXTINT_CHANNEL(2), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC3, 0, 0),
|
|
|
|
TCC(TCC0, 2, 2),
|
|
|
|
SERCOM(SERCOM1, 2),
|
|
|
|
SERCOM(SERCOM3, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA19
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA19, EXTINT_CHANNEL(3), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
TC(TC3, 1, 1),
|
|
|
|
TCC(TCC0, 3, 3),
|
|
|
|
SERCOM(SERCOM1, 3),
|
|
|
|
SERCOM(SERCOM3, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB16
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB16, EXTINT_CHANNEL(0), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC6_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC6, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 4),
|
|
|
|
SERCOM(SERCOM5, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB17
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB17, EXTINT_CHANNEL(1), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC6_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
TC(TC6, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 1, 5),
|
|
|
|
SERCOM(SERCOM5, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA20
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA20, EXTINT_CHANNEL(4), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC7, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 2, 6),
|
|
|
|
SERCOM(SERCOM5, 2),
|
|
|
|
SERCOM(SERCOM3, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA21
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA21, EXTINT_CHANNEL(5), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC7, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 3, 7),
|
|
|
|
SERCOM(SERCOM5, 3),
|
|
|
|
SERCOM(SERCOM3, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA22
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA22, EXTINT_CHANNEL(6), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC4, 0, 0),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 4),
|
|
|
|
SERCOM(SERCOM3, 0),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM5
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 0)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA23
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA23, EXTINT_CHANNEL(7), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC4, 1, 1),
|
|
|
|
TCC(TCC0, 1, 5),
|
|
|
|
SERCOM(SERCOM3, 1),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM5
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 1)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA24
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA24, EXTINT_CHANNEL(12), NO_ADC, NO_TOUCH,
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC5, 0, 0),
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 2, 2),
|
|
|
|
SERCOM(SERCOM3, 2),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM5
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 2)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA25
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA25, EXTINT_CHANNEL(13), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC5, 1, 1),
|
2017-06-12 18:36:09 -04:00
|
|
|
TCC(TCC1, 1, 3),
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM3, 3),
|
2016-11-22 15:03:42 -05:00
|
|
|
#ifdef SERCOM5
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 3)
|
2016-11-22 15:03:42 -05:00
|
|
|
#else
|
|
|
|
NO_SERCOM
|
|
|
|
#endif
|
|
|
|
);
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB22
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB22, EXTINT_CHANNEL(6), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC7, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB23
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB23, EXTINT_CHANNEL(7), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC7, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA27
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA27, EXTINT_CHANNEL(15), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA28
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA28, EXTINT_CHANNEL(8), NO_ADC, NO_TOUCH,
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
|
|
|
NO_SERCOM);
|
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA30
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA30, EXTINT_CHANNEL(10), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM1, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PA31
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PA31, EXTINT_CHANNEL(11), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC1, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM1, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB30
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB30, EXTINT_CHANNEL(14), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 0, 0),
|
2017-06-12 18:36:09 -04:00
|
|
|
TCC(TCC1, 0, 2),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB31
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB31, EXTINT_CHANNEL(15), NO_ADC, NO_TOUCH,
|
2016-12-01 16:47:18 -05:00
|
|
|
TCC(TCC0, 1, 1),
|
2017-06-12 18:36:09 -04:00
|
|
|
TCC(TCC1, 1, 3),
|
2016-10-26 20:57:47 -04:00
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB00
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB00, EXTINT_CHANNEL(0), ADC_INPUT(ADC_POSITIVE_INPUT_PIN8), TOUCH(6),
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC7, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 2));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB01
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB01, EXTINT_CHANNEL(1), ADC_INPUT(ADC_POSITIVE_INPUT_PIN9), TOUCH(7),
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC7_INSTANCE_
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC7, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 3));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB02
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB02, EXTINT_CHANNEL(2), ADC_INPUT(ADC_POSITIVE_INPUT_PIN10), TOUCH(8),
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC6_INSTANCE_
|
2017-01-26 21:05:46 -05:00
|
|
|
NO_TIMER, // TC(TC6, 0, 0),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 0));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|
|
|
|
#ifdef PIN_PB03
|
2017-03-13 16:55:11 -04:00
|
|
|
PIN(PB03, EXTINT_CHANNEL(3), ADC_INPUT(ADC_POSITIVE_INPUT_PIN11), TOUCH(9),
|
2016-10-26 20:57:47 -04:00
|
|
|
#ifdef _SAMD21_TC6_INSTANCE_
|
2016-12-01 16:47:18 -05:00
|
|
|
TC(TC6, 1, 1),
|
2016-10-26 20:57:47 -04:00
|
|
|
#else
|
|
|
|
NO_TIMER,
|
|
|
|
#endif
|
|
|
|
NO_TIMER,
|
|
|
|
NO_SERCOM,
|
2016-12-01 16:47:18 -05:00
|
|
|
SERCOM(SERCOM5, 1));
|
2016-10-26 20:57:47 -04:00
|
|
|
#endif
|