Skip to content

Commit

Permalink
Pixel Trinkey Analog JST pin (#369)
Browse files Browse the repository at this point in the history
Adding analog support to the 3-pin JST A6.
  • Loading branch information
mikeysklar authored Sep 18, 2024
1 parent 8859387 commit bb55281
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions variants/pixeltrinkey_m0/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion variants/pixeltrinkey_m0/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
Expand Down

0 comments on commit bb55281

Please sign in to comment.