Merge pull request #603 from siddacious/SAMD51G_support

Added SAMD51G support as per issue #597
This commit is contained in:
Scott Shawcroft 2018-02-08 09:55:48 -08:00 committed by GitHub
commit 3e79638b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -251,7 +251,11 @@ PIN(PB07, EXTINT_CHANNEL(7), NO_ADC, ADC_INPUT(9),
PIN(PB08, EXTINT_CHANNEL(8), ADC_INPUT(2), ADC_INPUT(0), TOUCH(1),
NO_SERCOM,
SERCOM(4, 0),
#ifdef TC4
TC(TC4, 0),
#else
NO_TIMER,
#endif
NO_TIMER,
NO_TIMER);
#endif
@ -259,7 +263,11 @@ PIN(PB08, EXTINT_CHANNEL(8), ADC_INPUT(2), ADC_INPUT(0), TOUCH(1),
PIN(PB09, EXTINT_CHANNEL(9), ADC_INPUT(3), ADC_INPUT(1), TOUCH(2),
NO_SERCOM,
SERCOM(4, 1),
#ifdef TC4
TC(TC4, 1),
#else
NO_TIMER,
#endif
NO_TIMER,
NO_TIMER);
#endif

View File

@ -119,12 +119,13 @@ safe_mode_t port_init(void) {
// port_pin_set_output_level(MICROPY_HW_LED1, false);
// Output clocks for debugging.
#ifdef SAMD51
gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3
gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4
gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5
gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6
#endif
// not supported by SAMD51G; uncomment for SAMD51J or update for 51G
// #ifdef SAMD51
// gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3
// gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4
// gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5
// gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6
// #endif
// Init the nvm controller.
// struct nvm_config config_nvm;