pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CLKOUTSEL0 {
Disabled = 0,
Ulfrco = 1,
Lfrco = 2,
Lfxo = 3,
Hfxo = 6,
Hfexpclk = 7,
Ulfrcoq = 9,
Lfrcoq = 10,
Lfxoq = 11,
Hfrcoq = 12,
Auxhfrcoq = 13,
Hfxoq = 14,
Hfsrcclk = 15,
}
impl From<CLKOUTSEL0> for u8 {
#[inline(always)]
fn from(variant: CLKOUTSEL0) -> Self {
variant as _
}
}
impl crate::FieldSpec for CLKOUTSEL0 {
type Ux = u8;
}
impl crate::IsEnum for CLKOUTSEL0 {}
pub type Clkoutsel0R = crate::FieldReader<CLKOUTSEL0>;
impl Clkoutsel0R {
#[inline(always)]
pub const fn variant(&self) -> Option<CLKOUTSEL0> {
match self.bits {
0 => Some(CLKOUTSEL0::Disabled),
1 => Some(CLKOUTSEL0::Ulfrco),
2 => Some(CLKOUTSEL0::Lfrco),
3 => Some(CLKOUTSEL0::Lfxo),
6 => Some(CLKOUTSEL0::Hfxo),
7 => Some(CLKOUTSEL0::Hfexpclk),
9 => Some(CLKOUTSEL0::Ulfrcoq),
10 => Some(CLKOUTSEL0::Lfrcoq),
11 => Some(CLKOUTSEL0::Lfxoq),
12 => Some(CLKOUTSEL0::Hfrcoq),
13 => Some(CLKOUTSEL0::Auxhfrcoq),
14 => Some(CLKOUTSEL0::Hfxoq),
15 => Some(CLKOUTSEL0::Hfsrcclk),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CLKOUTSEL0::Disabled
}
#[inline(always)]
pub fn is_ulfrco(&self) -> bool {
*self == CLKOUTSEL0::Ulfrco
}
#[inline(always)]
pub fn is_lfrco(&self) -> bool {
*self == CLKOUTSEL0::Lfrco
}
#[inline(always)]
pub fn is_lfxo(&self) -> bool {
*self == CLKOUTSEL0::Lfxo
}
#[inline(always)]
pub fn is_hfxo(&self) -> bool {
*self == CLKOUTSEL0::Hfxo
}
#[inline(always)]
pub fn is_hfexpclk(&self) -> bool {
*self == CLKOUTSEL0::Hfexpclk
}
#[inline(always)]
pub fn is_ulfrcoq(&self) -> bool {
*self == CLKOUTSEL0::Ulfrcoq
}
#[inline(always)]
pub fn is_lfrcoq(&self) -> bool {
*self == CLKOUTSEL0::Lfrcoq
}
#[inline(always)]
pub fn is_lfxoq(&self) -> bool {
*self == CLKOUTSEL0::Lfxoq
}
#[inline(always)]
pub fn is_hfrcoq(&self) -> bool {
*self == CLKOUTSEL0::Hfrcoq
}
#[inline(always)]
pub fn is_auxhfrcoq(&self) -> bool {
*self == CLKOUTSEL0::Auxhfrcoq
}
#[inline(always)]
pub fn is_hfxoq(&self) -> bool {
*self == CLKOUTSEL0::Hfxoq
}
#[inline(always)]
pub fn is_hfsrcclk(&self) -> bool {
*self == CLKOUTSEL0::Hfsrcclk
}
}
pub type Clkoutsel0W<'a, REG> = crate::FieldWriter<'a, REG, 4, CLKOUTSEL0>;
impl<'a, REG> Clkoutsel0W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Disabled)
}
#[inline(always)]
pub fn ulfrco(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Ulfrco)
}
#[inline(always)]
pub fn lfrco(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Lfrco)
}
#[inline(always)]
pub fn lfxo(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Lfxo)
}
#[inline(always)]
pub fn hfxo(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Hfxo)
}
#[inline(always)]
pub fn hfexpclk(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Hfexpclk)
}
#[inline(always)]
pub fn ulfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Ulfrcoq)
}
#[inline(always)]
pub fn lfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Lfrcoq)
}
#[inline(always)]
pub fn lfxoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Lfxoq)
}
#[inline(always)]
pub fn hfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Hfrcoq)
}
#[inline(always)]
pub fn auxhfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Auxhfrcoq)
}
#[inline(always)]
pub fn hfxoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Hfxoq)
}
#[inline(always)]
pub fn hfsrcclk(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL0::Hfsrcclk)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CLKOUTSEL1 {
Disabled = 0,
Ulfrco = 1,
Lfrco = 2,
Lfxo = 3,
Hfxo = 6,
Hfexpclk = 7,
Ulfrcoq = 9,
Lfrcoq = 10,
Lfxoq = 11,
Hfrcoq = 12,
Auxhfrcoq = 13,
Hfxoq = 14,
Hfsrcclk = 15,
}
impl From<CLKOUTSEL1> for u8 {
#[inline(always)]
fn from(variant: CLKOUTSEL1) -> Self {
variant as _
}
}
impl crate::FieldSpec for CLKOUTSEL1 {
type Ux = u8;
}
impl crate::IsEnum for CLKOUTSEL1 {}
pub type Clkoutsel1R = crate::FieldReader<CLKOUTSEL1>;
impl Clkoutsel1R {
#[inline(always)]
pub const fn variant(&self) -> Option<CLKOUTSEL1> {
match self.bits {
0 => Some(CLKOUTSEL1::Disabled),
1 => Some(CLKOUTSEL1::Ulfrco),
2 => Some(CLKOUTSEL1::Lfrco),
3 => Some(CLKOUTSEL1::Lfxo),
6 => Some(CLKOUTSEL1::Hfxo),
7 => Some(CLKOUTSEL1::Hfexpclk),
9 => Some(CLKOUTSEL1::Ulfrcoq),
10 => Some(CLKOUTSEL1::Lfrcoq),
11 => Some(CLKOUTSEL1::Lfxoq),
12 => Some(CLKOUTSEL1::Hfrcoq),
13 => Some(CLKOUTSEL1::Auxhfrcoq),
14 => Some(CLKOUTSEL1::Hfxoq),
15 => Some(CLKOUTSEL1::Hfsrcclk),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CLKOUTSEL1::Disabled
}
#[inline(always)]
pub fn is_ulfrco(&self) -> bool {
*self == CLKOUTSEL1::Ulfrco
}
#[inline(always)]
pub fn is_lfrco(&self) -> bool {
*self == CLKOUTSEL1::Lfrco
}
#[inline(always)]
pub fn is_lfxo(&self) -> bool {
*self == CLKOUTSEL1::Lfxo
}
#[inline(always)]
pub fn is_hfxo(&self) -> bool {
*self == CLKOUTSEL1::Hfxo
}
#[inline(always)]
pub fn is_hfexpclk(&self) -> bool {
*self == CLKOUTSEL1::Hfexpclk
}
#[inline(always)]
pub fn is_ulfrcoq(&self) -> bool {
*self == CLKOUTSEL1::Ulfrcoq
}
#[inline(always)]
pub fn is_lfrcoq(&self) -> bool {
*self == CLKOUTSEL1::Lfrcoq
}
#[inline(always)]
pub fn is_lfxoq(&self) -> bool {
*self == CLKOUTSEL1::Lfxoq
}
#[inline(always)]
pub fn is_hfrcoq(&self) -> bool {
*self == CLKOUTSEL1::Hfrcoq
}
#[inline(always)]
pub fn is_auxhfrcoq(&self) -> bool {
*self == CLKOUTSEL1::Auxhfrcoq
}
#[inline(always)]
pub fn is_hfxoq(&self) -> bool {
*self == CLKOUTSEL1::Hfxoq
}
#[inline(always)]
pub fn is_hfsrcclk(&self) -> bool {
*self == CLKOUTSEL1::Hfsrcclk
}
}
pub type Clkoutsel1W<'a, REG> = crate::FieldWriter<'a, REG, 4, CLKOUTSEL1>;
impl<'a, REG> Clkoutsel1W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Disabled)
}
#[inline(always)]
pub fn ulfrco(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Ulfrco)
}
#[inline(always)]
pub fn lfrco(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Lfrco)
}
#[inline(always)]
pub fn lfxo(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Lfxo)
}
#[inline(always)]
pub fn hfxo(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Hfxo)
}
#[inline(always)]
pub fn hfexpclk(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Hfexpclk)
}
#[inline(always)]
pub fn ulfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Ulfrcoq)
}
#[inline(always)]
pub fn lfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Lfrcoq)
}
#[inline(always)]
pub fn lfxoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Lfxoq)
}
#[inline(always)]
pub fn hfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Hfrcoq)
}
#[inline(always)]
pub fn auxhfrcoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Auxhfrcoq)
}
#[inline(always)]
pub fn hfxoq(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Hfxoq)
}
#[inline(always)]
pub fn hfsrcclk(self) -> &'a mut crate::W<REG> {
self.variant(CLKOUTSEL1::Hfsrcclk)
}
}
pub type WshfleR = crate::BitReader;
pub type WshfleW<'a, REG> = crate::BitWriter<'a, REG>;
pub type HfperclkenR = crate::BitReader;
pub type HfperclkenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn clkoutsel0(&self) -> Clkoutsel0R {
Clkoutsel0R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn clkoutsel1(&self) -> Clkoutsel1R {
Clkoutsel1R::new(((self.bits >> 5) & 0x0f) as u8)
}
#[inline(always)]
pub fn wshfle(&self) -> WshfleR {
WshfleR::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn hfperclken(&self) -> HfperclkenR {
HfperclkenR::new(((self.bits >> 20) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("clkoutsel0", &self.clkoutsel0())
.field("clkoutsel1", &self.clkoutsel1())
.field("wshfle", &self.wshfle())
.field("hfperclken", &self.hfperclken())
.finish()
}
}
impl W {
#[inline(always)]
pub fn clkoutsel0(&mut self) -> Clkoutsel0W<'_, CTRLrs> {
Clkoutsel0W::new(self, 0)
}
#[inline(always)]
pub fn clkoutsel1(&mut self) -> Clkoutsel1W<'_, CTRLrs> {
Clkoutsel1W::new(self, 5)
}
#[inline(always)]
pub fn wshfle(&mut self) -> WshfleW<'_, CTRLrs> {
WshfleW::new(self, 16)
}
#[inline(always)]
pub fn hfperclken(&mut self) -> HfperclkenW<'_, CTRLrs> {
HfperclkenW::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 {
const RESET_VALUE: u32 = 0x0010_0000;
}