esp32s2/ledc/
int_ena.rs

1#[doc = "Register `INT_ENA` reader"]
2pub type R = crate::R<INT_ENA_SPEC>;
3#[doc = "Register `INT_ENA` writer"]
4pub type W = crate::W<INT_ENA_SPEC>;
5#[doc = "Field `TIMER_OVF(0-3)` reader - The interrupt enable bit for the TIMER%s_OVF interrupt."]
6pub type TIMER_OVF_R = crate::BitReader;
7#[doc = "Field `TIMER_OVF(0-3)` writer - The interrupt enable bit for the TIMER%s_OVF interrupt."]
8pub type TIMER_OVF_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `DUTY_CHNG_END_CH(0-7)` reader - The interrupt enable bit for the DUTY_CHNG_END_CH%s interrupt."]
10pub type DUTY_CHNG_END_CH_R = crate::BitReader;
11#[doc = "Field `DUTY_CHNG_END_CH(0-7)` writer - The interrupt enable bit for the DUTY_CHNG_END_CH%s interrupt."]
12pub type DUTY_CHNG_END_CH_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `OVF_CNT_CH(0-7)` reader - The interrupt enable bit for the OVF_CNT_CH%s interrupt."]
14pub type OVF_CNT_CH_R = crate::BitReader;
15#[doc = "Field `OVF_CNT_CH(0-7)` writer - The interrupt enable bit for the OVF_CNT_CH%s interrupt."]
16pub type OVF_CNT_CH_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "The interrupt enable bit for the TIMER(0-3)_OVF interrupt."]
19    #[doc = ""]
20    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TIMER0_OVF` field.</div>"]
21    #[inline(always)]
22    pub fn timer_ovf(&self, n: u8) -> TIMER_OVF_R {
23        #[allow(clippy::no_effect)]
24        [(); 4][n as usize];
25        TIMER_OVF_R::new(((self.bits >> n) & 1) != 0)
26    }
27    #[doc = "Iterator for array of:"]
28    #[doc = "The interrupt enable bit for the TIMER(0-3)_OVF interrupt."]
29    #[inline(always)]
30    pub fn timer_ovf_iter(&self) -> impl Iterator<Item = TIMER_OVF_R> + '_ {
31        (0..4).map(move |n| TIMER_OVF_R::new(((self.bits >> n) & 1) != 0))
32    }
33    #[doc = "Bit 0 - The interrupt enable bit for the TIMER0_OVF interrupt."]
34    #[inline(always)]
35    pub fn timer0_ovf(&self) -> TIMER_OVF_R {
36        TIMER_OVF_R::new((self.bits & 1) != 0)
37    }
38    #[doc = "Bit 1 - The interrupt enable bit for the TIMER1_OVF interrupt."]
39    #[inline(always)]
40    pub fn timer1_ovf(&self) -> TIMER_OVF_R {
41        TIMER_OVF_R::new(((self.bits >> 1) & 1) != 0)
42    }
43    #[doc = "Bit 2 - The interrupt enable bit for the TIMER2_OVF interrupt."]
44    #[inline(always)]
45    pub fn timer2_ovf(&self) -> TIMER_OVF_R {
46        TIMER_OVF_R::new(((self.bits >> 2) & 1) != 0)
47    }
48    #[doc = "Bit 3 - The interrupt enable bit for the TIMER3_OVF interrupt."]
49    #[inline(always)]
50    pub fn timer3_ovf(&self) -> TIMER_OVF_R {
51        TIMER_OVF_R::new(((self.bits >> 3) & 1) != 0)
52    }
53    #[doc = "The interrupt enable bit for the DUTY_CHNG_END_CH(0-7) interrupt."]
54    #[doc = ""]
55    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `DUTY_CHNG_END_CH0` field.</div>"]
56    #[inline(always)]
57    pub fn duty_chng_end_ch(&self, n: u8) -> DUTY_CHNG_END_CH_R {
58        #[allow(clippy::no_effect)]
59        [(); 8][n as usize];
60        DUTY_CHNG_END_CH_R::new(((self.bits >> (n + 4)) & 1) != 0)
61    }
62    #[doc = "Iterator for array of:"]
63    #[doc = "The interrupt enable bit for the DUTY_CHNG_END_CH(0-7) interrupt."]
64    #[inline(always)]
65    pub fn duty_chng_end_ch_iter(&self) -> impl Iterator<Item = DUTY_CHNG_END_CH_R> + '_ {
66        (0..8).map(move |n| DUTY_CHNG_END_CH_R::new(((self.bits >> (n + 4)) & 1) != 0))
67    }
68    #[doc = "Bit 4 - The interrupt enable bit for the DUTY_CHNG_END_CH0 interrupt."]
69    #[inline(always)]
70    pub fn duty_chng_end_ch0(&self) -> DUTY_CHNG_END_CH_R {
71        DUTY_CHNG_END_CH_R::new(((self.bits >> 4) & 1) != 0)
72    }
73    #[doc = "Bit 5 - The interrupt enable bit for the DUTY_CHNG_END_CH1 interrupt."]
74    #[inline(always)]
75    pub fn duty_chng_end_ch1(&self) -> DUTY_CHNG_END_CH_R {
76        DUTY_CHNG_END_CH_R::new(((self.bits >> 5) & 1) != 0)
77    }
78    #[doc = "Bit 6 - The interrupt enable bit for the DUTY_CHNG_END_CH2 interrupt."]
79    #[inline(always)]
80    pub fn duty_chng_end_ch2(&self) -> DUTY_CHNG_END_CH_R {
81        DUTY_CHNG_END_CH_R::new(((self.bits >> 6) & 1) != 0)
82    }
83    #[doc = "Bit 7 - The interrupt enable bit for the DUTY_CHNG_END_CH3 interrupt."]
84    #[inline(always)]
85    pub fn duty_chng_end_ch3(&self) -> DUTY_CHNG_END_CH_R {
86        DUTY_CHNG_END_CH_R::new(((self.bits >> 7) & 1) != 0)
87    }
88    #[doc = "Bit 8 - The interrupt enable bit for the DUTY_CHNG_END_CH4 interrupt."]
89    #[inline(always)]
90    pub fn duty_chng_end_ch4(&self) -> DUTY_CHNG_END_CH_R {
91        DUTY_CHNG_END_CH_R::new(((self.bits >> 8) & 1) != 0)
92    }
93    #[doc = "Bit 9 - The interrupt enable bit for the DUTY_CHNG_END_CH5 interrupt."]
94    #[inline(always)]
95    pub fn duty_chng_end_ch5(&self) -> DUTY_CHNG_END_CH_R {
96        DUTY_CHNG_END_CH_R::new(((self.bits >> 9) & 1) != 0)
97    }
98    #[doc = "Bit 10 - The interrupt enable bit for the DUTY_CHNG_END_CH6 interrupt."]
99    #[inline(always)]
100    pub fn duty_chng_end_ch6(&self) -> DUTY_CHNG_END_CH_R {
101        DUTY_CHNG_END_CH_R::new(((self.bits >> 10) & 1) != 0)
102    }
103    #[doc = "Bit 11 - The interrupt enable bit for the DUTY_CHNG_END_CH7 interrupt."]
104    #[inline(always)]
105    pub fn duty_chng_end_ch7(&self) -> DUTY_CHNG_END_CH_R {
106        DUTY_CHNG_END_CH_R::new(((self.bits >> 11) & 1) != 0)
107    }
108    #[doc = "The interrupt enable bit for the OVF_CNT_CH(0-7) interrupt."]
109    #[doc = ""]
110    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `OVF_CNT_CH0` field.</div>"]
111    #[inline(always)]
112    pub fn ovf_cnt_ch(&self, n: u8) -> OVF_CNT_CH_R {
113        #[allow(clippy::no_effect)]
114        [(); 8][n as usize];
115        OVF_CNT_CH_R::new(((self.bits >> (n + 12)) & 1) != 0)
116    }
117    #[doc = "Iterator for array of:"]
118    #[doc = "The interrupt enable bit for the OVF_CNT_CH(0-7) interrupt."]
119    #[inline(always)]
120    pub fn ovf_cnt_ch_iter(&self) -> impl Iterator<Item = OVF_CNT_CH_R> + '_ {
121        (0..8).map(move |n| OVF_CNT_CH_R::new(((self.bits >> (n + 12)) & 1) != 0))
122    }
123    #[doc = "Bit 12 - The interrupt enable bit for the OVF_CNT_CH0 interrupt."]
124    #[inline(always)]
125    pub fn ovf_cnt_ch0(&self) -> OVF_CNT_CH_R {
126        OVF_CNT_CH_R::new(((self.bits >> 12) & 1) != 0)
127    }
128    #[doc = "Bit 13 - The interrupt enable bit for the OVF_CNT_CH1 interrupt."]
129    #[inline(always)]
130    pub fn ovf_cnt_ch1(&self) -> OVF_CNT_CH_R {
131        OVF_CNT_CH_R::new(((self.bits >> 13) & 1) != 0)
132    }
133    #[doc = "Bit 14 - The interrupt enable bit for the OVF_CNT_CH2 interrupt."]
134    #[inline(always)]
135    pub fn ovf_cnt_ch2(&self) -> OVF_CNT_CH_R {
136        OVF_CNT_CH_R::new(((self.bits >> 14) & 1) != 0)
137    }
138    #[doc = "Bit 15 - The interrupt enable bit for the OVF_CNT_CH3 interrupt."]
139    #[inline(always)]
140    pub fn ovf_cnt_ch3(&self) -> OVF_CNT_CH_R {
141        OVF_CNT_CH_R::new(((self.bits >> 15) & 1) != 0)
142    }
143    #[doc = "Bit 16 - The interrupt enable bit for the OVF_CNT_CH4 interrupt."]
144    #[inline(always)]
145    pub fn ovf_cnt_ch4(&self) -> OVF_CNT_CH_R {
146        OVF_CNT_CH_R::new(((self.bits >> 16) & 1) != 0)
147    }
148    #[doc = "Bit 17 - The interrupt enable bit for the OVF_CNT_CH5 interrupt."]
149    #[inline(always)]
150    pub fn ovf_cnt_ch5(&self) -> OVF_CNT_CH_R {
151        OVF_CNT_CH_R::new(((self.bits >> 17) & 1) != 0)
152    }
153    #[doc = "Bit 18 - The interrupt enable bit for the OVF_CNT_CH6 interrupt."]
154    #[inline(always)]
155    pub fn ovf_cnt_ch6(&self) -> OVF_CNT_CH_R {
156        OVF_CNT_CH_R::new(((self.bits >> 18) & 1) != 0)
157    }
158    #[doc = "Bit 19 - The interrupt enable bit for the OVF_CNT_CH7 interrupt."]
159    #[inline(always)]
160    pub fn ovf_cnt_ch7(&self) -> OVF_CNT_CH_R {
161        OVF_CNT_CH_R::new(((self.bits >> 19) & 1) != 0)
162    }
163}
164#[cfg(feature = "impl-register-debug")]
165impl core::fmt::Debug for R {
166    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
167        f.debug_struct("INT_ENA")
168            .field("timer0_ovf", &self.timer0_ovf())
169            .field("timer1_ovf", &self.timer1_ovf())
170            .field("timer2_ovf", &self.timer2_ovf())
171            .field("timer3_ovf", &self.timer3_ovf())
172            .field("duty_chng_end_ch0", &self.duty_chng_end_ch0())
173            .field("duty_chng_end_ch1", &self.duty_chng_end_ch1())
174            .field("duty_chng_end_ch2", &self.duty_chng_end_ch2())
175            .field("duty_chng_end_ch3", &self.duty_chng_end_ch3())
176            .field("duty_chng_end_ch4", &self.duty_chng_end_ch4())
177            .field("duty_chng_end_ch5", &self.duty_chng_end_ch5())
178            .field("duty_chng_end_ch6", &self.duty_chng_end_ch6())
179            .field("duty_chng_end_ch7", &self.duty_chng_end_ch7())
180            .field("ovf_cnt_ch0", &self.ovf_cnt_ch0())
181            .field("ovf_cnt_ch1", &self.ovf_cnt_ch1())
182            .field("ovf_cnt_ch2", &self.ovf_cnt_ch2())
183            .field("ovf_cnt_ch3", &self.ovf_cnt_ch3())
184            .field("ovf_cnt_ch4", &self.ovf_cnt_ch4())
185            .field("ovf_cnt_ch5", &self.ovf_cnt_ch5())
186            .field("ovf_cnt_ch6", &self.ovf_cnt_ch6())
187            .field("ovf_cnt_ch7", &self.ovf_cnt_ch7())
188            .finish()
189    }
190}
191impl W {
192    #[doc = "The interrupt enable bit for the TIMER(0-3)_OVF interrupt."]
193    #[doc = ""]
194    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TIMER0_OVF` field.</div>"]
195    #[inline(always)]
196    pub fn timer_ovf(&mut self, n: u8) -> TIMER_OVF_W<INT_ENA_SPEC> {
197        #[allow(clippy::no_effect)]
198        [(); 4][n as usize];
199        TIMER_OVF_W::new(self, n)
200    }
201    #[doc = "Bit 0 - The interrupt enable bit for the TIMER0_OVF interrupt."]
202    #[inline(always)]
203    pub fn timer0_ovf(&mut self) -> TIMER_OVF_W<INT_ENA_SPEC> {
204        TIMER_OVF_W::new(self, 0)
205    }
206    #[doc = "Bit 1 - The interrupt enable bit for the TIMER1_OVF interrupt."]
207    #[inline(always)]
208    pub fn timer1_ovf(&mut self) -> TIMER_OVF_W<INT_ENA_SPEC> {
209        TIMER_OVF_W::new(self, 1)
210    }
211    #[doc = "Bit 2 - The interrupt enable bit for the TIMER2_OVF interrupt."]
212    #[inline(always)]
213    pub fn timer2_ovf(&mut self) -> TIMER_OVF_W<INT_ENA_SPEC> {
214        TIMER_OVF_W::new(self, 2)
215    }
216    #[doc = "Bit 3 - The interrupt enable bit for the TIMER3_OVF interrupt."]
217    #[inline(always)]
218    pub fn timer3_ovf(&mut self) -> TIMER_OVF_W<INT_ENA_SPEC> {
219        TIMER_OVF_W::new(self, 3)
220    }
221    #[doc = "The interrupt enable bit for the DUTY_CHNG_END_CH(0-7) interrupt."]
222    #[doc = ""]
223    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `DUTY_CHNG_END_CH0` field.</div>"]
224    #[inline(always)]
225    pub fn duty_chng_end_ch(&mut self, n: u8) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
226        #[allow(clippy::no_effect)]
227        [(); 8][n as usize];
228        DUTY_CHNG_END_CH_W::new(self, n + 4)
229    }
230    #[doc = "Bit 4 - The interrupt enable bit for the DUTY_CHNG_END_CH0 interrupt."]
231    #[inline(always)]
232    pub fn duty_chng_end_ch0(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
233        DUTY_CHNG_END_CH_W::new(self, 4)
234    }
235    #[doc = "Bit 5 - The interrupt enable bit for the DUTY_CHNG_END_CH1 interrupt."]
236    #[inline(always)]
237    pub fn duty_chng_end_ch1(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
238        DUTY_CHNG_END_CH_W::new(self, 5)
239    }
240    #[doc = "Bit 6 - The interrupt enable bit for the DUTY_CHNG_END_CH2 interrupt."]
241    #[inline(always)]
242    pub fn duty_chng_end_ch2(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
243        DUTY_CHNG_END_CH_W::new(self, 6)
244    }
245    #[doc = "Bit 7 - The interrupt enable bit for the DUTY_CHNG_END_CH3 interrupt."]
246    #[inline(always)]
247    pub fn duty_chng_end_ch3(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
248        DUTY_CHNG_END_CH_W::new(self, 7)
249    }
250    #[doc = "Bit 8 - The interrupt enable bit for the DUTY_CHNG_END_CH4 interrupt."]
251    #[inline(always)]
252    pub fn duty_chng_end_ch4(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
253        DUTY_CHNG_END_CH_W::new(self, 8)
254    }
255    #[doc = "Bit 9 - The interrupt enable bit for the DUTY_CHNG_END_CH5 interrupt."]
256    #[inline(always)]
257    pub fn duty_chng_end_ch5(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
258        DUTY_CHNG_END_CH_W::new(self, 9)
259    }
260    #[doc = "Bit 10 - The interrupt enable bit for the DUTY_CHNG_END_CH6 interrupt."]
261    #[inline(always)]
262    pub fn duty_chng_end_ch6(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
263        DUTY_CHNG_END_CH_W::new(self, 10)
264    }
265    #[doc = "Bit 11 - The interrupt enable bit for the DUTY_CHNG_END_CH7 interrupt."]
266    #[inline(always)]
267    pub fn duty_chng_end_ch7(&mut self) -> DUTY_CHNG_END_CH_W<INT_ENA_SPEC> {
268        DUTY_CHNG_END_CH_W::new(self, 11)
269    }
270    #[doc = "The interrupt enable bit for the OVF_CNT_CH(0-7) interrupt."]
271    #[doc = ""]
272    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `OVF_CNT_CH0` field.</div>"]
273    #[inline(always)]
274    pub fn ovf_cnt_ch(&mut self, n: u8) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
275        #[allow(clippy::no_effect)]
276        [(); 8][n as usize];
277        OVF_CNT_CH_W::new(self, n + 12)
278    }
279    #[doc = "Bit 12 - The interrupt enable bit for the OVF_CNT_CH0 interrupt."]
280    #[inline(always)]
281    pub fn ovf_cnt_ch0(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
282        OVF_CNT_CH_W::new(self, 12)
283    }
284    #[doc = "Bit 13 - The interrupt enable bit for the OVF_CNT_CH1 interrupt."]
285    #[inline(always)]
286    pub fn ovf_cnt_ch1(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
287        OVF_CNT_CH_W::new(self, 13)
288    }
289    #[doc = "Bit 14 - The interrupt enable bit for the OVF_CNT_CH2 interrupt."]
290    #[inline(always)]
291    pub fn ovf_cnt_ch2(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
292        OVF_CNT_CH_W::new(self, 14)
293    }
294    #[doc = "Bit 15 - The interrupt enable bit for the OVF_CNT_CH3 interrupt."]
295    #[inline(always)]
296    pub fn ovf_cnt_ch3(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
297        OVF_CNT_CH_W::new(self, 15)
298    }
299    #[doc = "Bit 16 - The interrupt enable bit for the OVF_CNT_CH4 interrupt."]
300    #[inline(always)]
301    pub fn ovf_cnt_ch4(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
302        OVF_CNT_CH_W::new(self, 16)
303    }
304    #[doc = "Bit 17 - The interrupt enable bit for the OVF_CNT_CH5 interrupt."]
305    #[inline(always)]
306    pub fn ovf_cnt_ch5(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
307        OVF_CNT_CH_W::new(self, 17)
308    }
309    #[doc = "Bit 18 - The interrupt enable bit for the OVF_CNT_CH6 interrupt."]
310    #[inline(always)]
311    pub fn ovf_cnt_ch6(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
312        OVF_CNT_CH_W::new(self, 18)
313    }
314    #[doc = "Bit 19 - The interrupt enable bit for the OVF_CNT_CH7 interrupt."]
315    #[inline(always)]
316    pub fn ovf_cnt_ch7(&mut self) -> OVF_CNT_CH_W<INT_ENA_SPEC> {
317        OVF_CNT_CH_W::new(self, 19)
318    }
319}
320#[doc = "Interrupt enable bits\n\nYou can [`read`](crate::Reg::read) this register and get [`int_ena::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_ena::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
321pub struct INT_ENA_SPEC;
322impl crate::RegisterSpec for INT_ENA_SPEC {
323    type Ux = u32;
324}
325#[doc = "`read()` method returns [`int_ena::R`](R) reader structure"]
326impl crate::Readable for INT_ENA_SPEC {}
327#[doc = "`write(|w| ..)` method takes [`int_ena::W`](W) writer structure"]
328impl crate::Writable for INT_ENA_SPEC {
329    type Safety = crate::Unsafe;
330}
331#[doc = "`reset()` method sets INT_ENA to value 0"]
332impl crate::Resettable for INT_ENA_SPEC {}