stm32u5/stm32u585/octospi1/
fcr.rs

1///Register `FCR` writer
2pub type W = crate::W<FCRrs>;
3/**Clear Transfer error flag
4
5Value on reset: 0*/
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum CTEF {
9    ///1: Writing 1 clears the TEF flag in the OCTOSPI_SR register
10    Clear = 1,
11}
12impl From<CTEF> for bool {
13    #[inline(always)]
14    fn from(variant: CTEF) -> Self {
15        variant as u8 != 0
16    }
17}
18///Field `CTEF` writer - Clear Transfer error flag
19pub type CTEF_W<'a, REG> = crate::BitWriter<'a, REG, CTEF>;
20impl<'a, REG> CTEF_W<'a, REG>
21where
22    REG: crate::Writable + crate::RegisterSpec,
23{
24    ///Writing 1 clears the TEF flag in the OCTOSPI_SR register
25    #[inline(always)]
26    pub fn clear(self) -> &'a mut crate::W<REG> {
27        self.variant(CTEF::Clear)
28    }
29}
30/**Clear transfer complete flag
31
32Value on reset: 0*/
33#[cfg_attr(feature = "defmt", derive(defmt::Format))]
34#[derive(Clone, Copy, Debug, PartialEq, Eq)]
35pub enum CTCF {
36    ///1: Writing 1 clears the TCF flag in the OCTOSPI_SR register
37    Clear = 1,
38}
39impl From<CTCF> for bool {
40    #[inline(always)]
41    fn from(variant: CTCF) -> Self {
42        variant as u8 != 0
43    }
44}
45///Field `CTCF` writer - Clear transfer complete flag
46pub type CTCF_W<'a, REG> = crate::BitWriter<'a, REG, CTCF>;
47impl<'a, REG> CTCF_W<'a, REG>
48where
49    REG: crate::Writable + crate::RegisterSpec,
50{
51    ///Writing 1 clears the TCF flag in the OCTOSPI_SR register
52    #[inline(always)]
53    pub fn clear(self) -> &'a mut crate::W<REG> {
54        self.variant(CTCF::Clear)
55    }
56}
57/**Clear status match flag
58
59Value on reset: 0*/
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum CSMF {
63    ///1: Writing 1 clears the SMF flag in the OCTOSPI_SR register
64    Clear = 1,
65}
66impl From<CSMF> for bool {
67    #[inline(always)]
68    fn from(variant: CSMF) -> Self {
69        variant as u8 != 0
70    }
71}
72///Field `CSMF` writer - Clear status match flag
73pub type CSMF_W<'a, REG> = crate::BitWriter<'a, REG, CSMF>;
74impl<'a, REG> CSMF_W<'a, REG>
75where
76    REG: crate::Writable + crate::RegisterSpec,
77{
78    ///Writing 1 clears the SMF flag in the OCTOSPI_SR register
79    #[inline(always)]
80    pub fn clear(self) -> &'a mut crate::W<REG> {
81        self.variant(CSMF::Clear)
82    }
83}
84/**Clear timeout flag
85
86Value on reset: 0*/
87#[cfg_attr(feature = "defmt", derive(defmt::Format))]
88#[derive(Clone, Copy, Debug, PartialEq, Eq)]
89pub enum CTOF {
90    ///1: Writing 1 clears the TOF flag in the OCTOSPI_SR register
91    Clear = 1,
92}
93impl From<CTOF> for bool {
94    #[inline(always)]
95    fn from(variant: CTOF) -> Self {
96        variant as u8 != 0
97    }
98}
99///Field `CTOF` writer - Clear timeout flag
100pub type CTOF_W<'a, REG> = crate::BitWriter<'a, REG, CTOF>;
101impl<'a, REG> CTOF_W<'a, REG>
102where
103    REG: crate::Writable + crate::RegisterSpec,
104{
105    ///Writing 1 clears the TOF flag in the OCTOSPI_SR register
106    #[inline(always)]
107    pub fn clear(self) -> &'a mut crate::W<REG> {
108        self.variant(CTOF::Clear)
109    }
110}
111impl core::fmt::Debug for crate::generic::Reg<FCRrs> {
112    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
113        write!(f, "(not readable)")
114    }
115}
116impl W {
117    ///Bit 0 - Clear Transfer error flag
118    #[inline(always)]
119    pub fn ctef(&mut self) -> CTEF_W<FCRrs> {
120        CTEF_W::new(self, 0)
121    }
122    ///Bit 1 - Clear transfer complete flag
123    #[inline(always)]
124    pub fn ctcf(&mut self) -> CTCF_W<FCRrs> {
125        CTCF_W::new(self, 1)
126    }
127    ///Bit 3 - Clear status match flag
128    #[inline(always)]
129    pub fn csmf(&mut self) -> CSMF_W<FCRrs> {
130        CSMF_W::new(self, 3)
131    }
132    ///Bit 4 - Clear timeout flag
133    #[inline(always)]
134    pub fn ctof(&mut self) -> CTOF_W<FCRrs> {
135        CTOF_W::new(self, 4)
136    }
137}
138/**flag clear register
139
140You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fcr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
141
142See register [structure](https://stm32-rs.github.io/stm32-rs/STM32U585.html#OCTOSPI1:FCR)*/
143pub struct FCRrs;
144impl crate::RegisterSpec for FCRrs {
145    type Ux = u32;
146}
147///`write(|w| ..)` method takes [`fcr::W`](W) writer structure
148impl crate::Writable for FCRrs {
149    type Safety = crate::Unsafe;
150}
151///`reset()` method sets FCR to value 0
152impl crate::Resettable for FCRrs {}