Skip to content

Initial minimal port for jumperless v5 (micropython) #2

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

Open
wants to merge 1 commit into
base: master
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
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
{
"name": "Default Linux Universal",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/universal:3-linux"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
19 changes: 19 additions & 0 deletions ports/rp2/boards/JUMPERLESS_V5/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"deploy": [
"../deploy.md"
],
"docs": "",
"features": [
"Dual-core",
"External Flash",
"USB"
],
"images": [
"rp2-pico2.jpg"
],
"mcu": "rp2350",
"product": "Jumperless v5",
"thumbnail": "",
"url": "https://github.com/Architeuthis-Flux/JumperlessV5",
"vendor": "Architeuthis-Flux"
}
91 changes: 91 additions & 0 deletions ports/rp2/boards/JUMPERLESS_V5/jumperless-v5.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright (c) 2024 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// Board definition for the Jumperless v5
//
// This header may be included by other board headers as "boards/jumperless_v5.h"

// pico_cmake_set PICO_PLATFORM=rp2350

#ifndef _BOARDS_JUMPERLESS_V5_H
#define _BOARDS_JUMPERLESS_V5_H

// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif

// For board detection
#define JUMPERLESS_V5

// --- RP2350 VARIANT ---
#define PICO_RP2350A 0 // 1 for RP2350A, 0 for RP2350B

// // --- BOARD SPECIFIC ---
// TODO: see https://github.com/raspberrypi/pico-sdk/pull/2363/files as an example

// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif

// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif

// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 22
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 23
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 21
#endif

// --- FLASH ---

#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1

#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif

// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (128 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (128 * 1024 * 1024)
#endif

// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif

#endif // _BOARDS_JUMPERLESS_V5_H
9 changes: 9 additions & 0 deletions ports/rp2/boards/JUMPERLESS_V5/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# cmake file for Jumperless v5
set(PICO_BOARD "jumperless-v5")
set(PICO_PLATFORM "rp2350")

# This was copied from SparkFun IoT RedBoard RP350, not sure if needed
# TODO: DELETE THIS LINE WHEN SUBMODULED PICO-SDK INCLUDES THIS BOARD
set(PICO_BOARD_HEADER_DIRS ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD})

set(PICO_NUM_GPIOS 48)
39 changes: 39 additions & 0 deletions ports/rp2/boards/JUMPERLESS_V5/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Board and hardware specific configuration
#define MICROPY_HW_BOARD_NAME "Jumperless v5"
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - 1024 * 1024)

// USB VID/PID
#define MICROPY_HW_USB_VID (0x1D50)
#define MICROPY_HW_USB_PID (0xACAB)

// UART0
#define MICROPY_HW_UART0_TX (0)
#define MICROPY_HW_UART0_RX (1)
#define MICROPY_HW_UART0_CTS (-1)
#define MICROPY_HW_UART0_RTS (-1)

// UART1
#define MICROPY_HW_UART1_TX (24)
#define MICROPY_HW_UART1_RX (25)
#define MICROPY_HW_UART1_CTS (-1)
#define MICROPY_HW_UART1_RTS (-1)

// I2C0
#define MICROPY_HW_I2C0_SCL (5)
#define MICROPY_HW_I2C0_SDA (4)

// I2C1
#define MICROPY_HW_I2C1_SCL (23)
#define MICROPY_HW_I2C1_SDA (22)

// SPI0
#define MICROPY_HW_SPI0_SCK (22)
#define MICROPY_HW_SPI0_MOSI (23)
#define MICROPY_HW_SPI0_MISO (20)
#define MICROPY_HW_SPI0_NSS (21)

// SPI1
#define MICROPY_HW_SPI1_SCK (26)
#define MICROPY_HW_SPI1_MOSI (27)
#define MICROPY_HW_SPI1_MISO (24)
#define MICROPY_HW_SPI1_NSS (25)
1 change: 1 addition & 0 deletions ports/rp2/boards/JUMPERLESS_V5/mpconfigvariant.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(PICO_PLATFORM "rp2350")
1 change: 1 addition & 0 deletions ports/rp2/boards/JUMPERLESS_V5/mpconfigvariant_RISCV.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(PICO_PLATFORM "rp2350-riscv")
24 changes: 24 additions & 0 deletions ports/rp2/boards/JUMPERLESS_V5/pins.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
TX,GPIO0
RX,GPIO1
SDA,GPIO4
SCL,GPIO5
GP6,GPIO6
GP7,GPIO7
GP20,GPIO20
GP21,GPIO21
GP22,GPIO22
GP23,GPIO23
GP25,GPIO25
GP26,GPIO26
GP27,GPIO27
NEOPIXEL,GPIO17
NEOPIXEL0,GPIO3
NEOPIXEL1,GPIO2
A0,GPIO40
A1,GPIO41
A2,GPIO42
A3,GPIO43
A4,GPIO44
A5,GPIO45
A6,GPIO46
A7,GPIO47
Loading