Skip to content

Commit 16d8216

Browse files
committed
add SPI flash SS pin
1 parent 590c97f commit 16d8216

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

variants/metro_m0/variant.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,17 @@ const PinDescription g_APinDescription[]=
181181
{ PORTB, 03, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI Flash MISO
182182
{ PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI FLash MOSI
183183
{ PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI FLash SCK
184+
// 39 Secondary SPI SS
185+
{ PORTA, 13, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_13 }, // SPI Flash SS
184186

185-
// 39 - Internal NeoPixel
187+
// 40 - Internal NeoPixel
186188
{ PORTA, 30, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only
187189

188-
// 40 (AREF)
190+
// 41 (AREF)
189191
{ PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP
190192

191193
// ----------------------
192-
// 41 - Alternate use of A0 (DAC output)
194+
// 42 - Alternate use of A0 (DAC output)
193195
{ PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // DAC/VOUT
194196
} ;
195197

variants/metro_m0/variant.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static const uint8_t ATN = PIN_ATN;
136136
/*
137137
* SPI Interfaces
138138
*/
139-
#define SPI_INTERFACES_COUNT 1
139+
#define SPI_INTERFACES_COUNT 2
140140

141141
#define PIN_SPI_MISO (28u)
142142
#define PIN_SPI_MOSI (29u)
@@ -150,6 +150,20 @@ static const uint8_t MOSI = PIN_SPI_MOSI ;
150150
static const uint8_t MISO = PIN_SPI_MISO ;
151151
static const uint8_t SCK = PIN_SPI_SCK ;
152152

153+
154+
#define PIN_SPI1_MISO (36u)
155+
#define PIN_SPI1_MOSI (37u)
156+
#define PIN_SPI1_SCK (38u)
157+
#define PERIPH_SPI1 sercom5
158+
#define PAD_SPI1_TX SPI_PAD_2_SCK_3
159+
#define PAD_SPI1_RX SERCOM_RX_PAD_1
160+
161+
static const uint8_t SS1 = 39 ; // HW SS isn't used. Set here only for reference.
162+
static const uint8_t MOSI1 = PIN_SPI_MOSI ;
163+
static const uint8_t MISO1 = PIN_SPI_MISO ;
164+
static const uint8_t SCK1 = PIN_SPI_SCK ;
165+
166+
153167
/*
154168
* Wire Interfaces
155169
*/

0 commit comments

Comments
 (0)