pub type R = crate::R<HTCRrs>;
pub type W = crate::W<HTCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u32)]
pub enum HTCFG {
Recommended = 43636,
Magic = 391711420,
}
impl From<HTCFG> for u32 {
#[inline(always)]
fn from(variant: HTCFG) -> Self {
variant as _
}
}
impl crate::FieldSpec for HTCFG {
type Ux = u32;
}
impl crate::IsEnum for HTCFG {}
pub type HTCFG_R = crate::FieldReader<HTCFG>;
impl HTCFG_R {
#[inline(always)]
pub const fn variant(&self) -> Option<HTCFG> {
match self.bits {
43636 => Some(HTCFG::Recommended),
391711420 => Some(HTCFG::Magic),
_ => None,
}
}
#[inline(always)]
pub fn is_recommended(&self) -> bool {
*self == HTCFG::Recommended
}
#[inline(always)]
pub fn is_magic(&self) -> bool {
*self == HTCFG::Magic
}
}
pub type HTCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 32, HTCFG>;
impl<'a, REG> HTCFG_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u32>,
{
#[inline(always)]
pub fn recommended(self) -> &'a mut crate::W<REG> {
self.variant(HTCFG::Recommended)
}
#[inline(always)]
pub fn magic(self) -> &'a mut crate::W<REG> {
self.variant(HTCFG::Magic)
}
}
impl R {
#[inline(always)]
pub fn htcfg(&self) -> HTCFG_R {
HTCFG_R::new(self.bits)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HTCR").field("htcfg", &self.htcfg()).finish()
}
}
impl W {
#[inline(always)]
pub fn htcfg(&mut self) -> HTCFG_W<HTCRrs> {
HTCFG_W::new(self, 0)
}
}
pub struct HTCRrs;
impl crate::RegisterSpec for HTCRrs {
type Ux = u32;
}
impl crate::Readable for HTCRrs {}
impl crate::Writable for HTCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HTCRrs {
const RESET_VALUE: u32 = 0x72ac;
}