stm32wb_pac/ipcc/
c2mr.rs

1#[doc = "Reader of register C2MR"]
2pub type R = crate::R<u32, super::C2MR>;
3#[doc = "Writer for register C2MR"]
4pub type W = crate::W<u32, super::C2MR>;
5#[doc = "Register C2MR `reset()`'s with value 0xffff_ffff"]
6impl crate::ResetValue for super::C2MR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0xffff_ffff
11    }
12}
13#[doc = "Reader of field `CH6FM`"]
14pub type CH6FM_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `CH6FM`"]
16pub struct CH6FM_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> CH6FM_W<'a> {
20    #[doc = r"Sets the field bit"]
21    #[inline(always)]
22    pub fn set_bit(self) -> &'a mut W {
23        self.bit(true)
24    }
25    #[doc = r"Clears the field bit"]
26    #[inline(always)]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r"Writes raw bits to the field"]
31    #[inline(always)]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
34        self.w
35    }
36}
37#[doc = "Reader of field `CH5FM`"]
38pub type CH5FM_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `CH5FM`"]
40pub struct CH5FM_W<'a> {
41    w: &'a mut W,
42}
43impl<'a> CH5FM_W<'a> {
44    #[doc = r"Sets the field bit"]
45    #[inline(always)]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r"Clears the field bit"]
50    #[inline(always)]
51    pub fn clear_bit(self) -> &'a mut W {
52        self.bit(false)
53    }
54    #[doc = r"Writes raw bits to the field"]
55    #[inline(always)]
56    pub fn bit(self, value: bool) -> &'a mut W {
57        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
58        self.w
59    }
60}
61#[doc = "Reader of field `CH4FM`"]
62pub type CH4FM_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `CH4FM`"]
64pub struct CH4FM_W<'a> {
65    w: &'a mut W,
66}
67impl<'a> CH4FM_W<'a> {
68    #[doc = r"Sets the field bit"]
69    #[inline(always)]
70    pub fn set_bit(self) -> &'a mut W {
71        self.bit(true)
72    }
73    #[doc = r"Clears the field bit"]
74    #[inline(always)]
75    pub fn clear_bit(self) -> &'a mut W {
76        self.bit(false)
77    }
78    #[doc = r"Writes raw bits to the field"]
79    #[inline(always)]
80    pub fn bit(self, value: bool) -> &'a mut W {
81        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
82        self.w
83    }
84}
85#[doc = "Reader of field `CH3FM`"]
86pub type CH3FM_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `CH3FM`"]
88pub struct CH3FM_W<'a> {
89    w: &'a mut W,
90}
91impl<'a> CH3FM_W<'a> {
92    #[doc = r"Sets the field bit"]
93    #[inline(always)]
94    pub fn set_bit(self) -> &'a mut W {
95        self.bit(true)
96    }
97    #[doc = r"Clears the field bit"]
98    #[inline(always)]
99    pub fn clear_bit(self) -> &'a mut W {
100        self.bit(false)
101    }
102    #[doc = r"Writes raw bits to the field"]
103    #[inline(always)]
104    pub fn bit(self, value: bool) -> &'a mut W {
105        self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
106        self.w
107    }
108}
109#[doc = "Reader of field `CH2FM`"]
110pub type CH2FM_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `CH2FM`"]
112pub struct CH2FM_W<'a> {
113    w: &'a mut W,
114}
115impl<'a> CH2FM_W<'a> {
116    #[doc = r"Sets the field bit"]
117    #[inline(always)]
118    pub fn set_bit(self) -> &'a mut W {
119        self.bit(true)
120    }
121    #[doc = r"Clears the field bit"]
122    #[inline(always)]
123    pub fn clear_bit(self) -> &'a mut W {
124        self.bit(false)
125    }
126    #[doc = r"Writes raw bits to the field"]
127    #[inline(always)]
128    pub fn bit(self, value: bool) -> &'a mut W {
129        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
130        self.w
131    }
132}
133#[doc = "Reader of field `CH1FM`"]
134pub type CH1FM_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `CH1FM`"]
136pub struct CH1FM_W<'a> {
137    w: &'a mut W,
138}
139impl<'a> CH1FM_W<'a> {
140    #[doc = r"Sets the field bit"]
141    #[inline(always)]
142    pub fn set_bit(self) -> &'a mut W {
143        self.bit(true)
144    }
145    #[doc = r"Clears the field bit"]
146    #[inline(always)]
147    pub fn clear_bit(self) -> &'a mut W {
148        self.bit(false)
149    }
150    #[doc = r"Writes raw bits to the field"]
151    #[inline(always)]
152    pub fn bit(self, value: bool) -> &'a mut W {
153        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
154        self.w
155    }
156}
157#[doc = "Reader of field `CH6OM`"]
158pub type CH6OM_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `CH6OM`"]
160pub struct CH6OM_W<'a> {
161    w: &'a mut W,
162}
163impl<'a> CH6OM_W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
178        self.w
179    }
180}
181#[doc = "Reader of field `CH5OM`"]
182pub type CH5OM_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `CH5OM`"]
184pub struct CH5OM_W<'a> {
185    w: &'a mut W,
186}
187impl<'a> CH5OM_W<'a> {
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
202        self.w
203    }
204}
205#[doc = "Reader of field `CH4OM`"]
206pub type CH4OM_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `CH4OM`"]
208pub struct CH4OM_W<'a> {
209    w: &'a mut W,
210}
211impl<'a> CH4OM_W<'a> {
212    #[doc = r"Sets the field bit"]
213    #[inline(always)]
214    pub fn set_bit(self) -> &'a mut W {
215        self.bit(true)
216    }
217    #[doc = r"Clears the field bit"]
218    #[inline(always)]
219    pub fn clear_bit(self) -> &'a mut W {
220        self.bit(false)
221    }
222    #[doc = r"Writes raw bits to the field"]
223    #[inline(always)]
224    pub fn bit(self, value: bool) -> &'a mut W {
225        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
226        self.w
227    }
228}
229#[doc = "Reader of field `CH3OM`"]
230pub type CH3OM_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `CH3OM`"]
232pub struct CH3OM_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> CH3OM_W<'a> {
236    #[doc = r"Sets the field bit"]
237    #[inline(always)]
238    pub fn set_bit(self) -> &'a mut W {
239        self.bit(true)
240    }
241    #[doc = r"Clears the field bit"]
242    #[inline(always)]
243    pub fn clear_bit(self) -> &'a mut W {
244        self.bit(false)
245    }
246    #[doc = r"Writes raw bits to the field"]
247    #[inline(always)]
248    pub fn bit(self, value: bool) -> &'a mut W {
249        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
250        self.w
251    }
252}
253#[doc = "Reader of field `CH2OM`"]
254pub type CH2OM_R = crate::R<bool, bool>;
255#[doc = "Write proxy for field `CH2OM`"]
256pub struct CH2OM_W<'a> {
257    w: &'a mut W,
258}
259impl<'a> CH2OM_W<'a> {
260    #[doc = r"Sets the field bit"]
261    #[inline(always)]
262    pub fn set_bit(self) -> &'a mut W {
263        self.bit(true)
264    }
265    #[doc = r"Clears the field bit"]
266    #[inline(always)]
267    pub fn clear_bit(self) -> &'a mut W {
268        self.bit(false)
269    }
270    #[doc = r"Writes raw bits to the field"]
271    #[inline(always)]
272    pub fn bit(self, value: bool) -> &'a mut W {
273        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
274        self.w
275    }
276}
277#[doc = "Reader of field `CH1OM`"]
278pub type CH1OM_R = crate::R<bool, bool>;
279#[doc = "Write proxy for field `CH1OM`"]
280pub struct CH1OM_W<'a> {
281    w: &'a mut W,
282}
283impl<'a> CH1OM_W<'a> {
284    #[doc = r"Sets the field bit"]
285    #[inline(always)]
286    pub fn set_bit(self) -> &'a mut W {
287        self.bit(true)
288    }
289    #[doc = r"Clears the field bit"]
290    #[inline(always)]
291    pub fn clear_bit(self) -> &'a mut W {
292        self.bit(false)
293    }
294    #[doc = r"Writes raw bits to the field"]
295    #[inline(always)]
296    pub fn bit(self, value: bool) -> &'a mut W {
297        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
298        self.w
299    }
300}
301impl R {
302    #[doc = "Bit 21 - processor 2 Transmit channel 6 free interrupt mask"]
303    #[inline(always)]
304    pub fn ch6fm(&self) -> CH6FM_R {
305        CH6FM_R::new(((self.bits >> 21) & 0x01) != 0)
306    }
307    #[doc = "Bit 20 - processor 2 Transmit channel 5 free interrupt mask"]
308    #[inline(always)]
309    pub fn ch5fm(&self) -> CH5FM_R {
310        CH5FM_R::new(((self.bits >> 20) & 0x01) != 0)
311    }
312    #[doc = "Bit 19 - processor 2 Transmit channel 4 free interrupt mask"]
313    #[inline(always)]
314    pub fn ch4fm(&self) -> CH4FM_R {
315        CH4FM_R::new(((self.bits >> 19) & 0x01) != 0)
316    }
317    #[doc = "Bit 18 - processor 2 Transmit channel 3 free interrupt mask"]
318    #[inline(always)]
319    pub fn ch3fm(&self) -> CH3FM_R {
320        CH3FM_R::new(((self.bits >> 18) & 0x01) != 0)
321    }
322    #[doc = "Bit 17 - processor 2 Transmit channel 2 free interrupt mask"]
323    #[inline(always)]
324    pub fn ch2fm(&self) -> CH2FM_R {
325        CH2FM_R::new(((self.bits >> 17) & 0x01) != 0)
326    }
327    #[doc = "Bit 16 - processor 2 Transmit channel 1 free interrupt mask"]
328    #[inline(always)]
329    pub fn ch1fm(&self) -> CH1FM_R {
330        CH1FM_R::new(((self.bits >> 16) & 0x01) != 0)
331    }
332    #[doc = "Bit 5 - processor 2 Receive channel 6 occupied interrupt enable"]
333    #[inline(always)]
334    pub fn ch6om(&self) -> CH6OM_R {
335        CH6OM_R::new(((self.bits >> 5) & 0x01) != 0)
336    }
337    #[doc = "Bit 4 - processor 2 Receive channel 5 occupied interrupt enable"]
338    #[inline(always)]
339    pub fn ch5om(&self) -> CH5OM_R {
340        CH5OM_R::new(((self.bits >> 4) & 0x01) != 0)
341    }
342    #[doc = "Bit 3 - processor 2 Receive channel 4 occupied interrupt enable"]
343    #[inline(always)]
344    pub fn ch4om(&self) -> CH4OM_R {
345        CH4OM_R::new(((self.bits >> 3) & 0x01) != 0)
346    }
347    #[doc = "Bit 2 - processor 2 Receive channel 3 occupied interrupt enable"]
348    #[inline(always)]
349    pub fn ch3om(&self) -> CH3OM_R {
350        CH3OM_R::new(((self.bits >> 2) & 0x01) != 0)
351    }
352    #[doc = "Bit 1 - processor 2 Receive channel 2 occupied interrupt enable"]
353    #[inline(always)]
354    pub fn ch2om(&self) -> CH2OM_R {
355        CH2OM_R::new(((self.bits >> 1) & 0x01) != 0)
356    }
357    #[doc = "Bit 0 - processor 2 Receive channel 1 occupied interrupt enable"]
358    #[inline(always)]
359    pub fn ch1om(&self) -> CH1OM_R {
360        CH1OM_R::new((self.bits & 0x01) != 0)
361    }
362}
363impl W {
364    #[doc = "Bit 21 - processor 2 Transmit channel 6 free interrupt mask"]
365    #[inline(always)]
366    pub fn ch6fm(&mut self) -> CH6FM_W {
367        CH6FM_W { w: self }
368    }
369    #[doc = "Bit 20 - processor 2 Transmit channel 5 free interrupt mask"]
370    #[inline(always)]
371    pub fn ch5fm(&mut self) -> CH5FM_W {
372        CH5FM_W { w: self }
373    }
374    #[doc = "Bit 19 - processor 2 Transmit channel 4 free interrupt mask"]
375    #[inline(always)]
376    pub fn ch4fm(&mut self) -> CH4FM_W {
377        CH4FM_W { w: self }
378    }
379    #[doc = "Bit 18 - processor 2 Transmit channel 3 free interrupt mask"]
380    #[inline(always)]
381    pub fn ch3fm(&mut self) -> CH3FM_W {
382        CH3FM_W { w: self }
383    }
384    #[doc = "Bit 17 - processor 2 Transmit channel 2 free interrupt mask"]
385    #[inline(always)]
386    pub fn ch2fm(&mut self) -> CH2FM_W {
387        CH2FM_W { w: self }
388    }
389    #[doc = "Bit 16 - processor 2 Transmit channel 1 free interrupt mask"]
390    #[inline(always)]
391    pub fn ch1fm(&mut self) -> CH1FM_W {
392        CH1FM_W { w: self }
393    }
394    #[doc = "Bit 5 - processor 2 Receive channel 6 occupied interrupt enable"]
395    #[inline(always)]
396    pub fn ch6om(&mut self) -> CH6OM_W {
397        CH6OM_W { w: self }
398    }
399    #[doc = "Bit 4 - processor 2 Receive channel 5 occupied interrupt enable"]
400    #[inline(always)]
401    pub fn ch5om(&mut self) -> CH5OM_W {
402        CH5OM_W { w: self }
403    }
404    #[doc = "Bit 3 - processor 2 Receive channel 4 occupied interrupt enable"]
405    #[inline(always)]
406    pub fn ch4om(&mut self) -> CH4OM_W {
407        CH4OM_W { w: self }
408    }
409    #[doc = "Bit 2 - processor 2 Receive channel 3 occupied interrupt enable"]
410    #[inline(always)]
411    pub fn ch3om(&mut self) -> CH3OM_W {
412        CH3OM_W { w: self }
413    }
414    #[doc = "Bit 1 - processor 2 Receive channel 2 occupied interrupt enable"]
415    #[inline(always)]
416    pub fn ch2om(&mut self) -> CH2OM_W {
417        CH2OM_W { w: self }
418    }
419    #[doc = "Bit 0 - processor 2 Receive channel 1 occupied interrupt enable"]
420    #[inline(always)]
421    pub fn ch1om(&mut self) -> CH1OM_W {
422        CH1OM_W { w: self }
423    }
424}