avr_device/devices/atmega4809/spi0/
intflags.rs

1#[doc = "Register `INTFLAGS` reader"]
2pub struct R(crate::R<INTFLAGS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTFLAGS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTFLAGS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTFLAGS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTFLAGS` writer"]
17pub struct W(crate::W<INTFLAGS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTFLAGS_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<INTFLAGS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTFLAGS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `BUFFERED_BUFOVF` reader - Buffer Overflow"]
38pub type BUFFERED_BUFOVF_R = crate::BitReader<bool>;
39#[doc = "Field `BUFFERED_BUFOVF` writer - Buffer Overflow"]
40pub type BUFFERED_BUFOVF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
41#[doc = "Field `BUFFERED_SSIF` reader - Slave Select Trigger Interrupt Flag"]
42pub type BUFFERED_SSIF_R = crate::BitReader<bool>;
43#[doc = "Field `BUFFERED_SSIF` writer - Slave Select Trigger Interrupt Flag"]
44pub type BUFFERED_SSIF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
45#[doc = "Field `BUFFERED_DREIF` reader - Data Register Empty Interrupt Flag"]
46pub type BUFFERED_DREIF_R = crate::BitReader<bool>;
47#[doc = "Field `BUFFERED_DREIF` writer - Data Register Empty Interrupt Flag"]
48pub type BUFFERED_DREIF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
49#[doc = "Field `BUFFERED_TXCIF` reader - Transfer Complete Interrupt Flag"]
50pub type BUFFERED_TXCIF_R = crate::BitReader<bool>;
51#[doc = "Field `BUFFERED_TXCIF` writer - Transfer Complete Interrupt Flag"]
52pub type BUFFERED_TXCIF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
53#[doc = "Field `DEFAULT_WRCOL` reader - Write Collision"]
54pub type DEFAULT_WRCOL_R = crate::BitReader<bool>;
55#[doc = "Field `DEFAULT_WRCOL` writer - Write Collision"]
56pub type DEFAULT_WRCOL_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
57#[doc = "Field `BUFFERED_RXCIF` reader - Receive Complete Interrupt Flag"]
58pub type BUFFERED_RXCIF_R = crate::BitReader<bool>;
59#[doc = "Field `BUFFERED_RXCIF` writer - Receive Complete Interrupt Flag"]
60pub type BUFFERED_RXCIF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
61#[doc = "Field `DEFAULT_IF` reader - Interrupt Flag"]
62pub type DEFAULT_IF_R = crate::BitReader<bool>;
63#[doc = "Field `DEFAULT_IF` writer - Interrupt Flag"]
64pub type DEFAULT_IF_W<'a, const O: u8> = crate::BitWriter<'a, u8, INTFLAGS_SPEC, bool, O>;
65impl R {
66    #[doc = "Bit 0 - Buffer Overflow"]
67    #[inline(always)]
68    pub fn buffered_bufovf(&self) -> BUFFERED_BUFOVF_R {
69        BUFFERED_BUFOVF_R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 4 - Slave Select Trigger Interrupt Flag"]
72    #[inline(always)]
73    pub fn buffered_ssif(&self) -> BUFFERED_SSIF_R {
74        BUFFERED_SSIF_R::new(((self.bits >> 4) & 1) != 0)
75    }
76    #[doc = "Bit 5 - Data Register Empty Interrupt Flag"]
77    #[inline(always)]
78    pub fn buffered_dreif(&self) -> BUFFERED_DREIF_R {
79        BUFFERED_DREIF_R::new(((self.bits >> 5) & 1) != 0)
80    }
81    #[doc = "Bit 6 - Transfer Complete Interrupt Flag"]
82    #[inline(always)]
83    pub fn buffered_txcif(&self) -> BUFFERED_TXCIF_R {
84        BUFFERED_TXCIF_R::new(((self.bits >> 6) & 1) != 0)
85    }
86    #[doc = "Bit 6 - Write Collision"]
87    #[inline(always)]
88    pub fn default_wrcol(&self) -> DEFAULT_WRCOL_R {
89        DEFAULT_WRCOL_R::new(((self.bits >> 6) & 1) != 0)
90    }
91    #[doc = "Bit 7 - Receive Complete Interrupt Flag"]
92    #[inline(always)]
93    pub fn buffered_rxcif(&self) -> BUFFERED_RXCIF_R {
94        BUFFERED_RXCIF_R::new(((self.bits >> 7) & 1) != 0)
95    }
96    #[doc = "Bit 7 - Interrupt Flag"]
97    #[inline(always)]
98    pub fn default_if(&self) -> DEFAULT_IF_R {
99        DEFAULT_IF_R::new(((self.bits >> 7) & 1) != 0)
100    }
101}
102impl W {
103    #[doc = "Bit 0 - Buffer Overflow"]
104    #[inline(always)]
105    #[must_use]
106    pub fn buffered_bufovf(&mut self) -> BUFFERED_BUFOVF_W<0> {
107        BUFFERED_BUFOVF_W::new(self)
108    }
109    #[doc = "Bit 4 - Slave Select Trigger Interrupt Flag"]
110    #[inline(always)]
111    #[must_use]
112    pub fn buffered_ssif(&mut self) -> BUFFERED_SSIF_W<4> {
113        BUFFERED_SSIF_W::new(self)
114    }
115    #[doc = "Bit 5 - Data Register Empty Interrupt Flag"]
116    #[inline(always)]
117    #[must_use]
118    pub fn buffered_dreif(&mut self) -> BUFFERED_DREIF_W<5> {
119        BUFFERED_DREIF_W::new(self)
120    }
121    #[doc = "Bit 6 - Transfer Complete Interrupt Flag"]
122    #[inline(always)]
123    #[must_use]
124    pub fn buffered_txcif(&mut self) -> BUFFERED_TXCIF_W<6> {
125        BUFFERED_TXCIF_W::new(self)
126    }
127    #[doc = "Bit 6 - Write Collision"]
128    #[inline(always)]
129    #[must_use]
130    pub fn default_wrcol(&mut self) -> DEFAULT_WRCOL_W<6> {
131        DEFAULT_WRCOL_W::new(self)
132    }
133    #[doc = "Bit 7 - Receive Complete Interrupt Flag"]
134    #[inline(always)]
135    #[must_use]
136    pub fn buffered_rxcif(&mut self) -> BUFFERED_RXCIF_W<7> {
137        BUFFERED_RXCIF_W::new(self)
138    }
139    #[doc = "Bit 7 - Interrupt Flag"]
140    #[inline(always)]
141    #[must_use]
142    pub fn default_if(&mut self) -> DEFAULT_IF_W<7> {
143        DEFAULT_IF_W::new(self)
144    }
145    #[doc = "Writes raw bits to the register."]
146    #[inline(always)]
147    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
148        self.0.bits(bits);
149        self
150    }
151}
152#[doc = "Interrupt Flags\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 [intflags](index.html) module"]
153pub struct INTFLAGS_SPEC;
154impl crate::RegisterSpec for INTFLAGS_SPEC {
155    type Ux = u8;
156}
157#[doc = "`read()` method returns [intflags::R](R) reader structure"]
158impl crate::Readable for INTFLAGS_SPEC {
159    type Reader = R;
160}
161#[doc = "`write(|w| ..)` method takes [intflags::W](W) writer structure"]
162impl crate::Writable for INTFLAGS_SPEC {
163    type Writer = W;
164    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
165    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166}
167#[doc = "`reset()` method sets INTFLAGS to value 0"]
168impl crate::Resettable for INTFLAGS_SPEC {
169    const RESET_VALUE: Self::Ux = 0;
170}