pub type R = crate::R<PLLCFGRrs>;
pub type W = crate::W<PLLCFGRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PLL1FRACEN {
Reset = 0,
Set = 1,
}
impl From<PLL1FRACEN> for bool {
#[inline(always)]
fn from(variant: PLL1FRACEN) -> Self {
variant as u8 != 0
}
}
pub type PLL1FRACEN_R = crate::BitReader<PLL1FRACEN>;
impl PLL1FRACEN_R {
#[inline(always)]
pub const fn variant(&self) -> PLL1FRACEN {
match self.bits {
false => PLL1FRACEN::Reset,
true => PLL1FRACEN::Set,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == PLL1FRACEN::Reset
}
#[inline(always)]
pub fn is_set(&self) -> bool {
*self == PLL1FRACEN::Set
}
}
pub type PLL1FRACEN_W<'a, REG> = crate::BitWriter<'a, REG, PLL1FRACEN>;
impl<'a, REG> PLL1FRACEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(PLL1FRACEN::Reset)
}
#[inline(always)]
pub fn set_(self) -> &'a mut crate::W<REG> {
self.variant(PLL1FRACEN::Set)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PLL1VCOSEL {
WideVco = 0,
MediumVco = 1,
}
impl From<PLL1VCOSEL> for bool {
#[inline(always)]
fn from(variant: PLL1VCOSEL) -> Self {
variant as u8 != 0
}
}
pub type PLL1VCOSEL_R = crate::BitReader<PLL1VCOSEL>;
impl PLL1VCOSEL_R {
#[inline(always)]
pub const fn variant(&self) -> PLL1VCOSEL {
match self.bits {
false => PLL1VCOSEL::WideVco,
true => PLL1VCOSEL::MediumVco,
}
}
#[inline(always)]
pub fn is_wide_vco(&self) -> bool {
*self == PLL1VCOSEL::WideVco
}
#[inline(always)]
pub fn is_medium_vco(&self) -> bool {
*self == PLL1VCOSEL::MediumVco
}
}
pub type PLL1VCOSEL_W<'a, REG> = crate::BitWriter<'a, REG, PLL1VCOSEL>;
impl<'a, REG> PLL1VCOSEL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn wide_vco(self) -> &'a mut crate::W<REG> {
self.variant(PLL1VCOSEL::WideVco)
}
#[inline(always)]
pub fn medium_vco(self) -> &'a mut crate::W<REG> {
self.variant(PLL1VCOSEL::MediumVco)
}
}
pub type PLL1SSCGEN_R = crate::BitReader;
pub type PLL1SSCGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PLL1RGE {
Range1 = 0,
Range2 = 1,
Range4 = 2,
Range8 = 3,
}
impl From<PLL1RGE> for u8 {
#[inline(always)]
fn from(variant: PLL1RGE) -> Self {
variant as _
}
}
impl crate::FieldSpec for PLL1RGE {
type Ux = u8;
}
impl crate::IsEnum for PLL1RGE {}
pub type PLL1RGE_R = crate::FieldReader<PLL1RGE>;
impl PLL1RGE_R {
#[inline(always)]
pub const fn variant(&self) -> PLL1RGE {
match self.bits {
0 => PLL1RGE::Range1,
1 => PLL1RGE::Range2,
2 => PLL1RGE::Range4,
3 => PLL1RGE::Range8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_range1(&self) -> bool {
*self == PLL1RGE::Range1
}
#[inline(always)]
pub fn is_range2(&self) -> bool {
*self == PLL1RGE::Range2
}
#[inline(always)]
pub fn is_range4(&self) -> bool {
*self == PLL1RGE::Range4
}
#[inline(always)]
pub fn is_range8(&self) -> bool {
*self == PLL1RGE::Range8
}
}
pub type PLL1RGE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PLL1RGE, crate::Safe>;
impl<'a, REG> PLL1RGE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn range1(self) -> &'a mut crate::W<REG> {
self.variant(PLL1RGE::Range1)
}
#[inline(always)]
pub fn range2(self) -> &'a mut crate::W<REG> {
self.variant(PLL1RGE::Range2)
}
#[inline(always)]
pub fn range4(self) -> &'a mut crate::W<REG> {
self.variant(PLL1RGE::Range4)
}
#[inline(always)]
pub fn range8(self) -> &'a mut crate::W<REG> {
self.variant(PLL1RGE::Range8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DIVP1EN {
Disabled = 0,
Enabled = 1,
}
impl From<DIVP1EN> for bool {
#[inline(always)]
fn from(variant: DIVP1EN) -> Self {
variant as u8 != 0
}
}
pub type DIVP1EN_R = crate::BitReader<DIVP1EN>;
impl DIVP1EN_R {
#[inline(always)]
pub const fn variant(&self) -> DIVP1EN {
match self.bits {
false => DIVP1EN::Disabled,
true => DIVP1EN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DIVP1EN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DIVP1EN::Enabled
}
}
pub type DIVP1EN_W<'a, REG> = crate::BitWriter<'a, REG, DIVP1EN>;
impl<'a, REG> DIVP1EN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DIVP1EN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DIVP1EN::Enabled)
}
}
pub use DIVP1EN_R as DIVQ1EN_R;
pub use DIVP1EN_R as DIVR1EN_R;
pub use DIVP1EN_R as DIVS1EN_R;
pub use DIVP1EN_R as DIVT1EN_R;
pub use DIVP1EN_W as DIVQ1EN_W;
pub use DIVP1EN_W as DIVR1EN_W;
pub use DIVP1EN_W as DIVS1EN_W;
pub use DIVP1EN_W as DIVT1EN_W;
pub use PLL1FRACEN_R as PLL2FRACEN_R;
pub use PLL1FRACEN_W as PLL2FRACEN_W;
pub use PLL1VCOSEL_R as PLL2VCOSEL_R;
pub use PLL1VCOSEL_W as PLL2VCOSEL_W;
pub type PLL2SSCGEN_R = crate::BitReader;
pub type PLL2SSCGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub use DIVP1EN_R as DIVP2EN_R;
pub use DIVP1EN_R as DIVQ2EN_R;
pub use DIVP1EN_R as DIVR2EN_R;
pub use DIVP1EN_R as DIVS2EN_R;
pub use DIVP1EN_R as DIVT2EN_R;
pub use DIVP1EN_W as DIVP2EN_W;
pub use DIVP1EN_W as DIVQ2EN_W;
pub use DIVP1EN_W as DIVR2EN_W;
pub use DIVP1EN_W as DIVS2EN_W;
pub use DIVP1EN_W as DIVT2EN_W;
pub use PLL1FRACEN_R as PLL3FRACEN_R;
pub use PLL1FRACEN_W as PLL3FRACEN_W;
pub use PLL1RGE_R as PLL2RGE_R;
pub use PLL1RGE_W as PLL2RGE_W;
pub use PLL1VCOSEL_R as PLL3VCOSEL_R;
pub use PLL1VCOSEL_W as PLL3VCOSEL_W;
pub type PLL3SSCGEN_R = crate::BitReader;
pub type PLL3SSCGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub use DIVP1EN_R as DIVP3EN_R;
pub use DIVP1EN_R as DIVQ3EN_R;
pub use DIVP1EN_R as DIVR3EN_R;
pub use DIVP1EN_R as DIVS3EN_R;
pub use DIVP1EN_R as DIVT3EN_R;
pub use DIVP1EN_W as DIVP3EN_W;
pub use DIVP1EN_W as DIVQ3EN_W;
pub use DIVP1EN_W as DIVR3EN_W;
pub use DIVP1EN_W as DIVS3EN_W;
pub use DIVP1EN_W as DIVT3EN_W;
pub use PLL1RGE_R as PLL3RGE_R;
pub use PLL1RGE_W as PLL3RGE_W;
impl R {
#[inline(always)]
pub fn pll1fracen(&self) -> PLL1FRACEN_R {
PLL1FRACEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn pll1vcosel(&self) -> PLL1VCOSEL_R {
PLL1VCOSEL_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn pll1sscgen(&self) -> PLL1SSCGEN_R {
PLL1SSCGEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn pll1rge(&self) -> PLL1RGE_R {
PLL1RGE_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn divp1en(&self) -> DIVP1EN_R {
DIVP1EN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn divq1en(&self) -> DIVQ1EN_R {
DIVQ1EN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn divr1en(&self) -> DIVR1EN_R {
DIVR1EN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn divs1en(&self) -> DIVS1EN_R {
DIVS1EN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn divt1en(&self) -> DIVT1EN_R {
DIVT1EN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn pll2fracen(&self) -> PLL2FRACEN_R {
PLL2FRACEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn pll2vcosel(&self) -> PLL2VCOSEL_R {
PLL2VCOSEL_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn pll2sscgen(&self) -> PLL2SSCGEN_R {
PLL2SSCGEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn pll2rge(&self) -> PLL2RGE_R {
PLL2RGE_R::new(((self.bits >> 14) & 3) as u8)
}
#[inline(always)]
pub fn divp2en(&self) -> DIVP2EN_R {
DIVP2EN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn divq2en(&self) -> DIVQ2EN_R {
DIVQ2EN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn divr2en(&self) -> DIVR2EN_R {
DIVR2EN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn divs2en(&self) -> DIVS2EN_R {
DIVS2EN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn divt2en(&self) -> DIVT2EN_R {
DIVT2EN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn pll3fracen(&self) -> PLL3FRACEN_R {
PLL3FRACEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn pll3vcosel(&self) -> PLL3VCOSEL_R {
PLL3VCOSEL_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn pll3sscgen(&self) -> PLL3SSCGEN_R {
PLL3SSCGEN_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn pll3rge(&self) -> PLL3RGE_R {
PLL3RGE_R::new(((self.bits >> 25) & 3) as u8)
}
#[inline(always)]
pub fn divp3en(&self) -> DIVP3EN_R {
DIVP3EN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn divq3en(&self) -> DIVQ3EN_R {
DIVQ3EN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn divr3en(&self) -> DIVR3EN_R {
DIVR3EN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn divs3en(&self) -> DIVS3EN_R {
DIVS3EN_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn divt3en(&self) -> DIVT3EN_R {
DIVT3EN_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("PLLCFGR")
.field("pll1fracen", &self.pll1fracen())
.field("pll1vcosel", &self.pll1vcosel())
.field("pll1sscgen", &self.pll1sscgen())
.field("pll1rge", &self.pll1rge())
.field("divp1en", &self.divp1en())
.field("divq1en", &self.divq1en())
.field("divr1en", &self.divr1en())
.field("divs1en", &self.divs1en())
.field("divt1en", &self.divt1en())
.field("pll2fracen", &self.pll2fracen())
.field("pll2vcosel", &self.pll2vcosel())
.field("pll2sscgen", &self.pll2sscgen())
.field("pll2rge", &self.pll2rge())
.field("divp2en", &self.divp2en())
.field("divq2en", &self.divq2en())
.field("divr2en", &self.divr2en())
.field("divs2en", &self.divs2en())
.field("divt2en", &self.divt2en())
.field("pll3fracen", &self.pll3fracen())
.field("pll3vcosel", &self.pll3vcosel())
.field("pll3sscgen", &self.pll3sscgen())
.field("pll3rge", &self.pll3rge())
.field("divp3en", &self.divp3en())
.field("divq3en", &self.divq3en())
.field("divr3en", &self.divr3en())
.field("divs3en", &self.divs3en())
.field("divt3en", &self.divt3en())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pll1fracen(&mut self) -> PLL1FRACEN_W<PLLCFGRrs> {
PLL1FRACEN_W::new(self, 0)
}
#[inline(always)]
pub fn pll1vcosel(&mut self) -> PLL1VCOSEL_W<PLLCFGRrs> {
PLL1VCOSEL_W::new(self, 1)
}
#[inline(always)]
pub fn pll1sscgen(&mut self) -> PLL1SSCGEN_W<PLLCFGRrs> {
PLL1SSCGEN_W::new(self, 2)
}
#[inline(always)]
pub fn pll1rge(&mut self) -> PLL1RGE_W<PLLCFGRrs> {
PLL1RGE_W::new(self, 3)
}
#[inline(always)]
pub fn divp1en(&mut self) -> DIVP1EN_W<PLLCFGRrs> {
DIVP1EN_W::new(self, 5)
}
#[inline(always)]
pub fn divq1en(&mut self) -> DIVQ1EN_W<PLLCFGRrs> {
DIVQ1EN_W::new(self, 6)
}
#[inline(always)]
pub fn divr1en(&mut self) -> DIVR1EN_W<PLLCFGRrs> {
DIVR1EN_W::new(self, 7)
}
#[inline(always)]
pub fn divs1en(&mut self) -> DIVS1EN_W<PLLCFGRrs> {
DIVS1EN_W::new(self, 8)
}
#[inline(always)]
pub fn divt1en(&mut self) -> DIVT1EN_W<PLLCFGRrs> {
DIVT1EN_W::new(self, 9)
}
#[inline(always)]
pub fn pll2fracen(&mut self) -> PLL2FRACEN_W<PLLCFGRrs> {
PLL2FRACEN_W::new(self, 11)
}
#[inline(always)]
pub fn pll2vcosel(&mut self) -> PLL2VCOSEL_W<PLLCFGRrs> {
PLL2VCOSEL_W::new(self, 12)
}
#[inline(always)]
pub fn pll2sscgen(&mut self) -> PLL2SSCGEN_W<PLLCFGRrs> {
PLL2SSCGEN_W::new(self, 13)
}
#[inline(always)]
pub fn pll2rge(&mut self) -> PLL2RGE_W<PLLCFGRrs> {
PLL2RGE_W::new(self, 14)
}
#[inline(always)]
pub fn divp2en(&mut self) -> DIVP2EN_W<PLLCFGRrs> {
DIVP2EN_W::new(self, 16)
}
#[inline(always)]
pub fn divq2en(&mut self) -> DIVQ2EN_W<PLLCFGRrs> {
DIVQ2EN_W::new(self, 17)
}
#[inline(always)]
pub fn divr2en(&mut self) -> DIVR2EN_W<PLLCFGRrs> {
DIVR2EN_W::new(self, 18)
}
#[inline(always)]
pub fn divs2en(&mut self) -> DIVS2EN_W<PLLCFGRrs> {
DIVS2EN_W::new(self, 19)
}
#[inline(always)]
pub fn divt2en(&mut self) -> DIVT2EN_W<PLLCFGRrs> {
DIVT2EN_W::new(self, 20)
}
#[inline(always)]
pub fn pll3fracen(&mut self) -> PLL3FRACEN_W<PLLCFGRrs> {
PLL3FRACEN_W::new(self, 22)
}
#[inline(always)]
pub fn pll3vcosel(&mut self) -> PLL3VCOSEL_W<PLLCFGRrs> {
PLL3VCOSEL_W::new(self, 23)
}
#[inline(always)]
pub fn pll3sscgen(&mut self) -> PLL3SSCGEN_W<PLLCFGRrs> {
PLL3SSCGEN_W::new(self, 24)
}
#[inline(always)]
pub fn pll3rge(&mut self) -> PLL3RGE_W<PLLCFGRrs> {
PLL3RGE_W::new(self, 25)
}
#[inline(always)]
pub fn divp3en(&mut self) -> DIVP3EN_W<PLLCFGRrs> {
DIVP3EN_W::new(self, 27)
}
#[inline(always)]
pub fn divq3en(&mut self) -> DIVQ3EN_W<PLLCFGRrs> {
DIVQ3EN_W::new(self, 28)
}
#[inline(always)]
pub fn divr3en(&mut self) -> DIVR3EN_W<PLLCFGRrs> {
DIVR3EN_W::new(self, 29)
}
#[inline(always)]
pub fn divs3en(&mut self) -> DIVS3EN_W<PLLCFGRrs> {
DIVS3EN_W::new(self, 30)
}
#[inline(always)]
pub fn divt3en(&mut self) -> DIVT3EN_W<PLLCFGRrs> {
DIVT3EN_W::new(self, 31)
}
}
pub struct PLLCFGRrs;
impl crate::RegisterSpec for PLLCFGRrs {
type Ux = u32;
}
impl crate::Readable for PLLCFGRrs {}
impl crate::Writable for PLLCFGRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for PLLCFGRrs {}