pub type R = crate::R<DTCTRLrs>;
pub type W = crate::W<DTCTRLrs>;
pub type DtenR = crate::BitReader;
pub type DtenW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DtdasR = crate::BitReader;
pub type DtdasW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DtipolR = crate::BitReader;
pub type DtipolW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DtcinvR = crate::BitReader;
pub type DtcinvW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DTPRSSEL {
Prsch0 = 0,
Prsch1 = 1,
Prsch2 = 2,
Prsch3 = 3,
Prsch4 = 4,
Prsch5 = 5,
Prsch6 = 6,
Prsch7 = 7,
Prsch8 = 8,
Prsch9 = 9,
Prsch10 = 10,
Prsch11 = 11,
}
impl From<DTPRSSEL> for u8 {
#[inline(always)]
fn from(variant: DTPRSSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for DTPRSSEL {
type Ux = u8;
}
impl crate::IsEnum for DTPRSSEL {}
pub type DtprsselR = crate::FieldReader<DTPRSSEL>;
impl DtprsselR {
#[inline(always)]
pub const fn variant(&self) -> Option<DTPRSSEL> {
match self.bits {
0 => Some(DTPRSSEL::Prsch0),
1 => Some(DTPRSSEL::Prsch1),
2 => Some(DTPRSSEL::Prsch2),
3 => Some(DTPRSSEL::Prsch3),
4 => Some(DTPRSSEL::Prsch4),
5 => Some(DTPRSSEL::Prsch5),
6 => Some(DTPRSSEL::Prsch6),
7 => Some(DTPRSSEL::Prsch7),
8 => Some(DTPRSSEL::Prsch8),
9 => Some(DTPRSSEL::Prsch9),
10 => Some(DTPRSSEL::Prsch10),
11 => Some(DTPRSSEL::Prsch11),
_ => None,
}
}
#[inline(always)]
pub fn is_prsch0(&self) -> bool {
*self == DTPRSSEL::Prsch0
}
#[inline(always)]
pub fn is_prsch1(&self) -> bool {
*self == DTPRSSEL::Prsch1
}
#[inline(always)]
pub fn is_prsch2(&self) -> bool {
*self == DTPRSSEL::Prsch2
}
#[inline(always)]
pub fn is_prsch3(&self) -> bool {
*self == DTPRSSEL::Prsch3
}
#[inline(always)]
pub fn is_prsch4(&self) -> bool {
*self == DTPRSSEL::Prsch4
}
#[inline(always)]
pub fn is_prsch5(&self) -> bool {
*self == DTPRSSEL::Prsch5
}
#[inline(always)]
pub fn is_prsch6(&self) -> bool {
*self == DTPRSSEL::Prsch6
}
#[inline(always)]
pub fn is_prsch7(&self) -> bool {
*self == DTPRSSEL::Prsch7
}
#[inline(always)]
pub fn is_prsch8(&self) -> bool {
*self == DTPRSSEL::Prsch8
}
#[inline(always)]
pub fn is_prsch9(&self) -> bool {
*self == DTPRSSEL::Prsch9
}
#[inline(always)]
pub fn is_prsch10(&self) -> bool {
*self == DTPRSSEL::Prsch10
}
#[inline(always)]
pub fn is_prsch11(&self) -> bool {
*self == DTPRSSEL::Prsch11
}
}
pub type DtprsselW<'a, REG> = crate::FieldWriter<'a, REG, 4, DTPRSSEL>;
impl<'a, REG> DtprsselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn prsch0(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch0)
}
#[inline(always)]
pub fn prsch1(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch1)
}
#[inline(always)]
pub fn prsch2(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch2)
}
#[inline(always)]
pub fn prsch3(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch3)
}
#[inline(always)]
pub fn prsch4(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch4)
}
#[inline(always)]
pub fn prsch5(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch5)
}
#[inline(always)]
pub fn prsch6(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch6)
}
#[inline(always)]
pub fn prsch7(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch7)
}
#[inline(always)]
pub fn prsch8(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch8)
}
#[inline(always)]
pub fn prsch9(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch9)
}
#[inline(always)]
pub fn prsch10(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch10)
}
#[inline(always)]
pub fn prsch11(self) -> &'a mut crate::W<REG> {
self.variant(DTPRSSEL::Prsch11)
}
}
pub type DtarR = crate::BitReader;
pub type DtarW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DtfatsR = crate::BitReader;
pub type DtfatsW<'a, REG> = crate::BitWriter<'a, REG>;
pub type DtprsenR = crate::BitReader;
pub type DtprsenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn dten(&self) -> DtenR {
DtenR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dtdas(&self) -> DtdasR {
DtdasR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn dtipol(&self) -> DtipolR {
DtipolR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn dtcinv(&self) -> DtcinvR {
DtcinvR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn dtprssel(&self) -> DtprsselR {
DtprsselR::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn dtar(&self) -> DtarR {
DtarR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn dtfats(&self) -> DtfatsR {
DtfatsR::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn dtprsen(&self) -> DtprsenR {
DtprsenR::new(((self.bits >> 24) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DTCTRL")
.field("dten", &self.dten())
.field("dtdas", &self.dtdas())
.field("dtipol", &self.dtipol())
.field("dtcinv", &self.dtcinv())
.field("dtprssel", &self.dtprssel())
.field("dtar", &self.dtar())
.field("dtfats", &self.dtfats())
.field("dtprsen", &self.dtprsen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dten(&mut self) -> DtenW<'_, DTCTRLrs> {
DtenW::new(self, 0)
}
#[inline(always)]
pub fn dtdas(&mut self) -> DtdasW<'_, DTCTRLrs> {
DtdasW::new(self, 1)
}
#[inline(always)]
pub fn dtipol(&mut self) -> DtipolW<'_, DTCTRLrs> {
DtipolW::new(self, 2)
}
#[inline(always)]
pub fn dtcinv(&mut self) -> DtcinvW<'_, DTCTRLrs> {
DtcinvW::new(self, 3)
}
#[inline(always)]
pub fn dtprssel(&mut self) -> DtprsselW<'_, DTCTRLrs> {
DtprsselW::new(self, 4)
}
#[inline(always)]
pub fn dtar(&mut self) -> DtarW<'_, DTCTRLrs> {
DtarW::new(self, 9)
}
#[inline(always)]
pub fn dtfats(&mut self) -> DtfatsW<'_, DTCTRLrs> {
DtfatsW::new(self, 10)
}
#[inline(always)]
pub fn dtprsen(&mut self) -> DtprsenW<'_, DTCTRLrs> {
DtprsenW::new(self, 24)
}
}
pub struct DTCTRLrs;
impl crate::RegisterSpec for DTCTRLrs {
type Ux = u32;
}
impl crate::Readable for DTCTRLrs {}
impl crate::Writable for DTCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DTCTRLrs {}