pub type R = crate::R<ICSRrs>;
pub type W = crate::W<ICSRrs>;
pub type ALRWF_R = crate::BitReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUTWFR {
UpdateNotAllowed = 0,
UpdateAllowed = 1,
}
impl From<WUTWFR> for bool {
#[inline(always)]
fn from(variant: WUTWFR) -> Self {
variant as u8 != 0
}
}
pub type WUTWF_R = crate::BitReader<WUTWFR>;
impl WUTWF_R {
#[inline(always)]
pub const fn variant(&self) -> WUTWFR {
match self.bits {
false => WUTWFR::UpdateNotAllowed,
true => WUTWFR::UpdateAllowed,
}
}
#[inline(always)]
pub fn is_update_not_allowed(&self) -> bool {
*self == WUTWFR::UpdateNotAllowed
}
#[inline(always)]
pub fn is_update_allowed(&self) -> bool {
*self == WUTWFR::UpdateAllowed
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SHPFR {
NoShiftPending = 0,
ShiftPending = 1,
}
impl From<SHPFR> for bool {
#[inline(always)]
fn from(variant: SHPFR) -> Self {
variant as u8 != 0
}
}
pub type SHPF_R = crate::BitReader<SHPFR>;
impl SHPF_R {
#[inline(always)]
pub const fn variant(&self) -> SHPFR {
match self.bits {
false => SHPFR::NoShiftPending,
true => SHPFR::ShiftPending,
}
}
#[inline(always)]
pub fn is_no_shift_pending(&self) -> bool {
*self == SHPFR::NoShiftPending
}
#[inline(always)]
pub fn is_shift_pending(&self) -> bool {
*self == SHPFR::ShiftPending
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INITSR {
NotInitalized = 0,
Initalized = 1,
}
impl From<INITSR> for bool {
#[inline(always)]
fn from(variant: INITSR) -> Self {
variant as u8 != 0
}
}
pub type INITS_R = crate::BitReader<INITSR>;
impl INITS_R {
#[inline(always)]
pub const fn variant(&self) -> INITSR {
match self.bits {
false => INITSR::NotInitalized,
true => INITSR::Initalized,
}
}
#[inline(always)]
pub fn is_not_initalized(&self) -> bool {
*self == INITSR::NotInitalized
}
#[inline(always)]
pub fn is_initalized(&self) -> bool {
*self == INITSR::Initalized
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSFR {
NotSynced = 0,
Synced = 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::NotSynced,
true => RSFR::Synced,
}
}
#[inline(always)]
pub fn is_not_synced(&self) -> bool {
*self == RSFR::NotSynced
}
#[inline(always)]
pub fn is_synced(&self) -> bool {
*self == RSFR::Synced
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RSFW {
Clear = 0,
}
impl From<RSFW> for bool {
#[inline(always)]
fn from(variant: RSFW) -> Self {
variant as u8 != 0
}
}
pub type RSF_W<'a, REG> = crate::BitWriter0C<'a, REG, RSFW>;
impl<'a, REG> RSF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(RSFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INITFR {
NotAllowed = 0,
Allowed = 1,
}
impl From<INITFR> for bool {
#[inline(always)]
fn from(variant: INITFR) -> Self {
variant as u8 != 0
}
}
pub type INITF_R = crate::BitReader<INITFR>;
impl INITF_R {
#[inline(always)]
pub const fn variant(&self) -> INITFR {
match self.bits {
false => INITFR::NotAllowed,
true => INITFR::Allowed,
}
}
#[inline(always)]
pub fn is_not_allowed(&self) -> bool {
*self == INITFR::NotAllowed
}
#[inline(always)]
pub fn is_allowed(&self) -> bool {
*self == INITFR::Allowed
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INIT {
FreeRunningMode = 0,
InitMode = 1,
}
impl From<INIT> for bool {
#[inline(always)]
fn from(variant: INIT) -> Self {
variant as u8 != 0
}
}
pub type INIT_R = crate::BitReader<INIT>;
impl INIT_R {
#[inline(always)]
pub const fn variant(&self) -> INIT {
match self.bits {
false => INIT::FreeRunningMode,
true => INIT::InitMode,
}
}
#[inline(always)]
pub fn is_free_running_mode(&self) -> bool {
*self == INIT::FreeRunningMode
}
#[inline(always)]
pub fn is_init_mode(&self) -> bool {
*self == INIT::InitMode
}
}
pub type INIT_W<'a, REG> = crate::BitWriter<'a, REG, INIT>;
impl<'a, REG> INIT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn free_running_mode(self) -> &'a mut crate::W<REG> {
self.variant(INIT::FreeRunningMode)
}
#[inline(always)]
pub fn init_mode(self) -> &'a mut crate::W<REG> {
self.variant(INIT::InitMode)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RECALPFR {
Pending = 1,
}
impl From<RECALPFR> for bool {
#[inline(always)]
fn from(variant: RECALPFR) -> Self {
variant as u8 != 0
}
}
pub type RECALPF_R = crate::BitReader<RECALPFR>;
impl RECALPF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RECALPFR> {
match self.bits {
true => Some(RECALPFR::Pending),
_ => None,
}
}
#[inline(always)]
pub fn is_pending(&self) -> bool {
*self == RECALPFR::Pending
}
}
impl R {
#[inline(always)]
pub fn alrwf(&self, n: u8) -> ALRWF_R {
#[allow(clippy::no_effect)] [(); 2][n as usize];
ALRWF_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn alrwf_iter(&self) -> impl Iterator<Item = ALRWF_R> + '_ {
(0..2).map(move |n| ALRWF_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn alrawf(&self) -> ALRWF_R {
ALRWF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn alrbwf(&self) -> ALRWF_R {
ALRWF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn wutwf(&self) -> WUTWF_R {
WUTWF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn shpf(&self) -> SHPF_R {
SHPF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn inits(&self) -> INITS_R {
INITS_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rsf(&self) -> RSF_R {
RSF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn initf(&self) -> INITF_R {
INITF_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn init(&self) -> INIT_R {
INIT_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn recalpf(&self) -> RECALPF_R {
RECALPF_R::new(((self.bits >> 16) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ICSR")
.field("alrawf", &self.alrawf())
.field("alrbwf", &self.alrbwf())
.field("wutwf", &self.wutwf())
.field("shpf", &self.shpf())
.field("inits", &self.inits())
.field("rsf", &self.rsf())
.field("initf", &self.initf())
.field("init", &self.init())
.field("recalpf", &self.recalpf())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rsf(&mut self) -> RSF_W<ICSRrs> {
RSF_W::new(self, 5)
}
#[inline(always)]
pub fn init(&mut self) -> INIT_W<ICSRrs> {
INIT_W::new(self, 7)
}
}
pub struct ICSRrs;
impl crate::RegisterSpec for ICSRrs {
type Ux = u32;
}
impl crate::Readable for ICSRrs {}
impl crate::Writable for ICSRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x20;
}
impl crate::Resettable for ICSRrs {
const RESET_VALUE: u32 = 0x07;
}