pub type R = crate::R<EECR2rs>;
pub type W = crate::W<EECR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EE6SRC {
Src1 = 0,
Src2 = 1,
Src3 = 2,
Src4 = 3,
}
impl From<EE6SRC> for u8 {
#[inline(always)]
fn from(variant: EE6SRC) -> Self {
variant as _
}
}
impl crate::FieldSpec for EE6SRC {
type Ux = u8;
}
impl crate::IsEnum for EE6SRC {}
pub type EESRC_R = crate::FieldReader<EE6SRC>;
impl EESRC_R {
#[inline(always)]
pub const fn variant(&self) -> EE6SRC {
match self.bits {
0 => EE6SRC::Src1,
1 => EE6SRC::Src2,
2 => EE6SRC::Src3,
3 => EE6SRC::Src4,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_src1(&self) -> bool {
*self == EE6SRC::Src1
}
#[inline(always)]
pub fn is_src2(&self) -> bool {
*self == EE6SRC::Src2
}
#[inline(always)]
pub fn is_src3(&self) -> bool {
*self == EE6SRC::Src3
}
#[inline(always)]
pub fn is_src4(&self) -> bool {
*self == EE6SRC::Src4
}
}
pub type EESRC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EE6SRC, crate::Safe>;
impl<'a, REG> EESRC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn src1(self) -> &'a mut crate::W<REG> {
self.variant(EE6SRC::Src1)
}
#[inline(always)]
pub fn src2(self) -> &'a mut crate::W<REG> {
self.variant(EE6SRC::Src2)
}
#[inline(always)]
pub fn src3(self) -> &'a mut crate::W<REG> {
self.variant(EE6SRC::Src3)
}
#[inline(always)]
pub fn src4(self) -> &'a mut crate::W<REG> {
self.variant(EE6SRC::Src4)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EE6POL {
ActiveHigh = 0,
ActiveLow = 1,
}
impl From<EE6POL> for bool {
#[inline(always)]
fn from(variant: EE6POL) -> Self {
variant as u8 != 0
}
}
pub type EEPOL_R = crate::BitReader<EE6POL>;
impl EEPOL_R {
#[inline(always)]
pub const fn variant(&self) -> EE6POL {
match self.bits {
false => EE6POL::ActiveHigh,
true => EE6POL::ActiveLow,
}
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == EE6POL::ActiveHigh
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == EE6POL::ActiveLow
}
}
pub type EEPOL_W<'a, REG> = crate::BitWriter<'a, REG, EE6POL>;
impl<'a, REG> EEPOL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(EE6POL::ActiveHigh)
}
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(EE6POL::ActiveLow)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EE6SNS {
Active = 0,
Rising = 1,
Falling = 2,
Both = 3,
}
impl From<EE6SNS> for u8 {
#[inline(always)]
fn from(variant: EE6SNS) -> Self {
variant as _
}
}
impl crate::FieldSpec for EE6SNS {
type Ux = u8;
}
impl crate::IsEnum for EE6SNS {}
pub type EESNS_R = crate::FieldReader<EE6SNS>;
impl EESNS_R {
#[inline(always)]
pub const fn variant(&self) -> EE6SNS {
match self.bits {
0 => EE6SNS::Active,
1 => EE6SNS::Rising,
2 => EE6SNS::Falling,
3 => EE6SNS::Both,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_active(&self) -> bool {
*self == EE6SNS::Active
}
#[inline(always)]
pub fn is_rising(&self) -> bool {
*self == EE6SNS::Rising
}
#[inline(always)]
pub fn is_falling(&self) -> bool {
*self == EE6SNS::Falling
}
#[inline(always)]
pub fn is_both(&self) -> bool {
*self == EE6SNS::Both
}
}
pub type EESNS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EE6SNS, crate::Safe>;
impl<'a, REG> EESNS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn active(self) -> &'a mut crate::W<REG> {
self.variant(EE6SNS::Active)
}
#[inline(always)]
pub fn rising(self) -> &'a mut crate::W<REG> {
self.variant(EE6SNS::Rising)
}
#[inline(always)]
pub fn falling(self) -> &'a mut crate::W<REG> {
self.variant(EE6SNS::Falling)
}
#[inline(always)]
pub fn both(self) -> &'a mut crate::W<REG> {
self.variant(EE6SNS::Both)
}
}
impl R {
#[inline(always)]
pub fn eesrc(&self, n: u8) -> EESRC_R {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EESRC_R::new(((self.bits >> (n * 6)) & 3) as u8)
}
#[inline(always)]
pub fn eesrc_iter(&self) -> impl Iterator<Item = EESRC_R> + '_ {
(0..5).map(move |n| EESRC_R::new(((self.bits >> (n * 6)) & 3) as u8))
}
#[inline(always)]
pub fn ee6src(&self) -> EESRC_R {
EESRC_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn ee7src(&self) -> EESRC_R {
EESRC_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn ee8src(&self) -> EESRC_R {
EESRC_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn ee9src(&self) -> EESRC_R {
EESRC_R::new(((self.bits >> 18) & 3) as u8)
}
#[inline(always)]
pub fn ee10src(&self) -> EESRC_R {
EESRC_R::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn eepol(&self, n: u8) -> EEPOL_R {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EEPOL_R::new(((self.bits >> (n * 6 + 2)) & 1) != 0)
}
#[inline(always)]
pub fn eepol_iter(&self) -> impl Iterator<Item = EEPOL_R> + '_ {
(0..5).map(move |n| EEPOL_R::new(((self.bits >> (n * 6 + 2)) & 1) != 0))
}
#[inline(always)]
pub fn ee6pol(&self) -> EEPOL_R {
EEPOL_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn ee7pol(&self) -> EEPOL_R {
EEPOL_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ee8pol(&self) -> EEPOL_R {
EEPOL_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn ee9pol(&self) -> EEPOL_R {
EEPOL_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn ee10pol(&self) -> EEPOL_R {
EEPOL_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn eesns(&self, n: u8) -> EESNS_R {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EESNS_R::new(((self.bits >> (n * 6 + 3)) & 3) as u8)
}
#[inline(always)]
pub fn eesns_iter(&self) -> impl Iterator<Item = EESNS_R> + '_ {
(0..5).map(move |n| EESNS_R::new(((self.bits >> (n * 6 + 3)) & 3) as u8))
}
#[inline(always)]
pub fn ee6sns(&self) -> EESNS_R {
EESNS_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn ee7sns(&self) -> EESNS_R {
EESNS_R::new(((self.bits >> 9) & 3) as u8)
}
#[inline(always)]
pub fn ee8sns(&self) -> EESNS_R {
EESNS_R::new(((self.bits >> 15) & 3) as u8)
}
#[inline(always)]
pub fn ee9sns(&self) -> EESNS_R {
EESNS_R::new(((self.bits >> 21) & 3) as u8)
}
#[inline(always)]
pub fn ee10sns(&self) -> EESNS_R {
EESNS_R::new(((self.bits >> 27) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EECR2")
.field("ee6sns", &self.ee6sns())
.field("ee7sns", &self.ee7sns())
.field("ee8sns", &self.ee8sns())
.field("ee9sns", &self.ee9sns())
.field("ee10sns", &self.ee10sns())
.field("ee6pol", &self.ee6pol())
.field("ee7pol", &self.ee7pol())
.field("ee8pol", &self.ee8pol())
.field("ee9pol", &self.ee9pol())
.field("ee10pol", &self.ee10pol())
.field("ee6src", &self.ee6src())
.field("ee7src", &self.ee7src())
.field("ee8src", &self.ee8src())
.field("ee9src", &self.ee9src())
.field("ee10src", &self.ee10src())
.finish()
}
}
impl W {
#[inline(always)]
pub fn eesrc(&mut self, n: u8) -> EESRC_W<EECR2rs> {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EESRC_W::new(self, n * 6)
}
#[inline(always)]
pub fn ee6src(&mut self) -> EESRC_W<EECR2rs> {
EESRC_W::new(self, 0)
}
#[inline(always)]
pub fn ee7src(&mut self) -> EESRC_W<EECR2rs> {
EESRC_W::new(self, 6)
}
#[inline(always)]
pub fn ee8src(&mut self) -> EESRC_W<EECR2rs> {
EESRC_W::new(self, 12)
}
#[inline(always)]
pub fn ee9src(&mut self) -> EESRC_W<EECR2rs> {
EESRC_W::new(self, 18)
}
#[inline(always)]
pub fn ee10src(&mut self) -> EESRC_W<EECR2rs> {
EESRC_W::new(self, 24)
}
#[inline(always)]
pub fn eepol(&mut self, n: u8) -> EEPOL_W<EECR2rs> {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EEPOL_W::new(self, n * 6 + 2)
}
#[inline(always)]
pub fn ee6pol(&mut self) -> EEPOL_W<EECR2rs> {
EEPOL_W::new(self, 2)
}
#[inline(always)]
pub fn ee7pol(&mut self) -> EEPOL_W<EECR2rs> {
EEPOL_W::new(self, 8)
}
#[inline(always)]
pub fn ee8pol(&mut self) -> EEPOL_W<EECR2rs> {
EEPOL_W::new(self, 14)
}
#[inline(always)]
pub fn ee9pol(&mut self) -> EEPOL_W<EECR2rs> {
EEPOL_W::new(self, 20)
}
#[inline(always)]
pub fn ee10pol(&mut self) -> EEPOL_W<EECR2rs> {
EEPOL_W::new(self, 26)
}
#[inline(always)]
pub fn eesns(&mut self, n: u8) -> EESNS_W<EECR2rs> {
#[allow(clippy::no_effect)] [(); 5][n as usize];
EESNS_W::new(self, n * 6 + 3)
}
#[inline(always)]
pub fn ee6sns(&mut self) -> EESNS_W<EECR2rs> {
EESNS_W::new(self, 3)
}
#[inline(always)]
pub fn ee7sns(&mut self) -> EESNS_W<EECR2rs> {
EESNS_W::new(self, 9)
}
#[inline(always)]
pub fn ee8sns(&mut self) -> EESNS_W<EECR2rs> {
EESNS_W::new(self, 15)
}
#[inline(always)]
pub fn ee9sns(&mut self) -> EESNS_W<EECR2rs> {
EESNS_W::new(self, 21)
}
#[inline(always)]
pub fn ee10sns(&mut self) -> EESNS_W<EECR2rs> {
EESNS_W::new(self, 27)
}
}
pub struct EECR2rs;
impl crate::RegisterSpec for EECR2rs {
type Ux = u32;
}
impl crate::Readable for EECR2rs {}
impl crate::Writable for EECR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for EECR2rs {}