pub type R = crate::R<CRHrs>;
pub type W = crate::W<CRHrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SECIE {
Disabled = 0,
Enabled = 1,
}
impl From<SECIE> for bool {
#[inline(always)]
fn from(variant: SECIE) -> Self {
variant as u8 != 0
}
}
pub type SECIE_R = crate::BitReader<SECIE>;
impl SECIE_R {
#[inline(always)]
pub const fn variant(&self) -> SECIE {
match self.bits {
false => SECIE::Disabled,
true => SECIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SECIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SECIE::Enabled
}
}
pub type SECIE_W<'a, REG> = crate::BitWriter<'a, REG, SECIE>;
impl<'a, REG> SECIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SECIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SECIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALRIE {
Disabled = 0,
Enabled = 1,
}
impl From<ALRIE> for bool {
#[inline(always)]
fn from(variant: ALRIE) -> Self {
variant as u8 != 0
}
}
pub type ALRIE_R = crate::BitReader<ALRIE>;
impl ALRIE_R {
#[inline(always)]
pub const fn variant(&self) -> ALRIE {
match self.bits {
false => ALRIE::Disabled,
true => ALRIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ALRIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ALRIE::Enabled
}
}
pub type ALRIE_W<'a, REG> = crate::BitWriter<'a, REG, ALRIE>;
impl<'a, REG> ALRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ALRIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OWIE {
Disabled = 0,
Enabled = 1,
}
impl From<OWIE> for bool {
#[inline(always)]
fn from(variant: OWIE) -> Self {
variant as u8 != 0
}
}
pub type OWIE_R = crate::BitReader<OWIE>;
impl OWIE_R {
#[inline(always)]
pub const fn variant(&self) -> OWIE {
match self.bits {
false => OWIE::Disabled,
true => OWIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == OWIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == OWIE::Enabled
}
}
pub type OWIE_W<'a, REG> = crate::BitWriter<'a, REG, OWIE>;
impl<'a, REG> OWIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(OWIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(OWIE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn secie(&self) -> SECIE_R {
SECIE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn alrie(&self) -> ALRIE_R {
ALRIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn owie(&self) -> OWIE_R {
OWIE_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CRH")
.field("secie", &self.secie())
.field("alrie", &self.alrie())
.field("owie", &self.owie())
.finish()
}
}
impl W {
#[inline(always)]
pub fn secie(&mut self) -> SECIE_W<CRHrs> {
SECIE_W::new(self, 0)
}
#[inline(always)]
pub fn alrie(&mut self) -> ALRIE_W<CRHrs> {
ALRIE_W::new(self, 1)
}
#[inline(always)]
pub fn owie(&mut self) -> OWIE_W<CRHrs> {
OWIE_W::new(self, 2)
}
}
pub struct CRHrs;
impl crate::RegisterSpec for CRHrs {
type Ux = u32;
}
impl crate::Readable for CRHrs {}
impl crate::Writable for CRHrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRHrs {}