pub type R = crate::R<TRrs>;
pub type W = crate::W<TRrs>;
pub type SU_R = crate::FieldReader;
pub type SU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type ST_R = crate::FieldReader;
pub type ST_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
pub type MNU_R = crate::FieldReader;
pub type MNU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type MNT_R = crate::FieldReader;
pub type MNT_W<'a, REG> = crate::FieldWriter<'a, REG, 3, u8, crate::Safe>;
pub type HU_R = crate::FieldReader;
pub type HU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type HT_R = crate::FieldReader;
pub type HT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PM {
Am = 0,
Pm = 1,
}
impl From<PM> for bool {
#[inline(always)]
fn from(variant: PM) -> Self {
variant as u8 != 0
}
}
pub type PM_R = crate::BitReader<PM>;
impl PM_R {
#[inline(always)]
pub const fn variant(&self) -> PM {
match self.bits {
false => PM::Am,
true => PM::Pm,
}
}
#[inline(always)]
pub fn is_am(&self) -> bool {
*self == PM::Am
}
#[inline(always)]
pub fn is_pm(&self) -> bool {
*self == PM::Pm
}
}
pub type PM_W<'a, REG> = crate::BitWriter<'a, REG, PM>;
impl<'a, REG> PM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn am(self) -> &'a mut crate::W<REG> {
self.variant(PM::Am)
}
#[inline(always)]
pub fn pm(self) -> &'a mut crate::W<REG> {
self.variant(PM::Pm)
}
}
impl R {
#[inline(always)]
pub fn su(&self) -> SU_R {
SU_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn st(&self) -> ST_R {
ST_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn mnu(&self) -> MNU_R {
MNU_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn mnt(&self) -> MNT_R {
MNT_R::new(((self.bits >> 12) & 7) as u8)
}
#[inline(always)]
pub fn hu(&self) -> HU_R {
HU_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn ht(&self) -> HT_R {
HT_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn pm(&self) -> PM_R {
PM_R::new(((self.bits >> 22) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TR")
.field("pm", &self.pm())
.field("ht", &self.ht())
.field("hu", &self.hu())
.field("mnt", &self.mnt())
.field("mnu", &self.mnu())
.field("st", &self.st())
.field("su", &self.su())
.finish()
}
}
impl W {
#[inline(always)]
pub fn su(&mut self) -> SU_W<TRrs> {
SU_W::new(self, 0)
}
#[inline(always)]
pub fn st(&mut self) -> ST_W<TRrs> {
ST_W::new(self, 4)
}
#[inline(always)]
pub fn mnu(&mut self) -> MNU_W<TRrs> {
MNU_W::new(self, 8)
}
#[inline(always)]
pub fn mnt(&mut self) -> MNT_W<TRrs> {
MNT_W::new(self, 12)
}
#[inline(always)]
pub fn hu(&mut self) -> HU_W<TRrs> {
HU_W::new(self, 16)
}
#[inline(always)]
pub fn ht(&mut self) -> HT_W<TRrs> {
HT_W::new(self, 20)
}
#[inline(always)]
pub fn pm(&mut self) -> PM_W<TRrs> {
PM_W::new(self, 22)
}
}
pub struct TRrs;
impl crate::RegisterSpec for TRrs {
type Ux = u32;
}
impl crate::Readable for TRrs {}
impl crate::Writable for TRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TRrs {}