eensy/gpio

Types

pub type Direction {
  Input
  Output
  OutputOd
}

Constructors

  • Input
  • Output
  • OutputOd
pub type Level {
  Low
  High
}

Constructors

  • Low
  • High
pub type Pull {
  Up
  Down
}

Constructors

  • Up
  • Down

Functions

pub fn digital_read(pin: Int) -> Result(Level, Nil)

Read from gpio pin

pub fn digital_write(pin: Int, level: Level) -> Result(Int, Nil)

Write to gpio pin

pub fn init(pin: Int) -> Nil

Init pin

pub fn set_pin_mode(
  pin: Int,
  direction: Direction,
) -> Result(Int, Nil)

Set gpio pin direction

pub fn set_pin_pull(pin: Int, pull: Pull) -> Result(Nil, Nil)

Set pin pull

pub fn start() -> Result(Int, Nil)

Start gpio

Search Document