Skip to main content

write_gpio

Function write_gpio 

Source
pub const fn write_gpio(port: u8, pin: u8, high: bool) -> [u8; 3]
Expand description

The payload that drives a pin.

§Arguments

  • port - the pin’s port, which is GPIO_PORT for every pin on the card.
  • pin - which pin.
  • high - whether to drive it high.

§Returns

The three bytes.

§Examples

use pamoja_radios::sx1302::bridge::{write_gpio, GPIO_PORT, PIN_RESET};

assert_eq!(write_gpio(GPIO_PORT, PIN_RESET, true), [0, 2, 1]);