pub type R = crate::R<DTTIMErs>;
pub type W = crate::W<DTTIMErs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DTPRESC {
Div1 = 0,
Div2 = 1,
Div4 = 2,
Div8 = 3,
Div16 = 4,
Div32 = 5,
Div64 = 6,
Div128 = 7,
Div256 = 8,
Div512 = 9,
Div1024 = 10,
}
impl From<DTPRESC> for u8 {
#[inline(always)]
fn from(variant: DTPRESC) -> Self {
variant as _
}
}
impl crate::FieldSpec for DTPRESC {
type Ux = u8;
}
impl crate::IsEnum for DTPRESC {}
pub type DtprescR = crate::FieldReader<DTPRESC>;
impl DtprescR {
#[inline(always)]
pub const fn variant(&self) -> Option<DTPRESC> {
match self.bits {
0 => Some(DTPRESC::Div1),
1 => Some(DTPRESC::Div2),
2 => Some(DTPRESC::Div4),
3 => Some(DTPRESC::Div8),
4 => Some(DTPRESC::Div16),
5 => Some(DTPRESC::Div32),
6 => Some(DTPRESC::Div64),
7 => Some(DTPRESC::Div128),
8 => Some(DTPRESC::Div256),
9 => Some(DTPRESC::Div512),
10 => Some(DTPRESC::Div1024),
_ => None,
}
}
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == DTPRESC::Div1
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == DTPRESC::Div2
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == DTPRESC::Div4
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == DTPRESC::Div8
}
#[inline(always)]
pub fn is_div16(&self) -> bool {
*self == DTPRESC::Div16
}
#[inline(always)]
pub fn is_div32(&self) -> bool {
*self == DTPRESC::Div32
}
#[inline(always)]
pub fn is_div64(&self) -> bool {
*self == DTPRESC::Div64
}
#[inline(always)]
pub fn is_div128(&self) -> bool {
*self == DTPRESC::Div128
}
#[inline(always)]
pub fn is_div256(&self) -> bool {
*self == DTPRESC::Div256
}
#[inline(always)]
pub fn is_div512(&self) -> bool {
*self == DTPRESC::Div512
}
#[inline(always)]
pub fn is_div1024(&self) -> bool {
*self == DTPRESC::Div1024
}
}
pub type DtprescW<'a, REG> = crate::FieldWriter<'a, REG, 4, DTPRESC>;
impl<'a, REG> DtprescW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn div1(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div1)
}
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div2)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div4)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div8)
}
#[inline(always)]
pub fn div16(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div16)
}
#[inline(always)]
pub fn div32(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div32)
}
#[inline(always)]
pub fn div64(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div64)
}
#[inline(always)]
pub fn div128(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div128)
}
#[inline(always)]
pub fn div256(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div256)
}
#[inline(always)]
pub fn div512(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div512)
}
#[inline(always)]
pub fn div1024(self) -> &'a mut crate::W<REG> {
self.variant(DTPRESC::Div1024)
}
}
pub type DtrisetR = crate::FieldReader;
pub type DtrisetW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
pub type DtfalltR = crate::FieldReader;
pub type DtfalltW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
impl R {
#[inline(always)]
pub fn dtpresc(&self) -> DtprescR {
DtprescR::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn dtriset(&self) -> DtrisetR {
DtrisetR::new(((self.bits >> 8) & 0x3f) as u8)
}
#[inline(always)]
pub fn dtfallt(&self) -> DtfalltR {
DtfalltR::new(((self.bits >> 16) & 0x3f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DTTIME")
.field("dtpresc", &self.dtpresc())
.field("dtriset", &self.dtriset())
.field("dtfallt", &self.dtfallt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dtpresc(&mut self) -> DtprescW<'_, DTTIMErs> {
DtprescW::new(self, 0)
}
#[inline(always)]
pub fn dtriset(&mut self) -> DtrisetW<'_, DTTIMErs> {
DtrisetW::new(self, 8)
}
#[inline(always)]
pub fn dtfallt(&mut self) -> DtfalltW<'_, DTTIMErs> {
DtfalltW::new(self, 16)
}
}
pub struct DTTIMErs;
impl crate::RegisterSpec for DTTIMErs {
type Ux = u32;
}
impl crate::Readable for DTTIMErs {}
impl crate::Writable for DTTIMErs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DTTIMErs {}