pub type R = crate::R<SINGLECTRLXrs>;
pub type W = crate::W<SINGLECTRLXrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum VREFSEL {
Vbgr = 0,
Vddxwatt = 1,
Vrefpwatt = 2,
Vrefp = 3,
Ventropy = 4,
Vrefpnwatt = 5,
Vrefpn = 6,
Vbgrlow = 7,
}
impl From<VREFSEL> for u8 {
#[inline(always)]
fn from(variant: VREFSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for VREFSEL {
type Ux = u8;
}
impl crate::IsEnum for VREFSEL {}
pub type VrefselR = crate::FieldReader<VREFSEL>;
impl VrefselR {
#[inline(always)]
pub const fn variant(&self) -> VREFSEL {
match self.bits {
0 => VREFSEL::Vbgr,
1 => VREFSEL::Vddxwatt,
2 => VREFSEL::Vrefpwatt,
3 => VREFSEL::Vrefp,
4 => VREFSEL::Ventropy,
5 => VREFSEL::Vrefpnwatt,
6 => VREFSEL::Vrefpn,
7 => VREFSEL::Vbgrlow,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_vbgr(&self) -> bool {
*self == VREFSEL::Vbgr
}
#[inline(always)]
pub fn is_vddxwatt(&self) -> bool {
*self == VREFSEL::Vddxwatt
}
#[inline(always)]
pub fn is_vrefpwatt(&self) -> bool {
*self == VREFSEL::Vrefpwatt
}
#[inline(always)]
pub fn is_vrefp(&self) -> bool {
*self == VREFSEL::Vrefp
}
#[inline(always)]
pub fn is_ventropy(&self) -> bool {
*self == VREFSEL::Ventropy
}
#[inline(always)]
pub fn is_vrefpnwatt(&self) -> bool {
*self == VREFSEL::Vrefpnwatt
}
#[inline(always)]
pub fn is_vrefpn(&self) -> bool {
*self == VREFSEL::Vrefpn
}
#[inline(always)]
pub fn is_vbgrlow(&self) -> bool {
*self == VREFSEL::Vbgrlow
}
}
pub type VrefselW<'a, REG> = crate::FieldWriter<'a, REG, 3, VREFSEL, crate::Safe>;
impl<'a, REG> VrefselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn vbgr(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vbgr)
}
#[inline(always)]
pub fn vddxwatt(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vddxwatt)
}
#[inline(always)]
pub fn vrefpwatt(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vrefpwatt)
}
#[inline(always)]
pub fn vrefp(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vrefp)
}
#[inline(always)]
pub fn ventropy(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Ventropy)
}
#[inline(always)]
pub fn vrefpnwatt(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vrefpnwatt)
}
#[inline(always)]
pub fn vrefpn(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vrefpn)
}
#[inline(always)]
pub fn vbgrlow(self) -> &'a mut crate::W<REG> {
self.variant(VREFSEL::Vbgrlow)
}
}
pub type VrefattfixR = crate::BitReader;
pub type VrefattfixW<'a, REG> = crate::BitWriter<'a, REG>;
pub type VrefattR = crate::FieldReader;
pub type VrefattW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type VinattR = crate::FieldReader;
pub type VinattW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type DvlR = crate::FieldReader;
pub type DvlW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type FifoofactR = crate::BitReader;
pub type FifoofactW<'a, REG> = crate::BitWriter<'a, REG>;
pub type PrsmodeR = crate::BitReader;
pub type PrsmodeW<'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)
}
}
pub type ConvstartdelayR = crate::FieldReader;
pub type ConvstartdelayW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type ConvstartdelayenR = crate::BitReader;
pub type ConvstartdelayenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn vrefsel(&self) -> VrefselR {
VrefselR::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn vrefattfix(&self) -> VrefattfixR {
VrefattfixR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn vrefatt(&self) -> VrefattR {
VrefattR::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn vinatt(&self) -> VinattR {
VinattR::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn dvl(&self) -> DvlR {
DvlR::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn fifoofact(&self) -> FifoofactR {
FifoofactR::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn prsmode(&self) -> PrsmodeR {
PrsmodeR::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn prssel(&self) -> PrsselR {
PrsselR::new(((self.bits >> 17) & 0x0f) as u8)
}
#[inline(always)]
pub fn convstartdelay(&self) -> ConvstartdelayR {
ConvstartdelayR::new(((self.bits >> 24) & 7) as u8)
}
#[inline(always)]
pub fn convstartdelayen(&self) -> ConvstartdelayenR {
ConvstartdelayenR::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SINGLECTRLX")
.field("vrefsel", &self.vrefsel())
.field("vrefattfix", &self.vrefattfix())
.field("vrefatt", &self.vrefatt())
.field("vinatt", &self.vinatt())
.field("dvl", &self.dvl())
.field("fifoofact", &self.fifoofact())
.field("prsmode", &self.prsmode())
.field("prssel", &self.prssel())
.field("convstartdelay", &self.convstartdelay())
.field("convstartdelayen", &self.convstartdelayen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn vrefsel(&mut self) -> VrefselW<'_, SINGLECTRLXrs> {
VrefselW::new(self, 0)
}
#[inline(always)]
pub fn vrefattfix(&mut self) -> VrefattfixW<'_, SINGLECTRLXrs> {
VrefattfixW::new(self, 3)
}
#[inline(always)]
pub fn vrefatt(&mut self) -> VrefattW<'_, SINGLECTRLXrs> {
VrefattW::new(self, 4)
}
#[inline(always)]
pub fn vinatt(&mut self) -> VinattW<'_, SINGLECTRLXrs> {
VinattW::new(self, 8)
}
#[inline(always)]
pub fn dvl(&mut self) -> DvlW<'_, SINGLECTRLXrs> {
DvlW::new(self, 12)
}
#[inline(always)]
pub fn fifoofact(&mut self) -> FifoofactW<'_, SINGLECTRLXrs> {
FifoofactW::new(self, 14)
}
#[inline(always)]
pub fn prsmode(&mut self) -> PrsmodeW<'_, SINGLECTRLXrs> {
PrsmodeW::new(self, 16)
}
#[inline(always)]
pub fn prssel(&mut self) -> PrsselW<'_, SINGLECTRLXrs> {
PrsselW::new(self, 17)
}
#[inline(always)]
pub fn convstartdelay(&mut self) -> ConvstartdelayW<'_, SINGLECTRLXrs> {
ConvstartdelayW::new(self, 24)
}
#[inline(always)]
pub fn convstartdelayen(&mut self) -> ConvstartdelayenW<'_, SINGLECTRLXrs> {
ConvstartdelayenW::new(self, 27)
}
}
pub struct SINGLECTRLXrs;
impl crate::RegisterSpec for SINGLECTRLXrs {
type Ux = u32;
}
impl crate::Readable for SINGLECTRLXrs {}
impl crate::Writable for SINGLECTRLXrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SINGLECTRLXrs {}