Skip to content

Commit

Permalink
update BLM badge for uart (used in testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jan 25, 2021
1 parent 812399f commit 7716ebb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 4 additions & 9 deletions variants/blm_badge/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ const PinDescription g_APinDescription[]=
{ PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0]

// GPIO 2 - Cap touch 2
{ PORTA, 4, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel4, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_4 }, // TCC0/WO[0]
{ PORTA, 4, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER|PIN_ATTR_ANALOG), ADC_Channel4, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_4 }, // TCC0/WO[0]

// GPIO 3 - Cap touch 3
{ PORTA, 6, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0]
{ PORTA, 6, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER|PIN_ATTR_ANALOG), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0]

// GPIO 4 - Cap touch 4
{ PORTA, 7, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1]
{ PORTA, 7, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER|PIN_ATTR_ANALOG), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1]

// GPIO 5 - Stemma I2C SDA
{ PORTA, 0, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 }, // SDA
Expand Down Expand Up @@ -88,13 +88,8 @@ SERCOM sercom3( SERCOM3 ) ;

Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;


// If wire.h isnt included, just do nothing
void WIRE_IT_HANDLER(void) __attribute__ ((weak));

void SERCOM1_Handler()
void SERCOM0_Handler()
{
Serial1.IrqHandler();
WIRE_IT_HANDLER();
}

6 changes: 3 additions & 3 deletions variants/blm_badge/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ static const uint8_t DAC0 = PIN_DAC0;
*/

// Serial1 (sercom 0)
#define PIN_SERIAL1_RX (6ul) // same as SCL
#define PAD_SERIAL1_RX (SERCOM_RX_PAD_1)
#define PIN_SERIAL1_TX (5ul) // same as SDA
#define PIN_SERIAL1_RX (3ul) // captouch pad
#define PAD_SERIAL1_RX (SERCOM_RX_PAD_2)
#define PIN_SERIAL1_TX (2ul) // captouch pad
#define PAD_SERIAL1_TX (UART_TX_PAD_0)

/*
Expand Down

0 comments on commit 7716ebb

Please sign in to comment.