nrf5340_app_pac/clock_ns/
hfclkaudiostat.rs1#[doc = "Register `HFCLKAUDIOSTAT` reader"]
2pub struct R(crate::R<HFCLKAUDIOSTAT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HFCLKAUDIOSTAT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HFCLKAUDIOSTAT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HFCLKAUDIOSTAT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `ALWAYSRUNNING` reader - ALWAYSRUN activated"]
17pub type ALWAYSRUNNING_R = crate::BitReader<ALWAYSRUNNING_A>;
18#[doc = "ALWAYSRUN activated\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20pub enum ALWAYSRUNNING_A {
21 #[doc = "0: Automatic clock control enabled"]
22 NOT_RUNNING = 0,
23 #[doc = "1: Oscillator is always running"]
24 RUNNING = 1,
25}
26impl From<ALWAYSRUNNING_A> for bool {
27 #[inline(always)]
28 fn from(variant: ALWAYSRUNNING_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl ALWAYSRUNNING_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> ALWAYSRUNNING_A {
36 match self.bits {
37 false => ALWAYSRUNNING_A::NOT_RUNNING,
38 true => ALWAYSRUNNING_A::RUNNING,
39 }
40 }
41 #[doc = "Checks if the value of the field is `NOT_RUNNING`"]
42 #[inline(always)]
43 pub fn is_not_running(&self) -> bool {
44 *self == ALWAYSRUNNING_A::NOT_RUNNING
45 }
46 #[doc = "Checks if the value of the field is `RUNNING`"]
47 #[inline(always)]
48 pub fn is_running(&self) -> bool {
49 *self == ALWAYSRUNNING_A::RUNNING
50 }
51}
52#[doc = "Field `STATE` reader - HFCLKAUDIO state"]
53pub type STATE_R = crate::BitReader<STATE_A>;
54#[doc = "HFCLKAUDIO state\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq)]
56pub enum STATE_A {
57 #[doc = "0: HFCLKAUDIO not running"]
58 NOT_RUNNING = 0,
59 #[doc = "1: HFCLKAUDIO running"]
60 RUNNING = 1,
61}
62impl From<STATE_A> for bool {
63 #[inline(always)]
64 fn from(variant: STATE_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl STATE_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> STATE_A {
72 match self.bits {
73 false => STATE_A::NOT_RUNNING,
74 true => STATE_A::RUNNING,
75 }
76 }
77 #[doc = "Checks if the value of the field is `NOT_RUNNING`"]
78 #[inline(always)]
79 pub fn is_not_running(&self) -> bool {
80 *self == STATE_A::NOT_RUNNING
81 }
82 #[doc = "Checks if the value of the field is `RUNNING`"]
83 #[inline(always)]
84 pub fn is_running(&self) -> bool {
85 *self == STATE_A::RUNNING
86 }
87}
88impl R {
89 #[doc = "Bit 4 - ALWAYSRUN activated"]
90 #[inline(always)]
91 pub fn alwaysrunning(&self) -> ALWAYSRUNNING_R {
92 ALWAYSRUNNING_R::new(((self.bits >> 4) & 1) != 0)
93 }
94 #[doc = "Bit 16 - HFCLKAUDIO state"]
95 #[inline(always)]
96 pub fn state(&self) -> STATE_R {
97 STATE_R::new(((self.bits >> 16) & 1) != 0)
98 }
99}
100#[doc = "Status indicating which HFCLKAUDIO source is running\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hfclkaudiostat](index.html) module"]
101pub struct HFCLKAUDIOSTAT_SPEC;
102impl crate::RegisterSpec for HFCLKAUDIOSTAT_SPEC {
103 type Ux = u32;
104}
105#[doc = "`read()` method returns [hfclkaudiostat::R](R) reader structure"]
106impl crate::Readable for HFCLKAUDIOSTAT_SPEC {
107 type Reader = R;
108}
109#[doc = "`reset()` method sets HFCLKAUDIOSTAT to value 0"]
110impl crate::Resettable for HFCLKAUDIOSTAT_SPEC {
111 #[inline(always)]
112 fn reset_value() -> Self::Ux {
113 0
114 }
115}