pub type R = crate::R<CPT1CRrs>;
pub type W = crate::W<CPT1CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SWCPT {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<SWCPT> for bool {
#[inline(always)]
fn from(variant: SWCPT) -> Self {
variant as u8 != 0
}
}
pub type SWCPT_R = crate::BitReader<SWCPT>;
impl SWCPT_R {
#[inline(always)]
pub const fn variant(&self) -> SWCPT {
match self.bits {
false => SWCPT::NoEffect,
true => SWCPT::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == SWCPT::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == SWCPT::TriggerCapture
}
}
pub type SWCPT_W<'a, REG> = crate::BitWriter<'a, REG, SWCPT>;
impl<'a, REG> SWCPT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(SWCPT::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(SWCPT::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UPDCPT {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<UPDCPT> for bool {
#[inline(always)]
fn from(variant: UPDCPT) -> Self {
variant as u8 != 0
}
}
pub type UPDCPT_R = crate::BitReader<UPDCPT>;
impl UPDCPT_R {
#[inline(always)]
pub const fn variant(&self) -> UPDCPT {
match self.bits {
false => UPDCPT::NoEffect,
true => UPDCPT::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == UPDCPT::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == UPDCPT::TriggerCapture
}
}
pub type UPDCPT_W<'a, REG> = crate::BitWriter<'a, REG, UPDCPT>;
impl<'a, REG> UPDCPT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(UPDCPT::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(UPDCPT::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EXEV1CPT {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<EXEV1CPT> for bool {
#[inline(always)]
fn from(variant: EXEV1CPT) -> Self {
variant as u8 != 0
}
}
pub type EXEVCPT_R = crate::BitReader<EXEV1CPT>;
impl EXEVCPT_R {
#[inline(always)]
pub const fn variant(&self) -> EXEV1CPT {
match self.bits {
false => EXEV1CPT::NoEffect,
true => EXEV1CPT::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == EXEV1CPT::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == EXEV1CPT::TriggerCapture
}
}
pub type EXEVCPT_W<'a, REG> = crate::BitWriter<'a, REG, EXEV1CPT>;
impl<'a, REG> EXEVCPT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(EXEV1CPT::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(EXEV1CPT::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TB1SET {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TB1SET> for bool {
#[inline(always)]
fn from(variant: TB1SET) -> Self {
variant as u8 != 0
}
}
pub type TB1SET_R = crate::BitReader<TB1SET>;
impl TB1SET_R {
#[inline(always)]
pub const fn variant(&self) -> TB1SET {
match self.bits {
false => TB1SET::NoEffect,
true => TB1SET::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TB1SET::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TB1SET::TriggerCapture
}
}
pub type TB1SET_W<'a, REG> = crate::BitWriter<'a, REG, TB1SET>;
impl<'a, REG> TB1SET_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TB1SET::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TB1SET::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TB1RST {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TB1RST> for bool {
#[inline(always)]
fn from(variant: TB1RST) -> Self {
variant as u8 != 0
}
}
pub type TB1RST_R = crate::BitReader<TB1RST>;
impl TB1RST_R {
#[inline(always)]
pub const fn variant(&self) -> TB1RST {
match self.bits {
false => TB1RST::NoEffect,
true => TB1RST::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TB1RST::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TB1RST::TriggerCapture
}
}
pub type TB1RST_W<'a, REG> = crate::BitWriter<'a, REG, TB1RST>;
impl<'a, REG> TB1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TB1RST::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TB1RST::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TBCMP1 {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TBCMP1> for bool {
#[inline(always)]
fn from(variant: TBCMP1) -> Self {
variant as u8 != 0
}
}
pub type TBCMP1_R = crate::BitReader<TBCMP1>;
impl TBCMP1_R {
#[inline(always)]
pub const fn variant(&self) -> TBCMP1 {
match self.bits {
false => TBCMP1::NoEffect,
true => TBCMP1::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TBCMP1::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TBCMP1::TriggerCapture
}
}
pub type TBCMP1_W<'a, REG> = crate::BitWriter<'a, REG, TBCMP1>;
impl<'a, REG> TBCMP1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TBCMP1::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TBCMP1::TriggerCapture)
}
}
pub use TB1RST_R as TC1RST_R;
pub use TB1RST_R as TD1RST_R;
pub use TB1RST_R as TE1RST_R;
pub use TB1RST_W as TC1RST_W;
pub use TB1RST_W as TD1RST_W;
pub use TB1RST_W as TE1RST_W;
pub use TB1SET_R as TC1SET_R;
pub use TB1SET_R as TD1SET_R;
pub use TB1SET_R as TE1SET_R;
pub use TB1SET_W as TC1SET_W;
pub use TB1SET_W as TD1SET_W;
pub use TB1SET_W as TE1SET_W;
pub use TBCMP1_R as TBCMP2_R;
pub use TBCMP1_R as TCCMP1_R;
pub use TBCMP1_R as TCCMP2_R;
pub use TBCMP1_R as TDCMP1_R;
pub use TBCMP1_R as TDCMP2_R;
pub use TBCMP1_R as TECMP1_R;
pub use TBCMP1_R as TECMP2_R;
pub use TBCMP1_W as TBCMP2_W;
pub use TBCMP1_W as TCCMP1_W;
pub use TBCMP1_W as TCCMP2_W;
pub use TBCMP1_W as TDCMP1_W;
pub use TBCMP1_W as TDCMP2_W;
pub use TBCMP1_W as TECMP1_W;
pub use TBCMP1_W as TECMP2_W;
impl R {
#[inline(always)]
pub fn swcpt(&self) -> SWCPT_R {
SWCPT_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn updcpt(&self) -> UPDCPT_R {
UPDCPT_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn exevcpt(&self, n: u8) -> EXEVCPT_R {
#[allow(clippy::no_effect)] [(); 10][n as usize];
EXEVCPT_R::new(((self.bits >> (n + 2)) & 1) != 0)
}
#[inline(always)]
pub fn exevcpt_iter(&self) -> impl Iterator<Item = EXEVCPT_R> + '_ {
(0..10).map(move |n| EXEVCPT_R::new(((self.bits >> (n + 2)) & 1) != 0))
}
#[inline(always)]
pub fn exev1cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn exev2cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn exev3cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn exev4cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn exev5cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn exev6cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn exev7cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn exev8cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn exev9cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn exev10cpt(&self) -> EXEVCPT_R {
EXEVCPT_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn tb1set(&self) -> TB1SET_R {
TB1SET_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn tb1rst(&self) -> TB1RST_R {
TB1RST_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn tbcmp1(&self) -> TBCMP1_R {
TBCMP1_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn tbcmp2(&self) -> TBCMP2_R {
TBCMP2_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn tc1set(&self) -> TC1SET_R {
TC1SET_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn tc1rst(&self) -> TC1RST_R {
TC1RST_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn tccmp1(&self) -> TCCMP1_R {
TCCMP1_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn tccmp2(&self) -> TCCMP2_R {
TCCMP2_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn td1set(&self) -> TD1SET_R {
TD1SET_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn td1rst(&self) -> TD1RST_R {
TD1RST_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn tdcmp1(&self) -> TDCMP1_R {
TDCMP1_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn tdcmp2(&self) -> TDCMP2_R {
TDCMP2_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn te1set(&self) -> TE1SET_R {
TE1SET_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn te1rst(&self) -> TE1RST_R {
TE1RST_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn tecmp1(&self) -> TECMP1_R {
TECMP1_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn tecmp2(&self) -> TECMP2_R {
TECMP2_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CPT1CR")
.field("tbcmp1", &self.tbcmp1())
.field("tecmp2", &self.tecmp2())
.field("tecmp1", &self.tecmp1())
.field("tb1rst", &self.tb1rst())
.field("te1rst", &self.te1rst())
.field("tb1set", &self.tb1set())
.field("te1set", &self.te1set())
.field("tdcmp2", &self.tdcmp2())
.field("tdcmp1", &self.tdcmp1())
.field("td1rst", &self.td1rst())
.field("td1set", &self.td1set())
.field("tccmp2", &self.tccmp2())
.field("tccmp1", &self.tccmp1())
.field("tc1rst", &self.tc1rst())
.field("tc1set", &self.tc1set())
.field("tbcmp2", &self.tbcmp2())
.field("exev1cpt", &self.exev1cpt())
.field("exev2cpt", &self.exev2cpt())
.field("exev3cpt", &self.exev3cpt())
.field("exev4cpt", &self.exev4cpt())
.field("exev5cpt", &self.exev5cpt())
.field("exev6cpt", &self.exev6cpt())
.field("exev7cpt", &self.exev7cpt())
.field("exev8cpt", &self.exev8cpt())
.field("exev9cpt", &self.exev9cpt())
.field("exev10cpt", &self.exev10cpt())
.field("updcpt", &self.updcpt())
.field("swcpt", &self.swcpt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn swcpt(&mut self) -> SWCPT_W<CPT1CRrs> {
SWCPT_W::new(self, 0)
}
#[inline(always)]
pub fn updcpt(&mut self) -> UPDCPT_W<CPT1CRrs> {
UPDCPT_W::new(self, 1)
}
#[inline(always)]
pub fn exevcpt(&mut self, n: u8) -> EXEVCPT_W<CPT1CRrs> {
#[allow(clippy::no_effect)] [(); 10][n as usize];
EXEVCPT_W::new(self, n + 2)
}
#[inline(always)]
pub fn exev1cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 2)
}
#[inline(always)]
pub fn exev2cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 3)
}
#[inline(always)]
pub fn exev3cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 4)
}
#[inline(always)]
pub fn exev4cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 5)
}
#[inline(always)]
pub fn exev5cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 6)
}
#[inline(always)]
pub fn exev6cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 7)
}
#[inline(always)]
pub fn exev7cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 8)
}
#[inline(always)]
pub fn exev8cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 9)
}
#[inline(always)]
pub fn exev9cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 10)
}
#[inline(always)]
pub fn exev10cpt(&mut self) -> EXEVCPT_W<CPT1CRrs> {
EXEVCPT_W::new(self, 11)
}
#[inline(always)]
pub fn tb1set(&mut self) -> TB1SET_W<CPT1CRrs> {
TB1SET_W::new(self, 16)
}
#[inline(always)]
pub fn tb1rst(&mut self) -> TB1RST_W<CPT1CRrs> {
TB1RST_W::new(self, 17)
}
#[inline(always)]
pub fn tbcmp1(&mut self) -> TBCMP1_W<CPT1CRrs> {
TBCMP1_W::new(self, 18)
}
#[inline(always)]
pub fn tbcmp2(&mut self) -> TBCMP2_W<CPT1CRrs> {
TBCMP2_W::new(self, 19)
}
#[inline(always)]
pub fn tc1set(&mut self) -> TC1SET_W<CPT1CRrs> {
TC1SET_W::new(self, 20)
}
#[inline(always)]
pub fn tc1rst(&mut self) -> TC1RST_W<CPT1CRrs> {
TC1RST_W::new(self, 21)
}
#[inline(always)]
pub fn tccmp1(&mut self) -> TCCMP1_W<CPT1CRrs> {
TCCMP1_W::new(self, 22)
}
#[inline(always)]
pub fn tccmp2(&mut self) -> TCCMP2_W<CPT1CRrs> {
TCCMP2_W::new(self, 23)
}
#[inline(always)]
pub fn td1set(&mut self) -> TD1SET_W<CPT1CRrs> {
TD1SET_W::new(self, 24)
}
#[inline(always)]
pub fn td1rst(&mut self) -> TD1RST_W<CPT1CRrs> {
TD1RST_W::new(self, 25)
}
#[inline(always)]
pub fn tdcmp1(&mut self) -> TDCMP1_W<CPT1CRrs> {
TDCMP1_W::new(self, 26)
}
#[inline(always)]
pub fn tdcmp2(&mut self) -> TDCMP2_W<CPT1CRrs> {
TDCMP2_W::new(self, 27)
}
#[inline(always)]
pub fn te1set(&mut self) -> TE1SET_W<CPT1CRrs> {
TE1SET_W::new(self, 28)
}
#[inline(always)]
pub fn te1rst(&mut self) -> TE1RST_W<CPT1CRrs> {
TE1RST_W::new(self, 29)
}
#[inline(always)]
pub fn tecmp1(&mut self) -> TECMP1_W<CPT1CRrs> {
TECMP1_W::new(self, 30)
}
#[inline(always)]
pub fn tecmp2(&mut self) -> TECMP2_W<CPT1CRrs> {
TECMP2_W::new(self, 31)
}
}
pub struct CPT1CRrs;
impl crate::RegisterSpec for CPT1CRrs {
type Ux = u32;
}
impl crate::Readable for CPT1CRrs {}
impl crate::Writable for CPT1CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CPT1CRrs {}