pub type R = crate::R<D3PCR3Hrs>;
pub type W = crate::W<D3PCR3Hrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PCS88 {
DmaCh6 = 0,
DmaCh7 = 1,
Lptim4 = 2,
Lptim5 = 3,
}
impl From<PCS88> for u8 {
#[inline(always)]
fn from(variant: PCS88) -> Self {
variant as _
}
}
impl crate::FieldSpec for PCS88 {
type Ux = u8;
}
impl crate::IsEnum for PCS88 {}
pub type PCS88_R = crate::FieldReader<PCS88>;
impl PCS88_R {
#[inline(always)]
pub const fn variant(&self) -> PCS88 {
match self.bits {
0 => PCS88::DmaCh6,
1 => PCS88::DmaCh7,
2 => PCS88::Lptim4,
3 => PCS88::Lptim5,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_dma_ch6(&self) -> bool {
*self == PCS88::DmaCh6
}
#[inline(always)]
pub fn is_dma_ch7(&self) -> bool {
*self == PCS88::DmaCh7
}
#[inline(always)]
pub fn is_lptim4(&self) -> bool {
*self == PCS88::Lptim4
}
#[inline(always)]
pub fn is_lptim5(&self) -> bool {
*self == PCS88::Lptim5
}
}
pub type PCS88_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PCS88, crate::Safe>;
impl<'a, REG> PCS88_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn dma_ch6(self) -> &'a mut crate::W<REG> {
self.variant(PCS88::DmaCh6)
}
#[inline(always)]
pub fn dma_ch7(self) -> &'a mut crate::W<REG> {
self.variant(PCS88::DmaCh7)
}
#[inline(always)]
pub fn lptim4(self) -> &'a mut crate::W<REG> {
self.variant(PCS88::Lptim4)
}
#[inline(always)]
pub fn lptim5(self) -> &'a mut crate::W<REG> {
self.variant(PCS88::Lptim5)
}
}
impl R {
#[inline(always)]
pub fn pcs88(&self) -> PCS88_R {
PCS88_R::new(((self.bits >> 18) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("D3PCR3H").field("pcs88", &self.pcs88()).finish()
}
}
impl W {
#[inline(always)]
pub fn pcs88(&mut self) -> PCS88_W<D3PCR3Hrs> {
PCS88_W::new(self, 18)
}
}
pub struct D3PCR3Hrs;
impl crate::RegisterSpec for D3PCR3Hrs {
type Ux = u32;
}
impl crate::Readable for D3PCR3Hrs {}
impl crate::Writable for D3PCR3Hrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for D3PCR3Hrs {}