bl702_pac/glb/
gpdac_ctrl.rs1#[doc = "Register `gpdac_ctrl` reader"]
2pub struct R(crate::R<GPDAC_CTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<GPDAC_CTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<GPDAC_CTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<GPDAC_CTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `gpdac_ctrl` writer"]
17pub struct W(crate::W<GPDAC_CTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<GPDAC_CTRL_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<GPDAC_CTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<GPDAC_CTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `gpdaca_rstn_ana` reader - "]
38pub type GPDACA_RSTN_ANA_R = crate::BitReader<bool>;
39#[doc = "Field `gpdaca_rstn_ana` writer - "]
40pub type GPDACA_RSTN_ANA_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_CTRL_SPEC, bool, O>;
41#[doc = "Field `gpdacb_rstn_ana` reader - "]
42pub type GPDACB_RSTN_ANA_R = crate::BitReader<bool>;
43#[doc = "Field `gpdacb_rstn_ana` writer - "]
44pub type GPDACB_RSTN_ANA_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_CTRL_SPEC, bool, O>;
45#[doc = "Field `gpdac_test_en` reader - "]
46pub type GPDAC_TEST_EN_R = crate::BitReader<bool>;
47#[doc = "Field `gpdac_test_en` writer - "]
48pub type GPDAC_TEST_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_CTRL_SPEC, bool, O>;
49#[doc = "Field `gpdac_ref_sel` reader - "]
50pub type GPDAC_REF_SEL_R = crate::BitReader<bool>;
51#[doc = "Field `gpdac_ref_sel` writer - "]
52pub type GPDAC_REF_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_CTRL_SPEC, bool, O>;
53#[doc = "Field `gpdac_test_sel` reader - "]
54pub type GPDAC_TEST_SEL_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `gpdac_test_sel` writer - "]
56pub type GPDAC_TEST_SEL_W<'a, const O: u8> =
57 crate::FieldWriter<'a, u32, GPDAC_CTRL_SPEC, u8, u8, 3, O>;
58#[doc = "Field `gpdac_reserved` reader - "]
59pub type GPDAC_RESERVED_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `gpdac_reserved` writer - "]
61pub type GPDAC_RESERVED_W<'a, const O: u8> =
62 crate::FieldWriter<'a, u32, GPDAC_CTRL_SPEC, u8, u8, 8, O>;
63impl R {
64 #[doc = "Bit 0"]
65 #[inline(always)]
66 pub fn gpdaca_rstn_ana(&self) -> GPDACA_RSTN_ANA_R {
67 GPDACA_RSTN_ANA_R::new((self.bits & 1) != 0)
68 }
69 #[doc = "Bit 1"]
70 #[inline(always)]
71 pub fn gpdacb_rstn_ana(&self) -> GPDACB_RSTN_ANA_R {
72 GPDACB_RSTN_ANA_R::new(((self.bits >> 1) & 1) != 0)
73 }
74 #[doc = "Bit 7"]
75 #[inline(always)]
76 pub fn gpdac_test_en(&self) -> GPDAC_TEST_EN_R {
77 GPDAC_TEST_EN_R::new(((self.bits >> 7) & 1) != 0)
78 }
79 #[doc = "Bit 8"]
80 #[inline(always)]
81 pub fn gpdac_ref_sel(&self) -> GPDAC_REF_SEL_R {
82 GPDAC_REF_SEL_R::new(((self.bits >> 8) & 1) != 0)
83 }
84 #[doc = "Bits 9:11"]
85 #[inline(always)]
86 pub fn gpdac_test_sel(&self) -> GPDAC_TEST_SEL_R {
87 GPDAC_TEST_SEL_R::new(((self.bits >> 9) & 7) as u8)
88 }
89 #[doc = "Bits 24:31"]
90 #[inline(always)]
91 pub fn gpdac_reserved(&self) -> GPDAC_RESERVED_R {
92 GPDAC_RESERVED_R::new(((self.bits >> 24) & 0xff) as u8)
93 }
94}
95impl W {
96 #[doc = "Bit 0"]
97 #[inline(always)]
98 #[must_use]
99 pub fn gpdaca_rstn_ana(&mut self) -> GPDACA_RSTN_ANA_W<0> {
100 GPDACA_RSTN_ANA_W::new(self)
101 }
102 #[doc = "Bit 1"]
103 #[inline(always)]
104 #[must_use]
105 pub fn gpdacb_rstn_ana(&mut self) -> GPDACB_RSTN_ANA_W<1> {
106 GPDACB_RSTN_ANA_W::new(self)
107 }
108 #[doc = "Bit 7"]
109 #[inline(always)]
110 #[must_use]
111 pub fn gpdac_test_en(&mut self) -> GPDAC_TEST_EN_W<7> {
112 GPDAC_TEST_EN_W::new(self)
113 }
114 #[doc = "Bit 8"]
115 #[inline(always)]
116 #[must_use]
117 pub fn gpdac_ref_sel(&mut self) -> GPDAC_REF_SEL_W<8> {
118 GPDAC_REF_SEL_W::new(self)
119 }
120 #[doc = "Bits 9:11"]
121 #[inline(always)]
122 #[must_use]
123 pub fn gpdac_test_sel(&mut self) -> GPDAC_TEST_SEL_W<9> {
124 GPDAC_TEST_SEL_W::new(self)
125 }
126 #[doc = "Bits 24:31"]
127 #[inline(always)]
128 #[must_use]
129 pub fn gpdac_reserved(&mut self) -> GPDAC_RESERVED_W<24> {
130 GPDAC_RESERVED_W::new(self)
131 }
132 #[doc = "Writes raw bits to the register."]
133 #[inline(always)]
134 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
135 self.0.bits(bits);
136 self
137 }
138}
139#[doc = "gpdac_ctrl.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpdac_ctrl](index.html) module"]
140pub struct GPDAC_CTRL_SPEC;
141impl crate::RegisterSpec for GPDAC_CTRL_SPEC {
142 type Ux = u32;
143}
144#[doc = "`read()` method returns [gpdac_ctrl::R](R) reader structure"]
145impl crate::Readable for GPDAC_CTRL_SPEC {
146 type Reader = R;
147}
148#[doc = "`write(|w| ..)` method takes [gpdac_ctrl::W](W) writer structure"]
149impl crate::Writable for GPDAC_CTRL_SPEC {
150 type Writer = W;
151 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
152 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
153}
154#[doc = "`reset()` method sets gpdac_ctrl to value 0"]
155impl crate::Resettable for GPDAC_CTRL_SPEC {
156 const RESET_VALUE: Self::Ux = 0;
157}