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.
Trait Implementations§
Auto Trait Implementations§
impl<'lt> Freeze for DedicatedGpioFlex<'lt>
impl<'lt> RefUnwindSafe for DedicatedGpioFlex<'lt>
impl<'lt> Send for DedicatedGpioFlex<'lt>
impl<'lt> Sync for DedicatedGpioFlex<'lt>
impl<'lt> Unpin for DedicatedGpioFlex<'lt>
impl<'lt> UnsafeUnpin for DedicatedGpioFlex<'lt>
impl<'lt> !UnwindSafe for DedicatedGpioFlex<'lt>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more