1#[doc = "Register `ier` reader"]
2pub struct R(crate::R<IER_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IER_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IER_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IER_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ier` writer"]
17pub struct W(crate::W<IER_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IER_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<IER_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IER_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Programmable THRE Interrupt Mode Enable\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum PTIME_A {
40    #[doc = "0: `0`"]
41    DISABLE = 0,
42    #[doc = "1: `1`"]
43    ENABLE = 1,
44}
45impl From<PTIME_A> for bool {
46    #[inline(always)]
47    fn from(variant: PTIME_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `ptime` reader - Programmable THRE Interrupt Mode Enable"]
52pub type PTIME_R = crate::BitReader<PTIME_A>;
53impl PTIME_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> PTIME_A {
57        match self.bits {
58            false => PTIME_A::DISABLE,
59            true => PTIME_A::ENABLE,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLE`"]
63    #[inline(always)]
64    pub fn is_disable(&self) -> bool {
65        *self == PTIME_A::DISABLE
66    }
67    #[doc = "Checks if the value of the field is `ENABLE`"]
68    #[inline(always)]
69    pub fn is_enable(&self) -> bool {
70        *self == PTIME_A::ENABLE
71    }
72}
73#[doc = "Field `ptime` writer - Programmable THRE Interrupt Mode Enable"]
74pub type PTIME_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, PTIME_A, O>;
75impl<'a, const O: u8> PTIME_W<'a, O> {
76    #[doc = "`0`"]
77    #[inline(always)]
78    pub fn disable(self) -> &'a mut W {
79        self.variant(PTIME_A::DISABLE)
80    }
81    #[doc = "`1`"]
82    #[inline(always)]
83    pub fn enable(self) -> &'a mut W {
84        self.variant(PTIME_A::ENABLE)
85    }
86}
87#[doc = "RS485 Interrupt Enable\n\nValue on reset: 0"]
88#[derive(Clone, Copy, Debug, PartialEq)]
89pub enum RS485_INT_EN_A {
90    #[doc = "0: `0`"]
91    DISABLE = 0,
92    #[doc = "1: `1`"]
93    ENABLE = 1,
94}
95impl From<RS485_INT_EN_A> for bool {
96    #[inline(always)]
97    fn from(variant: RS485_INT_EN_A) -> Self {
98        variant as u8 != 0
99    }
100}
101#[doc = "Field `rs485_int_en` reader - RS485 Interrupt Enable"]
102pub type RS485_INT_EN_R = crate::BitReader<RS485_INT_EN_A>;
103impl RS485_INT_EN_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> RS485_INT_EN_A {
107        match self.bits {
108            false => RS485_INT_EN_A::DISABLE,
109            true => RS485_INT_EN_A::ENABLE,
110        }
111    }
112    #[doc = "Checks if the value of the field is `DISABLE`"]
113    #[inline(always)]
114    pub fn is_disable(&self) -> bool {
115        *self == RS485_INT_EN_A::DISABLE
116    }
117    #[doc = "Checks if the value of the field is `ENABLE`"]
118    #[inline(always)]
119    pub fn is_enable(&self) -> bool {
120        *self == RS485_INT_EN_A::ENABLE
121    }
122}
123#[doc = "Field `rs485_int_en` writer - RS485 Interrupt Enable"]
124pub type RS485_INT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, RS485_INT_EN_A, O>;
125impl<'a, const O: u8> RS485_INT_EN_W<'a, O> {
126    #[doc = "`0`"]
127    #[inline(always)]
128    pub fn disable(self) -> &'a mut W {
129        self.variant(RS485_INT_EN_A::DISABLE)
130    }
131    #[doc = "`1`"]
132    #[inline(always)]
133    pub fn enable(self) -> &'a mut W {
134        self.variant(RS485_INT_EN_A::ENABLE)
135    }
136}
137#[doc = "Enable Modem Status Interrupt\n\nValue on reset: 0"]
138#[derive(Clone, Copy, Debug, PartialEq)]
139pub enum EDSSI_A {
140    #[doc = "0: `0`"]
141    DISABLE = 0,
142    #[doc = "1: `1`"]
143    ENABLE = 1,
144}
145impl From<EDSSI_A> for bool {
146    #[inline(always)]
147    fn from(variant: EDSSI_A) -> Self {
148        variant as u8 != 0
149    }
150}
151#[doc = "Field `edssi` reader - Enable Modem Status Interrupt"]
152pub type EDSSI_R = crate::BitReader<EDSSI_A>;
153impl EDSSI_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> EDSSI_A {
157        match self.bits {
158            false => EDSSI_A::DISABLE,
159            true => EDSSI_A::ENABLE,
160        }
161    }
162    #[doc = "Checks if the value of the field is `DISABLE`"]
163    #[inline(always)]
164    pub fn is_disable(&self) -> bool {
165        *self == EDSSI_A::DISABLE
166    }
167    #[doc = "Checks if the value of the field is `ENABLE`"]
168    #[inline(always)]
169    pub fn is_enable(&self) -> bool {
170        *self == EDSSI_A::ENABLE
171    }
172}
173#[doc = "Field `edssi` writer - Enable Modem Status Interrupt"]
174pub type EDSSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, EDSSI_A, O>;
175impl<'a, const O: u8> EDSSI_W<'a, O> {
176    #[doc = "`0`"]
177    #[inline(always)]
178    pub fn disable(self) -> &'a mut W {
179        self.variant(EDSSI_A::DISABLE)
180    }
181    #[doc = "`1`"]
182    #[inline(always)]
183    pub fn enable(self) -> &'a mut W {
184        self.variant(EDSSI_A::ENABLE)
185    }
186}
187#[doc = "Enable Receiver Line Status Interrupt\n\nValue on reset: 0"]
188#[derive(Clone, Copy, Debug, PartialEq)]
189pub enum ELSI_A {
190    #[doc = "0: `0`"]
191    DISABLE = 0,
192    #[doc = "1: `1`"]
193    ENABLE = 1,
194}
195impl From<ELSI_A> for bool {
196    #[inline(always)]
197    fn from(variant: ELSI_A) -> Self {
198        variant as u8 != 0
199    }
200}
201#[doc = "Field `elsi` reader - Enable Receiver Line Status Interrupt"]
202pub type ELSI_R = crate::BitReader<ELSI_A>;
203impl ELSI_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> ELSI_A {
207        match self.bits {
208            false => ELSI_A::DISABLE,
209            true => ELSI_A::ENABLE,
210        }
211    }
212    #[doc = "Checks if the value of the field is `DISABLE`"]
213    #[inline(always)]
214    pub fn is_disable(&self) -> bool {
215        *self == ELSI_A::DISABLE
216    }
217    #[doc = "Checks if the value of the field is `ENABLE`"]
218    #[inline(always)]
219    pub fn is_enable(&self) -> bool {
220        *self == ELSI_A::ENABLE
221    }
222}
223#[doc = "Field `elsi` writer - Enable Receiver Line Status Interrupt"]
224pub type ELSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, ELSI_A, O>;
225impl<'a, const O: u8> ELSI_W<'a, O> {
226    #[doc = "`0`"]
227    #[inline(always)]
228    pub fn disable(self) -> &'a mut W {
229        self.variant(ELSI_A::DISABLE)
230    }
231    #[doc = "`1`"]
232    #[inline(always)]
233    pub fn enable(self) -> &'a mut W {
234        self.variant(ELSI_A::ENABLE)
235    }
236}
237#[doc = "Enable Transmit Holding Register Empty Interrupt\n\nValue on reset: 0"]
238#[derive(Clone, Copy, Debug, PartialEq)]
239pub enum ETBEI_A {
240    #[doc = "0: `0`"]
241    DISABLE = 0,
242    #[doc = "1: `1`"]
243    ENABLE = 1,
244}
245impl From<ETBEI_A> for bool {
246    #[inline(always)]
247    fn from(variant: ETBEI_A) -> Self {
248        variant as u8 != 0
249    }
250}
251#[doc = "Field `etbei` reader - Enable Transmit Holding Register Empty Interrupt"]
252pub type ETBEI_R = crate::BitReader<ETBEI_A>;
253impl ETBEI_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> ETBEI_A {
257        match self.bits {
258            false => ETBEI_A::DISABLE,
259            true => ETBEI_A::ENABLE,
260        }
261    }
262    #[doc = "Checks if the value of the field is `DISABLE`"]
263    #[inline(always)]
264    pub fn is_disable(&self) -> bool {
265        *self == ETBEI_A::DISABLE
266    }
267    #[doc = "Checks if the value of the field is `ENABLE`"]
268    #[inline(always)]
269    pub fn is_enable(&self) -> bool {
270        *self == ETBEI_A::ENABLE
271    }
272}
273#[doc = "Field `etbei` writer - Enable Transmit Holding Register Empty Interrupt"]
274pub type ETBEI_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, ETBEI_A, O>;
275impl<'a, const O: u8> ETBEI_W<'a, O> {
276    #[doc = "`0`"]
277    #[inline(always)]
278    pub fn disable(self) -> &'a mut W {
279        self.variant(ETBEI_A::DISABLE)
280    }
281    #[doc = "`1`"]
282    #[inline(always)]
283    pub fn enable(self) -> &'a mut W {
284        self.variant(ETBEI_A::ENABLE)
285    }
286}
287#[doc = "Enable Received Data Available Interrupt\n\nValue on reset: 0"]
288#[derive(Clone, Copy, Debug, PartialEq)]
289pub enum ERBFI_A {
290    #[doc = "0: `0`"]
291    DISABLE = 0,
292    #[doc = "1: `1`"]
293    ENABLE = 1,
294}
295impl From<ERBFI_A> for bool {
296    #[inline(always)]
297    fn from(variant: ERBFI_A) -> Self {
298        variant as u8 != 0
299    }
300}
301#[doc = "Field `erbfi` reader - Enable Received Data Available Interrupt"]
302pub type ERBFI_R = crate::BitReader<ERBFI_A>;
303impl ERBFI_R {
304    #[doc = "Get enumerated values variant"]
305    #[inline(always)]
306    pub fn variant(&self) -> ERBFI_A {
307        match self.bits {
308            false => ERBFI_A::DISABLE,
309            true => ERBFI_A::ENABLE,
310        }
311    }
312    #[doc = "Checks if the value of the field is `DISABLE`"]
313    #[inline(always)]
314    pub fn is_disable(&self) -> bool {
315        *self == ERBFI_A::DISABLE
316    }
317    #[doc = "Checks if the value of the field is `ENABLE`"]
318    #[inline(always)]
319    pub fn is_enable(&self) -> bool {
320        *self == ERBFI_A::ENABLE
321    }
322}
323#[doc = "Field `erbfi` writer - Enable Received Data Available Interrupt"]
324pub type ERBFI_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, ERBFI_A, O>;
325impl<'a, const O: u8> ERBFI_W<'a, O> {
326    #[doc = "`0`"]
327    #[inline(always)]
328    pub fn disable(self) -> &'a mut W {
329        self.variant(ERBFI_A::DISABLE)
330    }
331    #[doc = "`1`"]
332    #[inline(always)]
333    pub fn enable(self) -> &'a mut W {
334        self.variant(ERBFI_A::ENABLE)
335    }
336}
337impl R {
338    #[doc = "Bit 7 - Programmable THRE Interrupt Mode Enable"]
339    #[inline(always)]
340    pub fn ptime(&self) -> PTIME_R {
341        PTIME_R::new(((self.bits >> 7) & 1) != 0)
342    }
343    #[doc = "Bit 4 - RS485 Interrupt Enable"]
344    #[inline(always)]
345    pub fn rs485_int_en(&self) -> RS485_INT_EN_R {
346        RS485_INT_EN_R::new(((self.bits >> 4) & 1) != 0)
347    }
348    #[doc = "Bit 3 - Enable Modem Status Interrupt"]
349    #[inline(always)]
350    pub fn edssi(&self) -> EDSSI_R {
351        EDSSI_R::new(((self.bits >> 3) & 1) != 0)
352    }
353    #[doc = "Bit 2 - Enable Receiver Line Status Interrupt"]
354    #[inline(always)]
355    pub fn elsi(&self) -> ELSI_R {
356        ELSI_R::new(((self.bits >> 2) & 1) != 0)
357    }
358    #[doc = "Bit 1 - Enable Transmit Holding Register Empty Interrupt"]
359    #[inline(always)]
360    pub fn etbei(&self) -> ETBEI_R {
361        ETBEI_R::new(((self.bits >> 1) & 1) != 0)
362    }
363    #[doc = "Bit 0 - Enable Received Data Available Interrupt"]
364    #[inline(always)]
365    pub fn erbfi(&self) -> ERBFI_R {
366        ERBFI_R::new((self.bits & 1) != 0)
367    }
368}
369impl W {
370    #[doc = "Bit 7 - Programmable THRE Interrupt Mode Enable"]
371    #[inline(always)]
372    pub fn ptime(&mut self) -> PTIME_W<7> {
373        PTIME_W::new(self)
374    }
375    #[doc = "Bit 4 - RS485 Interrupt Enable"]
376    #[inline(always)]
377    pub fn rs485_int_en(&mut self) -> RS485_INT_EN_W<4> {
378        RS485_INT_EN_W::new(self)
379    }
380    #[doc = "Bit 3 - Enable Modem Status Interrupt"]
381    #[inline(always)]
382    pub fn edssi(&mut self) -> EDSSI_W<3> {
383        EDSSI_W::new(self)
384    }
385    #[doc = "Bit 2 - Enable Receiver Line Status Interrupt"]
386    #[inline(always)]
387    pub fn elsi(&mut self) -> ELSI_W<2> {
388        ELSI_W::new(self)
389    }
390    #[doc = "Bit 1 - Enable Transmit Holding Register Empty Interrupt"]
391    #[inline(always)]
392    pub fn etbei(&mut self) -> ETBEI_W<1> {
393        ETBEI_W::new(self)
394    }
395    #[doc = "Bit 0 - Enable Received Data Available Interrupt"]
396    #[inline(always)]
397    pub fn erbfi(&mut self) -> ERBFI_W<0> {
398        ERBFI_W::new(self)
399    }
400    #[doc = "Writes raw bits to the register."]
401    #[inline(always)]
402    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
403        self.0.bits(bits);
404        self
405    }
406}
407#[doc = "UART Interrupt Enable Register\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 [ier](index.html) module"]
408pub struct IER_SPEC;
409impl crate::RegisterSpec for IER_SPEC {
410    type Ux = u32;
411}
412#[doc = "`read()` method returns [ier::R](R) reader structure"]
413impl crate::Readable for IER_SPEC {
414    type Reader = R;
415}
416#[doc = "`write(|w| ..)` method takes [ier::W](W) writer structure"]
417impl crate::Writable for IER_SPEC {
418    type Writer = W;
419}
420#[doc = "`reset()` method sets ier to value 0"]
421impl crate::Resettable for IER_SPEC {
422    #[inline(always)]
423    fn reset_value() -> Self::Ux {
424        0
425    }
426}