eensy/gpio
Types
pub type Direction {
Input
Output
OutputOd
}
Constructors
-
Input
-
Output
-
OutputOd
pub type Level {
Low
High
}
Constructors
-
Low
-
High
Pin
opaquepub opaque type Pin
PinActor
opaquepub opaque type PinActor(model, msg)
Functions
pub fn pin(
level level: Level,
pull pull: Pull,
port port: Int,
direction direction: Direction,
update update: Option(fn(Level) -> Nil),
) -> Pin
pub fn read(actor: PinActor(a, b)) -> Result(Pin, Nil)
pub fn set_pin_mode(
pin: Int,
direction: Direction,
) -> Result(Int, Nil)
Set gpio pin direction
pub fn start(pin: Pin) -> Result(PinActor(a, b), StartError)
pub fn sync(actor: PinActor(a, b)) -> Nil
pub fn write(actor: PinActor(a, b), value: Level) -> Nil