GPIO
These commands are available three ways — in the FREE-WILi GUI app, in a serial terminal, and on the device itself. See Connecting it to a computer for how to reach them.
High
Drive a GPIO pin high (logic 1, ~3.3 V).
Usage
Enter the GPIO pin number when prompted:
s 25
Valid Pins
Only pins exposed on the FreeWili connectors are accepted. On the standard
build these include: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
25, 26, 27. Invalid pins return false.
See Also
l— Low (drive a GPIO low)t— Toggle (invert a GPIO)u— Get All IOs (read full GPIO bitfield)
How to use it — press s. At the prompt, enter: GPIO Number.
What you enter — pin.
Low
Drive a GPIO pin low (logic 0, ~0 V).
Usage
Enter the GPIO pin number when prompted:
l 25
Valid Pins
Only pins exposed on the FreeWili connectors are accepted. On the standard
build these include: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
25, 26, 27. Invalid pins return false.
See Also
s— High (drive a GPIO high)t— Toggle (invert a GPIO)u— Get All IOs (read full GPIO bitfield)
How to use it — press l. At the prompt, enter: GPIO Number.
What you enter — pin.
Toggle
Invert the current output level of a GPIO pin. If the pin is currently low it is driven high; if it is currently high it is driven low.
Usage
Enter the GPIO pin number when prompted:
t 25
Valid Pins
Only pins exposed on the FreeWili connectors are accepted. On the standard
build these include: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
25, 26, 27. Invalid pins return false.
Notes
- If the pin was previously configured as an input (e.g. floating or pulled), the read state determines the initial toggle direction before the pin is switched to output.
- To force a known level instead of toggling, use
s(High) orl(Low).
See Also
s— High (drive a GPIO high)l— Low (drive a GPIO low)p— PWM IO (drive a GPIO with PWM)u— Get All IOs (read full GPIO bitfield)
How to use it — press t. At the prompt, enter: GPIO Number.
What you enter — pin.
PWM IO
Enable PWM (pulse-width modulation) output on a GPIO pin at a given frequency and duty cycle.
Usage
Enter the GPIO number, frequency (Hz), and duty cycle (%) separated by spaces:
p 25 1000 50
The example above drives pin 25 with a 1 kHz square wave at 50 % duty.
Valid Pins
Only pins exposed on the FreeWili connectors are accepted. On the
standard build these include: 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 25, 26, 27. Invalid pins return false.
Notes
- Very low or very high frequencies may not be exactly representable; the achieved value depends on the RP2350 PWM clock divider and wrap.
- Duty cycles of
0or100produce a steady low or high output, respectively. - To stop PWM and return the pin to plain GPIO, drive it with
s,l, ort.
See Also
s— High (drive a GPIO high)l— Low (drive a GPIO low)t— Toggle (invert a GPIO)u— Get All IOs (read full GPIO bitfield)
How to use it — press p. At the prompt, enter: GPIO Number, freq, and duty (0-100) separated by spaces:
What you enter — gpio_number, freq, duty.
Get All IOs (hex)
Read the state of every GPIO pin at once and print the result as a hexadecimal bitfield.
Usage
u
No arguments are required.
Decoding the Output
For example, an output of 0200:
0x0200 = 0000 0010 0000 0000
^
bit 9 → GPIO 9 is high
All other pins shown are low.
Notes
- Pins are sampled as inputs regardless of their current direction; this reads the pad level, so an output pin reads back the level it is driving.
- Only GPIOs exposed on the FreeWili connectors are typically meaningful
(
8–17,25–27on the standard build); other bits reflect internal signals and may not be useful. - The printed width is fixed at 4 hex digits and does not cover all RP2350 GPIOs — use it primarily for the lower 16 pins.
See Also
s— High (drive a GPIO high)l— Low (drive a GPIO low)t— Toggle (invert a GPIO)o— Stream IO reads (periodically report the GPIO bitfield)
How to use it — press u.
Stream IO reads
Periodically sample all GPIO pins and stream the bitfield to the host as
gpioReport binary events at a fixed millisecond rate.
Usage
Enter the report rate in milliseconds when prompted:
o 10
The example above streams the full GPIO bitfield every 10 ms. Pass 0 to
stop streaming.
Notes
- The stream uses the binary API (
addEvent_gpioReport), not the text console, so reports do not appear as printed lines. - Very small intervals increase USB/CPU load; choose the largest rate that meets your needs.
- Only one stream rate is active at a time; sending a new value replaces the previous one.
See Also
u— Get All IOs (one-shot read of the GPIO bitfield as hex)s— High (drive a GPIO high)l— Low (drive a GPIO low)t— Toggle (invert a GPIO)
How to use it — press o. At the prompt, enter: Sample Time in milliseconds.
What you enter — reportratems.
Toggle High-Speed Bidirectional IO
Enable or disable the High-Speed Bidirectional IO (HSBDIO) path, which uses GPIO27 to control the direction of GPIO26 through the FPGA. This allows GPIO26 to be driven as a fast bidirectional data line under FPGA control instead of being a plain RP2350 GPIO.
Usage
Enter 1 to enable HSBDIO or 0 to disable it:
e 1
e 0
Pins Used
GPIO26— high-speed bidirectional data line.GPIO27— direction control for GPIO26 (driven by the host while HSBDIO is enabled).
While HSBDIO is enabled, do not drive GPIO26 or GPIO27 with the normal
GPIO commands (s, l, t, p) — disable HSBDIO first with e 0.
See Also
s— High (drive a GPIO high)l— Low (drive a GPIO low)t— Toggle (invert a GPIO)u— Get All IOs (read full GPIO bitfield)
How to use it — press e. At the prompt, enter: 1 to enable or 0 to disable.
What you enter — pin.
Set IO Voltage Source
Selects which source the DISPLAY IO expander connects to the external IO voltage rail.
0- disconnected1- 3.3 V2- 5.0 V3- Trig_IN/VREF4- programmable Vout
How to use it — press v. At the prompt, enter: 0=None, 1=3.3V, 2=5.0V, 3=Trig_IN/VREF, 4=Prog Vout.
What you enter — source.
See also: GPIO panel — the on-screen panel for this.