pub type R = crate::R<ICRrs>;
pub type W = crate::W<ICRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYNCOKC {
Clear = 1,
}
impl From<SYNCOKC> for bool {
#[inline(always)]
fn from(variant: SYNCOKC) -> Self {
variant as u8 != 0
}
}
pub type SYNCOKC_R = crate::BitReader<SYNCOKC>;
impl SYNCOKC_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SYNCOKC> {
match self.bits {
true => Some(SYNCOKC::Clear),
_ => None,
}
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == SYNCOKC::Clear
}
}
pub type SYNCOKC_W<'a, REG> = crate::BitWriter<'a, REG, SYNCOKC>;
impl<'a, REG> SYNCOKC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(SYNCOKC::Clear)
}
}
pub use SYNCOKC_R as SYNCWARNC_R;
pub use SYNCOKC_R as ERRC_R;
pub use SYNCOKC_R as ESYNCC_R;
pub use SYNCOKC_W as SYNCWARNC_W;
pub use SYNCOKC_W as ERRC_W;
pub use SYNCOKC_W as ESYNCC_W;
impl R {
#[inline(always)]
pub fn syncokc(&self) -> SYNCOKC_R {
SYNCOKC_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn syncwarnc(&self) -> SYNCWARNC_R {
SYNCWARNC_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn errc(&self) -> ERRC_R {
ERRC_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn esyncc(&self) -> ESYNCC_R {
ESYNCC_R::new(((self.bits >> 3) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ICR")
.field("syncokc", &self.syncokc())
.field("esyncc", &self.esyncc())
.field("errc", &self.errc())
.field("syncwarnc", &self.syncwarnc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn syncokc(&mut self) -> SYNCOKC_W<ICRrs> {
SYNCOKC_W::new(self, 0)
}
#[inline(always)]
pub fn syncwarnc(&mut self) -> SYNCWARNC_W<ICRrs> {
SYNCWARNC_W::new(self, 1)
}
#[inline(always)]
pub fn errc(&mut self) -> ERRC_W<ICRrs> {
ERRC_W::new(self, 2)
}
#[inline(always)]
pub fn esyncc(&mut self) -> ESYNCC_W<ICRrs> {
ESYNCC_W::new(self, 3)
}
}
pub struct ICRrs;
impl crate::RegisterSpec for ICRrs {
type Ux = u32;
}
impl crate::Readable for ICRrs {}
impl crate::Writable for ICRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ICRrs {}