stm32/pwm: add output type control

This commit is contained in:
xoviat
2023-07-29 12:01:32 -05:00
parent fcbfd224a7
commit 0d7b005252
7 changed files with 35 additions and 16 deletions

View File

@ -4,6 +4,7 @@ use core::convert::Infallible;
use embassy_hal_internal::{impl_peripheral, into_ref, PeripheralRef};
use crate::pac::gpio::{self, vals};
use crate::usb_otg::Out;
use crate::{pac, peripherals, Peripheral};
/// GPIO flexible pin.
@ -502,6 +503,20 @@ impl<'d, T: Pin> OutputOpenDrain<'d, T> {
}
}
pub enum OutputType {
PushPull,
OpenDrain,
}
impl From<OutputType> for sealed::AFType {
fn from(value: OutputType) -> Self {
match value {
OutputType::OpenDrain => sealed::AFType::OutputOpenDrain,
OutputType::PushPull => sealed::AFType::OutputPushPull,
}
}
}
pub(crate) mod sealed {
use super::*;