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
2 changes: 1 addition & 1 deletion lib/CMSIS
Submodule CMSIS updated from 9fe411 to f2cad4
2 changes: 1 addition & 1 deletion lib/avr
Submodule avr updated 142 files
2 changes: 1 addition & 1 deletion lib/bdwgc
Submodule bdwgc updated from 7577ca to 1d38c6
2 changes: 1 addition & 1 deletion lib/binaryen
Submodule binaryen updated 2389 files
2 changes: 1 addition & 1 deletion lib/mingw-w64
Submodule mingw-w64 updated 3097 files
2 changes: 1 addition & 1 deletion lib/nrfx
Submodule nrfx updated from d779b4 to 0883a2
2 changes: 1 addition & 1 deletion lib/picolibc
Submodule picolibc updated 6294 files
2 changes: 1 addition & 1 deletion lib/wasi-cli
Submodule wasi-cli updated 65 files
+8 −5 .github/workflows/main.yml
+72 −0 .github/workflows/publish-0.3.yml
+70 −0 .github/workflows/publish.yml
+80 −0 .github/workflows/update-0.3.yml
+68 −0 .github/workflows/update.yml
+8 −0 LICENSE.md
+3 −0 README.md
+878 −801 command.md
+877 −800 imports.md
+10 −0 wit-0.3.0-draft/command.wit
+23 −0 wit-0.3.0-draft/deps.lock
+3 −0 wit-0.3.0-draft/deps.toml
+48 −0 wit-0.3.0-draft/deps/clocks/monotonic-clock.wit
+55 −0 wit-0.3.0-draft/deps/clocks/timezone.wit
+8 −0 wit-0.3.0-draft/deps/clocks/types.wit
+46 −0 wit-0.3.0-draft/deps/clocks/wall-clock.wit
+11 −0 wit-0.3.0-draft/deps/clocks/world.wit
+11 −0 wit-0.3.0-draft/deps/filesystem/preopens.wit
+636 −0 wit-0.3.0-draft/deps/filesystem/types.wit
+9 −0 wit-0.3.0-draft/deps/filesystem/world.wit
+27 −0 wit-0.3.0-draft/deps/random/insecure-seed.wit
+25 −0 wit-0.3.0-draft/deps/random/insecure.wit
+29 −0 wit-0.3.0-draft/deps/random/random.wit
+13 −0 wit-0.3.0-draft/deps/random/world.wit
+62 −0 wit-0.3.0-draft/deps/sockets/ip-name-lookup.wit
+725 −0 wit-0.3.0-draft/deps/sockets/types.wit
+9 −0 wit-0.3.0-draft/deps/sockets/world.wit
+22 −0 wit-0.3.0-draft/environment.wit
+17 −0 wit-0.3.0-draft/exit.wit
+34 −0 wit-0.3.0-draft/imports.wit
+6 −0 wit-0.3.0-draft/run.wit
+65 −0 wit-0.3.0-draft/stdio.wit
+62 −0 wit-0.3.0-draft/terminal.wit
+4 −1 wit/command.wit
+15 −15 wit/deps.lock
+3 −5 wit/deps.toml
+18 −8 wit/deps/clocks/monotonic-clock.wit
+55 −0 wit/deps/clocks/timezone.wit
+5 −1 wit/deps/clocks/wall-clock.wit
+6 −1 wit/deps/clocks/world.wit
+5 −2 wit/deps/filesystem/preopens.wit
+54 −12 wit/deps/filesystem/types.wit
+4 −1 wit/deps/filesystem/world.wit
+9 −9 wit/deps/io/error.wit
+20 −14 wit/deps/io/poll.wit
+40 −44 wit/deps/io/streams.wit
+5 −1 wit/deps/io/world.wit
+3 −1 wit/deps/random/insecure-seed.wit
+4 −1 wit/deps/random/insecure.wit
+4 −1 wit/deps/random/random.wit
+7 −1 wit/deps/random/world.wit
+3 −1 wit/deps/sockets/instance-network.wit
+9 −4 wit/deps/sockets/ip-name-lookup.wit
+26 −2 wit/deps/sockets/network.wit
+4 −1 wit/deps/sockets/tcp-create-socket.wit
+45 −11 wit/deps/sockets/tcp.wit
+4 −1 wit/deps/sockets/udp-create-socket.wit
+29 −7 wit/deps/sockets/udp.wit
+9 −1 wit/deps/sockets/world.wit
+4 −0 wit/environment.wit
+13 −0 wit/exit.wit
+22 −6 wit/imports.wit
+2 −0 wit/run.wit
+12 −3 wit/stdio.wit
+13 −0 wit/terminal.wit
2 changes: 1 addition & 1 deletion lib/wasi-libc
Submodule wasi-libc updated 980 files
113 changes: 113 additions & 0 deletions src/machine/board_badger2350.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
//go:build badger2350

// Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350".
// Pin source: https://github.com/pimoroni/badger2350/blob/main/board/pins.csv
//
// NOTES (verify before first flash):
// - POWER_EN (GPIO27) likely switches peripheral/display power.
// Verify polarity against the schematic; pull HIGH early if needed,
// otherwise the display will remain blank.
// - CHARGE_STAT is connected to EXT_GPIO2 (I2C IO expander) according to pins.csv,
// NOT the RP2350 -> intentionally not defined as a pin here.

package machine

// Crystal oscillator frequency.
const xoscFreq = 12 // MHz

// User buttons.
const (
BUTTON_A Pin = GPIO7
BUTTON_B Pin = GPIO9
BUTTON_C Pin = GPIO10
BUTTON_UP Pin = GPIO11
BUTTON_DOWN Pin = GPIO6
BUTTON_HOME Pin = GPIO22
BUTTON_BOOT Pin = BUTTON_HOME

// System / RTC-related buttons.
BUTTON_RESET Pin = GPIO14
BUTTON_INT Pin = GPIO15
)

// Case LEDs (4-zone mono illumination), named CL0..CL3 in the docs.
const (
CL0 Pin = GPIO0
CL1 Pin = GPIO1
CL2 Pin = GPIO2
CL3 Pin = GPIO3

// Convention: first zone as default LED.
LED = CL0
)

// E-ink display (Inky), on SPI0.
const (
INKY_BUSY Pin = GPIO16
INKY_CS Pin = GPIO17
INKY_SCLK Pin = GPIO18
INKY_MOSI Pin = GPIO19
INKY_DC Pin = GPIO20
INKY_RES Pin = GPIO21
)

// SPI0 default pins == Inky bus. SDI is unused by the EPD,
// but GPIO16 is a valid SPI0 RX line on the RP2350.
const (
SPI0_SCK_PIN = GPIO18 // INKY_SCLK
SPI0_SDO_PIN = GPIO19 // INKY_MOSI
SPI0_SDI_PIN = GPIO16 // (unused by the EPD)
)

// SPI1 is not routed to any header; NoPin satisfies the machine package.
const (
SPI1_SCK_PIN Pin = NoPin
SPI1_SDO_PIN Pin = NoPin
SPI1_SDI_PIN Pin = NoPin
)

// UART pins - default RP2350 UART0 mapping.
// Note: GPIO0/GPIO1 are also CL0/CL1 (case LEDs)
// Do not use UART0 and LEDs simultaneously.
const (
UART0_TX_PIN = GPIO0
UART0_RX_PIN = GPIO1
UART_TX_PIN = UART0_TX_PIN
UART_RX_PIN = UART0_RX_PIN
)

// I2C0 (Qwiic/STEMMA QT + RTC PCF85063A).
const (
I2C0_SDA_PIN = GPIO4
I2C0_SCL_PIN = GPIO5
)

// I2C1 is not routed to any header; NoPin satisfies the machine package.
const (
I2C1_SDA_PIN Pin = NoPin
I2C1_SCL_PIN Pin = NoPin
)

// Power / Sensing.
const (
VBUS_DETECT Pin = GPIO12
RTC_ALARM Pin = GPIO13
VBAT_SENSE Pin = GPIO26
POWER_EN Pin = GPIO27
SENSE_1V1 Pin = GPIO28

BATTERY = VBAT_SENSE
)

var DefaultUART = UART0

// USB identifiers
const (
usb_STRING_PRODUCT = "Badger 2350"
usb_STRING_MANUFACTURER = "Pimoroni"
)

var (
usb_VID uint16 = 0x2E8A
usb_PID uint16 = 0x0005
)
112 changes: 112 additions & 0 deletions src/machine/board_blinky2350.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
//go:build blinky2350

