pub type R = crate::R<PDMCRrs>;
pub type W = crate::W<PDMCRrs>;
pub type PDMEN_R = crate::BitReader;
pub type PDMEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MICNBR_R = crate::FieldReader;
pub type MICNBR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type CKEN_R = crate::BitReader;
pub type CKEN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn pdmen(&self) -> PDMEN_R {
PDMEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn micnbr(&self) -> MICNBR_R {
MICNBR_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn cken(&self, n: u8) -> CKEN_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CKEN_R::new(((self.bits >> (n + 8)) & 1) != 0)
}
#[inline(always)]
pub fn cken_iter(&self) -> impl Iterator<Item = CKEN_R> + '_ {
(0..4).map(move |n| CKEN_R::new(((self.bits >> (n + 8)) & 1) != 0))
}
#[inline(always)]
pub fn cken1(&self) -> CKEN_R {
CKEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn cken2(&self) -> CKEN_R {
CKEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cken3(&self) -> CKEN_R {
CKEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn cken4(&self) -> CKEN_R {
CKEN_R::new(((self.bits >> 11) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PDMCR")
.field("pdmen", &self.pdmen())
.field("micnbr", &self.micnbr())
.field("cken1", &self.cken1())
.field("cken2", &self.cken2())
.field("cken3", &self.cken3())
.field("cken4", &self.cken4())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pdmen(&mut self) -> PDMEN_W<PDMCRrs> {
PDMEN_W::new(self, 0)
}
#[inline(always)]
pub fn micnbr(&mut self) -> MICNBR_W<PDMCRrs> {
MICNBR_W::new(self, 4)
}
#[inline(always)]
pub fn cken(&mut self, n: u8) -> CKEN_W<PDMCRrs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CKEN_W::new(self, n + 8)
}
#[inline(always)]
pub fn cken1(&mut self) -> CKEN_W<PDMCRrs> {
CKEN_W::new(self, 8)
}
#[inline(always)]
pub fn cken2(&mut self) -> CKEN_W<PDMCRrs> {
CKEN_W::new(self, 9)
}
#[inline(always)]
pub fn cken3(&mut self) -> CKEN_W<PDMCRrs> {
CKEN_W::new(self, 10)
}
#[inline(always)]
pub fn cken4(&mut self) -> CKEN_W<PDMCRrs> {
CKEN_W::new(self, 11)
}
}
pub struct PDMCRrs;
impl crate::RegisterSpec for PDMCRrs {
type Ux = u32;
}
impl crate::Readable for PDMCRrs {}
impl crate::Writable for PDMCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for PDMCRrs {}