pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
pub type EnR = crate::BitReader;
pub type EnW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CursinkR = crate::BitReader;
pub type CursinkW<'a, REG> = crate::BitWriter<'a, REG>;
pub type MinouttransR = crate::BitReader;
pub type MinouttransW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AportoutenR = crate::BitReader;
pub type AportoutenW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum APORTOUTSEL {
Aport1xch0 = 32,
Aport1ych1 = 33,
Aport1xch2 = 34,
Aport1ych3 = 35,
Aport1xch4 = 36,
Aport1ych5 = 37,
Aport1xch6 = 38,
Aport1ych7 = 39,
Aport1xch8 = 40,
Aport1ych9 = 41,
Aport1xch10 = 42,
Aport1ych11 = 43,
Aport1xch12 = 44,
Aport1ych13 = 45,
Aport1xch14 = 46,
Aport1ych15 = 47,
Aport1xch16 = 48,
Aport1ych17 = 49,
Aport1xch18 = 50,
Aport1ych19 = 51,
Aport1xch20 = 52,
Aport1ych21 = 53,
Aport1xch22 = 54,
Aport1ych23 = 55,
Aport1xch24 = 56,
Aport1ych25 = 57,
Aport1xch26 = 58,
Aport1ych27 = 59,
Aport1xch28 = 60,
Aport1ych29 = 61,
Aport1xch30 = 62,
Aport1ych31 = 63,
}
impl From<APORTOUTSEL> for u8 {
#[inline(always)]
fn from(variant: APORTOUTSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for APORTOUTSEL {
type Ux = u8;
}
impl crate::IsEnum for APORTOUTSEL {}
pub type AportoutselR = crate::FieldReader<APORTOUTSEL>;
impl AportoutselR {
#[inline(always)]
pub const fn variant(&self) -> Option<APORTOUTSEL> {
match self.bits {
32 => Some(APORTOUTSEL::Aport1xch0),
33 => Some(APORTOUTSEL::Aport1ych1),
34 => Some(APORTOUTSEL::Aport1xch2),
35 => Some(APORTOUTSEL::Aport1ych3),
36 => Some(APORTOUTSEL::Aport1xch4),
37 => Some(APORTOUTSEL::Aport1ych5),
38 => Some(APORTOUTSEL::Aport1xch6),
39 => Some(APORTOUTSEL::Aport1ych7),
40 => Some(APORTOUTSEL::Aport1xch8),
41 => Some(APORTOUTSEL::Aport1ych9),
42 => Some(APORTOUTSEL::Aport1xch10),
43 => Some(APORTOUTSEL::Aport1ych11),
44 => Some(APORTOUTSEL::Aport1xch12),
45 => Some(APORTOUTSEL::Aport1ych13),
46 => Some(APORTOUTSEL::Aport1xch14),
47 => Some(APORTOUTSEL::Aport1ych15),
48 => Some(APORTOUTSEL::Aport1xch16),
49 => Some(APORTOUTSEL::Aport1ych17),
50 => Some(APORTOUTSEL::Aport1xch18),
51 => Some(APORTOUTSEL::Aport1ych19),
52 => Some(APORTOUTSEL::Aport1xch20),
53 => Some(APORTOUTSEL::Aport1ych21),
54 => Some(APORTOUTSEL::Aport1xch22),
55 => Some(APORTOUTSEL::Aport1ych23),
56 => Some(APORTOUTSEL::Aport1xch24),
57 => Some(APORTOUTSEL::Aport1ych25),
58 => Some(APORTOUTSEL::Aport1xch26),
59 => Some(APORTOUTSEL::Aport1ych27),
60 => Some(APORTOUTSEL::Aport1xch28),
61 => Some(APORTOUTSEL::Aport1ych29),
62 => Some(APORTOUTSEL::Aport1xch30),
63 => Some(APORTOUTSEL::Aport1ych31),
_ => None,
}
}
#[inline(always)]
pub fn is_aport1xch0(&self) -> bool {
*self == APORTOUTSEL::Aport1xch0
}
#[inline(always)]
pub fn is_aport1ych1(&self) -> bool {
*self == APORTOUTSEL::Aport1ych1
}
#[inline(always)]
pub fn is_aport1xch2(&self) -> bool {
*self == APORTOUTSEL::Aport1xch2
}
#[inline(always)]
pub fn is_aport1ych3(&self) -> bool {
*self == APORTOUTSEL::Aport1ych3
}
#[inline(always)]
pub fn is_aport1xch4(&self) -> bool {
*self == APORTOUTSEL::Aport1xch4
}
#[inline(always)]
pub fn is_aport1ych5(&self) -> bool {
*self == APORTOUTSEL::Aport1ych5
}
#[inline(always)]
pub fn is_aport1xch6(&self) -> bool {
*self == APORTOUTSEL::Aport1xch6
}
#[inline(always)]
pub fn is_aport1ych7(&self) -> bool {
*self == APORTOUTSEL::Aport1ych7
}
#[inline(always)]
pub fn is_aport1xch8(&self) -> bool {
*self == APORTOUTSEL::Aport1xch8
}
#[inline(always)]
pub fn is_aport1ych9(&self) -> bool {
*self == APORTOUTSEL::Aport1ych9
}
#[inline(always)]
pub fn is_aport1xch10(&self) -> bool {
*self == APORTOUTSEL::Aport1xch10
}
#[inline(always)]
pub fn is_aport1ych11(&self) -> bool {
*self == APORTOUTSEL::Aport1ych11
}
#[inline(always)]
pub fn is_aport1xch12(&self) -> bool {
*self == APORTOUTSEL::Aport1xch12
}
#[inline(always)]
pub fn is_aport1ych13(&self) -> bool {
*self == APORTOUTSEL::Aport1ych13
}
#[inline(always)]
pub fn is_aport1xch14(&self) -> bool {
*self == APORTOUTSEL::Aport1xch14
}
#[inline(always)]
pub fn is_aport1ych15(&self) -> bool {
*self == APORTOUTSEL::Aport1ych15
}
#[inline(always)]
pub fn is_aport1xch16(&self) -> bool {
*self == APORTOUTSEL::Aport1xch16
}
#[inline(always)]
pub fn is_aport1ych17(&self) -> bool {
*self == APORTOUTSEL::Aport1ych17
}
#[inline(always)]
pub fn is_aport1xch18(&self) -> bool {
*self == APORTOUTSEL::Aport1xch18
}
#[inline(always)]
pub fn is_aport1ych19(&self) -> bool {
*self == APORTOUTSEL::Aport1ych19
}
#[inline(always)]
pub fn is_aport1xch20(&self) -> bool {
*self == APORTOUTSEL::Aport1xch20
}
#[inline(always)]
pub fn is_aport1ych21(&self) -> bool {
*self == APORTOUTSEL::Aport1ych21
}
#[inline(always)]
pub fn is_aport1xch22(&self) -> bool {
*self == APORTOUTSEL::Aport1xch22
}
#[inline(always)]
pub fn is_aport1ych23(&self) -> bool {
*self == APORTOUTSEL::Aport1ych23
}
#[inline(always)]
pub fn is_aport1xch24(&self) -> bool {
*self == APORTOUTSEL::Aport1xch24
}
#[inline(always)]
pub fn is_aport1ych25(&self) -> bool {
*self == APORTOUTSEL::Aport1ych25
}
#[inline(always)]
pub fn is_aport1xch26(&self) -> bool {
*self == APORTOUTSEL::Aport1xch26
}
#[inline(always)]
pub fn is_aport1ych27(&self) -> bool {
*self == APORTOUTSEL::Aport1ych27
}
#[inline(always)]
pub fn is_aport1xch28(&self) -> bool {
*self == APORTOUTSEL::Aport1xch28
}
#[inline(always)]
pub fn is_aport1ych29(&self) -> bool {
*self == APORTOUTSEL::Aport1ych29
}
#[inline(always)]
pub fn is_aport1xch30(&self) -> bool {
*self == APORTOUTSEL::Aport1xch30
}
#[inline(always)]
pub fn is_aport1ych31(&self) -> bool {
*self == APORTOUTSEL::Aport1ych31
}
}
pub type AportoutselW<'a, REG> = crate::FieldWriter<'a, REG, 8, APORTOUTSEL>;
impl<'a, REG> AportoutselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn aport1xch0(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch0)
}
#[inline(always)]
pub fn aport1ych1(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych1)
}
#[inline(always)]
pub fn aport1xch2(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch2)
}
#[inline(always)]
pub fn aport1ych3(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych3)
}
#[inline(always)]
pub fn aport1xch4(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch4)
}
#[inline(always)]
pub fn aport1ych5(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych5)
}
#[inline(always)]
pub fn aport1xch6(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch6)
}
#[inline(always)]
pub fn aport1ych7(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych7)
}
#[inline(always)]
pub fn aport1xch8(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch8)
}
#[inline(always)]
pub fn aport1ych9(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych9)
}
#[inline(always)]
pub fn aport1xch10(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch10)
}
#[inline(always)]
pub fn aport1ych11(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych11)
}
#[inline(always)]
pub fn aport1xch12(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch12)
}
#[inline(always)]
pub fn aport1ych13(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych13)
}
#[inline(always)]
pub fn aport1xch14(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch14)
}
#[inline(always)]
pub fn aport1ych15(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych15)
}
#[inline(always)]
pub fn aport1xch16(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch16)
}
#[inline(always)]
pub fn aport1ych17(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych17)
}
#[inline(always)]
pub fn aport1xch18(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch18)
}
#[inline(always)]
pub fn aport1ych19(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych19)
}
#[inline(always)]
pub fn aport1xch20(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch20)
}
#[inline(always)]
pub fn aport1ych21(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych21)
}
#[inline(always)]
pub fn aport1xch22(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch22)
}
#[inline(always)]
pub fn aport1ych23(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych23)
}
#[inline(always)]
pub fn aport1xch24(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch24)
}
#[inline(always)]
pub fn aport1ych25(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych25)
}
#[inline(always)]
pub fn aport1xch26(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch26)
}
#[inline(always)]
pub fn aport1ych27(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych27)
}
#[inline(always)]
pub fn aport1xch28(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch28)
}
#[inline(always)]
pub fn aport1ych29(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych29)
}
#[inline(always)]
pub fn aport1xch30(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1xch30)
}
#[inline(always)]
pub fn aport1ych31(self) -> &'a mut crate::W<REG> {
self.variant(APORTOUTSEL::Aport1ych31)
}
}
pub type PwrselR = crate::BitReader;
pub type PwrselW<'a, REG> = crate::BitWriter<'a, REG>;
pub type Em2delayR = crate::BitReader;
pub type Em2delayW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AportmasterdisR = crate::BitReader;
pub type AportmasterdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AportoutenprsR = crate::BitReader;
pub type AportoutenprsW<'a, REG> = crate::BitWriter<'a, REG>;
#[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)
}
}
impl R {
#[inline(always)]
pub fn en(&self) -> EnR {
EnR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cursink(&self) -> CursinkR {
CursinkR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn minouttrans(&self) -> MinouttransR {
MinouttransR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn aportouten(&self) -> AportoutenR {
AportoutenR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn aportoutsel(&self) -> AportoutselR {
AportoutselR::new(((self.bits >> 4) & 0xff) as u8)
}
#[inline(always)]
pub fn pwrsel(&self) -> PwrselR {
PwrselR::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn em2delay(&self) -> Em2delayR {
Em2delayR::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn aportmasterdis(&self) -> AportmasterdisR {
AportmasterdisR::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn aportoutenprs(&self) -> AportoutenprsR {
AportoutenprsR::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn prssel(&self) -> PrsselR {
PrsselR::new(((self.bits >> 20) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("en", &self.en())
.field("cursink", &self.cursink())
.field("minouttrans", &self.minouttrans())
.field("aportouten", &self.aportouten())
.field("aportoutsel", &self.aportoutsel())
.field("pwrsel", &self.pwrsel())
.field("em2delay", &self.em2delay())
.field("aportmasterdis", &self.aportmasterdis())
.field("aportoutenprs", &self.aportoutenprs())
.field("prssel", &self.prssel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn en(&mut self) -> EnW<'_, CTRLrs> {
EnW::new(self, 0)
}
#[inline(always)]
pub fn cursink(&mut self) -> CursinkW<'_, CTRLrs> {
CursinkW::new(self, 1)
}
#[inline(always)]
pub fn minouttrans(&mut self) -> MinouttransW<'_, CTRLrs> {
MinouttransW::new(self, 2)
}
#[inline(always)]
pub fn aportouten(&mut self) -> AportoutenW<'_, CTRLrs> {
AportoutenW::new(self, 3)
}
#[inline(always)]
pub fn aportoutsel(&mut self) -> AportoutselW<'_, CTRLrs> {
AportoutselW::new(self, 4)
}
#[inline(always)]
pub fn pwrsel(&mut self) -> PwrselW<'_, CTRLrs> {
PwrselW::new(self, 12)
}
#[inline(always)]
pub fn em2delay(&mut self) -> Em2delayW<'_, CTRLrs> {
Em2delayW::new(self, 13)
}
#[inline(always)]
pub fn aportmasterdis(&mut self) -> AportmasterdisW<'_, CTRLrs> {
AportmasterdisW::new(self, 14)
}
#[inline(always)]
pub fn aportoutenprs(&mut self) -> AportoutenprsW<'_, CTRLrs> {
AportoutenprsW::new(self, 16)
}
#[inline(always)]
pub fn prssel(&mut self) -> PrsselW<'_, CTRLrs> {
PrsselW::new(self, 20)
}
}
pub struct CTRLrs;
impl crate::RegisterSpec for CTRLrs {
type Ux = u32;
}
impl crate::Readable for CTRLrs {}
impl crate::Writable for CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CTRLrs {}