Skip to content
Open
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
3 changes: 2 additions & 1 deletion firmware/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ build feather FEATHER 0 0 1000 0
build itsybitsy ITSYBITSY 0 0 1000 0
build qtpy QTPY 0 0 1000 0
build qt2040_trinkey QT2040_TRINKEY 0 0 1000 0

build seeed_xiao SEEED_XIAO 0 0 1000 0
build waveshare_zero WAVESHARE_ZERO 0 0 1000 0
2 changes: 1 addition & 1 deletion firmware/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pico_sdk_init()


set(BOARD "PICO" CACHE STRING "BaseName chosen by the user at CMake configure time")
set_property(CACHE BOARD PROPERTY STRINGS PICO FEATHER ITSYBITSY QTPY QT2040_TRINKEY)
set_property(CACHE BOARD PROPERTY STRINGS PICO FEATHER ITSYBITSY QTPY QT2040_TRINKEY SEEED_XIAO WAVESHARE_ZERO)
message(STATUS "Selected board:'${BOARD}'")

# might help for feather?
Expand Down
38 changes: 38 additions & 0 deletions firmware/source/board_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define ITSYBITSY 3
#define QTPY 4
#define QT2040_TRINKEY 5
#define SEEED_XIAO 6
#define WAVESHARE_ZERO 7

#define BOARD ${BOARD}

Expand Down Expand Up @@ -169,6 +171,42 @@
// HUB75
#define HUB75_ENABLED HUB75_ALLOW

//---------------------------------------------------------
// SEEED_XIAO
//---------------------------------------------------------
#elif BOARD == SEEED_XIAO
// I2C1
#define I2C1_ENABLED 1
#define U2IF_I2C1_SDA 6
#define U2IF_I2C1_SCL 7
// SPI0
#define SPI0_ENABLED 1
#define U2IF_SPI0_CK 2
#define U2IF_SPI0_MOSI 3
#define U2IF_SPI0_MISO 4
// UART0
#define UART0_ENABLED 1
#define U2IF_UART0_TX 0
#define U2IF_UART0_RX 1

//---------------------------------------------------------
// WAVESHARE_ZERO
//---------------------------------------------------------
#elif BOARD == WAVESHARE_ZERO
// I2C1
#define I2C1_ENABLED 1
#define U2IF_I2C1_SDA 14
#define U2IF_I2C1_SCL 15
// SPI1
#define SPI1_ENABLED 1
#define U2IF_SPI1_CK 10
#define U2IF_SPI1_MOSI 11
#define U2IF_SPI1_MISO 12
// UART0
#define UART0_ENABLED 1
#define U2IF_UART0_TX 0
#define U2IF_UART0_RX 1

#else
#warning "Please define board type"
#endif
Expand Down
10 changes: 10 additions & 0 deletions firmware/source/usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
#define USB_VID 0xCAFE
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
_PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
#elif BOARD == WAVESHARE_ZERO
#define USB_MFG "Waveshare"
#define USB_PRD "RP2040-Zero U2IF"
#define USB_VID 0x2E8A
#define USB_PID 0x101F
#elif BOARD == SEEED_XIAO
#define USB_MFG "Seeed Studio"
#define USB_PRD "XIAO RP2040 U2IF"
#define USB_VID 0x2E8A
#define USB_PID 0x0005
#else
#warning "Please define board type"
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/machine/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _i2c_scan(self, start=0, end=0x79):
found = []
for addr in range(start, end + 1):
try:
self._i2c_writeto(addr, b"\x00\x00\x00")
self.readfrom(addr, b"\x01")
except RuntimeError:
continue
found.append(addr)
Expand Down
2 changes: 2 additions & 0 deletions source/machine/u2if.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
(0x239a, 0x00fd), # Adafruit ItsyBitsy
(0x239a, 0x0109), # Adafruit QT2040 Trinket
(0x239a, 0x00f7), # Adafruit QTPY
(0x2e8a, 0x0005), # Seeed Xiao RP2040
(0x2e8a, 0x101f), # Waveshare Zero
]


Expand Down