// Chip: RP2350A (QFN-60, 30 GPIO) -> target inherits from "rp2350".
// Pin source: https://github.com/pimoroni/blinky2350/blob/main/board/pins.csv
//
// NOTES (verify before first flash):
// - POWER_EN (GPIO27) likely switches peripheral power.
// Verify polarity against the schematic; pull HIGH early if needed,
// otherwise the display will remain blank.
// - CHARGE_STAT is connected to EXT_GPIO2 (I2C IO expander) according to pins.csv,
// NOT the RP2350 -> intentionally not defined as a pin here.
// - The dot matrix is NOT driven via SPI (Latch/Blank/
// Row-Clock are not SPI signals) -> use PIO or bit-banging.
// SPI0 and SPI1 are therefore set to NoPin (required by the machine package).

package machine

// Crystal oscillator frequency.
const xoscFreq = 12 // MHz

// User buttons.
const (
BUTTON_A Pin = GPIO7
BUTTON_B Pin = GPIO9
BUTTON_C Pin = GPIO10
BUTTON_UP Pin = GPIO11
BUTTON_DOWN Pin = GPIO6
BUTTON_HOME Pin = GPIO22
BUTTON_BOOT Pin = BUTTON_HOME

BUTTON_RESET Pin = GPIO14
BUTTON_INT Pin = GPIO15
)

// Case LEDs (4-zone mono illumination), named CL0..CL3 in the docs.
const (
CL0 Pin = GPIO0
CL1 Pin = GPIO1
CL2 Pin = GPIO2
CL3 Pin = GPIO3

LED = CL0
)

// LED dot matrix: column shift register + row driver.
// NOT SPI -> drive via PIO or bit-banging.
const (
DISPLAY_COL_SCLK Pin = GPIO16
DISPLAY_COL_DATA Pin = GPIO17
DISPLAY_COL_LATCH Pin = GPIO18
DISPLAY_COL_BLANK Pin = GPIO19
DISPLAY_ROW_DATA Pin = GPIO20
DISPLAY_ROW_CLK Pin = GPIO21
)

// I2C0 (Qwiic/STEMMA QT + RTC).
const (
I2C0_SDA_PIN = GPIO4
I2C0_SCL_PIN = GPIO5
)

// I2C1 is not routed to any header; NoPin satisfies the machine package.
const (
I2C1_SDA_PIN Pin = NoPin
I2C1_SCL_PIN Pin = NoPin
)

// SPI pins - the LED matrix is driven via PIO/bit-banging, not SPI.
// NoPin satisfies the machine package requirements.
const (
SPI0_SCK_PIN Pin = NoPin
SPI0_SDO_PIN Pin = NoPin
SPI0_SDI_PIN Pin = NoPin

SPI1_SCK_PIN Pin = NoPin
SPI1_SDO_PIN Pin = NoPin
SPI1_SDI_PIN Pin = NoPin
)

// UART pins - default RP2350 UART0 mapping.
// Note: GPIO0/GPIO1 are also CL0/CL1 (case LEDs)
// Do not use UART0 and LEDs simultaneously.
const (
UART0_TX_PIN = GPIO0
UART0_RX_PIN = GPIO1
UART_TX_PIN = UART0_TX_PIN
UART_RX_PIN = UART0_RX_PIN
)

// Power / sensing.
const (
VBUS_DETECT Pin = GPIO12
RTC_ALARM Pin = GPIO13
VBAT_SENSE Pin = GPIO26
POWER_EN Pin = GPIO27
SENSE_1V1 Pin = GPIO28

BATTERY = VBAT_SENSE
)

var DefaultUART = UART0

// USB identifiers
const (
usb_STRING_PRODUCT = "Blinky 2350"
usb_STRING_MANUFACTURER = "Pimoroni"
)

var (
usb_VID uint16 = 0x2E8A
usb_PID uint16 = 0x0005
)
9 changes: 9 additions & 0 deletions targets/badger2350.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"inherits": ["rp2350"],
"build-tags": ["badger2350"],
"serial-port": ["2e8a:0005"],
"default-stack-size": 8192,
"ldflags": [
"--defsym=__flash_size=16M"
]
}
9 changes: 9 additions & 0 deletions targets/blinky2350.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"inherits": ["rp2350"],
"build-tags": ["blinky2350"],
"serial-port": ["2e8a:0005"],
"default-stack-size": 8192,
"ldflags": [
"--defsym=__flash_size=16M"
]
}