atsamd11c/sercom0/spi/
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 `SSL` reader - Slave Select Low Interrupt Flag"]
14pub type SslR = crate::BitReader;
15#[doc = "Field `SSL` writer - Slave Select Low Interrupt Flag"]
16pub type SslW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ERROR` reader - Combined Error Interrupt"]
18pub type ErrorR = crate::BitReader;
19#[doc = "Field `ERROR` writer - Combined Error Interrupt"]
20pub type ErrorW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bit 0 - Data Register Empty Interrupt"]
23 #[inline(always)]
24 pub fn dre(&self) -> DreR {
25 DreR::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - Transmit Complete Interrupt"]
28 #[inline(always)]
29 pub fn txc(&self) -> TxcR {
30 TxcR::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bit 2 - Receive Complete Interrupt"]
33 #[inline(always)]
34 pub fn rxc(&self) -> RxcR {
35 RxcR::new(((self.bits >> 2) & 1) != 0)
36 }
37 #[doc = "Bit 3 - Slave Select Low Interrupt Flag"]
38 #[inline(always)]
39 pub fn ssl(&self) -> SslR {
40 SslR::new(((self.bits >> 3) & 1) != 0)
41 }
42 #[doc = "Bit 7 - Combined Error Interrupt"]
43 #[inline(always)]
44 pub fn error(&self) -> ErrorR {
45 ErrorR::new(((self.bits >> 7) & 1) != 0)
46 }
47}
48impl W {
49 #[doc = "Bit 1 - Transmit Complete Interrupt"]
50 #[inline(always)]
51 #[must_use]
52 pub fn txc(&mut self) -> TxcW<IntflagSpec> {
53 TxcW::new(self, 1)
54 }
55 #[doc = "Bit 3 - Slave Select Low Interrupt Flag"]
56 #[inline(always)]
57 #[must_use]
58 pub fn ssl(&mut self) -> SslW<IntflagSpec> {
59 SslW::new(self, 3)
60 }
61 #[doc = "Bit 7 - Combined Error Interrupt"]
62 #[inline(always)]
63 #[must_use]
64 pub fn error(&mut self) -> ErrorW<IntflagSpec> {
65 ErrorW::new(self, 7)
66 }
67}
68#[doc = "SPI 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)."]
69pub struct IntflagSpec;
70impl crate::RegisterSpec for IntflagSpec {
71 type Ux = u8;
72}
73#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
74impl crate::Readable for IntflagSpec {}
75#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
76impl crate::Writable for IntflagSpec {
77 type Safety = crate::Unsafe;
78 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
79 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
80}
81#[doc = "`reset()` method sets INTFLAG to value 0"]
82impl crate::Resettable for IntflagSpec {
83 const RESET_VALUE: u8 = 0;
84}