Skip to content

OpenDevicePartnership/pico-de-gallo

check no-std book crates.io crates.io crates.io crates.io crates.io

Pico de Gallo

A USB bridge that turns a Raspberry Pi Pico 2 into a host-accessible I²C, SPI, UART, GPIO, PWM, ADC, and 1-Wire interface. Write and test embedded Rust drivers on your development machine without cross-compiling or flashing firmware to a target board.

Overview

Pico de Gallo provides:

  • I²C: read, write, write-then-read, bus scanning, and transaction batching
  • SPI: read, write, full-duplex transfer, write-then-read, and transaction batching
  • UART: read, write, flush, and baud rate configuration
  • GPIO: digital input/output, edge event monitoring (subscribe/unsubscribe)
  • PWM: 4-channel PWM output with configurable frequency and duty cycle
  • ADC: 4 GPIO-based analog inputs (12-bit)
  • 1-Wire: bus reset, read, write, strong pullup, and ROM search (PIO hardware)
  • Configuration: runtime I²C/SPI/UART/PWM frequency and SPI mode changes

All communication uses postcard-rpc over USB — a compact, typed, binary RPC protocol.

Book

The Pico de Gallo Book covers hardware assembly, firmware flashing, and a step-by-step guide to writing an embedded device driver using Pico de Gallo.

Crates

Crate Description
pico-de-gallo-firmware Embassy-rs firmware for the RP2350
pico-de-gallo-lib Async host library (requires tokio)
pico-de-gallo-hal embedded-hal + embedded-hal-async implementation
pico-de-gallo-ffi C FFI bindings (shared library + header)
gallo CLI application for batch-mode access
pico-de-gallo-internal Shared wire-protocol types (internal)

Firmware

Embassy-rs firmware for the RP2350 that exposes I²C, SPI, UART, and GPIO peripherals over USB via postcard-rpc endpoints.

Library

Async host-side library wrapping the postcard-rpc transport. Provides typed methods for every firmware endpoint. Requires the tokio runtime.

HAL

Implements both embedded-hal and embedded-hal-async traits — including I2c, SpiBus, SpiDevice, GPIO digital I/O, delay, and embedded-io Read/Write for UART — so embedded device drivers written against those traits can be tested on a host machine with real hardware attached to the Pico de Gallo.

App

Command-line tool (gallo) for interactive and batch-mode I²C/SPI/UART/GPIO access. Supports hex, binary, and ASCII output formats.

FFI

C-compatible shared library wrapping the Rust host library. Generates a C header via cbindgen. Suitable for integration into C/C++/Python/etc. projects.

Internal

Shared wire-protocol crate defining all postcard-rpc endpoints, request and response types, and constants. Used by both firmware and host crates.

Hardware

KiCAD schematic and PCB design for a Pico 2 daughter board. The v1.1 board features a single keyed 2x12 shrouded header that routes all 20 firmware signals with on-board I²C pull-ups and ADC input protection.

Case

3D-printable snap-fit enclosure (FreeCAD) in two parts — body and lid.

About

A tool for testing Embedded Rust drivers for discrete I2C/SPI components.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors