mcxa_pac/smartdma0/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub type R = crate::R<CtrlSpec>;
3#[doc = "Register `CTRL` writer"]
4pub type W = crate::W<CtrlSpec>;
5#[doc = "Field `START` reader - Start Bit Ignition"]
6pub type StartR = crate::BitReader;
7#[doc = "Field `START` writer - Start Bit Ignition"]
8pub type StartW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `EXF` reader - External Flag"]
10pub type ExfR = crate::BitReader;
11#[doc = "Field `EXF` writer - External Flag"]
12pub type ExfW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `ERRDIS` reader - Error Disable"]
14pub type ErrdisR = crate::BitReader;
15#[doc = "Field `ERRDIS` writer - Error Disable"]
16pub type ErrdisW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `BUFEN` reader - Buffer Enable"]
18pub type BufenR = crate::BitReader;
19#[doc = "Field `BUFEN` writer - Buffer Enable"]
20pub type BufenW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SYNCEN` reader - Sync Enable"]
22pub type SyncenR = crate::BitReader;
23#[doc = "Field `SYNCEN` writer - Sync Enable"]
24pub type SyncenW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `WKEY` reader - Write Key"]
26pub type WkeyR = crate::FieldReader<u16>;
27#[doc = "Field `WKEY` writer - Write Key"]
28pub type WkeyW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
29impl R {
30    #[doc = "Bit 0 - Start Bit Ignition"]
31    #[inline(always)]
32    pub fn start(&self) -> StartR {
33        StartR::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - External Flag"]
36    #[inline(always)]
37    pub fn exf(&self) -> ExfR {
38        ExfR::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - Error Disable"]
41    #[inline(always)]
42    pub fn errdis(&self) -> ErrdisR {
43        ErrdisR::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - Buffer Enable"]
46    #[inline(always)]
47    pub fn bufen(&self) -> BufenR {
48        BufenR::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - Sync Enable"]
51    #[inline(always)]
52    pub fn syncen(&self) -> SyncenR {
53        SyncenR::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bits 16:31 - Write Key"]
56    #[inline(always)]
57    pub fn wkey(&self) -> WkeyR {
58        WkeyR::new(((self.bits >> 16) & 0xffff) as u16)
59    }
60}
61#[cfg(feature = "debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("CTRL")
65            .field("start", &self.start())
66            .field("exf", &self.exf())
67            .field("errdis", &self.errdis())
68            .field("bufen", &self.bufen())
69            .field("syncen", &self.syncen())
70            .field("wkey", &self.wkey())
71            .finish()
72    }
73}
74impl W {
75    #[doc = "Bit 0 - Start Bit Ignition"]
76    #[inline(always)]
77    pub fn start(&mut self) -> StartW<'_, CtrlSpec> {
78        StartW::new(self, 0)
79    }
80    #[doc = "Bit 1 - External Flag"]
81    #[inline(always)]
82    pub fn exf(&mut self) -> ExfW<'_, CtrlSpec> {
83        ExfW::new(self, 1)
84    }
85    #[doc = "Bit 2 - Error Disable"]
86    #[inline(always)]
87    pub fn errdis(&mut self) -> ErrdisW<'_, CtrlSpec> {
88        ErrdisW::new(self, 2)
89    }
90    #[doc = "Bit 3 - Buffer Enable"]
91    #[inline(always)]
92    pub fn bufen(&mut self) -> BufenW<'_, CtrlSpec> {
93        BufenW::new(self, 3)
94    }
95    #[doc = "Bit 4 - Sync Enable"]
96    #[inline(always)]
97    pub fn syncen(&mut self) -> SyncenW<'_, CtrlSpec> {
98        SyncenW::new(self, 4)
99    }
100    #[doc = "Bits 16:31 - Write Key"]
101    #[inline(always)]
102    pub fn wkey(&mut self) -> WkeyW<'_, CtrlSpec> {
103        WkeyW::new(self, 16)
104    }
105}
106#[doc = "Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
107pub struct CtrlSpec;
108impl crate::RegisterSpec for CtrlSpec {
109    type Ux = u32;
110}
111#[doc = "`read()` method returns [`ctrl::R`](R) reader structure"]
112impl crate::Readable for CtrlSpec {}
113#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
114impl crate::Writable for CtrlSpec {
115    type Safety = crate::Unsafe;
116}
117#[doc = "`reset()` method sets CTRL to value 0"]
118impl crate::Resettable for CtrlSpec {}