pub type R = crate::R<CC0_CTRLrs>;
pub type W = crate::W<CC0_CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MODE {
Off = 0,
Inputcapture = 1,
Outputcompare = 2,
Pwm = 3,
}
impl From<MODE> for u8 {
#[inline(always)]
fn from(variant: MODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for MODE {
type Ux = u8;
}
impl crate::IsEnum for MODE {}
pub type ModeR = crate::FieldReader<MODE>;
impl ModeR {
#[inline(always)]
pub const fn variant(&self) -> MODE {
match self.bits {
0 => MODE::Off,
1 => MODE::Inputcapture,
2 => MODE::Outputcompare,
3 => MODE::Pwm,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == MODE::Off
}
#[inline(always)]
pub fn is_inputcapture(&self) -> bool {
*self == MODE::Inputcapture
}
#[inline(always)]
pub fn is_outputcompare(&self) -> bool {
*self == MODE::Outputcompare
}
#[inline(always)]
pub fn is_pwm(&self) -> bool {
*self == MODE::Pwm
}
}
pub type ModeW<'a, REG> = crate::FieldWriter<'a, REG, 2, MODE, crate::Safe>;
impl<'a, REG> ModeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Off)
}
#[inline(always)]
pub fn inputcapture(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Inputcapture)
}
#[inline(always)]
pub fn outputcompare(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Outputcompare)
}
#[inline(always)]
pub fn pwm(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Pwm)
}
}
pub type OutinvR = crate::BitReader;
pub type OutinvW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CoistR = crate::BitReader;
pub type CoistW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CMOA {
None = 0,
Toggle = 1,
Clear = 2,
Set = 3,
}
impl From<CMOA> for u8 {
#[inline(always)]
fn from(variant: CMOA) -> Self {
variant as _
}
}
impl crate::FieldSpec for CMOA {
type Ux = u8;
}
impl crate::IsEnum for CMOA {}
pub type CmoaR = crate::FieldReader<CMOA>;
impl CmoaR {
#[inline(always)]
pub const fn variant(&self) -> CMOA {
match self.bits {
0 => CMOA::None,
1 => CMOA::Toggle,
2 => CMOA::Clear,
3 => CMOA::Set,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == CMOA::None
}
#[inline(always)]
pub fn is_toggle(&self) -> bool {
*self == CMOA::Toggle
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == CMOA::Clear
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == CMOA::Set
}
}
pub type CmoaW<'a, REG> = crate::FieldWriter<'a, REG, 2, CMOA, crate::Safe>;
impl<'a, REG> CmoaW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(CMOA::None)
}
#[inline(always)]
pub fn toggle(self) -> &'a mut crate::W<REG> {
self.variant(CMOA::Toggle)
}
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CMOA::Clear)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(CMOA::Set)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum COFOA {
None = 0,
Toggle = 1,
Clear = 2,
Set = 3,
}
impl From<COFOA> for u8 {
#[inline(always)]
fn from(variant: COFOA) -> Self {
variant as _
}
}
impl crate::FieldSpec for COFOA {
type Ux = u8;
}
impl crate::IsEnum for COFOA {}
pub type CofoaR = crate::FieldReader<COFOA>;
impl CofoaR {
#[inline(always)]
pub const fn variant(&self) -> COFOA {
match self.bits {
0 => COFOA::None,
1 => COFOA::Toggle,
2 => COFOA::Clear,
3 => COFOA::Set,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == COFOA::None
}
#[inline(always)]
pub fn is_toggle(&self) -> bool {
*self == COFOA::Toggle
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == COFOA::Clear
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == COFOA::Set
}
}
pub type CofoaW<'a, REG> = crate::FieldWriter<'a, REG, 2, COFOA, crate::Safe>;
impl<'a, REG> CofoaW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(COFOA::None)
}
#[inline(always)]
pub fn toggle(self) -> &'a mut crate::W<REG> {
self.variant(COFOA::Toggle)
}
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(COFOA::Clear)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(COFOA::Set)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CUFOA {
None = 0,
Toggle = 1,
Clear = 2,
Set = 3,
}
impl From<CUFOA> for u8 {
#[inline(always)]
fn from(variant: CUFOA) -> Self {
variant as _
}
}
impl crate::FieldSpec for CUFOA {
type Ux = u8;
}
impl crate::IsEnum for CUFOA {}
pub type CufoaR = crate::FieldReader<CUFOA>;
impl CufoaR {
#[inline(always)]
pub const fn variant(&self) -> CUFOA {
match self.bits {
0 => CUFOA::None,
1 => CUFOA::Toggle,
2 => CUFOA::Clear,
3 => CUFOA::Set,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == CUFOA::None
}
#[inline(always)]
pub fn is_toggle(&self) -> bool {
*self == CUFOA::Toggle
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == CUFOA::Clear
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == CUFOA::Set
}
}
pub type CufoaW<'a, REG> = crate::FieldWriter<'a, REG, 2, CUFOA, crate::Safe>;
impl<'a, REG> CufoaW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(CUFOA::None)
}
#[inline(always)]
pub fn toggle(self) -> &'a mut crate::W<REG> {
self.variant(CUFOA::Toggle)
}
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CUFOA::Clear)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(CUFOA::Set)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PRSSEL {
Prsch0 = 0,
Prsch1 = 1,
Prsch2 = 2,
Prsch3 = 3,
Prsch4 = 4,
Prsch5 = 5,
Prsch6 = 6,
Prsch7 = 7,
Prsch8 = 8,
Prsch9 = 9,
Prsch10 = 10,
Prsch11 = 11,
}
impl From<PRSSEL> for u8 {
#[inline(always)]
fn from(variant: PRSSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for PRSSEL {
type Ux = u8;
}
impl crate::IsEnum for PRSSEL {}
pub type PrsselR = crate::FieldReader<PRSSEL>;
impl PrsselR {
#[inline(always)]
pub const fn variant(&self) -> Option<PRSSEL> {
match self.bits {
0 => Some(PRSSEL::Prsch0),
1 => Some(PRSSEL::Prsch1),
2 => Some(PRSSEL::Prsch2),
3 => Some(PRSSEL::Prsch3),
4 => Some(PRSSEL::Prsch4),
5 => Some(PRSSEL::Prsch5),
6 => Some(PRSSEL::Prsch6),
7 => Some(PRSSEL::Prsch7),
8 => Some(PRSSEL::Prsch8),
9 => Some(PRSSEL::Prsch9),
10 => Some(PRSSEL::Prsch10),
11 => Some(PRSSEL::Prsch11),
_ => None,
}
}
#[inline(always)]
pub fn is_prsch0(&self) -> bool {
*self == PRSSEL::Prsch0
}
#[inline(always)]
pub fn is_prsch1(&self) -> bool {
*self == PRSSEL::Prsch1
}
#[inline(always)]
pub fn is_prsch2(&self) -> bool {
*self == PRSSEL::Prsch2
}
#[inline(always)]
pub fn is_prsch3(&self) -> bool {
*self == PRSSEL::Prsch3
}
#[inline(always)]
pub fn is_prsch4(&self) -> bool {
*self == PRSSEL::Prsch4
}
#[inline(always)]
pub fn is_prsch5(&self) -> bool {
*self == PRSSEL::Prsch5
}
#[inline(always)]
pub fn is_prsch6(&self) -> bool {
*self == PRSSEL::Prsch6
}
#[inline(always)]
pub fn is_prsch7(&self) -> bool {
*self == PRSSEL::Prsch7
}
#[inline(always)]
pub fn is_prsch8(&self) -> bool {
*self == PRSSEL::Prsch8
}
#[inline(always)]
pub fn is_prsch9(&self) -> bool {
*self == PRSSEL::Prsch9
}
#[inline(always)]
pub fn is_prsch10(&self) -> bool {
*self == PRSSEL::Prsch10
}
#[inline(always)]
pub fn is_prsch11(&self) -> bool {
*self == PRSSEL::Prsch11
}
}
pub type PrsselW<'a, REG> = crate::FieldWriter<'a, REG, 4, PRSSEL>;
impl<'a, REG> PrsselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn prsch0(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch0)
}
#[inline(always)]
pub fn prsch1(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch1)
}
#[inline(always)]
pub fn prsch2(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch2)
}
#[inline(always)]
pub fn prsch3(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch3)
}
#[inline(always)]
pub fn prsch4(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch4)
}
#[inline(always)]
pub fn prsch5(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch5)
}
#[inline(always)]
pub fn prsch6(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch6)
}
#[inline(always)]
pub fn prsch7(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch7)
}
#[inline(always)]
pub fn prsch8(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch8)
}
#[inline(always)]
pub fn prsch9(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch9)
}
#[inline(always)]
pub fn prsch10(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch10)
}
#[inline(always)]
pub fn prsch11(self) -> &'a mut crate::W<REG> {
self.variant(PRSSEL::Prsch11)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ICEDGE {
Rising = 0,
Falling = 1,
Both = 2,
None = 3,
}
impl From<ICEDGE> for u8 {
#[inline(always)]
fn from(variant: ICEDGE) -> Self {
variant as _
}
}
impl crate::FieldSpec for ICEDGE {
type Ux = u8;
}
impl crate::IsEnum for ICEDGE {}
pub type IcedgeR = crate::FieldReader<ICEDGE>;
impl IcedgeR {
#[inline(always)]
pub const fn variant(&self) -> ICEDGE {
match self.bits {
0 => ICEDGE::Rising,
1 => ICEDGE::Falling,
2 => ICEDGE::Both,
3 => ICEDGE::None,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_rising(&self) -> bool {
*self == ICEDGE::Rising
}
#[inline(always)]
pub fn is_falling(&self) -> bool {
*self == ICEDGE::Falling
}
#[inline(always)]
pub fn is_both(&self) -> bool {
*self == ICEDGE::Both
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == ICEDGE::None
}
}
pub type IcedgeW<'a, REG> = crate::FieldWriter<'a, REG, 2, ICEDGE, crate::Safe>;
impl<'a, REG> IcedgeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn rising(self) -> &'a mut crate::W<REG> {
self.variant(ICEDGE::Rising)
}
#[inline(always)]
pub fn falling(self) -> &'a mut crate::W<REG> {
self.variant(ICEDGE::Falling)
}
#[inline(always)]
pub fn both(self) -> &'a mut crate::W<REG> {
self.variant(ICEDGE::Both)
}
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(ICEDGE::None)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ICEVCTRL {
Everyedge = 0,
Everysecondedge = 1,
Rising = 2,
Falling = 3,
}
impl From<ICEVCTRL> for u8 {
#[inline(always)]
fn from(variant: ICEVCTRL) -> Self {
variant as _
}
}
impl crate::FieldSpec for ICEVCTRL {
type Ux = u8;
}
impl crate::IsEnum for ICEVCTRL {}
pub type IcevctrlR = crate::FieldReader<ICEVCTRL>;
impl IcevctrlR {
#[inline(always)]
pub const fn variant(&self) -> ICEVCTRL {
match self.bits {
0 => ICEVCTRL::Everyedge,
1 => ICEVCTRL::Everysecondedge,
2 => ICEVCTRL::Rising,
3 => ICEVCTRL::Falling,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_everyedge(&self) -> bool {
*self == ICEVCTRL::Everyedge
}
#[inline(always)]
pub fn is_everysecondedge(&self) -> bool {
*self == ICEVCTRL::Everysecondedge
}
#[inline(always)]
pub fn is_rising(&self) -> bool {
*self == ICEVCTRL::Rising
}
#[inline(always)]
pub fn is_falling(&self) -> bool {
*self == ICEVCTRL::Falling
}
}
pub type IcevctrlW<'a, REG> = crate::FieldWriter<'a, REG, 2, ICEVCTRL, crate::Safe>;
impl<'a, REG> IcevctrlW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn everyedge(self) -> &'a mut crate::W<REG> {
self.variant(ICEVCTRL::Everyedge)
}
#[inline(always)]
pub fn everysecondedge(self) -> &'a mut crate::W<REG> {
self.variant(ICEVCTRL::Everysecondedge)
}
#[inline(always)]
pub fn rising(self) -> &'a mut crate::W<REG> {
self.variant(ICEVCTRL::Rising)
}
#[inline(always)]
pub fn falling(self) -> &'a mut crate::W<REG> {
self.variant(ICEVCTRL::Falling)
}
}
pub type PrsconfR = crate::BitReader;
pub type PrsconfW<'a, REG> = crate::BitWriter<'a, REG>;
pub type InselR = crate::BitReader;
pub type InselW<'a, REG> = crate::BitWriter<'a, REG>;
pub type FiltR = crate::BitReader;
pub type FiltW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn mode(&self) -> ModeR {
ModeR::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn outinv(&self) -> OutinvR {
OutinvR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn coist(&self) -> CoistR {
CoistR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn cmoa(&self) -> CmoaR {
CmoaR::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn cofoa(&self) -> CofoaR {
CofoaR::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn cufoa(&self) -> CufoaR {
CufoaR::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn prssel(&self) -> PrsselR {
PrsselR::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn icedge(&self) -> IcedgeR {
IcedgeR::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn icevctrl(&self) -> IcevctrlR {
IcevctrlR::new(((self.bits >> 26) & 3) as u8)
}
#[inline(always)]
pub fn prsconf(&self) -> PrsconfR {
PrsconfR::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn insel(&self) -> InselR {
InselR::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn filt(&self) -> FiltR {
FiltR::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CC0_CTRL")
.field("mode", &self.mode())
.field("outinv", &self.outinv())
.field("coist", &self.coist())
.field("cmoa", &self.cmoa())
.field("cofoa", &self.cofoa())
.field("cufoa", &self.cufoa())
.field("prssel", &self.prssel())
.field("icedge", &self.icedge())
.field("icevctrl", &self.icevctrl())
.field("prsconf", &self.prsconf())
.field("insel", &self.insel())
.field("filt", &self.filt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mode(&mut self) -> ModeW<'_, CC0_CTRLrs> {
ModeW::new(self, 0)
}
#[inline(always)]
pub fn outinv(&mut self) -> OutinvW<'_, CC0_CTRLrs> {
OutinvW::new(self, 2)
}
#[inline(always)]
pub fn coist(&mut self) -> CoistW<'_, CC0_CTRLrs> {
CoistW::new(self, 4)
}
#[inline(always)]
pub fn cmoa(&mut self) -> CmoaW<'_, CC0_CTRLrs> {
CmoaW::new(self, 8)
}
#[inline(always)]
pub fn cofoa(&mut self) -> CofoaW<'_, CC0_CTRLrs> {
CofoaW::new(self, 10)
}
#[inline(always)]
pub fn cufoa(&mut self) -> CufoaW<'_, CC0_CTRLrs> {
CufoaW::new(self, 12)
}
#[inline(always)]
pub fn prssel(&mut self) -> PrsselW<'_, CC0_CTRLrs> {
PrsselW::new(self, 16)
}
#[inline(always)]
pub fn icedge(&mut self) -> IcedgeW<'_, CC0_CTRLrs> {
IcedgeW::new(self, 24)
}
#[inline(always)]
pub fn icevctrl(&mut self) -> IcevctrlW<'_, CC0_CTRLrs> {
IcevctrlW::new(self, 26)
}
#[inline(always)]
pub fn prsconf(&mut self) -> PrsconfW<'_, CC0_CTRLrs> {
PrsconfW::new(self, 28)
}
#[inline(always)]
pub fn insel(&mut self) -> InselW<'_, CC0_CTRLrs> {
InselW::new(self, 29)
}
#[inline(always)]
pub fn filt(&mut self) -> FiltW<'_, CC0_CTRLrs> {
FiltW::new(self, 30)
}
}
pub struct CC0_CTRLrs;
impl crate::RegisterSpec for CC0_CTRLrs {
type Ux = u32;
}
impl crate::Readable for CC0_CTRLrs {}
impl crate::Writable for CC0_CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CC0_CTRLrs {}