pub struct Output<'d, C: ControlKind> { /* private fields */ }Expand description
GPIO output driver
Implementations§
Source§impl<'d> Output<'d, Basic>
impl<'d> Output<'d, Basic>
Sourcepub fn new_basic(
pin: Peri<'d, impl Pin>,
initial: Level,
drive_capacity: DriveCapacity,
) -> Self
pub fn new_basic( pin: Peri<'d, impl Pin>, initial: Level, drive_capacity: DriveCapacity, ) -> Self
Create GPIO output driver for a Pin without pull-up or open-drain capabilities.
§Arguments
pinthePininitialset the initial output level to logic low or highdrive_capacitysets the output current, seeDriveCapacityfor details.
Source§impl<'d> Output<'d, WithOpenDrain>
impl<'d> Output<'d, WithOpenDrain>
Sourcepub fn new_with_open_drain(
pin: Peri<'d, impl Pin>,
initial: Level,
drive_capacity: DriveCapacity,
output_mode: OutputMode,
) -> Self
pub fn new_with_open_drain( pin: Peri<'d, impl Pin>, initial: Level, drive_capacity: DriveCapacity, output_mode: OutputMode, ) -> Self
Create GPIO output driver for a Pin that supports open-drain output.
§Arguments
pinthePininitialset the initial output level to logic low or highdrive_capacitysets the output current, seeDriveCapacityfor details.
Sourcepub fn set_output_mode(&mut self, output_mode: OutputMode)
pub fn set_output_mode(&mut self, output_mode: OutputMode)
Sets a pin’s output mode to either open-drain or push-pull.
Source§impl<'d, C: ControlKind> Output<'d, C>
impl<'d, C: ControlKind> Output<'d, C>
Sourcepub fn set_drive_capacity(&mut self, drive_capacity: DriveCapacity)
pub fn set_drive_capacity(&mut self, drive_capacity: DriveCapacity)
Sets the output drive capacity of a pin.
§Notes
Be aware of the maximum permissible combined current output for all pins, see DriveCapacity for more information.
Sourcepub fn is_set_low(&mut self) -> bool
pub fn is_set_low(&mut self) -> bool
Is the pin output set as logic low?
Sourcepub fn is_set_high(&mut self) -> bool
pub fn is_set_high(&mut self) -> bool
Is the pin output set as logic high?
Sourcepub fn output_level(&mut self) -> Level
pub fn output_level(&mut self) -> Level
What is the output level set to?
Sourcepub fn print_pfs_state(&self)
pub fn print_pfs_state(&self)
Log current PFS state at debug level.
Trait Implementations§
Source§impl<'d, C: ControlKind> OutputPin for Output<'d, C>
impl<'d, C: ControlKind> OutputPin for Output<'d, C>
Source§impl<'d, C: ControlKind> StatefulOutputPin for Output<'d, C>
impl<'d, C: ControlKind> StatefulOutputPin for Output<'d, C>
Auto Trait Implementations§
impl<'d, C> !UnwindSafe for Output<'d, C>
impl<'d, C> Forget for Output<'d, C>
impl<'d, C> Freeze for Output<'d, C>
impl<'d, C> Move for Output<'d, C>
impl<'d, C> RefUnwindSafe for Output<'d, C>where
Flex<'d, C>: RefUnwindSafe,
impl<'d, C> Send for Output<'d, C>
impl<'d, C> Sync for Output<'d, C>
impl<'d, C> Unpin for Output<'d, C>
impl<'d, C> UnsafeUnpin for Output<'d, C>where
Flex<'d, C>: UnsafeUnpin,
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