#[doc = "Register `ICWUR2` reader"]
pub struct R(crate::R<ICWUR2_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ICWUR2_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ICWUR2_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ICWUR2_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `WUSEN` reader - Wake-Up function synchronous enable"]
pub type WUSEN_R = crate::BitReader<WUSEN_A>;
#[doc = "Wake-Up function synchronous enable\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUSEN_A {
#[doc = "0: IIC asynchronous circuit enable"]
_0 = 0,
#[doc = "1: IIC synchronous circuit enable"]
_1 = 1,
}
impl From<WUSEN_A> for bool {
#[inline(always)]
fn from(variant: WUSEN_A) -> Self {
variant as u8 != 0
}
}
impl WUSEN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WUSEN_A {
match self.bits {
false => WUSEN_A::_0,
true => WUSEN_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == WUSEN_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == WUSEN_A::_1
}
}
#[doc = "Field `WUASYF` reader - Wake-Up function asynchronous operation status flag"]
pub type WUASYF_R = crate::BitReader<WUASYF_A>;
#[doc = "Wake-Up function asynchronous operation status flag\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUASYF_A {
#[doc = "0: IIC synchronous circuit enable condition"]
_0 = 0,
#[doc = "1: IIC asynchronous circuit enable condition"]
_1 = 1,
}
impl From<WUASYF_A> for bool {
#[inline(always)]
fn from(variant: WUASYF_A) -> Self {
variant as u8 != 0
}
}
impl WUASYF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WUASYF_A {
match self.bits {
false => WUASYF_A::_0,
true => WUASYF_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == WUASYF_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == WUASYF_A::_1
}
}
#[doc = "Field `WUSYF` reader - Wake-Up function synchronous operation status flag"]
pub type WUSYF_R = crate::BitReader<WUSYF_A>;
#[doc = "Wake-Up function synchronous operation status flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUSYF_A {
#[doc = "0: IIC asynchronous circuit enable condition"]
_0 = 0,
#[doc = "1: IIC synchronous circuit enable condition"]
_1 = 1,
}
impl From<WUSYF_A> for bool {
#[inline(always)]
fn from(variant: WUSYF_A) -> Self {
variant as u8 != 0
}
}
impl WUSYF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WUSYF_A {
match self.bits {
false => WUSYF_A::_0,
true => WUSYF_A::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline(always)]
pub fn is_0(&self) -> bool {
*self == WUSYF_A::_0
}
#[doc = "Checks if the value of the field is `_1`"]
#[inline(always)]
pub fn is_1(&self) -> bool {
*self == WUSYF_A::_1
}
}
impl R {
#[doc = "Bit 0 - Wake-Up function synchronous enable"]
#[inline(always)]
pub fn wusen(&self) -> WUSEN_R {
WUSEN_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Wake-Up function asynchronous operation status flag"]
#[inline(always)]
pub fn wuasyf(&self) -> WUASYF_R {
WUASYF_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Wake-Up function synchronous operation status flag"]
#[inline(always)]
pub fn wusyf(&self) -> WUSYF_R {
WUSYF_R::new(((self.bits >> 2) & 1) != 0)
}
}
#[doc = "I2C Bus Wake Up Unit Register 2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [icwur2](index.html) module"]
pub struct ICWUR2_SPEC;
impl crate::RegisterSpec for ICWUR2_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [icwur2::R](R) reader structure"]
impl crate::Readable for ICWUR2_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets ICWUR2 to value 0x03"]
impl crate::Resettable for ICWUR2_SPEC {
const RESET_VALUE: Self::Ux = 0x03;
}