pub type R = crate::R<INPUTSELrs>;
pub type W = crate::W<INPUTSELrs>;
pub type PosselR = crate::FieldReader;
pub type PosselW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type NegselR = crate::FieldReader;
pub type NegselW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum VASEL {
Vdd = 0,
Aport2ych0 = 1,
Aport2ych2 = 3,
Aport2ych4 = 5,
Aport2ych6 = 7,
Aport2ych8 = 9,
Aport2ych10 = 11,
Aport2ych12 = 13,
Aport2ych14 = 15,
Aport2ych16 = 17,
Aport2ych18 = 19,
Aport2ych20 = 21,
Aport2ych22 = 23,
Aport2ych24 = 25,
Aport2ych26 = 27,
Aport2ych28 = 29,
Aport2ych30 = 31,
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<VASEL> for u8 {
#[inline(always)]
fn from(variant: VASEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for VASEL {
type Ux = u8;
}
impl crate::IsEnum for VASEL {}
pub type VaselR = crate::FieldReader<VASEL>;
impl VaselR {
#[inline(always)]
pub const fn variant(&self) -> Option<VASEL> {
match self.bits {
0 => Some(VASEL::Vdd),
1 => Some(VASEL::Aport2ych0),
3 => Some(VASEL::Aport2ych2),
5 => Some(VASEL::Aport2ych4),
7 => Some(VASEL::Aport2ych6),
9 => Some(VASEL::Aport2ych8),
11 => Some(VASEL::Aport2ych10),
13 => Some(VASEL::Aport2ych12),
15 => Some(VASEL::Aport2ych14),
17 => Some(VASEL::Aport2ych16),
19 => Some(VASEL::Aport2ych18),
21 => Some(VASEL::Aport2ych20),
23 => Some(VASEL::Aport2ych22),
25 => Some(VASEL::Aport2ych24),
27 => Some(VASEL::Aport2ych26),
29 => Some(VASEL::Aport2ych28),
31 => Some(VASEL::Aport2ych30),
32 => Some(VASEL::Aport1xch0),
33 => Some(VASEL::Aport1ych1),
34 => Some(VASEL::Aport1xch2),
35 => Some(VASEL::Aport1ych3),
36 => Some(VASEL::Aport1xch4),
37 => Some(VASEL::Aport1ych5),
38 => Some(VASEL::Aport1xch6),
39 => Some(VASEL::Aport1ych7),
40 => Some(VASEL::Aport1xch8),
41 => Some(VASEL::Aport1ych9),
42 => Some(VASEL::Aport1xch10),
43 => Some(VASEL::Aport1ych11),
44 => Some(VASEL::Aport1xch12),
45 => Some(VASEL::Aport1ych13),
46 => Some(VASEL::Aport1xch14),
47 => Some(VASEL::Aport1ych15),
48 => Some(VASEL::Aport1xch16),
49 => Some(VASEL::Aport1ych17),
50 => Some(VASEL::Aport1xch18),
51 => Some(VASEL::Aport1ych19),
52 => Some(VASEL::Aport1xch20),
53 => Some(VASEL::Aport1ych21),
54 => Some(VASEL::Aport1xch22),
55 => Some(VASEL::Aport1ych23),
56 => Some(VASEL::Aport1xch24),
57 => Some(VASEL::Aport1ych25),
58 => Some(VASEL::Aport1xch26),
59 => Some(VASEL::Aport1ych27),
60 => Some(VASEL::Aport1xch28),
61 => Some(VASEL::Aport1ych29),
62 => Some(VASEL::Aport1xch30),
63 => Some(VASEL::Aport1ych31),
_ => None,
}
}
#[inline(always)]
pub fn is_vdd(&self) -> bool {
*self == VASEL::Vdd
}
#[inline(always)]
pub fn is_aport2ych0(&self) -> bool {
*self == VASEL::Aport2ych0
}
#[inline(always)]
pub fn is_aport2ych2(&self) -> bool {
*self == VASEL::Aport2ych2
}
#[inline(always)]
pub fn is_aport2ych4(&self) -> bool {
*self == VASEL::Aport2ych4
}
#[inline(always)]
pub fn is_aport2ych6(&self) -> bool {
*self == VASEL::Aport2ych6
}
#[inline(always)]
pub fn is_aport2ych8(&self) -> bool {
*self == VASEL::Aport2ych8
}
#[inline(always)]
pub fn is_aport2ych10(&self) -> bool {
*self == VASEL::Aport2ych10
}
#[inline(always)]
pub fn is_aport2ych12(&self) -> bool {
*self == VASEL::Aport2ych12
}
#[inline(always)]
pub fn is_aport2ych14(&self) -> bool {
*self == VASEL::Aport2ych14
}
#[inline(always)]
pub fn is_aport2ych16(&self) -> bool {
*self == VASEL::Aport2ych16
}
#[inline(always)]
pub fn is_aport2ych18(&self) -> bool {
*self == VASEL::Aport2ych18
}
#[inline(always)]
pub fn is_aport2ych20(&self) -> bool {
*self == VASEL::Aport2ych20
}
#[inline(always)]
pub fn is_aport2ych22(&self) -> bool {
*self == VASEL::Aport2ych22
}
#[inline(always)]
pub fn is_aport2ych24(&self) -> bool {
*self == VASEL::Aport2ych24
}
#[inline(always)]
pub fn is_aport2ych26(&self) -> bool {
*self == VASEL::Aport2ych26
}
#[inline(always)]
pub fn is_aport2ych28(&self) -> bool {
*self == VASEL::Aport2ych28
}
#[inline(always)]
pub fn is_aport2ych30(&self) -> bool {
*self == VASEL::Aport2ych30
}
#[inline(always)]
pub fn is_aport1xch0(&self) -> bool {
*self == VASEL::Aport1xch0
}
#[inline(always)]
pub fn is_aport1ych1(&self) -> bool {
*self == VASEL::Aport1ych1
}
#[inline(always)]
pub fn is_aport1xch2(&self) -> bool {
*self == VASEL::Aport1xch2
}
#[inline(always)]
pub fn is_aport1ych3(&self) -> bool {
*self == VASEL::Aport1ych3
}
#[inline(always)]
pub fn is_aport1xch4(&self) -> bool {
*self == VASEL::Aport1xch4
}
#[inline(always)]
pub fn is_aport1ych5(&self) -> bool {
*self == VASEL::Aport1ych5
}
#[inline(always)]
pub fn is_aport1xch6(&self) -> bool {
*self == VASEL::Aport1xch6
}
#[inline(always)]
pub fn is_aport1ych7(&self) -> bool {
*self == VASEL::Aport1ych7
}
#[inline(always)]
pub fn is_aport1xch8(&self) -> bool {
*self == VASEL::Aport1xch8
}
#[inline(always)]
pub fn is_aport1ych9(&self) -> bool {
*self == VASEL::Aport1ych9
}
#[inline(always)]
pub fn is_aport1xch10(&self) -> bool {
*self == VASEL::Aport1xch10
}
#[inline(always)]
pub fn is_aport1ych11(&self) -> bool {
*self == VASEL::Aport1ych11
}
#[inline(always)]
pub fn is_aport1xch12(&self) -> bool {
*self == VASEL::Aport1xch12
}
#[inline(always)]
pub fn is_aport1ych13(&self) -> bool {
*self == VASEL::Aport1ych13
}
#[inline(always)]
pub fn is_aport1xch14(&self) -> bool {
*self == VASEL::Aport1xch14
}
#[inline(always)]
pub fn is_aport1ych15(&self) -> bool {
*self == VASEL::Aport1ych15
}
#[inline(always)]
pub fn is_aport1xch16(&self) -> bool {
*self == VASEL::Aport1xch16
}
#[inline(always)]
pub fn is_aport1ych17(&self) -> bool {
*self == VASEL::Aport1ych17
}
#[inline(always)]
pub fn is_aport1xch18(&self) -> bool {
*self == VASEL::Aport1xch18
}
#[inline(always)]
pub fn is_aport1ych19(&self) -> bool {
*self == VASEL::Aport1ych19
}
#[inline(always)]
pub fn is_aport1xch20(&self) -> bool {
*self == VASEL::Aport1xch20
}
#[inline(always)]
pub fn is_aport1ych21(&self) -> bool {
*self == VASEL::Aport1ych21
}
#[inline(always)]
pub fn is_aport1xch22(&self) -> bool {
*self == VASEL::Aport1xch22
}
#[inline(always)]
pub fn is_aport1ych23(&self) -> bool {
*self == VASEL::Aport1ych23
}
#[inline(always)]
pub fn is_aport1xch24(&self) -> bool {
*self == VASEL::Aport1xch24
}
#[inline(always)]
pub fn is_aport1ych25(&self) -> bool {
*self == VASEL::Aport1ych25
}
#[inline(always)]
pub fn is_aport1xch26(&self) -> bool {
*self == VASEL::Aport1xch26
}
#[inline(always)]
pub fn is_aport1ych27(&self) -> bool {
*self == VASEL::Aport1ych27
}
#[inline(always)]
pub fn is_aport1xch28(&self) -> bool {
*self == VASEL::Aport1xch28
}
#[inline(always)]
pub fn is_aport1ych29(&self) -> bool {
*self == VASEL::Aport1ych29
}
#[inline(always)]
pub fn is_aport1xch30(&self) -> bool {
*self == VASEL::Aport1xch30
}
#[inline(always)]
pub fn is_aport1ych31(&self) -> bool {
*self == VASEL::Aport1ych31
}
}
pub type VaselW<'a, REG> = crate::FieldWriter<'a, REG, 6, VASEL>;
impl<'a, REG> VaselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn vdd(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Vdd)
}
#[inline(always)]
pub fn aport2ych0(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych0)
}
#[inline(always)]
pub fn aport2ych2(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych2)
}
#[inline(always)]
pub fn aport2ych4(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych4)
}
#[inline(always)]
pub fn aport2ych6(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych6)
}
#[inline(always)]
pub fn aport2ych8(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych8)
}
#[inline(always)]
pub fn aport2ych10(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych10)
}
#[inline(always)]
pub fn aport2ych12(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych12)
}
#[inline(always)]
pub fn aport2ych14(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych14)
}
#[inline(always)]
pub fn aport2ych16(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych16)
}
#[inline(always)]
pub fn aport2ych18(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych18)
}
#[inline(always)]
pub fn aport2ych20(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych20)
}
#[inline(always)]
pub fn aport2ych22(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych22)
}
#[inline(always)]
pub fn aport2ych24(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych24)
}
#[inline(always)]
pub fn aport2ych26(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych26)
}
#[inline(always)]
pub fn aport2ych28(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych28)
}
#[inline(always)]
pub fn aport2ych30(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport2ych30)
}
#[inline(always)]
pub fn aport1xch0(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch0)
}
#[inline(always)]
pub fn aport1ych1(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych1)
}
#[inline(always)]
pub fn aport1xch2(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch2)
}
#[inline(always)]
pub fn aport1ych3(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych3)
}
#[inline(always)]
pub fn aport1xch4(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch4)
}
#[inline(always)]
pub fn aport1ych5(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych5)
}
#[inline(always)]
pub fn aport1xch6(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch6)
}
#[inline(always)]
pub fn aport1ych7(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych7)
}
#[inline(always)]
pub fn aport1xch8(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch8)
}
#[inline(always)]
pub fn aport1ych9(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych9)
}
#[inline(always)]
pub fn aport1xch10(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch10)
}
#[inline(always)]
pub fn aport1ych11(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych11)
}
#[inline(always)]
pub fn aport1xch12(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch12)
}
#[inline(always)]
pub fn aport1ych13(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych13)
}
#[inline(always)]
pub fn aport1xch14(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch14)
}
#[inline(always)]
pub fn aport1ych15(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych15)
}
#[inline(always)]
pub fn aport1xch16(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch16)
}
#[inline(always)]
pub fn aport1ych17(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych17)
}
#[inline(always)]
pub fn aport1xch18(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch18)
}
#[inline(always)]
pub fn aport1ych19(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych19)
}
#[inline(always)]
pub fn aport1xch20(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch20)
}
#[inline(always)]
pub fn aport1ych21(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych21)
}
#[inline(always)]
pub fn aport1xch22(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch22)
}
#[inline(always)]
pub fn aport1ych23(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych23)
}
#[inline(always)]
pub fn aport1xch24(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch24)
}
#[inline(always)]
pub fn aport1ych25(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych25)
}
#[inline(always)]
pub fn aport1xch26(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch26)
}
#[inline(always)]
pub fn aport1ych27(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych27)
}
#[inline(always)]
pub fn aport1xch28(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch28)
}
#[inline(always)]
pub fn aport1ych29(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych29)
}
#[inline(always)]
pub fn aport1xch30(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1xch30)
}
#[inline(always)]
pub fn aport1ych31(self) -> &'a mut crate::W<REG> {
self.variant(VASEL::Aport1ych31)
}
}
pub type VbselR = crate::BitReader;
pub type VbselW<'a, REG> = crate::BitWriter<'a, REG>;
pub type VlpselR = crate::BitReader;
pub type VlpselW<'a, REG> = crate::BitWriter<'a, REG>;
pub type CsresenR = crate::BitReader;
pub type CsresenW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CSRESSEL {
Res0 = 0,
Res1 = 1,
Res2 = 2,
Res3 = 3,
Res4 = 4,
Res5 = 5,
Res6 = 6,
Res7 = 7,
}
impl From<CSRESSEL> for u8 {
#[inline(always)]
fn from(variant: CSRESSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for CSRESSEL {
type Ux = u8;
}
impl crate::IsEnum for CSRESSEL {}
pub type CsresselR = crate::FieldReader<CSRESSEL>;
impl CsresselR {
#[inline(always)]
pub const fn variant(&self) -> CSRESSEL {
match self.bits {
0 => CSRESSEL::Res0,
1 => CSRESSEL::Res1,
2 => CSRESSEL::Res2,
3 => CSRESSEL::Res3,
4 => CSRESSEL::Res4,
5 => CSRESSEL::Res5,
6 => CSRESSEL::Res6,
7 => CSRESSEL::Res7,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_res0(&self) -> bool {
*self == CSRESSEL::Res0
}
#[inline(always)]
pub fn is_res1(&self) -> bool {
*self == CSRESSEL::Res1
}
#[inline(always)]
pub fn is_res2(&self) -> bool {
*self == CSRESSEL::Res2
}
#[inline(always)]
pub fn is_res3(&self) -> bool {
*self == CSRESSEL::Res3
}
#[inline(always)]
pub fn is_res4(&self) -> bool {
*self == CSRESSEL::Res4
}
#[inline(always)]
pub fn is_res5(&self) -> bool {
*self == CSRESSEL::Res5
}
#[inline(always)]
pub fn is_res6(&self) -> bool {
*self == CSRESSEL::Res6
}
#[inline(always)]
pub fn is_res7(&self) -> bool {
*self == CSRESSEL::Res7
}
}
pub type CsresselW<'a, REG> = crate::FieldWriter<'a, REG, 3, CSRESSEL, crate::Safe>;
impl<'a, REG> CsresselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn res0(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res0)
}
#[inline(always)]
pub fn res1(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res1)
}
#[inline(always)]
pub fn res2(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res2)
}
#[inline(always)]
pub fn res3(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res3)
}
#[inline(always)]
pub fn res4(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res4)
}
#[inline(always)]
pub fn res5(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res5)
}
#[inline(always)]
pub fn res6(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res6)
}
#[inline(always)]
pub fn res7(self) -> &'a mut crate::W<REG> {
self.variant(CSRESSEL::Res7)
}
}
impl R {
#[inline(always)]
pub fn possel(&self) -> PosselR {
PosselR::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn negsel(&self) -> NegselR {
NegselR::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn vasel(&self) -> VaselR {
VaselR::new(((self.bits >> 16) & 0x3f) as u8)
}
#[inline(always)]
pub fn vbsel(&self) -> VbselR {
VbselR::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn vlpsel(&self) -> VlpselR {
VlpselR::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn csresen(&self) -> CsresenR {
CsresenR::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn csressel(&self) -> CsresselR {
CsresselR::new(((self.bits >> 28) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("INPUTSEL")
.field("possel", &self.possel())
.field("negsel", &self.negsel())
.field("vasel", &self.vasel())
.field("vbsel", &self.vbsel())
.field("vlpsel", &self.vlpsel())
.field("csresen", &self.csresen())
.field("csressel", &self.csressel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn possel(&mut self) -> PosselW<'_, INPUTSELrs> {
PosselW::new(self, 0)
}
#[inline(always)]
pub fn negsel(&mut self) -> NegselW<'_, INPUTSELrs> {
NegselW::new(self, 8)
}
#[inline(always)]
pub fn vasel(&mut self) -> VaselW<'_, INPUTSELrs> {
VaselW::new(self, 16)
}
#[inline(always)]
pub fn vbsel(&mut self) -> VbselW<'_, INPUTSELrs> {
VbselW::new(self, 22)
}
#[inline(always)]
pub fn vlpsel(&mut self) -> VlpselW<'_, INPUTSELrs> {
VlpselW::new(self, 24)
}
#[inline(always)]
pub fn csresen(&mut self) -> CsresenW<'_, INPUTSELrs> {
CsresenW::new(self, 26)
}
#[inline(always)]
pub fn csressel(&mut self) -> CsresselW<'_, INPUTSELrs> {
CsresselW::new(self, 28)
}
}
pub struct INPUTSELrs;
impl crate::RegisterSpec for INPUTSELrs {
type Ux = u32;
}
impl crate::Readable for INPUTSELrs {}
impl crate::Writable for INPUTSELrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for INPUTSELrs {}