stm32g4_staging/stm32g484/dmamux/
cfr.rs

1///Register `CFR` writer
2pub type W = crate::W<CFRrs>;
3/**Synchronization Clear Overrun Flag %s
4
5Value on reset: 0*/
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum CSOF0W {
9    ///1: Clear synchronization flag
10    Clear = 1,
11}
12impl From<CSOF0W> for bool {
13    #[inline(always)]
14    fn from(variant: CSOF0W) -> Self {
15        variant as u8 != 0
16    }
17}
18///Field `CSOF(0-15)` writer - Synchronization Clear Overrun Flag %s
19pub type CSOF_W<'a, REG> = crate::BitWriter1C<'a, REG, CSOF0W>;
20impl<'a, REG> CSOF_W<'a, REG>
21where
22    REG: crate::Writable + crate::RegisterSpec,
23{
24    ///Clear synchronization flag
25    #[inline(always)]
26    pub fn clear(self) -> &'a mut crate::W<REG> {
27        self.variant(CSOF0W::Clear)
28    }
29}
30impl core::fmt::Debug for crate::generic::Reg<CFRrs> {
31    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
32        write!(f, "(not readable)")
33    }
34}
35impl W {
36    ///Synchronization Clear Overrun Flag (0-15)
37    ///
38    ///<div class="warning">`n` is number of field in register. `n == 0` corresponds to `CSOF0` field.</div>
39    #[inline(always)]
40    pub fn csof(&mut self, n: u8) -> CSOF_W<CFRrs> {
41        #[allow(clippy::no_effect)] [(); 16][n as usize];
42        CSOF_W::new(self, n)
43    }
44    ///Bit 0 - Synchronization Clear Overrun Flag 0
45    #[inline(always)]
46    pub fn csof0(&mut self) -> CSOF_W<CFRrs> {
47        CSOF_W::new(self, 0)
48    }
49    ///Bit 1 - Synchronization Clear Overrun Flag 1
50    #[inline(always)]
51    pub fn csof1(&mut self) -> CSOF_W<CFRrs> {
52        CSOF_W::new(self, 1)
53    }
54    ///Bit 2 - Synchronization Clear Overrun Flag 2
55    #[inline(always)]
56    pub fn csof2(&mut self) -> CSOF_W<CFRrs> {
57        CSOF_W::new(self, 2)
58    }
59    ///Bit 3 - Synchronization Clear Overrun Flag 3
60    #[inline(always)]
61    pub fn csof3(&mut self) -> CSOF_W<CFRrs> {
62        CSOF_W::new(self, 3)
63    }
64    ///Bit 4 - Synchronization Clear Overrun Flag 4
65    #[inline(always)]
66    pub fn csof4(&mut self) -> CSOF_W<CFRrs> {
67        CSOF_W::new(self, 4)
68    }
69    ///Bit 5 - Synchronization Clear Overrun Flag 5
70    #[inline(always)]
71    pub fn csof5(&mut self) -> CSOF_W<CFRrs> {
72        CSOF_W::new(self, 5)
73    }
74    ///Bit 6 - Synchronization Clear Overrun Flag 6
75    #[inline(always)]
76    pub fn csof6(&mut self) -> CSOF_W<CFRrs> {
77        CSOF_W::new(self, 6)
78    }
79    ///Bit 7 - Synchronization Clear Overrun Flag 7
80    #[inline(always)]
81    pub fn csof7(&mut self) -> CSOF_W<CFRrs> {
82        CSOF_W::new(self, 7)
83    }
84    ///Bit 8 - Synchronization Clear Overrun Flag 8
85    #[inline(always)]
86    pub fn csof8(&mut self) -> CSOF_W<CFRrs> {
87        CSOF_W::new(self, 8)
88    }
89    ///Bit 9 - Synchronization Clear Overrun Flag 9
90    #[inline(always)]
91    pub fn csof9(&mut self) -> CSOF_W<CFRrs> {
92        CSOF_W::new(self, 9)
93    }
94    ///Bit 10 - Synchronization Clear Overrun Flag 10
95    #[inline(always)]
96    pub fn csof10(&mut self) -> CSOF_W<CFRrs> {
97        CSOF_W::new(self, 10)
98    }
99    ///Bit 11 - Synchronization Clear Overrun Flag 11
100    #[inline(always)]
101    pub fn csof11(&mut self) -> CSOF_W<CFRrs> {
102        CSOF_W::new(self, 11)
103    }
104    ///Bit 12 - Synchronization Clear Overrun Flag 12
105    #[inline(always)]
106    pub fn csof12(&mut self) -> CSOF_W<CFRrs> {
107        CSOF_W::new(self, 12)
108    }
109    ///Bit 13 - Synchronization Clear Overrun Flag 13
110    #[inline(always)]
111    pub fn csof13(&mut self) -> CSOF_W<CFRrs> {
112        CSOF_W::new(self, 13)
113    }
114    ///Bit 14 - Synchronization Clear Overrun Flag 14
115    #[inline(always)]
116    pub fn csof14(&mut self) -> CSOF_W<CFRrs> {
117        CSOF_W::new(self, 14)
118    }
119    ///Bit 15 - Synchronization Clear Overrun Flag 15
120    #[inline(always)]
121    pub fn csof15(&mut self) -> CSOF_W<CFRrs> {
122        CSOF_W::new(self, 15)
123    }
124}
125/**DMAMUX request line multiplexer interrupt clear flag register
126
127You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cfr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
128
129See register [structure](https://stm32-rs.github.io/stm32-rs/STM32G484.html#DMAMUX:CFR)*/
130pub struct CFRrs;
131impl crate::RegisterSpec for CFRrs {
132    type Ux = u32;
133}
134///`write(|w| ..)` method takes [`cfr::W`](W) writer structure
135impl crate::Writable for CFRrs {
136    type Safety = crate::Unsafe;
137    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0xffff;
138}
139///`reset()` method sets CFR to value 0
140impl crate::Resettable for CFRrs {}