pub type R = crate::R<CRLrs>;
pub type W = crate::W<CRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SECFR {
NoPrescalerOverflow = 0,
PrescalerOverflow = 1,
}
impl From<SECFR> for bool {
#[inline(always)]
fn from(variant: SECFR) -> Self {
variant as u8 != 0
}
}
pub type SECF_R = crate::BitReader<SECFR>;
impl SECF_R {
#[inline(always)]
pub const fn variant(&self) -> SECFR {
match self.bits {
false => SECFR::NoPrescalerOverflow,
true => SECFR::PrescalerOverflow,
}
}
#[inline(always)]
pub fn is_no_prescaler_overflow(&self) -> bool {
*self == SECFR::NoPrescalerOverflow
}
#[inline(always)]
pub fn is_prescaler_overflow(&self) -> bool {
*self == SECFR::PrescalerOverflow
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CLEAR {
Clear = 0,
}
impl From<CLEAR> for bool {
#[inline(always)]
fn from(variant: CLEAR) -> Self {
variant as u8 != 0
}
}
pub type SECF_W<'a, REG> = crate::BitWriter0C<'a, REG, CLEAR>;
impl<'a, REG> SECF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CLEAR::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALRFR {
NoAlarm = 0,
Alarm = 1,
}
impl From<ALRFR> for bool {
#[inline(always)]
fn from(variant: ALRFR) -> Self {
variant as u8 != 0
}
}
pub type ALRF_R = crate::BitReader<ALRFR>;
impl ALRF_R {
#[inline(always)]
pub const fn variant(&self) -> ALRFR {
match self.bits {
false => ALRFR::NoAlarm,
true => ALRFR::Alarm,
}
}
#[inline(always)]
pub fn is_no_alarm(&self) -> bool {
*self == ALRFR::NoAlarm
}
#[inline(always)]
pub fn is_alarm(&self) -> bool {
*self == ALRFR::Alarm
}
}
pub use SECF_W as ALRF_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OWFR {
NoOverflow = 0,
Overflow = 1,
}
impl From<OWFR> for bool {
#[inline(always)]
fn from(variant: OWFR) -> Self {
variant as u8 != 0
}
}
pub type OWF_R = crate::BitReader<OWFR>;
impl OWF_R {
#[inline(always)]
pub const fn variant(&self) -> OWFR {
match self.bits {
false => OWFR::NoOverflow,
true => OWFR::Overflow,
}
}
#[inline(always)]
pub fn is_no_overflow(&self) -> bool {
*self == OWFR::NoOverflow
}
#[inline(always)]
pub fn is_overflow(&self) -> bool {
*self == OWFR::Overflow
}
}
pub use SECF_W as OWF_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSFR {
NotSynchronized = 0,
Synchronized = 1,
}
impl From<RSFR> for bool {
#[inline(always)]
fn from(variant: RSFR) -> Self {
variant as u8 != 0
}
}
pub type RSF_R = crate::BitReader<RSFR>;
impl RSF_R {
#[inline(always)]
pub const fn variant(&self) -> RSFR {
match self.bits {
false => RSFR::NotSynchronized,
true => RSFR::Synchronized,
}
}
#[inline(always)]
pub fn is_not_synchronized(&self) -> bool {
*self == RSFR::NotSynchronized
}
#[inline(always)]
pub fn is_synchronized(&self) -> bool {
*self == RSFR::Synchronized
}
}
pub use SECF_W as RSF_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CNF {
Exit = 0,
Enter = 1,
}
impl From<CNF> for bool {
#[inline(always)]
fn from(variant: CNF) -> Self {
variant as u8 != 0
}
}
pub type CNF_R = crate::BitReader<CNF>;
impl CNF_R {
#[inline(always)]
pub const fn variant(&self) -> CNF {
match self.bits {
false => CNF::Exit,
true => CNF::Enter,
}
}
#[inline(always)]
pub fn is_exit(&self) -> bool {
*self == CNF::Exit
}
#[inline(always)]
pub fn is_enter(&self) -> bool {
*self == CNF::Enter
}
}
pub type CNF_W<'a, REG> = crate::BitWriter<'a, REG, CNF>;
impl<'a, REG> CNF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn exit(self) -> &'a mut crate::W<REG> {
self.variant(CNF::Exit)
}
#[inline(always)]
pub fn enter(self) -> &'a mut crate::W<REG> {
self.variant(CNF::Enter)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RTOFF {
Enabled = 0,
Disabled = 1,
}
impl From<RTOFF> for bool {
#[inline(always)]
fn from(variant: RTOFF) -> Self {
variant as u8 != 0
}
}
pub type RTOFF_R = crate::BitReader<RTOFF>;
impl RTOFF_R {
#[inline(always)]
pub const fn variant(&self) -> RTOFF {
match self.bits {
false => RTOFF::Enabled,
true => RTOFF::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RTOFF::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RTOFF::Disabled
}
}
impl R {
#[inline(always)]
pub fn secf(&self) -> SECF_R {
SECF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn alrf(&self) -> ALRF_R {
ALRF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn owf(&self) -> OWF_R {
OWF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn rsf(&self) -> RSF_R {
RSF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn cnf(&self) -> CNF_R {
CNF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rtoff(&self) -> RTOFF_R {
RTOFF_R::new(((self.bits >> 5) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CRL")
.field("secf", &self.secf())
.field("alrf", &self.alrf())
.field("owf", &self.owf())
.field("rsf", &self.rsf())
.field("cnf", &self.cnf())
.field("rtoff", &self.rtoff())
.finish()
}
}
impl W {
#[inline(always)]
pub fn secf(&mut self) -> SECF_W<CRLrs> {
SECF_W::new(self, 0)
}
#[inline(always)]
pub fn alrf(&mut self) -> ALRF_W<CRLrs> {
ALRF_W::new(self, 1)
}
#[inline(always)]
pub fn owf(&mut self) -> OWF_W<CRLrs> {
OWF_W::new(self, 2)
}
#[inline(always)]
pub fn rsf(&mut self) -> RSF_W<CRLrs> {
RSF_W::new(self, 3)
}
#[inline(always)]
pub fn cnf(&mut self) -> CNF_W<CRLrs> {
CNF_W::new(self, 4)
}
}
pub struct CRLrs;
impl crate::RegisterSpec for CRLrs {
type Ux = u32;
}
impl crate::Readable for CRLrs {}
impl crate::Writable for CRLrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0f;
}
impl crate::Resettable for CRLrs {
const RESET_VALUE: u32 = 0x20;
}