2016-08-24 20:38:08 -04:00
|
|
|
#include "pins.h"
|
|
|
|
#include "asf/sam0/drivers/system/system.h"
|
|
|
|
|
2016-08-30 16:10:52 -04:00
|
|
|
PIN_NO_TIMERS_(PA02, true, ADC_POSITIVE_INPUT_PIN0);
|
|
|
|
PIN_ONE_TIMER_(PB08, true, ADC_POSITIVE_INPUT_PIN8,
|
|
|
|
TC4, 0, 0, 0, PIN_PB08E_TC4_WO0, MUX_PB08E_TC4_WO0);
|
|
|
|
PIN_ONE_TIMER_(PB09, true, ADC_POSITIVE_INPUT_PIN9,
|
|
|
|
TC4, 0, 1, 1, PIN_PB09E_TC4_WO1, MUX_PB09E_TC4_WO1);
|
|
|
|
PIN_ONE_TIMER_(PA04, true, ADC_POSITIVE_INPUT_PIN4,
|
|
|
|
0, TCC0, 0, 0, PIN_PA04E_TCC0_WO0, MUX_PA04E_TCC0_WO0);
|
|
|
|
PIN_ONE_TIMER_(PA05, true, ADC_POSITIVE_INPUT_PIN5,
|
|
|
|
0, TCC0, 1, 1, PIN_PA05E_TCC0_WO1, MUX_PA05E_TCC0_WO1);
|
|
|
|
PIN_NO_TIMERS_(PB02, true, ADC_POSITIVE_INPUT_PIN10);
|
|
|
|
PIN_TWO_TIMERS(PB11, false, NO_ADC_INPUT,
|
|
|
|
TC5, 0, 1, 1, PIN_PB11E_TC5_WO1, MUX_PB11E_TC5_WO1,
|
|
|
|
0, TCC0, 1, 5, PIN_PB11F_TCC0_WO5, MUX_PB11F_TCC0_WO5);
|
|
|
|
PIN_TWO_TIMERS(PB10, false, NO_ADC_INPUT,
|
|
|
|
TC5, 0, 0, 0, PIN_PB10E_TC5_WO0, MUX_PB10E_TC5_WO0,
|
|
|
|
0, TCC0, 0, 4, PIN_PB10F_TCC0_WO4, MUX_PB10F_TCC0_WO4);
|
|
|
|
PIN_TWO_TIMERS(PA12, false, NO_ADC_INPUT,
|
|
|
|
0, TCC2, 0, 0, PIN_PA12E_TCC2_WO0, MUX_PA12E_TCC2_WO0,
|
|
|
|
0, TCC0, 2, 6, PIN_PA12F_TCC0_WO6, MUX_PA12F_TCC0_WO6);
|
|
|
|
PIN_TWO_TIMERS(PA11, true, ADC_POSITIVE_INPUT_PIN19,
|
|
|
|
0, TCC1, 1, 1, PIN_PA11E_TCC1_WO1, MUX_PA11E_TCC1_WO1,
|
|
|
|
0, TCC0, 3, 3, PIN_PA11F_TCC0_WO3, MUX_PA11F_TCC0_WO3);
|
|
|
|
PIN_TWO_TIMERS(PA10, true, ADC_POSITIVE_INPUT_PIN18,
|
|
|
|
0, TCC1, 0, 0, PIN_PA10E_TCC1_WO0, MUX_PA10E_TCC1_WO0,
|
|
|
|
0, TCC0, 2, 2, PIN_PA10F_TCC0_WO2, MUX_PA10F_TCC0_WO2);
|
|
|
|
PIN_TWO_TIMERS(PA22, false, NO_ADC_INPUT,
|
|
|
|
TC4, 0, 0, 0, PIN_PA22E_TC4_WO0, MUX_PA22E_TC4_WO0,
|
|
|
|
0, TCC0, 0, 4, PIN_PA22F_TCC0_WO4, MUX_PA22F_TCC0_WO4);
|
|
|
|
PIN_TWO_TIMERS(PA23, false, NO_ADC_INPUT,
|
|
|
|
TC4, 0, 1, 1, PIN_PA23E_TC4_WO1, MUX_PA23E_TC4_WO1,
|
|
|
|
0, TCC0, 1, 5, PIN_PA23F_TCC0_WO5, MUX_PA23F_TCC0_WO5);
|
|
|
|
PIN_TWO_TIMERS(PA15, false, NO_ADC_INPUT,
|
|
|
|
TC3, 0, 1, 1, PIN_PA15E_TC3_WO1, MUX_PA15E_TC3_WO1,
|
|
|
|
0, TCC0, 1, 5, PIN_PA15F_TCC0_WO5, MUX_PA15F_TCC0_WO5);
|
|
|
|
PIN_ONE_TIMER_(PA20, false, NO_ADC_INPUT,
|
|
|
|
0, TCC0, 2, 6, PIN_PA20F_TCC0_WO6, MUX_PA20F_TCC0_WO6);
|
|
|
|
PIN_ONE_TIMER_(PA07, true, ADC_POSITIVE_INPUT_PIN7,
|
|
|
|
0, TCC1, 1, 1, PIN_PA07E_TCC1_WO1, MUX_PA07E_TCC1_WO1);
|
|
|
|
PIN_TWO_TIMERS(PA18, false, NO_ADC_INPUT,
|
|
|
|
TC3, 0, 0, 0, PIN_PA18E_TC3_WO0, MUX_PA18E_TC3_WO0,
|
|
|
|
0, TCC0, 2, 2, PIN_PA18F_TCC0_WO2, MUX_PA18F_TCC0_WO2);
|
|
|
|
PIN_TWO_TIMERS(PA16, false, NO_ADC_INPUT,
|
|
|
|
0, TCC2, 0, 0, PIN_PA16E_TCC2_WO0, MUX_PA16E_TCC2_WO0,
|
|
|
|
0, TCC0, 2, 6, PIN_PA16F_TCC0_WO6, MUX_PA16F_TCC0_WO6);
|
|
|
|
PIN_TWO_TIMERS(PA19, false, NO_ADC_INPUT,
|
|
|
|
TC3, 0, 1, 1, PIN_PA19E_TC3_WO1, MUX_PA19E_TC3_WO1,
|
|
|
|
0, TCC0, 3, 3, PIN_PA19F_TCC0_WO3, MUX_PA19F_TCC0_WO3);
|
|
|
|
PIN_TWO_TIMERS(PA17, false, NO_ADC_INPUT,
|
|
|
|
0, TCC2, 1, 1, PIN_PA17E_TCC2_WO1, MUX_PA17E_TCC2_WO1,
|
|
|
|
0, TCC0, 3, 7, PIN_PA17F_TCC0_WO7, MUX_PA17F_TCC0_WO7);
|
2016-08-24 20:38:08 -04:00
|
|
|
|
|
|
|
STATIC const mp_map_elem_t pin_cpu_pins_locals_dict_table[] = {
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA02), (mp_obj_t)&pin_PA02 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PB08), (mp_obj_t)&pin_PB08 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PB09), (mp_obj_t)&pin_PB09 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA04), (mp_obj_t)&pin_PA04 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA05), (mp_obj_t)&pin_PA05 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PB02), (mp_obj_t)&pin_PB02 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PB11), (mp_obj_t)&pin_PB11 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PB10), (mp_obj_t)&pin_PB10 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA12), (mp_obj_t)&pin_PA12 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA11), (mp_obj_t)&pin_PA11 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA10), (mp_obj_t)&pin_PA10 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA22), (mp_obj_t)&pin_PA22 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA23), (mp_obj_t)&pin_PA23 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA15), (mp_obj_t)&pin_PA15 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA20), (mp_obj_t)&pin_PA20 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA07), (mp_obj_t)&pin_PA07 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA18), (mp_obj_t)&pin_PA18 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA16), (mp_obj_t)&pin_PA16 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA19), (mp_obj_t)&pin_PA19 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_PA17), (mp_obj_t)&pin_PA17 },
|
|
|
|
};
|
|
|
|
MP_DEFINE_CONST_DICT(pin_cpu_pins_locals_dict, pin_cpu_pins_locals_dict_table);
|
|
|
|
|
|
|
|
STATIC const mp_map_elem_t pin_board_pins_locals_dict_table[] = {
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_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R(MP_QSTR_D12), (mp_obj_t)&pin_PA19 },
|
|
|
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13), (mp_obj_t)&pin_PA17 },
|
|
|
|
};
|
|
|
|
MP_DEFINE_CONST_DICT(pin_board_pins_locals_dict, pin_board_pins_locals_dict_table);
|