lpc13xx_pac/lpc1311/uart/
ier.rs

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 = "Field `RBRIE` reader - Interrupt Enable. Enables the Receive Data Available interrupt for UART. It also controls the Character Receive Time-out interrupt."]
38pub type RBRIE_R = crate::BitReader<RBRIE_A>;
39#[doc = "Interrupt Enable. Enables the Receive Data Available interrupt for UART. It also controls the Character Receive Time-out interrupt.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum RBRIE_A {
42    #[doc = "0: Disable the RDA interrupt."]
43    DISABLE = 0,
44    #[doc = "1: Enable the RDA interrupt."]
45    ENABLE = 1,
46}
47impl From<RBRIE_A> for bool {
48    #[inline(always)]
49    fn from(variant: RBRIE_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl RBRIE_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> RBRIE_A {
57        match self.bits {
58            false => RBRIE_A::DISABLE,
59            true => RBRIE_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 == RBRIE_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 == RBRIE_A::ENABLE
71    }
72}
73#[doc = "Field `RBRIE` writer - Interrupt Enable. Enables the Receive Data Available interrupt for UART. It also controls the Character Receive Time-out interrupt."]
74pub type RBRIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, RBRIE_A, O>;
75impl<'a, const O: u8> RBRIE_W<'a, O> {
76    #[doc = "Disable the RDA interrupt."]
77    #[inline(always)]
78    pub fn disable(self) -> &'a mut W {
79        self.variant(RBRIE_A::DISABLE)
80    }
81    #[doc = "Enable the RDA interrupt."]
82    #[inline(always)]
83    pub fn enable(self) -> &'a mut W {
84        self.variant(RBRIE_A::ENABLE)
85    }
86}
87#[doc = "Field `THREIE` reader - Interrupt Enable. Enables the THRE interrupt for UART. The status of this interrupt can be read from LSR\\[5\\]."]
88pub type THREIE_R = crate::BitReader<THREIE_A>;
89#[doc = "Interrupt Enable. Enables the THRE interrupt for UART. The status of this interrupt can be read from LSR\\[5\\].\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq)]
91pub enum THREIE_A {
92    #[doc = "0: Disable the THRE interrupt."]
93    DISABLE = 0,
94    #[doc = "1: Enable the THRE interrupt."]
95    ENABLE = 1,
96}
97impl From<THREIE_A> for bool {
98    #[inline(always)]
99    fn from(variant: THREIE_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl THREIE_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> THREIE_A {
107        match self.bits {
108            false => THREIE_A::DISABLE,
109            true => THREIE_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 == THREIE_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 == THREIE_A::ENABLE
121    }
122}
123#[doc = "Field `THREIE` writer - Interrupt Enable. Enables the THRE interrupt for UART. The status of this interrupt can be read from LSR\\[5\\]."]
124pub type THREIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, THREIE_A, O>;
125impl<'a, const O: u8> THREIE_W<'a, O> {
126    #[doc = "Disable the THRE interrupt."]
127    #[inline(always)]
128    pub fn disable(self) -> &'a mut W {
129        self.variant(THREIE_A::DISABLE)
130    }
131    #[doc = "Enable the THRE interrupt."]
132    #[inline(always)]
133    pub fn enable(self) -> &'a mut W {
134        self.variant(THREIE_A::ENABLE)
135    }
136}
137#[doc = "Field `RXLIE` reader - Line Interrupt Enable. Enables the UART RX line status interrupts. The status of this interrupt can be read from LSR\\[4:1\\]."]
138pub type RXLIE_R = crate::BitReader<RXLIE_A>;
139#[doc = "Line Interrupt Enable. Enables the UART RX line status interrupts. The status of this interrupt can be read from LSR\\[4:1\\].\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum RXLIE_A {
142    #[doc = "0: Disable the RX line status interrupts."]
143    DISABLE = 0,
144    #[doc = "1: Enable the RX line status interrupts."]
145    ENABLE = 1,
146}
147impl From<RXLIE_A> for bool {
148    #[inline(always)]
149    fn from(variant: RXLIE_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl RXLIE_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> RXLIE_A {
157        match self.bits {
158            false => RXLIE_A::DISABLE,
159            true => RXLIE_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 == RXLIE_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 == RXLIE_A::ENABLE
171    }
172}
173#[doc = "Field `RXLIE` writer - Line Interrupt Enable. Enables the UART RX line status interrupts. The status of this interrupt can be read from LSR\\[4:1\\]."]
174pub type RXLIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, RXLIE_A, O>;
175impl<'a, const O: u8> RXLIE_W<'a, O> {
176    #[doc = "Disable the RX line status interrupts."]
177    #[inline(always)]
178    pub fn disable(self) -> &'a mut W {
179        self.variant(RXLIE_A::DISABLE)
180    }
181    #[doc = "Enable the RX line status interrupts."]
182    #[inline(always)]
183    pub fn enable(self) -> &'a mut W {
184        self.variant(RXLIE_A::ENABLE)
185    }
186}
187#[doc = "Field `ABEOINTEN` reader - Enables the end of auto-baud interrupt."]
188pub type ABEOINTEN_R = crate::BitReader<ABEOINTEN_A>;
189#[doc = "Enables the end of auto-baud interrupt.\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum ABEOINTEN_A {
192    #[doc = "0: Disable end of auto-baud Interrupt."]
193    DISABLE = 0,
194    #[doc = "1: Enable end of auto-baud Interrupt."]
195    ENABLE = 1,
196}
197impl From<ABEOINTEN_A> for bool {
198    #[inline(always)]
199    fn from(variant: ABEOINTEN_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl ABEOINTEN_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> ABEOINTEN_A {
207        match self.bits {
208            false => ABEOINTEN_A::DISABLE,
209            true => ABEOINTEN_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 == ABEOINTEN_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 == ABEOINTEN_A::ENABLE
221    }
222}
223#[doc = "Field `ABEOINTEN` writer - Enables the end of auto-baud interrupt."]
224pub type ABEOINTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, ABEOINTEN_A, O>;
225impl<'a, const O: u8> ABEOINTEN_W<'a, O> {
226    #[doc = "Disable end of auto-baud Interrupt."]
227    #[inline(always)]
228    pub fn disable(self) -> &'a mut W {
229        self.variant(ABEOINTEN_A::DISABLE)
230    }
231    #[doc = "Enable end of auto-baud Interrupt."]
232    #[inline(always)]
233    pub fn enable(self) -> &'a mut W {
234        self.variant(ABEOINTEN_A::ENABLE)
235    }
236}
237#[doc = "Field `ABTOINTEN` reader - Enables the auto-baud time-out interrupt."]
238pub type ABTOINTEN_R = crate::BitReader<ABTOINTEN_A>;
239#[doc = "Enables the auto-baud time-out interrupt.\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq)]
241pub enum ABTOINTEN_A {
242    #[doc = "0: Disable auto-baud time-out Interrupt."]
243    DISABLE = 0,
244    #[doc = "1: Enable auto-baud time-out Interrupt."]
245    ENABLE = 1,
246}
247impl From<ABTOINTEN_A> for bool {
248    #[inline(always)]
249    fn from(variant: ABTOINTEN_A) -> Self {
250        variant as u8 != 0
251    }
252}
253impl ABTOINTEN_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> ABTOINTEN_A {
257        match self.bits {
258            false => ABTOINTEN_A::DISABLE,
259            true => ABTOINTEN_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 == ABTOINTEN_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 == ABTOINTEN_A::ENABLE
271    }
272}
273#[doc = "Field `ABTOINTEN` writer - Enables the auto-baud time-out interrupt."]
274pub type ABTOINTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, IER_SPEC, ABTOINTEN_A, O>;
275impl<'a, const O: u8> ABTOINTEN_W<'a, O> {
276    #[doc = "Disable auto-baud time-out Interrupt."]
277    #[inline(always)]
278    pub fn disable(self) -> &'a mut W {
279        self.variant(ABTOINTEN_A::DISABLE)
280    }
281    #[doc = "Enable auto-baud time-out Interrupt."]
282    #[inline(always)]
283    pub fn enable(self) -> &'a mut W {
284        self.variant(ABTOINTEN_A::ENABLE)
285    }
286}
287impl R {
288    #[doc = "Bit 0 - Interrupt Enable. Enables the Receive Data Available interrupt for UART. It also controls the Character Receive Time-out interrupt."]
289    #[inline(always)]
290    pub fn rbrie(&self) -> RBRIE_R {
291        RBRIE_R::new((self.bits & 1) != 0)
292    }
293    #[doc = "Bit 1 - Interrupt Enable. Enables the THRE interrupt for UART. The status of this interrupt can be read from LSR\\[5\\]."]
294    #[inline(always)]
295    pub fn threie(&self) -> THREIE_R {
296        THREIE_R::new(((self.bits >> 1) & 1) != 0)
297    }
298    #[doc = "Bit 2 - Line Interrupt Enable. Enables the UART RX line status interrupts. The status of this interrupt can be read from LSR\\[4:1\\]."]
299    #[inline(always)]
300    pub fn rxlie(&self) -> RXLIE_R {
301        RXLIE_R::new(((self.bits >> 2) & 1) != 0)
302    }
303    #[doc = "Bit 8 - Enables the end of auto-baud interrupt."]
304    #[inline(always)]
305    pub fn abeointen(&self) -> ABEOINTEN_R {
306        ABEOINTEN_R::new(((self.bits >> 8) & 1) != 0)
307    }
308    #[doc = "Bit 9 - Enables the auto-baud time-out interrupt."]
309    #[inline(always)]
310    pub fn abtointen(&self) -> ABTOINTEN_R {
311        ABTOINTEN_R::new(((self.bits >> 9) & 1) != 0)
312    }
313}
314impl W {
315    #[doc = "Bit 0 - Interrupt Enable. Enables the Receive Data Available interrupt for UART. It also controls the Character Receive Time-out interrupt."]
316    #[inline(always)]
317    pub fn rbrie(&mut self) -> RBRIE_W<0> {
318        RBRIE_W::new(self)
319    }
320    #[doc = "Bit 1 - Interrupt Enable. Enables the THRE interrupt for UART. The status of this interrupt can be read from LSR\\[5\\]."]
321    #[inline(always)]
322    pub fn threie(&mut self) -> THREIE_W<1> {
323        THREIE_W::new(self)
324    }
325    #[doc = "Bit 2 - Line Interrupt Enable. Enables the UART RX line status interrupts. The status of this interrupt can be read from LSR\\[4:1\\]."]
326    #[inline(always)]
327    pub fn rxlie(&mut self) -> RXLIE_W<2> {
328        RXLIE_W::new(self)
329    }
330    #[doc = "Bit 8 - Enables the end of auto-baud interrupt."]
331    #[inline(always)]
332    pub fn abeointen(&mut self) -> ABEOINTEN_W<8> {
333        ABEOINTEN_W::new(self)
334    }
335    #[doc = "Bit 9 - Enables the auto-baud time-out interrupt."]
336    #[inline(always)]
337    pub fn abtointen(&mut self) -> ABTOINTEN_W<9> {
338        ABTOINTEN_W::new(self)
339    }
340    #[doc = "Writes raw bits to the register."]
341    #[inline(always)]
342    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
343        self.0.bits(bits);
344        self
345    }
346}
347#[doc = "Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential UART interrupts. When DLAB=0.\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"]
348pub struct IER_SPEC;
349impl crate::RegisterSpec for IER_SPEC {
350    type Ux = u32;
351}
352#[doc = "`read()` method returns [ier::R](R) reader structure"]
353impl crate::Readable for IER_SPEC {
354    type Reader = R;
355}
356#[doc = "`write(|w| ..)` method takes [ier::W](W) writer structure"]
357impl crate::Writable for IER_SPEC {
358    type Writer = W;
359}
360#[doc = "`reset()` method sets IER to value 0"]
361impl crate::Resettable for IER_SPEC {
362    #[inline(always)]
363    fn reset_value() -> Self::Ux {
364        0
365    }
366}