use embassy_rp::gpio::{Flex, Input, Level, Output, Pin, Pull};
pub trait GpioTrait<'d>: Pin {
#[inline]
fn input(self) -> Input<'d> {
self.input_with_pull(Pull::Up)
}
#[inline]
fn input_with_pull(self, pull: Pull) -> Input<'d> {
Input::new(self, pull)
}
#[inline]
fn output(self) -> Output<'d> {
self.output_with_level(Level::High)
}
#[inline]
fn output_with_level(self, level: Level) -> Output<'d> {
Output::new(self, level)
}
#[inline]
fn flex(self) -> Flex<'d> {
Flex::new(self)
}
}
impl<T: Pin> GpioTrait<'_> for T {}