pub struct GpioConfig {
pub function: [Option<PinFunction>; 54],
pub level: [Option<bool>; 54],
pub detect_rise: [Option<bool>; 54],
pub detect_fall: [Option<bool>; 54],
pub detect_high: [Option<bool>; 54],
pub detect_low: [Option<bool>; 54],
pub detect_async_rise: [Option<bool>; 54],
pub detect_async_fall: [Option<bool>; 54],
}
Expand description
A GPIO config that can be applied at once.
The configuration will only change the bits associated with the settings to apply. For example, setting the function of pin 1 will not change the function of pin 2.
Fields§
§function: [Option<PinFunction>; 54]
§level: [Option<bool>; 54]
§detect_rise: [Option<bool>; 54]
§detect_fall: [Option<bool>; 54]
§detect_high: [Option<bool>; 54]
§detect_low: [Option<bool>; 54]
§detect_async_rise: [Option<bool>; 54]
§detect_async_fall: [Option<bool>; 54]
Implementations§
Source§impl GpioConfig
impl GpioConfig
pub fn new() -> Self
pub fn set_function(&mut self, pin: usize, function: PinFunction)
pub fn set_level(&mut self, pin: usize, level: bool)
pub fn set_detect_rise(&mut self, pin: usize, detect: bool)
pub fn set_detect_fall(&mut self, pin: usize, detect: bool)
pub fn set_detect_high(&mut self, pin: usize, detect: bool)
pub fn set_detect_low(&mut self, pin: usize, detect: bool)
pub fn set_detect_async_rise(&mut self, pin: usize, detect: bool)
pub fn set_detect_async_fall(&mut self, pin: usize, detect: bool)
Trait Implementations§
Source§impl Clone for GpioConfig
impl Clone for GpioConfig
Source§fn clone(&self) -> GpioConfig
fn clone(&self) -> GpioConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for GpioConfig
impl RefUnwindSafe for GpioConfig
impl Send for GpioConfig
impl Sync for GpioConfig
impl Unpin for GpioConfig
impl UnwindSafe for GpioConfig
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