pub type R = crate::R<TIMEOUTRrs>;
pub type W = crate::W<TIMEOUTRrs>;
pub type TIMEOUTA_R = crate::FieldReader<u16>;
pub type TIMEOUTA_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIDLE {
Disabled = 0,
Enabled = 1,
}
impl From<TIDLE> for bool {
#[inline(always)]
fn from(variant: TIDLE) -> Self {
variant as u8 != 0
}
}
pub type TIDLE_R = crate::BitReader<TIDLE>;
impl TIDLE_R {
#[inline(always)]
pub const fn variant(&self) -> TIDLE {
match self.bits {
false => TIDLE::Disabled,
true => TIDLE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TIDLE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TIDLE::Enabled
}
}
pub type TIDLE_W<'a, REG> = crate::BitWriter<'a, REG, TIDLE>;
impl<'a, REG> TIDLE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TIDLE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TIDLE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMOUTEN {
Disabled = 0,
Enabled = 1,
}
impl From<TIMOUTEN> for bool {
#[inline(always)]
fn from(variant: TIMOUTEN) -> Self {
variant as u8 != 0
}
}
pub type TIMOUTEN_R = crate::BitReader<TIMOUTEN>;
impl TIMOUTEN_R {
#[inline(always)]
pub const fn variant(&self) -> TIMOUTEN {
match self.bits {
false => TIMOUTEN::Disabled,
true => TIMOUTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TIMOUTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TIMOUTEN::Enabled
}
}
pub type TIMOUTEN_W<'a, REG> = crate::BitWriter<'a, REG, TIMOUTEN>;
impl<'a, REG> TIMOUTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TIMOUTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TIMOUTEN::Enabled)
}
}
pub type TIMEOUTB_R = crate::FieldReader<u16>;
pub type TIMEOUTB_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TEXTEN {
Disabled = 0,
Enabled = 1,
}
impl From<TEXTEN> for bool {
#[inline(always)]
fn from(variant: TEXTEN) -> Self {
variant as u8 != 0
}
}
pub type TEXTEN_R = crate::BitReader<TEXTEN>;
impl TEXTEN_R {
#[inline(always)]
pub const fn variant(&self) -> TEXTEN {
match self.bits {
false => TEXTEN::Disabled,
true => TEXTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TEXTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TEXTEN::Enabled
}
}
pub type TEXTEN_W<'a, REG> = crate::BitWriter<'a, REG, TEXTEN>;
impl<'a, REG> TEXTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TEXTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TEXTEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn timeouta(&self) -> TIMEOUTA_R {
TIMEOUTA_R::new((self.bits & 0x0fff) as u16)
}
#[inline(always)]
pub fn tidle(&self) -> TIDLE_R {
TIDLE_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn timouten(&self) -> TIMOUTEN_R {
TIMOUTEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn timeoutb(&self) -> TIMEOUTB_R {
TIMEOUTB_R::new(((self.bits >> 16) & 0x0fff) as u16)
}
#[inline(always)]
pub fn texten(&self) -> TEXTEN_R {
TEXTEN_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIMEOUTR")
.field("timeouta", &self.timeouta())
.field("tidle", &self.tidle())
.field("timouten", &self.timouten())
.field("timeoutb", &self.timeoutb())
.field("texten", &self.texten())
.finish()
}
}
impl W {
#[inline(always)]
pub fn timeouta(&mut self) -> TIMEOUTA_W<TIMEOUTRrs> {
TIMEOUTA_W::new(self, 0)
}
#[inline(always)]
pub fn tidle(&mut self) -> TIDLE_W<TIMEOUTRrs> {
TIDLE_W::new(self, 12)
}
#[inline(always)]
pub fn timouten(&mut self) -> TIMOUTEN_W<TIMEOUTRrs> {
TIMOUTEN_W::new(self, 15)
}
#[inline(always)]
pub fn timeoutb(&mut self) -> TIMEOUTB_W<TIMEOUTRrs> {
TIMEOUTB_W::new(self, 16)
}
#[inline(always)]
pub fn texten(&mut self) -> TEXTEN_W<TIMEOUTRrs> {
TEXTEN_W::new(self, 31)
}
}
pub struct TIMEOUTRrs;
impl crate::RegisterSpec for TIMEOUTRrs {
type Ux = u32;
}
impl crate::Readable for TIMEOUTRrs {}
impl crate::Writable for TIMEOUTRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for TIMEOUTRrs {
const RESET_VALUE: u32 = 0;
}