atsamd21g/dmac/
chintflag.rs
1#[doc = "Register `CHINTFLAG` reader"]
2pub type R = crate::R<ChintflagSpec>;
3#[doc = "Register `CHINTFLAG` writer"]
4pub type W = crate::W<ChintflagSpec>;
5#[doc = "Field `TERR` reader - Channel Transfer Error"]
6pub type TerrR = crate::BitReader;
7#[doc = "Field `TERR` writer - Channel Transfer Error"]
8pub type TerrW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TCMPL` reader - Channel Transfer Complete"]
10pub type TcmplR = crate::BitReader;
11#[doc = "Field `TCMPL` writer - Channel Transfer Complete"]
12pub type TcmplW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SUSP` reader - Channel Suspend"]
14pub type SuspR = crate::BitReader;
15#[doc = "Field `SUSP` writer - Channel Suspend"]
16pub type SuspW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bit 0 - Channel Transfer Error"]
19 #[inline(always)]
20 pub fn terr(&self) -> TerrR {
21 TerrR::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - Channel Transfer Complete"]
24 #[inline(always)]
25 pub fn tcmpl(&self) -> TcmplR {
26 TcmplR::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bit 2 - Channel Suspend"]
29 #[inline(always)]
30 pub fn susp(&self) -> SuspR {
31 SuspR::new(((self.bits >> 2) & 1) != 0)
32 }
33}
34impl W {
35 #[doc = "Bit 0 - Channel Transfer Error"]
36 #[inline(always)]
37 #[must_use]
38 pub fn terr(&mut self) -> TerrW<ChintflagSpec> {
39 TerrW::new(self, 0)
40 }
41 #[doc = "Bit 1 - Channel Transfer Complete"]
42 #[inline(always)]
43 #[must_use]
44 pub fn tcmpl(&mut self) -> TcmplW<ChintflagSpec> {
45 TcmplW::new(self, 1)
46 }
47 #[doc = "Bit 2 - Channel Suspend"]
48 #[inline(always)]
49 #[must_use]
50 pub fn susp(&mut self) -> SuspW<ChintflagSpec> {
51 SuspW::new(self, 2)
52 }
53}
54#[doc = "Channel Interrupt Flag Status and Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`chintflag::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`chintflag::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct ChintflagSpec;
56impl crate::RegisterSpec for ChintflagSpec {
57 type Ux = u8;
58}
59#[doc = "`read()` method returns [`chintflag::R`](R) reader structure"]
60impl crate::Readable for ChintflagSpec {}
61#[doc = "`write(|w| ..)` method takes [`chintflag::W`](W) writer structure"]
62impl crate::Writable for ChintflagSpec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
66}
67#[doc = "`reset()` method sets CHINTFLAG to value 0"]
68impl crate::Resettable for ChintflagSpec {
69 const RESET_VALUE: u8 = 0;
70}