From bb552819ba79fbda21d868dd1c838d52bce383ba Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Wed, 18 Sep 2024 10:54:26 -0700 Subject: [PATCH] Pixel Trinkey Analog JST pin (#369) Adding analog support to the 3-pin JST A6. --- variants/pixeltrinkey_m0/variant.cpp | 4 ++-- variants/pixeltrinkey_m0/variant.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/variants/pixeltrinkey_m0/variant.cpp b/variants/pixeltrinkey_m0/variant.cpp index ccd09cf6f..15c9cce9c 100644 --- a/variants/pixeltrinkey_m0/variant.cpp +++ b/variants/pixeltrinkey_m0/variant.cpp @@ -33,8 +33,8 @@ const PinDescription g_APinDescription[]= { PORTA, 4, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // D2 / MOSI { PORTA, 5, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // D3 / SCK - // Extra Signal / MISO - { PORTA, 6, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // D4 / MISO + // A6 / MISO + { PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // A6 / MISO // USB pins D5, D6, D7 { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable diff --git a/variants/pixeltrinkey_m0/variant.h b/variants/pixeltrinkey_m0/variant.h index a58763e56..9a2b8222f 100644 --- a/variants/pixeltrinkey_m0/variant.h +++ b/variants/pixeltrinkey_m0/variant.h @@ -89,8 +89,12 @@ extern "C" #define PIN_A0 (0ul) #define PIN_DAC0 PIN_A0 +#define PIN_A6 (4ul) + static const uint8_t A0 = PIN_A0; +static const uint8_t A6 = PIN_A6; + #define ADC_RESOLUTION 12 @@ -99,7 +103,7 @@ static const uint8_t A0 = PIN_A0; */ #define SPI_INTERFACES_COUNT 1 -#define PIN_SPI_MISO (4ul) // not actually broken out +#define PIN_SPI_MISO (4ul) // off 3-pin JST, broken out #define PIN_SPI_MOSI (2ul) #define PIN_SPI_SCK (3ul) #define PERIPH_SPI sercom0