#![cfg(feature = "_rp235x")]
use embassy_hal_internal::{Peri, PeripheralType};
use crate::gpio::Pin as GpioPin;
use crate::{pac, peripherals};
pub struct QmiCs1<'d> {
_inner: Peri<'d, peripherals::QMI_CS1>,
}
impl<'d> QmiCs1<'d> {
pub fn new(qmi_cs1: Peri<'d, peripherals::QMI_CS1>, cs1: Peri<'d, impl QmiCs1Pin>) -> Self {
cs1.gpio().ctrl().write(|w| w.set_funcsel(9));
cs1.pad_ctrl().write(|w| {
#[cfg(feature = "_rp235x")]
w.set_iso(false);
w.set_ie(true);
w.set_drive(pac::pads::vals::Drive::_12M_A);
w.set_slewfast(true);
});
Self { _inner: qmi_cs1 }
}
}
trait SealedInstance {}
#[allow(private_bounds)]
pub trait Instance: SealedInstance + PeripheralType {}
impl SealedInstance for peripherals::QMI_CS1 {}
impl Instance for peripherals::QMI_CS1 {}
pub trait QmiCs1Pin: GpioPin {}
impl QmiCs1Pin for peripherals::PIN_0 {}
impl QmiCs1Pin for peripherals::PIN_8 {}
impl QmiCs1Pin for peripherals::PIN_19 {}
#[cfg(feature = "rp235xb")]
impl QmiCs1Pin for peripherals::PIN_47 {}