8000 Fix A0-A3 pin definitions for Adafruit QT Py RP2040 (#397) · solderparty/arduino-pico@5b270aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b270aa

Browse files
authored
Fix A0-A3 pin definitions for Adafruit QT Py RP2040 (earlephilhower#397)
1 parent 6591da9 commit 5b270aa

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed
10000

variants/adafruit_qtpy/pins_arduino.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@
3838
#define SPI_HOWMANY (1u)
3939
#define WIRE_HOWMANY (2u)
4040

41+
// Pin overrides specific to the QT Py RP2040
42+
#define __PIN_A0 (29u)
43+
#define __PIN_A1 (28u)
44+
#define __PIN_A2 (27u)
45+
#define __PIN_A3 (26u)
46+
4147
#include "../generic/common.h"

variants/generic/common.h

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,29 @@ static const uint8_t D27 = (27u);
3939
static const uint8_t D28 = (28u);
4040
static const uint8_t D29 = (29u);
4141

42-
static const uint8_t A0 = (26u);
43-
static const uint8_t A1 = (27u);
44-
static const uint8_t A2 = (28u);
45-
static const uint8_t A3 = (29u);
42+
#ifdef __PIN_A0
43+
static const uint8_t A0 = __PIN_A0;
44+
#else
45+
static const uint8_t A0 = (26u);
46+
#endif
47+
48+
#ifdef __PIN_A1
49+
static const uint8_t A1 = __PIN_A1;
50+
#else
51+
static const uint8_t A1 = (27u);
52+
#endif
53+
54+
#ifdef __PIN_A2
55+
static const uint8_t A2 = __PIN_A2;
56+
#else
57+
static const uint8_t A2 = (28u);
58+
#endif
59+
60+
#ifdef __PIN_A3
61+
static const uint8_t A3 = __PIN_A3;
62+
#else
63+
static const uint8_t A3 = (29u);
64+
#endif
4665

4766
static const uint8_t SS = PIN_SPI0_SS;
4867
static const uint8_t MOSI = PIN_SPI0_MOSI;

0 commit comments

Comments
 (0)
0