| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Multi-bus clients for macOS and Linux, and bus-host adaptor board firmware for the RP2040 or RP2350.
It is used as the basis for I²C client apps for generic I²C usage, and to operate Holtek HT16K33-controlled matrix and segment LED displays, and 1-Wire apps for generic 1-Wire usage and to use the Analog Devices DS18B20 sensors.
The client code is largely written in C, and will compile and run on both macOS and Linux. The exceptions are the DS18B20 command-line utility and DS18B20 GUI app, both of which are written in Swift — and the latter is built for the macOS GUI.
Why Depot? Because it’s a place in which you’ll find lots of buses.
Note This repo supersedes and extends cli2c, the previous repo for this code, now archived. However, Depot maintains the older repo’s versioning.
The bus host board is a Raspberry Pi Pico, Raspberry Pi Pico 2, Adafruit QTPy RP2040, Adafruit QT2040 Trinkey, Adafruit Feather RP2040, SparkFun ProMicro RP2040, Pimoroni Tiny 2040 or Arduino Nano RP2040 Connect.
It runs the included firmware and connects to a host computer via USB.
The build system will use the standard Pico SDK environment variable PICO_BOARD, if set, to configure compilation for a particular supported board. If the variable is undefined, or set to a board not yet supported by Depot, the firmware will be built for all supported boards.
| Board | PICO_BOARD Value |
|---|---|
| Raspberry Pi Pico | pico |
| Raspberry Pi Pico 2 | pico2 |
| Adafruit Feather RP2040 | adafruit_feather_rp2040 |
| Adafruit QTPy RP2040 | adafruit_qtpy_rp2040 |
| Adafruit Trinkey RP2040 | adafruit_trinkey_qt2040 |
| Arduino Nano RP2040 Connect | arduino_nano_rp2040_connect |
| Sparkfun ProMicro | sparkfun_promicro |
| Pimoroni Tiny 2040 | pimoroni_tiny2040 |
xcode-select --install
brew install cmake ninja libusb picotool
brew install --cask gcc-arm-embedded
git clone https://github.com/raspberrypi/pico-sdk.git
git -C pico-sdk submodule update --init
export PICO_SDK_PATH=/path/to/pico-sdk
export PICOTOOL_FETCH_FROM_GIT_PATH="$PICO_SDK_PATH/tools"sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev
git clone https://github.com/raspberrypi/pico-sdk.git
git -C pico-sdk submodule update --init
export PICO_SDK_PATH=/path/to/pico-sdk
export PICOTOOL_FETCH_FROM_GIT_PATH="$PICO_SDK_PATH/tools"You can build the code from the accompanying Xcode project files:
In each case:
Important WE STRONGLY RECOMMEND YOU BUILD THE FIRMWARE WITH PICO SDK 1.5.0 OR ABOVE.
The deploy script tricks the RP2040/RP2350-based board into booting into disk mode, then copies over the newly build firmware. When the copy completes, the board automatically reboots. This saves a lot of tedious power-cycling with the BOOT button held down.
You can switch between build types when you make the cmake call in step 3, above. A debug build is made by default, but you can make this explicit with
cmake -S . -B build -D CMAKE_BUILD_TYPE=DebugFor a release build, which among various optimisations omits UART debugging code, call:
cmake -S . -B build -D CMAKE_BUILD_TYPE=ReleaseFollow both of these commands with the usual
cmake --build buildThe contents of this repo are:
/depot | |___/client // Client-side code, written in C | |___/cli2c // A generic CLI tool for any I²C device | |___/matrix // An HT16K33 8x8 matrix-oriented version of cli2c | |___/segment // An HT16K33 4-digit, 7-segment-oriented version of cli2c | |___/cliwire // A generic CLI tool for any 1-Wire device | |___/common // Code common to all versions | |___/i2c // I2C driver code | |___/onewire // 1-Wire driver code | |___/ds18b20 // A DS18B20-oriented version of cliwire | |___/sensor // A Swift/C macOS GUI app that uses the 1-Wire and serial driver code. | |___/firmware // The RP2040/RP2350 host firmware, written in C | |___/common // Code common to multiple versions | |___/feather // An Adafruit Feathr RP2040 version | |___/nano // An Arduino Nano RP2040 Connect version | |___/pico // The Raspberry Pi Pico version | |___/pico2 // The Raspberry Pi Pico 2 version | |___/promicro // A SparkFun ProMicro RP2040 version | |___/qtpy // An Adafruit QTPy RP2040 version | |___/tiny // A Pimoroni Tiny 2040 version | |___/trinkey // An Adafruit QT2040 Trinkey version | |___/examples // Demo apps | |___cpu_chart_matrix.py // CPU utilisation display for 8x8 matrix LEDs | |___cpu_chart_segment.py // CPU utilisation display for 4-digit segment LEDs | |___cpu_chart_ltp305_cli2c.py // CPU utilisation display for twin LTP305 matrices | |___mcp9808_temp_cli2c.py // Periodic temperature reports from an MCP9808 sensor | |___mcp9808_temp_disp_cli2c.py // Periodic temperature reports from an MCP9808 sensor | // and presented on a 4-digit segment LED | |___/linux // Linux build settings (CMake) for the client apps | |___CMakeLists.txt // Top-level firmware project CMake config file |___pico_sdk_import.cmake // Raspberry Pi Pico SDK CMake import script | |___firmware.code-workspace // Visual Studio Code workspace for the board firmware |___cli2c.xcodeproj // Xcode project for cli2c, matrix and segment |___cliwire.xcodeproj // Xcode project for cliwire | |___deploy.sh // A .uf2 deployment script that saves pressing | // RESET/BOOTSEL buttons. LEGACY: now largely replaced | // by the official picotool | |___README.md |___LICENSE.md
Under macOS, RP2040/RP2350-based boards will appear in /dev as cu.usbmodemXXXXX or similar. You can use my dlist utility to save looking up and keying in these names, which can vary across boots.
Under Linux, specifically Raspberry Pi OS, boards appear as /dev/ttyACM0. You may need to add your user account to the group dialout in order to access the port:
The following client apps are included in the repo. They are documented on my documentation site.
| App | Description | Platform | Docs |
|---|---|---|---|
| cli2c | A command line utility for generic I²C use | macOS, Linux | Link |
| matrix | A specific driver for HT16K33-based 8x8 LED matrices | macOS, Linux | Link |
| segment | A specific driver for HT16K33-based 4-digit, 7-segment LEDs | macOS, Linux | Link |
| cliwire | A generic 1-Wire command line utility | macOS, Linux | Link |
Note These are essentially demo apps, and are required by the examples listed below. When built for debug release they will emit logging for the traffic passing to and from the bus host board. This can be disabled by using Xcode to compile a release build by choosing Archive from the Product menu.
The examples folder contains Python 3.x scripts that make use of the above apps:
All the examples run at the command line and take the path to the adaptor device as a required argument and an I²C address as a second, optional argument (if you are not using each device’s default address). For example:
python examples/cpu_chart_ltp305_cli2c.py /dev/cu.usbserial-0101 0x63Note These Python examples use the psutil library, which is not provided as standard. To try the examples, set up a virtual environment:
cd depot
python -m venv .python
source .python/bin/activate
pip install psutil
python examples/cpu_chart_ltp305_cli2c.py /dev/cu.usbserial-0101 0x63
...
deactivateThis work was inspired by James Bowman’s (@jamesbowman) i2ccl tool, which was written as a macOS/Linux/Windows command line tool to connect to his I2CMini board.
My own I²C driver code started out based on James’ but involves numerous changes and (I think) improvements. I also removed the Windows code and some functionality that I don’t need (I²C capture, monitoring). Finally, it targets fresh firmware I wrote from the ground up to run on an RP2040/RP2350-based board, not the I2CMini.
Why? Originally I was writing an HT16K33 driver based directly on James’ code, but I accidentally broke the pins off my I2CMini — only to find it is very hard to find new boards. James’ firmware is written in a modern version of Forth, so I had no choice but to learn Forth, or write code of my own. I chose the latter.
Thanks are also due to Hermann Stamm-Wilbrandt (@Hermann-SW) for the basis for the deploy script.
The 1-Wire driver is based on code I produced for the TwilioKORE Wireless Electric Imp IoT platform some years ago.
See CHANGELOG.md.
You can find release notes for previous versions here
All client apps are © 2026 Tony Smith (@smittytone) and licensed under the terms of the MIT Licence.
The RP2040/RP2350 firmware is © 2026, Tony Smith (@smittytone). It is licensed under the terms of the MIT Licence.
| Back | FazBrowse Home | New Git URL |