1#[doc = "Register `PAD_DAC%s` reader"]
2pub type R = crate::R<PAD_DAC_SPEC>;
3#[doc = "Register `PAD_DAC%s` writer"]
4pub type W = crate::W<PAD_DAC_SPEC>;
5#[doc = "Field `DAC_XPD_FORCE` reader - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
6pub type DAC_XPD_FORCE_R = crate::BitReader;
7#[doc = "Field `DAC_XPD_FORCE` writer - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
8pub type DAC_XPD_FORCE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `FUN_IE` reader - the input enable of the pad"]
10pub type FUN_IE_R = crate::BitReader;
11#[doc = "Field `FUN_IE` writer - the input enable of the pad"]
12pub type FUN_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SLP_OE` reader - the output enable of the pad in sleep status"]
14pub type SLP_OE_R = crate::BitReader;
15#[doc = "Field `SLP_OE` writer - the output enable of the pad in sleep status"]
16pub type SLP_OE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SLP_IE` reader - the input enable of the pad in sleep status"]
18pub type SLP_IE_R = crate::BitReader;
19#[doc = "Field `SLP_IE` writer - the input enable of the pad in sleep status"]
20pub type SLP_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SLP_SEL` reader - the sleep status selection signal of the pad"]
22pub type SLP_SEL_R = crate::BitReader;
23#[doc = "Field `SLP_SEL` writer - the sleep status selection signal of the pad"]
24pub type SLP_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `FUN_SEL` reader - the functional selection signal of the pad"]
26pub type FUN_SEL_R = crate::FieldReader;
27#[doc = "Field `FUN_SEL` writer - the functional selection signal of the pad"]
28pub type FUN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29#[doc = "Field `MUX_SEL` reader - Ò1Ó select the digital function Ó0Óslection the rtc function"]
30pub type MUX_SEL_R = crate::BitReader;
31#[doc = "Field `MUX_SEL` writer - Ò1Ó select the digital function Ó0Óslection the rtc function"]
32pub type MUX_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `XPD_DAC` reader - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
34pub type XPD_DAC_R = crate::BitReader;
35#[doc = "Field `XPD_DAC` writer - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
36pub type XPD_DAC_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `DAC` reader - PAD DAC1 control code."]
38pub type DAC_R = crate::FieldReader;
39#[doc = "Field `DAC` writer - PAD DAC1 control code."]
40pub type DAC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
41#[doc = "Field `RUE` reader - the pull up enable of the pad"]
42pub type RUE_R = crate::BitReader;
43#[doc = "Field `RUE` writer - the pull up enable of the pad"]
44pub type RUE_W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `RDE` reader - the pull down enable of the pad"]
46pub type RDE_R = crate::BitReader;
47#[doc = "Field `RDE` writer - the pull down enable of the pad"]
48pub type RDE_W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `HOLD` reader - hold the current value of the output when setting the hold to Ò1Ó"]
50pub type HOLD_R = crate::BitReader;
51#[doc = "Field `HOLD` writer - hold the current value of the output when setting the hold to Ò1Ó"]
52pub type HOLD_W<'a, REG> = crate::BitWriter<'a, REG>;
53#[doc = "Field `DRV` reader - the driver strength of the pad"]
54pub type DRV_R = crate::FieldReader;
55#[doc = "Field `DRV` writer - the driver strength of the pad"]
56pub type DRV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
57impl R {
58 #[doc = "Bit 10 - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
59 #[inline(always)]
60 pub fn dac_xpd_force(&self) -> DAC_XPD_FORCE_R {
61 DAC_XPD_FORCE_R::new(((self.bits >> 10) & 1) != 0)
62 }
63 #[doc = "Bit 11 - the input enable of the pad"]
64 #[inline(always)]
65 pub fn fun_ie(&self) -> FUN_IE_R {
66 FUN_IE_R::new(((self.bits >> 11) & 1) != 0)
67 }
68 #[doc = "Bit 12 - the output enable of the pad in sleep status"]
69 #[inline(always)]
70 pub fn slp_oe(&self) -> SLP_OE_R {
71 SLP_OE_R::new(((self.bits >> 12) & 1) != 0)
72 }
73 #[doc = "Bit 13 - the input enable of the pad in sleep status"]
74 #[inline(always)]
75 pub fn slp_ie(&self) -> SLP_IE_R {
76 SLP_IE_R::new(((self.bits >> 13) & 1) != 0)
77 }
78 #[doc = "Bit 14 - the sleep status selection signal of the pad"]
79 #[inline(always)]
80 pub fn slp_sel(&self) -> SLP_SEL_R {
81 SLP_SEL_R::new(((self.bits >> 14) & 1) != 0)
82 }
83 #[doc = "Bits 15:16 - the functional selection signal of the pad"]
84 #[inline(always)]
85 pub fn fun_sel(&self) -> FUN_SEL_R {
86 FUN_SEL_R::new(((self.bits >> 15) & 3) as u8)
87 }
88 #[doc = "Bit 17 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
89 #[inline(always)]
90 pub fn mux_sel(&self) -> MUX_SEL_R {
91 MUX_SEL_R::new(((self.bits >> 17) & 1) != 0)
92 }
93 #[doc = "Bit 18 - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
94 #[inline(always)]
95 pub fn xpd_dac(&self) -> XPD_DAC_R {
96 XPD_DAC_R::new(((self.bits >> 18) & 1) != 0)
97 }
98 #[doc = "Bits 19:26 - PAD DAC1 control code."]
99 #[inline(always)]
100 pub fn dac(&self) -> DAC_R {
101 DAC_R::new(((self.bits >> 19) & 0xff) as u8)
102 }
103 #[doc = "Bit 27 - the pull up enable of the pad"]
104 #[inline(always)]
105 pub fn rue(&self) -> RUE_R {
106 RUE_R::new(((self.bits >> 27) & 1) != 0)
107 }
108 #[doc = "Bit 28 - the pull down enable of the pad"]
109 #[inline(always)]
110 pub fn rde(&self) -> RDE_R {
111 RDE_R::new(((self.bits >> 28) & 1) != 0)
112 }
113 #[doc = "Bit 29 - hold the current value of the output when setting the hold to Ò1Ó"]
114 #[inline(always)]
115 pub fn hold(&self) -> HOLD_R {
116 HOLD_R::new(((self.bits >> 29) & 1) != 0)
117 }
118 #[doc = "Bits 30:31 - the driver strength of the pad"]
119 #[inline(always)]
120 pub fn drv(&self) -> DRV_R {
121 DRV_R::new(((self.bits >> 30) & 3) as u8)
122 }
123}
124#[cfg(feature = "impl-register-debug")]
125impl core::fmt::Debug for R {
126 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
127 f.debug_struct("PAD_DAC")
128 .field("dac_xpd_force", &self.dac_xpd_force())
129 .field("fun_ie", &self.fun_ie())
130 .field("slp_oe", &self.slp_oe())
131 .field("slp_ie", &self.slp_ie())
132 .field("slp_sel", &self.slp_sel())
133 .field("fun_sel", &self.fun_sel())
134 .field("mux_sel", &self.mux_sel())
135 .field("xpd_dac", &self.xpd_dac())
136 .field("dac", &self.dac())
137 .field("rue", &self.rue())
138 .field("rde", &self.rde())
139 .field("hold", &self.hold())
140 .field("drv", &self.drv())
141 .finish()
142 }
143}
144impl W {
145 #[doc = "Bit 10 - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
146 #[inline(always)]
147 pub fn dac_xpd_force(&mut self) -> DAC_XPD_FORCE_W<PAD_DAC_SPEC> {
148 DAC_XPD_FORCE_W::new(self, 10)
149 }
150 #[doc = "Bit 11 - the input enable of the pad"]
151 #[inline(always)]
152 pub fn fun_ie(&mut self) -> FUN_IE_W<PAD_DAC_SPEC> {
153 FUN_IE_W::new(self, 11)
154 }
155 #[doc = "Bit 12 - the output enable of the pad in sleep status"]
156 #[inline(always)]
157 pub fn slp_oe(&mut self) -> SLP_OE_W<PAD_DAC_SPEC> {
158 SLP_OE_W::new(self, 12)
159 }
160 #[doc = "Bit 13 - the input enable of the pad in sleep status"]
161 #[inline(always)]
162 pub fn slp_ie(&mut self) -> SLP_IE_W<PAD_DAC_SPEC> {
163 SLP_IE_W::new(self, 13)
164 }
165 #[doc = "Bit 14 - the sleep status selection signal of the pad"]
166 #[inline(always)]
167 pub fn slp_sel(&mut self) -> SLP_SEL_W<PAD_DAC_SPEC> {
168 SLP_SEL_W::new(self, 14)
169 }
170 #[doc = "Bits 15:16 - the functional selection signal of the pad"]
171 #[inline(always)]
172 pub fn fun_sel(&mut self) -> FUN_SEL_W<PAD_DAC_SPEC> {
173 FUN_SEL_W::new(self, 15)
174 }
175 #[doc = "Bit 17 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
176 #[inline(always)]
177 pub fn mux_sel(&mut self) -> MUX_SEL_W<PAD_DAC_SPEC> {
178 MUX_SEL_W::new(self, 17)
179 }
180 #[doc = "Bit 18 - Power on DAC1. Usually we need to tristate PDAC1 if we power on the DAC i.e. IE=0 OE=0 RDE=0 RUE=0"]
181 #[inline(always)]
182 pub fn xpd_dac(&mut self) -> XPD_DAC_W<PAD_DAC_SPEC> {
183 XPD_DAC_W::new(self, 18)
184 }
185 #[doc = "Bits 19:26 - PAD DAC1 control code."]
186 #[inline(always)]
187 pub fn dac(&mut self) -> DAC_W<PAD_DAC_SPEC> {
188 DAC_W::new(self, 19)
189 }
190 #[doc = "Bit 27 - the pull up enable of the pad"]
191 #[inline(always)]
192 pub fn rue(&mut self) -> RUE_W<PAD_DAC_SPEC> {
193 RUE_W::new(self, 27)
194 }
195 #[doc = "Bit 28 - the pull down enable of the pad"]
196 #[inline(always)]
197 pub fn rde(&mut self) -> RDE_W<PAD_DAC_SPEC> {
198 RDE_W::new(self, 28)
199 }
200 #[doc = "Bit 29 - hold the current value of the output when setting the hold to Ò1Ó"]
201 #[inline(always)]
202 pub fn hold(&mut self) -> HOLD_W<PAD_DAC_SPEC> {
203 HOLD_W::new(self, 29)
204 }
205 #[doc = "Bits 30:31 - the driver strength of the pad"]
206 #[inline(always)]
207 pub fn drv(&mut self) -> DRV_W<PAD_DAC_SPEC> {
208 DRV_W::new(self, 30)
209 }
210}
211#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`pad_dac::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pad_dac::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
212pub struct PAD_DAC_SPEC;
213impl crate::RegisterSpec for PAD_DAC_SPEC {
214 type Ux = u32;
215}
216#[doc = "`read()` method returns [`pad_dac::R`](R) reader structure"]
217impl crate::Readable for PAD_DAC_SPEC {}
218#[doc = "`write(|w| ..)` method takes [`pad_dac::W`](W) writer structure"]
219impl crate::Writable for PAD_DAC_SPEC {
220 type Safety = crate::Unsafe;
221}
222#[doc = "`reset()` method sets PAD_DAC%s to value 0x8000_0000"]
223impl crate::Resettable for PAD_DAC_SPEC {
224 const RESET_VALUE: u32 = 0x8000_0000;
225}