pub fn new(mut pin: P, args: &OutputArgs, cs: &CriticalSection) -> Self {
        pin.set_output_type(cs, args.ot);
        if args.ot == OutputType::OpenDrain {
            pin.set_pull(cs, args.pull)
        } else {
            pin.set_pull(cs, Pull::None)
        }
        pin.set_speed(cs, args.speed);
        pin.set_output_level(args.level);
        pin.set_mode(cs, sealed::Mode::Output);
        Output { pin }
    }
/// Create a new output pin from a GPIO.
///
/// # Example
///
/// Configure GPIO port C3, C4, C5 as outputs.
/// These are the GPIOs for the RF switch on the NUCLEO-WL55JC2.
///
/// ```no_run
/// use stm32wlxx_hal::{
///     gpio::{self, pins, Output, PortC},
///     pac,
/// };
///
/// let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
///
/// const OUTPUT_ARGS: gpio::OutputArgs = gpio::OutputArgs {
///     level: gpio::PinState::Low,
///     speed: gpio::Speed::High,
///     ot: gpio::OutputType::PushPull,
///     pull: gpio::Pull::None,
/// };
///
/// let gpioc: PortC = PortC::split(dp.GPIOC, &mut dp.RCC);
/// let (c2, c4, c5): (Output<pins::C3>, Output<pins::C4>, Output<pins::C5>) =
///     cortex_m::interrupt::free(|cs| {
///         (
///             Output::new(gpioc.c3, &OUTPUT_ARGS, cs),
///             Output::new(gpioc.c4, &OUTPUT_ARGS, cs),
///             Output::new(gpioc.c5, &OUTPUT_ARGS, cs),
///         )
///     });
/// ```
Create a new output pin from a GPIO.
Create a new output pin from a GPIO .
pub fn new(mut pin: P, args: &OutputArgs, cs: &CriticalSection) -> Self {
        pin.set_output_type(cs, args.ot);
        if args.ot == OutputType::OpenDrain {
            pin.set_pull(cs, args.pull)
        } else {
            pin.set_pull(cs, Pull::None)
        }
        pin.set_speed(cs, args.speed);
        pin.set_output_level(args.level);
        pin.set_mode(cs, sealed::Mode::Output);
        Output { pin }
    }
pub fn new ( mut pin : P , args : & OutputArgs , cs : & CriticalSection ) -> Self { pin . set_output_type ( cs , args . ot ) ; if args . ot == OutputType :: OpenDrain { pin . set_pull ( cs , args . pull ) } else { pin . set_pull ( cs , Pull :: None ) } pin . set_speed ( cs , args . speed ) ; pin . set_output_level ( args . level ) ; pin . set_mode ( cs , sealed :: Mode :: Output ) ; Output { pin } }
Create a new output pin from a GPIO.
Create a new output pin from a GPIO .
pin
P
args
&OutputArgs
cs
&CriticalSection
example
Configure GPIO port C3, C4, C5 as outputs.
These are the GPIOs for the RF switch on the NUCLEO-WL55JC2.

```no_run
use stm32wlxx_hal::{
gpio::{self, pins, Output, PortC},
pac,
}.

let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap().

const OUTPUT_ARGS: gpio::OutputArgs = gpio::OutputArgs {
level: gpio::PinState::Low,
speed: gpio::Speed::High,
ot: gpio::OutputType::PushPull,
pull: gpio::Pull::None,
}.

let gpioc: PortC = PortC::split(dp.GPIOC, &mut dp.RCC);
let (c2, c4, c5): (Output, Output, Output)
cortex_m::interrupt::free(|cs| {
(
Output::new(gpioc.c3, &OUTPUT_ARGS, cs),
Output::new(gpioc.c4, &OUTPUT_ARGS, cs),
Output::new(gpioc.c5, &OUTPUT_ARGS, cs),
)
});
```
Configure GPIO port C3 C4 C5 as outputs . These are the GPIOs for the RF switch on the NUCLEO - WL55JC2 . ` ` ` no_run use stm32wlxx_hal :: { gpio :: { self pins Output PortC } pac } . let mut dp : pac :: Peripherals = pac :: Peripherals :: take () . unwrap () . const OUTPUT_ARGS : gpio :: OutputArgs = gpio :: OutputArgs { level : gpio :: PinState :: Low speed : gpio :: Speed :: High ot : gpio :: OutputType :: PushPull pull : gpio :: Pull :: None } . let gpioc : PortC = PortC :: split ( dp . GPIOC &mut dp . RCC ) ; let ( c2 c4 c5 ) : ( Output Output Output ) cortex_m :: interrupt :: free ( |cs| { ( Output :: new ( gpioc . c3 &OUTPUT_ARGS cs ) Output :: new ( gpioc . c4 &OUTPUT_ARGS cs ) Output :: new ( gpioc . c5 &OUTPUT_ARGS cs ) ) } ) ; ` ` `