Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Waveshare RP2040 One (1 of 3) #11

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions firmware/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ build feather_epd FEATHER_EPD 0 1 1000 0
build feather_rfm FEATHER_RFM 0 1 1000 0
build feather_can FEATHER_CAN 0 1 1000 0
build kb2040 KB2040 0 1 1000 0
build rp2040_one RP2040_ONE 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 FEATHER_CAN FEATHER_EPD FEATHER_RFM ITSYBITSY QTPY QT2040_TRINKEY KB2040)
set_property(CACHE BOARD PROPERTY STRINGS PICO FEATHER FEATHER_CAN FEATHER_EPD FEATHER_RFM ITSYBITSY QTPY QT2040_TRINKEY KB2040 WAVESHARE_RP2040_ONE)
message(STATUS "Selected board:'${BOARD}'")

# might help for feather?
Expand Down
28 changes: 28 additions & 0 deletions firmware/source/board_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define FEATHER_RFM 7
#define FEATHER_CAN 8
#define KB2040 9
#define WAVESHARE_RP2040_ONE 10


#define BOARD ${BOARD}
Expand Down Expand Up @@ -225,6 +226,33 @@
#define U2IF_UART0_TX 0
#define U2IF_UART0_RX 1

//---------------------------------------------------------
// RP2040 One (Waveshare)
//---------------------------------------------------------
#elif BOARD == WAVESHARE_RP2040_ONE
// I2C0
#define I2C0_ENABLED 1
#define U2IF_I2C0_SDA 4
#define U2IF_I2C0_SCL 5
// I2C1
#define I2C1_ENABLED 1
#define U2IF_I2C1_SDA 2
#define U2IF_I2C1_SCL 3
// SPI0
#define SPI0_ENABLED 1
#define U2IF_SPI0_CK 6
#define U2IF_SPI0_MOSI 7
#define U2IF_SPI0_MISO 8
// 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

//---------------------------------------------------------
// Pico (default)
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions firmware/source/interfaces/StreamBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <stdio.h>
#include <vector>
#include <cstdint>


class StreamBuffer {
Expand Down
5 changes: 5 additions & 0 deletions firmware/source/usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
#define USB_PRD "KB2040 Kee Boar U2IF"
#define USB_VID 0x239A
#define USB_PID 0x0105
#elif BOARD == WAVESHARE_RP2040_ONE
#define USB_MFG "Waveshare"
#define USB_PRD "RP2040 One U2IF"
#define USB_VID 0x2E8A
#define USB_PID 0x103A
#elif BOARD == PICO
#define USB_MFG "Pico"
#define USB_PRD "U2IF"
Expand Down
1 change: 1 addition & 0 deletions source/machine/u2if.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
(0x239a, 0x0105), # Adafruit KB2040
(0x239a, 0x0109), # Adafruit QT2040 Trinket
(0x239a, 0x00f7), # Adafruit QTPY
(0x2e8a, 0x103a) # Waveshare RP2040 One
]


Expand Down