Multi-Bus Adaptor Firmware and Client Code for macOS and Linux

Latest Release: 1.2.2

 

About Depot

Depot comprises firmware and client code that allows you to connect a multi-bus adaptor board to your Mac or Linux computer and communicate with I²C and 1-Wire peripheral devices wired up to the adaptor.

Connect a matrix display to your Mac

The adaptor is a Raspberry Pi RP2040-based board, such as the Pico, running the Depot firmware. The adaptor relays commands from client apps to peripheral devices, be they sensors, displays, actuators, storage chips, or whatever.

The Mac or Linux box connects to the adaptor over USB.

Connect a matrix display to your Raspberry Pi 400

Documentation

The Depot firmware is documented separately in the documentation section.

cli2c

Depot builds on and extends the older cli2c tool, and its version numbering is therefore consistent with the older code.

Connect a matrix display to your Mac

Why Depot?

Because it’s a place in which you’ll find lots of buses.


Install Depot

Important WE STRONGLY RECOMMEND YOU BUILD THE FIRMWARE WITH PICO SDK 1.5.0 OR ABOVE.

  1. Clone the Depot repo and navigate to the repo directory.
  2. cmake -S . -B firmwarebuild
  3. cmake --build firmwarebuild
  4. Transfer the firmware to the specific board you are using:
    • ./deploy.sh /path/to/device firmwarebuild/firmware/pico/firmware_pico_rp2040.uf2
    • ./deploy.sh /path/to/device firmwarebuild/firmware/qtpy/firmware_qtpy_rp2040.uf2
    • ./deploy.sh /path/to/device firmwarebuild/firmware/promicro/firmware_promicro.uf2
    • ./deploy.sh /path/to/device firmwarebuild/firmware/tiny/firmware_tiny2040.uf2
    • ./deploy.sh /path/to/device firmwarebuild/firmware/trinkey/firmware_trinkey2040.uf2

The bundled deploy script, deploy.sh, tricks the RP2040-based board into booting into disk mode, then copies across the newly build firmware. When the copy completes, the RP2040 automatically reboots. This saves of a lot of tedious power-cycling with the BOOTSEL button held down.

Debug vs Release

You can switch between build types when you make the cmake call in step 2, above. A debug build is made by default, but you can make this explicit with:

cmake -S . -B firmwarebuild -D CMAKE_BUILD_TYPE=Debug

For a release build, which omits the UART debugging code, call:

cmake -S . -B firmwarebuild -D CMAKE_BUILD_TYPE=Release

Follow both of these commands with the usual:

cmake --build firmwarebuild

Build the Client Apps

macOS

You can build the code from the accompanying Xcode project files:

  • cli2c.xcodeproj — Contains cli2c. segment and matrix.
  • cliwire.xcodeproj — Contains cliwire, ds18b20 and Sensor (GUI).

In each case:

  1. Archive the project.
  2. Save the build products on the desktop.
  3. Copy the binary artifacts to your preferred location listed in $PATH.

Linux

  1. Navigate to the repo directory.
  2. cd linux
  3. cmake -S . -B build
  4. cmake --build build
  5. Copy the binary artifacts from the build directory to your preferred location listed in $PATH.

The Client Apps

The following client apps are provided:

App Description Platform(s) Docs
cli2c  A CLI utility for generic I²C use macOS, Linux Link
matrix  A CLI utility to operate Holtek HT16K33-based matrix displays via I²C macOS, Linux Link
segment  A CLI utility to operate Holtek HT16K33-based segment displays via I²C macOS, Linux Link
cliwire  A CLI utility for generic 1-Wire use macOS, Linux Link
ds18b20  A CLI utility to sample an Analog Devices 1-Wire DS18B20 temperature sensor macOS Link
Sensor  A GUI app to sample an Analog Devices 1-Wire DS18B20 temperature sensor macOS Link

 
All of these apps run on macOS and Linux with the exception of ds18b20 (written in Swift) and Sensor (a Swift-based macOS GUI app):

The Sensor macOS GUI app in operation

Every app makes use of common serial driver and bus driver code so you can view the apps as examples as much as tools that are ready to use.


Source Code

You can view Depot’s source code at GitHub.


Release Notes

  • 1.2.2 23 April 2023
    • Support the Pico SDK’s PICO_BOARD environment variable to select specific firmware targets.
    • Support the Arduino Nano RP2040 Connect.
  • 1.2.1 21 March 2023
    • Add LTP-305 example.
  • 1.2.0 17 March 2023
    • Renamed Depot from cli2c.
    • Add 1-Wire support.
    • Add 1-Wire client apps cliwire, ds18b20 and Sensor.
    • Many under-the-hood improvements and fixes.

Related Software


smittytonesmittytone
Site and software copyright © 2024, Tony Smith