atsamd11c/sercom0/usart/
intflag.rs

1#[doc = "Register `INTFLAG` reader"]
2pub type R = crate::R<IntflagSpec>;
3#[doc = "Register `INTFLAG` writer"]
4pub type W = crate::W<IntflagSpec>;
5#[doc = "Field `DRE` reader - Data Register Empty Interrupt"]
6pub type DreR = crate::BitReader;
7#[doc = "Field `TXC` reader - Transmit Complete Interrupt"]
8pub type TxcR = crate::BitReader;
9#[doc = "Field `TXC` writer - Transmit Complete Interrupt"]
10pub type TxcW<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `RXC` reader - Receive Complete Interrupt"]
12pub type RxcR = crate::BitReader;
13#[doc = "Field `RXS` writer - Receive Start Interrupt"]
14pub type RxsW<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `CTSIC` reader - Clear To Send Input Change Interrupt"]
16pub type CtsicR = crate::BitReader;
17#[doc = "Field `CTSIC` writer - Clear To Send Input Change Interrupt"]
18pub type CtsicW<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `RXBRK` reader - Break Received Interrupt"]
20pub type RxbrkR = crate::BitReader;
21#[doc = "Field `RXBRK` writer - Break Received Interrupt"]
22pub type RxbrkW<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `ERROR` reader - Combined Error Interrupt"]
24pub type ErrorR = crate::BitReader;
25#[doc = "Field `ERROR` writer - Combined Error Interrupt"]
26pub type ErrorW<'a, REG> = crate::BitWriter<'a, REG>;
27impl R {
28    #[doc = "Bit 0 - Data Register Empty Interrupt"]
29    #[inline(always)]
30    pub fn dre(&self) -> DreR {
31        DreR::new((self.bits & 1) != 0)
32    }
33    #[doc = "Bit 1 - Transmit Complete Interrupt"]
34    #[inline(always)]
35    pub fn txc(&self) -> TxcR {
36        TxcR::new(((self.bits >> 1) & 1) != 0)
37    }
38    #[doc = "Bit 2 - Receive Complete Interrupt"]
39    #[inline(always)]
40    pub fn rxc(&self) -> RxcR {
41        RxcR::new(((self.bits >> 2) & 1) != 0)
42    }
43    #[doc = "Bit 4 - Clear To Send Input Change Interrupt"]
44    #[inline(always)]
45    pub fn ctsic(&self) -> CtsicR {
46        CtsicR::new(((self.bits >> 4) & 1) != 0)
47    }
48    #[doc = "Bit 5 - Break Received Interrupt"]
49    #[inline(always)]
50    pub fn rxbrk(&self) -> RxbrkR {
51        RxbrkR::new(((self.bits >> 5) & 1) != 0)
52    }
53    #[doc = "Bit 7 - Combined Error Interrupt"]
54    #[inline(always)]
55    pub fn error(&self) -> ErrorR {
56        ErrorR::new(((self.bits >> 7) & 1) != 0)
57    }
58}
59impl W {
60    #[doc = "Bit 1 - Transmit Complete Interrupt"]
61    #[inline(always)]
62    #[must_use]
63    pub fn txc(&mut self) -> TxcW<IntflagSpec> {
64        TxcW::new(self, 1)
65    }
66    #[doc = "Bit 3 - Receive Start Interrupt"]
67    #[inline(always)]
68    #[must_use]
69    pub fn rxs(&mut self) -> RxsW<IntflagSpec> {
70        RxsW::new(self, 3)
71    }
72    #[doc = "Bit 4 - Clear To Send Input Change Interrupt"]
73    #[inline(always)]
74    #[must_use]
75    pub fn ctsic(&mut self) -> CtsicW<IntflagSpec> {
76        CtsicW::new(self, 4)
77    }
78    #[doc = "Bit 5 - Break Received Interrupt"]
79    #[inline(always)]
80    #[must_use]
81    pub fn rxbrk(&mut self) -> RxbrkW<IntflagSpec> {
82        RxbrkW::new(self, 5)
83    }
84    #[doc = "Bit 7 - Combined Error Interrupt"]
85    #[inline(always)]
86    #[must_use]
87    pub fn error(&mut self) -> ErrorW<IntflagSpec> {
88        ErrorW::new(self, 7)
89    }
90}
91#[doc = "USART Interrupt Flag Status and Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intflag::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intflag::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
92pub struct IntflagSpec;
93impl crate::RegisterSpec for IntflagSpec {
94    type Ux = u8;
95}
96#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
97impl crate::Readable for IntflagSpec {}
98#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
99impl crate::Writable for IntflagSpec {
100    type Safety = crate::Unsafe;
101    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
102    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
103}
104#[doc = "`reset()` method sets INTFLAG to value 0"]
105impl crate::Resettable for IntflagSpec {
106    const RESET_VALUE: u8 = 0;
107}