Skip to main content

CM0

Get the packages first - they all live in one repo:

git clone https://github.com/freewili/onewili
cd onewili

The CM0 is the Linux host beside MAIN on the same board. This package reaches MAIN's menu system from there over the FPGA mailbox console link - no USB, no serial port - so a CM0 program drives the device exactly as a PC would.

It needs the fwcm0 driver (fwcm0::fwcm0_core) for the mailbox and router; build the package against it:

cmake -S ./cm0 -B ./cm0/build
cmake --build ./cm0/build

Open a device and send a first command, in C++:

ConsoleClient client(router); // LinuxTransport -> SramRouter -> ConsoleClient
client.connect();
fwcm0::OneWiliLink link(client);
ow_transport t = link.transport();
ow_device dev;
ow_open(&dev, &t);

/* ow_status ow_gui_set_led_color(ow_device* dev, int32_t ledindex, int32_t red, int32_t green, int32_t blue, int32_t duration, ow_ow_led_manager_led_mode mode); */
ow_gui_set_led_color(&dev, /* args */);

ow_close(&dev);

or in Python, which pipes the same wire bytes through the fwcm0 console CLI instead of a serial port (needs the onewili package from ./python installed, and fwcm0 on PATH):

from onewili_cm0 import connect_cm0

dev = connect_cm0()
dev.gui.set_led_color(...)
dev.close()

The CM0's own SRAM/PSRAM router is not part of this API - it is a local capability reached directly through fwcm0::SramRouter.

Full command list: GUI Functions - or start at the API index.