pub type R = crate::R<CCERrs>;
pub type W = crate::W<CCERrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1E {
Disabled = 0,
Enabled = 1,
}
impl From<CC1E> for bool {
#[inline(always)]
fn from(variant: CC1E) -> Self {
variant as u8 != 0
}
}
pub type CCE_R = crate::BitReader<CC1E>;
impl CCE_R {
#[inline(always)]
pub const fn variant(&self) -> CC1E {
match self.bits {
false => CC1E::Disabled,
true => CC1E::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CC1E::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CC1E::Enabled
}
}
pub type CCE_W<'a, REG> = crate::BitWriter<'a, REG, CC1E>;
impl<'a, REG> CCE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1E::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1E::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1P {
RisingEdge = 0,
FallingEdge = 1,
}
impl From<CC1P> for bool {
#[inline(always)]
fn from(variant: CC1P) -> Self {
variant as u8 != 0
}
}
pub type CCP_R = crate::BitReader<CC1P>;
impl CCP_R {
#[inline(always)]
pub const fn variant(&self) -> CC1P {
match self.bits {
false => CC1P::RisingEdge,
true => CC1P::FallingEdge,
}
}
#[inline(always)]
pub fn is_rising_edge(&self) -> bool {
*self == CC1P::RisingEdge
}
#[inline(always)]
pub fn is_falling_edge(&self) -> bool {
*self == CC1P::FallingEdge
}
}
pub type CCP_W<'a, REG> = crate::BitWriter<'a, REG, CC1P>;
impl<'a, REG> CCP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn rising_edge(self) -> &'a mut crate::W<REG> {
self.variant(CC1P::RisingEdge)
}
#[inline(always)]
pub fn falling_edge(self) -> &'a mut crate::W<REG> {
self.variant(CC1P::FallingEdge)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1NE {
Disabled = 0,
Enabled = 1,
}
impl From<CC1NE> for bool {
#[inline(always)]
fn from(variant: CC1NE) -> Self {
variant as u8 != 0
}
}
pub type CCNE_R = crate::BitReader<CC1NE>;
impl CCNE_R {
#[inline(always)]
pub const fn variant(&self) -> CC1NE {
match self.bits {
false => CC1NE::Disabled,
true => CC1NE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CC1NE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CC1NE::Enabled
}
}
pub type CCNE_W<'a, REG> = crate::BitWriter<'a, REG, CC1NE>;
impl<'a, REG> CCNE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1NE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1NE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1NP {
ActiveHigh = 0,
ActiveLow = 1,
}
impl From<CC1NP> for bool {
#[inline(always)]
fn from(variant: CC1NP) -> Self {
variant as u8 != 0
}
}
pub type CCNP_R = crate::BitReader<CC1NP>;
impl CCNP_R {
#[inline(always)]
pub const fn variant(&self) -> CC1NP {
match self.bits {
false => CC1NP::ActiveHigh,
true => CC1NP::ActiveLow,
}
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == CC1NP::ActiveHigh
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == CC1NP::ActiveLow
}
}
pub type CCNP_W<'a, REG> = crate::BitWriter<'a, REG, CC1NP>;
impl<'a, REG> CCNP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(CC1NP::ActiveHigh)
}
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(CC1NP::ActiveLow)
}
}
impl R {
#[inline(always)]
pub fn cce(&self, n: u8) -> CCE_R {
#[allow(clippy::no_effect)]
[(); 6][n as usize];
CCE_R::new(((self.bits >> (n * 4)) & 1) != 0)
}
#[inline(always)]
pub fn cce_iter(&self) -> impl Iterator<Item = CCE_R> + '_ {
(0..6).map(move |n| CCE_R::new(((self.bits >> (n * 4)) & 1) != 0))
}
#[inline(always)]
pub fn cc1e(&self) -> CCE_R {
CCE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cc2e(&self) -> CCE_R {
CCE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn cc3e(&self) -> CCE_R {
CCE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn cc4e(&self) -> CCE_R {
CCE_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn cc5e(&self) -> CCE_R {
CCE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn cc6e(&self) -> CCE_R {
CCE_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn ccp(&self, n: u8) -> CCP_R {
#[allow(clippy::no_effect)]
[(); 6][n as usize];
CCP_R::new(((self.bits >> (n * 4 + 1)) & 1) != 0)
}
#[inline(always)]
pub fn ccp_iter(&self) -> impl Iterator<Item = CCP_R> + '_ {
(0..6).map(move |n| CCP_R::new(((self.bits >> (n * 4 + 1)) & 1) != 0))
}
#[inline(always)]
pub fn cc1p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cc2p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn cc3p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cc4p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn cc5p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn cc6p(&self) -> CCP_R {
CCP_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn ccne(&self, n: u8) -> CCNE_R {
#[allow(clippy::no_effect)]
[(); 3][n as usize];
CCNE_R::new(((self.bits >> (n * 4 + 2)) & 1) != 0)
}
#[inline(always)]
pub fn ccne_iter(&self) -> impl Iterator<Item = CCNE_R> + '_ {
(0..3).map(move |n| CCNE_R::new(((self.bits >> (n * 4 + 2)) & 1) != 0))
}
#[inline(always)]
pub fn cc1ne(&self) -> CCNE_R {
CCNE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cc2ne(&self) -> CCNE_R {
CCNE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn cc3ne(&self) -> CCNE_R {
CCNE_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn ccnp(&self, n: u8) -> CCNP_R {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCNP_R::new(((self.bits >> (n * 4 + 3)) & 1) != 0)
}
#[inline(always)]
pub fn ccnp_iter(&self) -> impl Iterator<Item = CCNP_R> + '_ {
(0..4).map(move |n| CCNP_R::new(((self.bits >> (n * 4 + 3)) & 1) != 0))
}
#[inline(always)]
pub fn cc1np(&self) -> CCNP_R {
CCNP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn cc2np(&self) -> CCNP_R {
CCNP_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn cc3np(&self) -> CCNP_R {
CCNP_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn cc4np(&self) -> CCNP_R {
CCNP_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCER")
.field("cc1e", &self.cc1e())
.field("cc2e", &self.cc2e())
.field("cc3e", &self.cc3e())
.field("cc4e", &self.cc4e())
.field("cc5e", &self.cc5e())
.field("cc6e", &self.cc6e())
.field("cc1p", &self.cc1p())
.field("cc2p", &self.cc2p())
.field("cc3p", &self.cc3p())
.field("cc4p", &self.cc4p())
.field("cc5p", &self.cc5p())
.field("cc6p", &self.cc6p())
.field("cc1ne", &self.cc1ne())
.field("cc2ne", &self.cc2ne())
.field("cc3ne", &self.cc3ne())
.field("cc1np", &self.cc1np())
.field("cc2np", &self.cc2np())
.field("cc3np", &self.cc3np())
.field("cc4np", &self.cc4np())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cce(&mut self, n: u8) -> CCE_W<CCERrs> {
#[allow(clippy::no_effect)]
[(); 6][n as usize];
CCE_W::new(self, n * 4)
}
#[inline(always)]
pub fn cc1e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 0)
}
#[inline(always)]
pub fn cc2e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 4)
}
#[inline(always)]
pub fn cc3e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 8)
}
#[inline(always)]
pub fn cc4e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 12)
}
#[inline(always)]
pub fn cc5e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 16)
}
#[inline(always)]
pub fn cc6e(&mut self) -> CCE_W<CCERrs> {
CCE_W::new(self, 20)
}
#[inline(always)]
pub fn ccp(&mut self, n: u8) -> CCP_W<CCERrs> {
#[allow(clippy::no_effect)]
[(); 6][n as usize];
CCP_W::new(self, n * 4 + 1)
}
#[inline(always)]
pub fn cc1p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 1)
}
#[inline(always)]
pub fn cc2p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 5)
}
#[inline(always)]
pub fn cc3p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 9)
}
#[inline(always)]
pub fn cc4p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 13)
}
#[inline(always)]
pub fn cc5p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 17)
}
#[inline(always)]
pub fn cc6p(&mut self) -> CCP_W<CCERrs> {
CCP_W::new(self, 21)
}
#[inline(always)]
pub fn ccne(&mut self, n: u8) -> CCNE_W<CCERrs> {
#[allow(clippy::no_effect)]
[(); 3][n as usize];
CCNE_W::new(self, n * 4 + 2)
}
#[inline(always)]
pub fn cc1ne(&mut self) -> CCNE_W<CCERrs> {
CCNE_W::new(self, 2)
}
#[inline(always)]
pub fn cc2ne(&mut self) -> CCNE_W<CCERrs> {
CCNE_W::new(self, 6)
}
#[inline(always)]
pub fn cc3ne(&mut self) -> CCNE_W<CCERrs> {
CCNE_W::new(self, 10)
}
#[inline(always)]
pub fn ccnp(&mut self, n: u8) -> CCNP_W<CCERrs> {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCNP_W::new(self, n * 4 + 3)
}
#[inline(always)]
pub fn cc1np(&mut self) -> CCNP_W<CCERrs> {
CCNP_W::new(self, 3)
}
#[inline(always)]
pub fn cc2np(&mut self) -> CCNP_W<CCERrs> {
CCNP_W::new(self, 7)
}
#[inline(always)]
pub fn cc3np(&mut self) -> CCNP_W<CCERrs> {
CCNP_W::new(self, 11)
}
#[inline(always)]
pub fn cc4np(&mut self) -> CCNP_W<CCERrs> {
CCNP_W::new(self, 15)
}
}
pub struct CCERrs;
impl crate::RegisterSpec for CCERrs {
type Ux = u32;
}
impl crate::Readable for CCERrs {}
impl crate::Writable for CCERrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCERrs {}