@@ -57,11 +57,11 @@ extern "C"
5757 *----------------------------------------------------------------------------*/
5858
5959// Number of pins defined in PinDescription array
60- #define PINS_COUNT (26u )
61- #define NUM_DIGITAL_PINS (20u )
62- #define NUM_ANALOG_INPUTS (8u )
63- #define NUM_ANALOG_OUTPUTS (2u )
64- #define analogInputToDigitalPin (p ) ((p < 6u ) ? (p) + 14u : -1)
60+ #define PINS_COUNT (52u )
61+ #define NUM_DIGITAL_PINS (42u )
62+ #define NUM_ANALOG_INPUTS (9u )
63+ #define NUM_ANALOG_OUTPUTS (1u )
64+ #define analogInputToDigitalPin (p ) ((p < 10u ) ? (p) + 14u : -1)
6565
6666#define digitalPinToPort (P ) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
6767#define digitalPinToBitMask (P ) ( 1 << g_APinDescription[P].ulPin )
@@ -82,11 +82,11 @@ extern "C"
8282
8383// LEDs
8484#define PIN_LED_13 (13u)
85- #define PIN_LED_RXL (27u)
86- #define PIN_LED_TXL (28u)
85+ // #define PIN_LED_RXL (27u)
86+ // #define PIN_LED_TXL (28u)
8787#define PIN_LED PIN_LED_13
88- #define PIN_LED2 PIN_LED_RXL
89- #define PIN_LED3 PIN_LED_TXL
88+ // #define PIN_LED2 PIN_LED_RXL
89+ // #define PIN_LED3 PIN_LED_TXL
9090#define LED_BUILTIN PIN_LED_13
9191
9292/*
@@ -100,25 +100,29 @@ extern "C"
100100#define PIN_A5 (PIN_A0 + 5)
101101#define PIN_A6 (PIN_A0 + 6)
102102#define PIN_A7 (PIN_A0 + 7)
103+ #define PIN_A8 (PIN_A0 + 8)
104+ #define PIN_A9 (PIN_A0 + 9)
105+ #define PIN_DAC PIN_A0
103106#define PIN_DAC0 PIN_A0
104- #define PIN_DAC1 PIN_A1
105107
106108static const uint8_t A0 = PIN_A0 ;
107109static const uint8_t A1 = PIN_A1 ;
108110static const uint8_t A2 = PIN_A2 ;
109111static const uint8_t A3 = PIN_A3 ;
110112static const uint8_t A4 = PIN_A4 ;
111113static const uint8_t A5 = PIN_A5 ;
112- static const uint8_t A6 = PIN_A6 ;
113- static const uint8_t A7 = PIN_A7 ;
114+ static const uint8_t A6 = PIN_A6 ;
115+ static const uint8_t A7 = PIN_A7 ;
116+ static const uint8_t A8 = PIN_A8 ;
117+ static const uint8_t A9 = PIN_A9 ;
114118
119+ static const uint8_t DAC = PIN_DAC ;
115120static const uint8_t DAC0 = PIN_DAC0 ;
116- static const uint8_t DAC1 = PIN_DAC1 ;
117121
118122#define ADC_RESOLUTION 12
119123
120124// Other pins
121- #define PIN_ATN (39ul)
125+ #define PIN_ATN (39ul) // ???
122126static const uint8_t ATN = PIN_ATN ;
123127
124128/*
@@ -136,26 +140,26 @@ static const uint8_t ATN = PIN_ATN;
136140 */
137141#define SPI_INTERFACES_COUNT 1
138142
139- #define PIN_SPI_MISO (24u )
140- #define PIN_SPI_MOSI (26u )
141- #define PIN_SPI_SCK (25u )
143+ #define PIN_SPI_MISO (31u )
144+ #define PIN_SPI_MOSI (29u )
145+ #define PIN_SPI_SCK (30u )
142146#define PERIPH_SPI sercom2
143147#define PAD_SPI_TX SPI_PAD_0_SCK_1
144148#define PAD_SPI_RX SERCOM_RX_PAD_2
145149
146- static const uint8_t SS = PIN_A2 ;
147- static const uint8_t MOSI = PIN_SPI_MOSI ;
148- static const uint8_t MISO = PIN_SPI_MISO ;
149- static const uint8_t SCK = PIN_SPI_SCK ;
150+ static const uint8_t SS = PIN_A2 ; // ???
151+ static const uint8_t MOSI = PIN_SPI_MOSI ;
152+ static const uint8_t MISO = PIN_SPI_MISO ;
153+ static const uint8_t SCK = PIN_SPI_SCK ;
150154
151155
152156/*
153157 * Wire Interfaces
154158 */
155159#define WIRE_INTERFACES_COUNT 1
156160
157- #define PIN_WIRE_SDA (22u )
158- #define PIN_WIRE_SCL (23u )
161+ #define PIN_WIRE_SDA (27u )
162+ #define PIN_WIRE_SCL (28u )
159163#define PERIPH_WIRE sercom5
160164#define WIRE_IT_HANDLER SERCOM5_Handler
161165
@@ -165,46 +169,17 @@ static const uint8_t SCL = PIN_WIRE_SCL;
165169/*
166170 * USB
167171 */
168- #define PIN_USB_HOST_ENABLE (29ul)
169- #define PIN_USB_DM (30ul)
170- #define PIN_USB_DP (31ul)
171-
172- /*
173- * I2S Interfaces
174- */
175- #define I2S_INTERFACES_COUNT 1
176-
177- #define I2S_DEVICE 0
178- #define I2S_CLOCK_GENERATOR 3
179-
180- #define PIN_I2S_SDO (8u)
181- #define PIN_I2S_SDI (1u)
182- #define PIN_I2S_SCK (3u)
183- #define PIN_I2S_FS (9u)
184- #define PIN_I2S_MCK (2u)
172+ #define PIN_USB_HOST_ENABLE (29ul) // ???
173+ #define PIN_USB_DM (48ul)
174+ #define PIN_USB_DP (49ul)
185175
186176//QSPI Pins
187- #define PIN_QSPI_SCK (41u)
188- #define PIN_QSPI_CS (42u)
189- #define PIN_QSPI_IO0 (43u)
190- #define PIN_QSPI_IO1 (44u)
191- #define PIN_QSPI_IO2 (45u)
192- #define PIN_QSPI_IO3 (46u)
193-
194- //PCC Pins
195- #define PIN_PCC_DEN1 (PIN_SPI_MOSI)
196- #define PIN_PCC_DEN2 (PIN_SPI_SCK)
197- #define PIN_PCC_CLK (PIN_SPI_MISO)
198- #define PIN_PCC_D0 (13u)
199- #define PIN_PCC_D1 (12u)
200- #define PIN_PCC_D2 (10u)
201- #define PIN_PCC_D3 (11u)
202- #define PIN_PCC_D4 (9u)
203- #define PIN_PCC_D5 (8u)
204- #define PIN_PCC_D6 (1u)
205- #define PIN_PCC_D7 (0u)
206- #define PIN_PCC_D8 (5u)
207- #define PIN_PCC_D9 (6u)
177+ #define PIN_QSPI_SCK (42u)
178+ #define PIN_QSPI_CS (43u)
179+ #define PIN_QSPI_IO0 (44u)
180+ #define PIN_QSPI_IO1 (45u)
181+ #define PIN_QSPI_IO2 (46u)
182+ #define PIN_QSPI_IO3 (47u)
208183
209184//TODO: meaningful value for this
210185#define VARIANT_QSPI_BAUD_DEFAULT 5000000
0 commit comments