pub struct DedicatedGpioInput<'lt> { /* private fields */ }Expand description
A dedicated GPIO input driver.
§Examples
use esp_hal::gpio::{
Input,
InputConfig,
Level,
dedicated::{DedicatedGpio, DedicatedGpioInput},
};
// Create an input pin driver:
let input = Input::new(peripherals.GPIO0, InputConfig::default());
// Create a dedicated GPIO driver:
let channels = DedicatedGpio::new(peripherals.GPIO_DEDICATED);
let mut dedicated_input = DedicatedGpioInput::new(channels.channel0, input);
// Now you can use the pin:
let level = dedicated_input.level();Implementations§
Source§impl<'lt> DedicatedGpioInput<'lt>
impl<'lt> DedicatedGpioInput<'lt>
Sourcepub fn new<CH, P>(channel: CH, pin: P) -> Selfwhere
CH: InputChannel + 'lt,
P: InputDriver + 'lt,
pub fn new<CH, P>(channel: CH, pin: P) -> Selfwhere
CH: InputChannel + 'lt,
P: InputDriver + 'lt,
Creates a new dedicated GPIO input driver.
Trait Implementations§
Source§impl ErrorType for DedicatedGpioInput<'_>
Available on crate feature unstable only.
impl ErrorType for DedicatedGpioInput<'_>
Available on crate feature
unstable only.