pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JEOCIE {
Disabled = 0,
Enabled = 1,
}
impl From<JEOCIE> for bool {
#[inline(always)]
fn from(variant: JEOCIE) -> Self {
variant as u8 != 0
}
}
pub type JEOCIE_R = crate::BitReader<JEOCIE>;
impl JEOCIE_R {
#[inline(always)]
pub const fn variant(&self) -> JEOCIE {
match self.bits {
false => JEOCIE::Disabled,
true => JEOCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JEOCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JEOCIE::Enabled
}
}
pub type JEOCIE_W<'a, REG> = crate::BitWriter<'a, REG, JEOCIE>;
impl<'a, REG> JEOCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JEOCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JEOCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REOCIE {
Disabled = 0,
Enabled = 1,
}
impl From<REOCIE> for bool {
#[inline(always)]
fn from(variant: REOCIE) -> Self {
variant as u8 != 0
}
}
pub type REOCIE_R = crate::BitReader<REOCIE>;
impl REOCIE_R {
#[inline(always)]
pub const fn variant(&self) -> REOCIE {
match self.bits {
false => REOCIE::Disabled,
true => REOCIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REOCIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REOCIE::Enabled
}
}
pub type REOCIE_W<'a, REG> = crate::BitWriter<'a, REG, REOCIE>;
impl<'a, REG> REOCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(REOCIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(REOCIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JOVRIE {
Disabled = 0,
Enabled = 1,
}
impl From<JOVRIE> for bool {
#[inline(always)]
fn from(variant: JOVRIE) -> Self {
variant as u8 != 0
}
}
pub type JOVRIE_R = crate::BitReader<JOVRIE>;
impl JOVRIE_R {
#[inline(always)]
pub const fn variant(&self) -> JOVRIE {
match self.bits {
false => JOVRIE::Disabled,
true => JOVRIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == JOVRIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == JOVRIE::Enabled
}
}
pub type JOVRIE_W<'a, REG> = crate::BitWriter<'a, REG, JOVRIE>;
impl<'a, REG> JOVRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(JOVRIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(JOVRIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ROVRIE {
Disabled = 0,
Enabled = 1,
}
impl From<ROVRIE> for bool {
#[inline(always)]
fn from(variant: ROVRIE) -> Self {
variant as u8 != 0
}
}
pub type ROVRIE_R = crate::BitReader<ROVRIE>;
impl ROVRIE_R {
#[inline(always)]
pub const fn variant(&self) -> ROVRIE {
match self.bits {
false => ROVRIE::Disabled,
true => ROVRIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ROVRIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ROVRIE::Enabled
}
}
pub type ROVRIE_W<'a, REG> = crate::BitWriter<'a, REG, ROVRIE>;
impl<'a, REG> ROVRIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ROVRIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ROVRIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDIE {
Disabled = 0,
Enabled = 1,
}
impl From<AWDIE> for bool {
#[inline(always)]
fn from(variant: AWDIE) -> Self {
variant as u8 != 0
}
}
pub type AWDIE_R = crate::BitReader<AWDIE>;
impl AWDIE_R {
#[inline(always)]
pub const fn variant(&self) -> AWDIE {
match self.bits {
false => AWDIE::Disabled,
true => AWDIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AWDIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AWDIE::Enabled
}
}
pub type AWDIE_W<'a, REG> = crate::BitWriter<'a, REG, AWDIE>;
impl<'a, REG> AWDIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SCDIE {
Disabled = 0,
Enabled = 1,
}
impl From<SCDIE> for bool {
#[inline(always)]
fn from(variant: SCDIE) -> Self {
variant as u8 != 0
}
}
pub type SCDIE_R = crate::BitReader<SCDIE>;
impl SCDIE_R {
#[inline(always)]
pub const fn variant(&self) -> SCDIE {
match self.bits {
false => SCDIE::Disabled,
true => SCDIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SCDIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SCDIE::Enabled
}
}
pub type SCDIE_W<'a, REG> = crate::BitWriter<'a, REG, SCDIE>;
impl<'a, REG> SCDIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SCDIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SCDIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CKABIE {
Disabled = 0,
Enabled = 1,
}
impl From<CKABIE> for bool {
#[inline(always)]
fn from(variant: CKABIE) -> Self {
variant as u8 != 0
}
}
pub type CKABIE_R = crate::BitReader<CKABIE>;
impl CKABIE_R {
#[inline(always)]
pub const fn variant(&self) -> CKABIE {
match self.bits {
false => CKABIE::Disabled,
true => CKABIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CKABIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CKABIE::Enabled
}
}
pub type CKABIE_W<'a, REG> = crate::BitWriter<'a, REG, CKABIE>;
impl<'a, REG> CKABIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CKABIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CKABIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EXCH {
Disabled = 0,
Enabled = 1,
}
impl From<EXCH> for u8 {
#[inline(always)]
fn from(variant: EXCH) -> Self {
variant as _
}
}
impl crate::FieldSpec for EXCH {
type Ux = u8;
}
impl crate::IsEnum for EXCH {}
pub type EXCH_R = crate::FieldReader<EXCH>;
impl EXCH_R {
#[inline(always)]
pub const fn variant(&self) -> Option<EXCH> {
match self.bits {
0 => Some(EXCH::Disabled),
1 => Some(EXCH::Enabled),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EXCH::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EXCH::Enabled
}
}
pub type EXCH_W<'a, REG> = crate::FieldWriter<'a, REG, 8, EXCH>;
impl<'a, REG> EXCH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EXCH::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EXCH::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum AWDCH {
Disabled = 0,
Enabled = 1,
}
impl From<AWDCH> for u8 {
#[inline(always)]
fn from(variant: AWDCH) -> Self {
variant as _
}
}
impl crate::FieldSpec for AWDCH {
type Ux = u8;
}
impl crate::IsEnum for AWDCH {}
pub type AWDCH_R = crate::FieldReader<AWDCH>;
impl AWDCH_R {
#[inline(always)]
pub const fn variant(&self) -> Option<AWDCH> {
match self.bits {
0 => Some(AWDCH::Disabled),
1 => Some(AWDCH::Enabled),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == AWDCH::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == AWDCH::Enabled
}
}
pub type AWDCH_W<'a, REG> = crate::FieldWriter<'a, REG, 8, AWDCH>;
impl<'a, REG> AWDCH_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDCH::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(AWDCH::Enabled)
}
}
impl R {
#[inline(always)]
pub fn jeocie(&self) -> JEOCIE_R {
JEOCIE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn reocie(&self) -> REOCIE_R {
REOCIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn jovrie(&self) -> JOVRIE_R {
JOVRIE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn rovrie(&self) -> ROVRIE_R {
ROVRIE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn awdie(&self) -> AWDIE_R {
AWDIE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn scdie(&self) -> SCDIE_R {
SCDIE_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn ckabie(&self) -> CKABIE_R {
CKABIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn exch(&self) -> EXCH_R {
EXCH_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn awdch(&self) -> AWDCH_R {
AWDCH_R::new(((self.bits >> 16) & 0xff) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR2")
.field("awdch", &self.awdch())
.field("exch", &self.exch())
.field("ckabie", &self.ckabie())
.field("scdie", &self.scdie())
.field("awdie", &self.awdie())
.field("rovrie", &self.rovrie())
.field("jovrie", &self.jovrie())
.field("reocie", &self.reocie())
.field("jeocie", &self.jeocie())
.finish()
}
}
impl W {
#[inline(always)]
pub fn jeocie(&mut self) -> JEOCIE_W<CR2rs> {
JEOCIE_W::new(self, 0)
}
#[inline(always)]
pub fn reocie(&mut self) -> REOCIE_W<CR2rs> {
REOCIE_W::new(self, 1)
}
#[inline(always)]
pub fn jovrie(&mut self) -> JOVRIE_W<CR2rs> {
JOVRIE_W::new(self, 2)
}
#[inline(always)]
pub fn rovrie(&mut self) -> ROVRIE_W<CR2rs> {
ROVRIE_W::new(self, 3)
}
#[inline(always)]
pub fn awdie(&mut self) -> AWDIE_W<CR2rs> {
AWDIE_W::new(self, 4)
}
#[inline(always)]
pub fn scdie(&mut self) -> SCDIE_W<CR2rs> {
SCDIE_W::new(self, 5)
}
#[inline(always)]
pub fn ckabie(&mut self) -> CKABIE_W<CR2rs> {
CKABIE_W::new(self, 6)
}
#[inline(always)]
pub fn exch(&mut self) -> EXCH_W<CR2rs> {
EXCH_W::new(self, 8)
}
#[inline(always)]
pub fn awdch(&mut self) -> AWDCH_W<CR2rs> {
AWDCH_W::new(self, 16)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}