Skip to content

Commit 904acd1

Browse files
committed
speed up samd21 by not erasing (we auto-erase). add SPI1 for TFT connection
1 parent a2d9587 commit 904acd1

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ tools.bossac.cmd=bossac
117117

118118
tools.bossac.upload.params.verbose=-i -d
119119
tools.bossac.upload.params.quiet=
120-
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R
120+
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -i -w -v "{build.path}/{build.project_name}.bin" -R
121121

122122
tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
123123

variants/circuitplay/variant.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ const PinDescription g_APinDescription[]=
9494
{ PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM
9595
{ PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP
9696

97+
// 39-42 External SPI
98+
{ PORTB, 2, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // GPIO D2 / A5 / SDA
99+
{ PORTB, 3, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // GPIO D3 / A4 / SCL
100+
{ PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // Not available
101+
{ PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // Not available
102+
97103
} ;
98104

99105
const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ;

variants/circuitplay/variant.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static const uint8_t DAC0 = PIN_DAC0;
111111
/*
112112
* SPI Interfaces
113113
*/
114-
#define SPI_INTERFACES_COUNT 1
114+
#define SPI_INTERFACES_COUNT 2
115115

116116
#define PIN_SPI_MISO (30u)
117117
#define PIN_SPI_SCK (31u)
@@ -126,6 +126,19 @@ static const uint8_t MISO = PIN_SPI_MISO ;
126126
static const uint8_t SCK = PIN_SPI_SCK ;
127127

128128

129+
// Extra hardware SPI for Gizmo
130+
#define PIN_SPI1_SCK (40u)
131+
#define PIN_SPI1_MOSI (39u)
132+
#define PIN_SPI1_MISO (41u)
133+
#define PERIPH_SPI1 sercom5
134+
#define PAD_SPI1_TX SPI_PAD_0_SCK_1 // MOSI / SCK
135+
#define PAD_SPI1_RX SERCOM_RX_PAD_2 // MISO not avail
136+
137+
static const uint8_t SS1 = 42 ;
138+
static const uint8_t MOSI1 = PIN_SPI_MOSI ;
139+
static const uint8_t MISO1 = PIN_SPI_MISO ;
140+
static const uint8_t SCK1 = PIN_SPI_SCK ;
141+
129142
/*
130143
* Wire Interfaces
131144
*/

0 commit comments

Comments
 (0)