pub struct DedicatedGpioFlex<'lt> { /* private fields */ }Expand description
A dedicated GPIO input and output driver.
§Examples
use esp_hal::gpio::{
Flex,
Input,
Level,
dedicated::{DedicatedGpio, DedicatedGpioFlex},
};
// Create a pin driver:
let flex = Flex::new(peripherals.GPIO0);
// Create a dedicated GPIO driver:
let channels = DedicatedGpio::new(peripherals.GPIO_DEDICATED);
let mut dedicated_io = DedicatedGpioFlex::new(channels.channel0, flex);
// Now you can use the pin:
let level = dedicated_io.level();Implementations§
Source§impl<'lt> DedicatedGpioFlex<'lt>
impl<'lt> DedicatedGpioFlex<'lt>
Sourcepub fn new<CH, P>(channel: CH, pin: P) -> Self
pub fn new<CH, P>(channel: CH, pin: P) -> Self
Creates a new dedicated GPIO input/output driver.
Sourcepub fn set_output_enabled(&mut self, enabled: bool)
pub fn set_output_enabled(&mut self, enabled: bool)
Enables or disables the output buffer of the GPIO pin.
Sourcepub fn output_level(&self) -> Level
pub fn output_level(&self) -> Level
Returns the current output state of the GPIO pin.