Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions variants/XIAO_m0_plus/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ const PinDescription g_APinDescription[]=

// 15..18 - Additional GPIOs
// -----------------------------------------------
// D15 - PA15 (TCC3/WO[3])
{ PORTA, 15, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM3_CH3, TC3_CH3, EXTERNAL_INT_15 },
// D16 - PA14 (TCC3/WO[2])
{ PORTA, 14, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM3_CH2, TC3_CH2, EXTERNAL_INT_14 },
// D15 - PA15 (TC3/WO[1])
{ PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 },
// D16 - PA14 (TC3/WO[0])
{ PORTA, 14, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_14 },
// D17 - PA13 (TCC2/WO[1])
{ PORTA, 13, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_13 },
// D18 - PA12 (TCC2/WO[0])
Expand All @@ -113,7 +113,7 @@ const PinDescription g_APinDescription[]=
// 24..27 - More GPIOs
// -----------------------------------------------
// D24 - PB23
{ PORTB, 23, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 },
{ PORTB, 23, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
// D25 - PA23
{ PORTA, 23, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 },
// D26 - PA22
Expand All @@ -130,7 +130,11 @@ const PinDescription g_APinDescription[]=
// USB_DM - PA24
{ PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
// USB_DP - PA25
{ PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }
{ PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },

// 31 - VBAT_EN (PB02)
// -----------------------------------------------
{ PORTB, 2, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }
} ;

const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ;
Expand Down
11 changes: 8 additions & 3 deletions variants/XIAO_m0_plus/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
// ----

// Number of pins defined in PinDescription array
#define PINS_COUNT (31u)
#define NUM_DIGITAL_PINS (31u)
#define PINS_COUNT (32u)
#define NUM_DIGITAL_PINS (32u)
#define NUM_ANALOG_INPUTS (11u)
#define NUM_ANALOG_OUTPUTS (1u)

Expand Down Expand Up @@ -69,11 +69,15 @@
#define LED_BUILTIN PIN_LED

// RGB LED (WS2812B) on PA27
#define PIN_LED_RGB (11u)
#define PIN_LED_RGB (11u)
#define PIN_NEOPIXEL PIN_LED_RGB

// User Button on PB22
#define PIN_BUTTON (28u)

// VBAT_EN on PB02
#define PIN_VBAT_EN (31u)


/*
* Analog pins
Expand Down Expand Up @@ -136,6 +140,7 @@ static const uint8_t DAC0 = PIN_DAC0;
#define D25 (25u)
#define D26 (26u)
#define D27 (27u)
#define D31 (31u)

/*
* SPI Interfaces
Expand Down