gd32e5/gd32e508/shrtimer_common/
ctl1.rs

1#[doc = "Register `CTL1` reader"]
2pub type R = crate::R<Ctl1Spec>;
3#[doc = "Register `CTL1` writer"]
4pub type W = crate::W<Ctl1Spec>;
5#[doc = "Field `MTSUP` reader - Master_TIMER software update"]
6pub type MtsupR = crate::BitReader;
7#[doc = "Field `MTSUP` writer - Master_TIMER software update"]
8pub type MtsupW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ST0SUP` reader - Slave_TIMER0 software update"]
10pub type St0supR = crate::BitReader;
11#[doc = "Field `ST0SUP` writer - Slave_TIMER0 software update"]
12pub type St0supW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `ST1SUP` reader - Slave_TIMER1 software update"]
14pub type St1supR = crate::BitReader;
15#[doc = "Field `ST1SUP` writer - Slave_TIMER1 software update"]
16pub type St1supW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ST2SUP` reader - Slave_TIMER2 software update"]
18pub type St2supR = crate::BitReader;
19#[doc = "Field `ST2SUP` writer - Slave_TIMER2 software update"]
20pub type St2supW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `ST3SUP` reader - Slave_TIMER3 software update"]
22pub type St3supR = crate::BitReader;
23#[doc = "Field `ST3SUP` writer - Slave_TIMER3 software update"]
24pub type St3supW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `ST4SUP` reader - Slave_TIMER4 software update"]
26pub type St4supR = crate::BitReader;
27#[doc = "Field `ST4SUP` writer - Slave_TIMER4 software update"]
28pub type St4supW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `MTSRST` reader - Master_TIMER software reset"]
30pub type MtsrstR = crate::BitReader;
31#[doc = "Field `MTSRST` writer - Master_TIMER software reset"]
32pub type MtsrstW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `ST0SRST` reader - Slave_TIMER0 software reset"]
34pub type St0srstR = crate::BitReader;
35#[doc = "Field `ST0SRST` writer - Slave_TIMER0 software reset"]
36pub type St0srstW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `ST1SRST` reader - Slave_TIMER1 software reset"]
38pub type St1srstR = crate::BitReader;
39#[doc = "Field `ST1SRST` writer - Slave_TIMER1 software reset"]
40pub type St1srstW<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `ST2SRST` reader - Slave_TIMER2 software reset"]
42pub type St2srstR = crate::BitReader;
43#[doc = "Field `ST2SRST` writer - Slave_TIMER2 software reset"]
44pub type St2srstW<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `ST3SRST` reader - Slave_TIMER3 software reset"]
46pub type St3srstR = crate::BitReader;
47#[doc = "Field `ST3SRST` writer - Slave_TIMER3 software reset"]
48pub type St3srstW<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `ST4SRST` reader - Slave_TIMER4 software reset"]
50pub type St4srstR = crate::BitReader;
51#[doc = "Field `ST4SRST` writer - Slave_TIMER4 software reset"]
52pub type St4srstW<'a, REG> = crate::BitWriter<'a, REG>;
53impl R {
54    #[doc = "Bit 0 - Master_TIMER software update"]
55    #[inline(always)]
56    pub fn mtsup(&self) -> MtsupR {
57        MtsupR::new((self.bits & 1) != 0)
58    }
59    #[doc = "Bit 1 - Slave_TIMER0 software update"]
60    #[inline(always)]
61    pub fn st0sup(&self) -> St0supR {
62        St0supR::new(((self.bits >> 1) & 1) != 0)
63    }
64    #[doc = "Bit 2 - Slave_TIMER1 software update"]
65    #[inline(always)]
66    pub fn st1sup(&self) -> St1supR {
67        St1supR::new(((self.bits >> 2) & 1) != 0)
68    }
69    #[doc = "Bit 3 - Slave_TIMER2 software update"]
70    #[inline(always)]
71    pub fn st2sup(&self) -> St2supR {
72        St2supR::new(((self.bits >> 3) & 1) != 0)
73    }
74    #[doc = "Bit 4 - Slave_TIMER3 software update"]
75    #[inline(always)]
76    pub fn st3sup(&self) -> St3supR {
77        St3supR::new(((self.bits >> 4) & 1) != 0)
78    }
79    #[doc = "Bit 5 - Slave_TIMER4 software update"]
80    #[inline(always)]
81    pub fn st4sup(&self) -> St4supR {
82        St4supR::new(((self.bits >> 5) & 1) != 0)
83    }
84    #[doc = "Bit 8 - Master_TIMER software reset"]
85    #[inline(always)]
86    pub fn mtsrst(&self) -> MtsrstR {
87        MtsrstR::new(((self.bits >> 8) & 1) != 0)
88    }
89    #[doc = "Bit 9 - Slave_TIMER0 software reset"]
90    #[inline(always)]
91    pub fn st0srst(&self) -> St0srstR {
92        St0srstR::new(((self.bits >> 9) & 1) != 0)
93    }
94    #[doc = "Bit 10 - Slave_TIMER1 software reset"]
95    #[inline(always)]
96    pub fn st1srst(&self) -> St1srstR {
97        St1srstR::new(((self.bits >> 10) & 1) != 0)
98    }
99    #[doc = "Bit 11 - Slave_TIMER2 software reset"]
100    #[inline(always)]
101    pub fn st2srst(&self) -> St2srstR {
102        St2srstR::new(((self.bits >> 11) & 1) != 0)
103    }
104    #[doc = "Bit 12 - Slave_TIMER3 software reset"]
105    #[inline(always)]
106    pub fn st3srst(&self) -> St3srstR {
107        St3srstR::new(((self.bits >> 12) & 1) != 0)
108    }
109    #[doc = "Bit 13 - Slave_TIMER4 software reset"]
110    #[inline(always)]
111    pub fn st4srst(&self) -> St4srstR {
112        St4srstR::new(((self.bits >> 13) & 1) != 0)
113    }
114}
115impl W {
116    #[doc = "Bit 0 - Master_TIMER software update"]
117    #[inline(always)]
118    #[must_use]
119    pub fn mtsup(&mut self) -> MtsupW<Ctl1Spec> {
120        MtsupW::new(self, 0)
121    }
122    #[doc = "Bit 1 - Slave_TIMER0 software update"]
123    #[inline(always)]
124    #[must_use]
125    pub fn st0sup(&mut self) -> St0supW<Ctl1Spec> {
126        St0supW::new(self, 1)
127    }
128    #[doc = "Bit 2 - Slave_TIMER1 software update"]
129    #[inline(always)]
130    #[must_use]
131    pub fn st1sup(&mut self) -> St1supW<Ctl1Spec> {
132        St1supW::new(self, 2)
133    }
134    #[doc = "Bit 3 - Slave_TIMER2 software update"]
135    #[inline(always)]
136    #[must_use]
137    pub fn st2sup(&mut self) -> St2supW<Ctl1Spec> {
138        St2supW::new(self, 3)
139    }
140    #[doc = "Bit 4 - Slave_TIMER3 software update"]
141    #[inline(always)]
142    #[must_use]
143    pub fn st3sup(&mut self) -> St3supW<Ctl1Spec> {
144        St3supW::new(self, 4)
145    }
146    #[doc = "Bit 5 - Slave_TIMER4 software update"]
147    #[inline(always)]
148    #[must_use]
149    pub fn st4sup(&mut self) -> St4supW<Ctl1Spec> {
150        St4supW::new(self, 5)
151    }
152    #[doc = "Bit 8 - Master_TIMER software reset"]
153    #[inline(always)]
154    #[must_use]
155    pub fn mtsrst(&mut self) -> MtsrstW<Ctl1Spec> {
156        MtsrstW::new(self, 8)
157    }
158    #[doc = "Bit 9 - Slave_TIMER0 software reset"]
159    #[inline(always)]
160    #[must_use]
161    pub fn st0srst(&mut self) -> St0srstW<Ctl1Spec> {
162        St0srstW::new(self, 9)
163    }
164    #[doc = "Bit 10 - Slave_TIMER1 software reset"]
165    #[inline(always)]
166    #[must_use]
167    pub fn st1srst(&mut self) -> St1srstW<Ctl1Spec> {
168        St1srstW::new(self, 10)
169    }
170    #[doc = "Bit 11 - Slave_TIMER2 software reset"]
171    #[inline(always)]
172    #[must_use]
173    pub fn st2srst(&mut self) -> St2srstW<Ctl1Spec> {
174        St2srstW::new(self, 11)
175    }
176    #[doc = "Bit 12 - Slave_TIMER3 software reset"]
177    #[inline(always)]
178    #[must_use]
179    pub fn st3srst(&mut self) -> St3srstW<Ctl1Spec> {
180        St3srstW::new(self, 12)
181    }
182    #[doc = "Bit 13 - Slave_TIMER4 software reset"]
183    #[inline(always)]
184    #[must_use]
185    pub fn st4srst(&mut self) -> St4srstW<Ctl1Spec> {
186        St4srstW::new(self, 13)
187    }
188}
189#[doc = "SHRTIMER control register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctl1::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctl1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
190pub struct Ctl1Spec;
191impl crate::RegisterSpec for Ctl1Spec {
192    type Ux = u32;
193}
194#[doc = "`read()` method returns [`ctl1::R`](R) reader structure"]
195impl crate::Readable for Ctl1Spec {}
196#[doc = "`write(|w| ..)` method takes [`ctl1::W`](W) writer structure"]
197impl crate::Writable for Ctl1Spec {
198    type Safety = crate::Unsafe;
199    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
200    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
201}
202#[doc = "`reset()` method sets CTL1 to value 0"]
203impl crate::Resettable for Ctl1Spec {
204    const RESET_VALUE: u32 = 0;
205}