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 TA1SET {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TA1SET> for bool {
#[inline(always)]
fn from(variant: TA1SET) -> Self {
variant as u8 != 0
}
}
pub type TA1SET_R = crate::BitReader<TA1SET>;
impl TA1SET_R {
#[inline(always)]
pub const fn variant(&self) -> TA1SET {
match self.bits {
false => TA1SET::NoEffect,
true => TA1SET::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TA1SET::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TA1SET::TriggerCapture
}
}
pub type TA1SET_W<'a, REG> = crate::BitWriter<'a, REG, TA1SET>;
impl<'a, REG> TA1SET_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TA1SET::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TA1SET::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TA1RST {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TA1RST> for bool {
#[inline(always)]
fn from(variant: TA1RST) -> Self {
variant as u8 != 0
}
}
pub type TA1RST_R = crate::BitReader<TA1RST>;
impl TA1RST_R {
#[inline(always)]
pub const fn variant(&self) -> TA1RST {
match self.bits {
false => TA1RST::NoEffect,
true => TA1RST::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TA1RST::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TA1RST::TriggerCapture
}
}
pub type TA1RST_W<'a, REG> = crate::BitWriter<'a, REG, TA1RST>;
impl<'a, REG> TA1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TA1RST::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TA1RST::TriggerCapture)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TACMP1 {
NoEffect = 0,
TriggerCapture = 1,
}
impl From<TACMP1> for bool {
#[inline(always)]
fn from(variant: TACMP1) -> Self {
variant as u8 != 0
}
}
pub type TACMP1_R = crate::BitReader<TACMP1>;
impl TACMP1_R {
#[inline(always)]
pub const fn variant(&self) -> TACMP1 {
match self.bits {
false => TACMP1::NoEffect,
true => TACMP1::TriggerCapture,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == TACMP1::NoEffect
}
#[inline(always)]
pub fn is_trigger_capture(&self) -> bool {
*self == TACMP1::TriggerCapture
}
}
pub type TACMP1_W<'a, REG> = crate::BitWriter<'a, REG, TACMP1>;
impl<'a, REG> TACMP1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(TACMP1::NoEffect)
}
#[inline(always)]
pub fn trigger_capture(self) -> &'a mut crate::W<REG> {
self.variant(TACMP1::TriggerCapture)
}
}
pub use TA1RST_R as TB1RST_R;
pub use TA1RST_R as TD1RST_R;
pub use TA1RST_R as TE1RST_R;
pub use TA1RST_W as TB1RST_W;
pub use TA1RST_W as TD1RST_W;
pub use TA1RST_W as TE1RST_W;
pub use TA1SET_R as TB1SET_R;
pub use TA1SET_R as TD1SET_R;
pub use TA1SET_R as TE1SET_R;
pub use TA1SET_W as TB1SET_W;
pub use TA1SET_W as TD1SET_W;
pub use TA1SET_W as TE1SET_W;
pub use TACMP1_R as TACMP2_R;
pub use TACMP1_R as TBCMP1_R;
pub use TACMP1_R as TBCMP2_R;
pub use TACMP1_R as TDCMP1_R;
pub use TACMP1_R as TDCMP2_R;
pub use TACMP1_R as TECMP1_R;
pub use TACMP1_R as TECMP2_R;
pub use TACMP1_W as TACMP2_W;
pub use TACMP1_W as TBCMP1_W;
pub use TACMP1_W as TBCMP2_W;
pub use TACMP1_W as TDCMP1_W;
pub use TACMP1_W as TDCMP2_W;
pub use TACMP1_W as TECMP1_W;
pub use TACMP1_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 ta1set(&self) -> TA1SET_R {
TA1SET_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn ta1rst(&self) -> TA1RST_R {
TA1RST_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn tacmp1(&self) -> TACMP1_R {
TACMP1_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn tacmp2(&self) -> TACMP2_R {
TACMP2_R::new(((self.bits >> 15) & 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 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("tacmp1", &self.tacmp1())
.field("tecmp2", &self.tecmp2())
.field("tecmp1", &self.tecmp1())
.field("ta1rst", &self.ta1rst())
.field("te1rst", &self.te1rst())
.field("ta1set", &self.ta1set())
.field("te1set", &self.te1set())
.field("tdcmp2", &self.tdcmp2())
.field("tdcmp1", &self.tdcmp1())
.field("td1rst", &self.td1rst())
.field("td1set", &self.td1set())
.field("tbcmp2", &self.tbcmp2())
.field("tbcmp1", &self.tbcmp1())
.field("tb1rst", &self.tb1rst())
.field("tb1set", &self.tb1set())
.field("tacmp2", &self.tacmp2())
.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 ta1set(&mut self) -> TA1SET_W<CPT1CRrs> {
TA1SET_W::new(self, 12)
}
#[inline(always)]
pub fn ta1rst(&mut self) -> TA1RST_W<CPT1CRrs> {
TA1RST_W::new(self, 13)
}
#[inline(always)]
pub fn tacmp1(&mut self) -> TACMP1_W<CPT1CRrs> {
TACMP1_W::new(self, 14)
}
#[inline(always)]
pub fn tacmp2(&mut self) -> TACMP2_W<CPT1CRrs> {
TACMP2_W::new(self, 15)
}
#[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 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 {}