Skip to main content

GUI Functions

dev.gui - wire path g - generated from fwMenuGUI.

set_led_color​

Set Board LED. Sets a led to a specific color

Set Board LED​

Sets the color of one of the seven on-board RGB status LEDs. The new color is applied immediately — no separate refresh/commit call is required.

Arguments​
NameTypeRangeDescription
ledindexdecU80–6Which on-board RGB LED to set
reddecU80–255Red channel intensity
greendecU80–255Green channel intensity
bluedecU80–255Blue channel intensity
Returns​
  • success=basic — 1 if the LED was updated, 0 if the arguments could not be parsed or ledindex is out of range.
Examples​

Set LED 0 to full green:

0 0 255 0

Set LED 6 to white:

6 255 255 255

Turn LED 3 off:

3 0 0 0
Notes​
  • Indices outside 0–6 are rejected.
  • Each channel is 8-bit (0–255); higher values are clamped/rejected by the decU8 parser.
  • To turn an LED off, set all three channels to 0.

Wire command: g\s

ArgWire type
ledindexdecU8
reddecU8
greendecU8
bluedecU8
durationdecS32
modeowLEDManagerLEDMode

Returns: none (Ok/Err only)

dev.gui.set_led_color(ledindex: int, red: int, green: int, blue: int, duration: int, mode: enums.owLEDManagerLEDMode | int) -> Result
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);
dev.gui().set_led_color(ledindex: i32, red: i32, green: i32, blue: i32, duration: i32, mode: owLEDManagerLEDMode) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.set_led_color(ledindex, red, green, blue, duration, mode) # check dev.ok

show_fwi_image​

Show FWI Image. Shows an freewili image (fwi) file from the file system.

Show FWI Image​

Loads and displays a FreeWili Image (.fwi) file from the on-device filesystem on the 3.5" touchscreen display.

Arguments​
NameTypeDescription
filenamestringPath to the .fwi file to display
Path resolution​
  • If filename begins with \, it is treated as an absolute path on the filesystem (e.g. \images\logo.fwi).
  • Otherwise, it is resolved relative to \images\ — logo.fwi is loaded as \images\logo.fwi.
  • Include the .fwi extension explicitly; it is not appended automatically.
  • The file must already exist on the filesystem.
Returns​
  • success=basic — 1 if the file was found and displayed, 0 if the path could not be resolved, the file does not exist, or the image failed to load.
Examples​

Show an image stored in the default \images\ folder:

logo.fwi

Show an image using an absolute path:

\images\subdir\splash.fwi
Notes​
  • .fwi is the FreeWili native image format. Use the FreeWili GUI tools to convert PNG/JPEG assets into .fwi files and copy them to the device's SD card or internal filesystem.
  • To display an image bundled as a built-in asset (by ID) rather than a file, use Show Asset Image (a) instead.
  • To clear the screen after viewing, use Reset Display (t).

Wire command: g\l

ArgWire type
filenamestring

Returns: none (Ok/Err only)

dev.gui.show_fwi_image(filename: str) -> Result
ow_status ow_gui_show_fwi_image(ow_device* dev, const char* filename);
dev.gui().show_fwi_image(filename: &str) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.show_fwi_image(filename) # check dev.ok

clear_display​

Reset Display. Clears any GUI menu actions done to the display such as show image or show text

Reset Display​

Clears the 3.5" touchscreen of any content drawn by menu commands such as Show FWI Image (l), Show Asset Image (a), or Show Text Display (p), returning the display to its default state.

Arguments​

None.

Returns​
  • success=basic — 1 if the display was reset, 0 otherwise.
Examples​

Reset the display after viewing an image or text:

t
Notes​
  • Use this after any of the following to restore the default UI:
    • Show FWI Image (l)
    • Show Asset Image (a)
    • Show Text Display (p)
  • This command takes no arguments — any input is ignored.
  • It only affects the display contents; it does not change LED state, button state, or any other peripheral.

Wire command: g\t

Returns: none (Ok/Err only)

dev.gui.clear_display() -> Result
ow_status ow_gui_clear_display(ow_device* dev);
dev.gui().clear_display() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.clear_display() # check dev.ok

show_text​

Show Text Display. Show text on the free wili display

Show Text Display​

Draws a text overlay on top of the current GUI window on the 3.5" touchscreen display. The underlying GUI is not modified — the text is rendered over it until cleared.

Arguments​
NameTypeDescription
texttodisplaystringThe text to render as an overlay
Returns​
  • success=basic — 1 if the text was accepted and drawn, 0 if the argument could not be parsed.
Examples​

Show a simple greeting:

Hello Wili

Show a status message:

Ready

Show a multi-word string (spaces are part of the text):

Battery OK
Notes​
  • The text is drawn as an overlay above the current GUI window; the GUI underneath is preserved.
  • Calling Show Text Display again replaces the previous overlay text.
  • Text longer than the available screen area is truncated to fit — it is not scrolled or wrapped onto additional screens.
  • To remove the overlay and restore the default display, use Reset Display (t).
  • To show an image instead of text, use Show FWI Image (l) or Show Asset Image (a).

Wire command: g\p

ArgWire type
texttodisplaystring

Returns: none (Ok/Err only)

dev.gui.show_text(texttodisplay: str) -> Result
ow_status ow_gui_show_text(ow_device* dev, const char* texttodisplay);
dev.gui().show_text(texttodisplay: &str) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.show_text(texttodisplay) # check dev.ok

read_all​

Read All Buttons. Sets the baud rate for I2C in Hz

Wire command: g\u

Returns: none (Ok/Err only)

dev.gui.read_all() -> Result
ow_status ow_gui_read_all(ow_device* dev);
dev.gui().read_all() -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.read_all() # check dev.ok

stream_io​

Stream Buttons. Sends GPIO values as a specific rate to host

Wire command: g\o

ArgWire type
pindec

Returns: none (Ok/Err only)

dev.gui.stream_io(pin: int) -> Result
ow_status ow_gui_stream_io(ow_device* dev, int32_t pin);
dev.gui().stream_io(pin: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.stream_io(pin) # check dev.ok

show_image_asset_by_id​

Show Asset Image. Reads the number from the address

Wire command: g\a

ArgWire type
image_iddecS32

Returns: none (Ok/Err only)

dev.gui.show_image_asset_by_id(image_id: int) -> Result
ow_status ow_gui_show_image_asset_by_id(ow_device* dev, int32_t image_id);
dev.gui().show_image_asset_by_id(image_id: i32) -> Result<(), OwError>

The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).

dev.gui.show_image_asset_by_id(image_id) # check dev.ok