atomvm_gleam/pico
Types
Erlang calendar:date() — {Year, Month, Day}.
pub type Date {
Date(year: Int, month: Int, day: Int)
}
Constructors
-
Date(year: Int, month: Int, day: Int)
Pico / RP2-specific AtomVM APIs (pico module).
CYW43 GPIO helpers are Pico-W only. The onboard LED is typically
CYW43 GPIO 0.
Source: libs/avm_rp2/src/pico.erl.
Docs: Module pico.
Errors from Pico NIFs and helpers.
Known reason atoms are Gleam constructors (so {error, not_supported} is
Error(NotSupported)). Bare AtomVM error becomes Failed. Anything else
lands in Other as a string.
pub type Error {
Failed
NotSupported
Badarg
Timeout
Other(String)
}
Constructors
-
Failed -
NotSupported -
Badarg -
Timeout -
Other(String)
Digital level for CYW43 GPIO write. Mapped to Erlang 0 / 1 in FFI
(matching upstream pico:cyw43_arch_gpio_put/2).
Naming matches gpio.Level (PinHigh / PinLow).
pub type Level {
PinHigh
PinLow
}
Constructors
-
PinHigh -
PinLow
Values
pub fn cyw43_arch_gpio_get(gpio: Int) -> Result(Int, Error)
Read a CYW43 GPIO pin (0..2). Pico-W only. Returns 0 or 1.
pub fn cyw43_arch_gpio_put(
gpio: Int,
level: Level,
) -> Result(Nil, Error)
Write a CYW43 GPIO pin (0..2). Pico-W only. Typically drives the onboard LED (GPIO 0).