muscab1_pac/qspifctrl/
flashcmdctrl.rs1#[doc = "Register `FLASHCMDCTRL` reader"]
2pub type R = crate::R<FlashcmdctrlSpec>;
3#[doc = "Register `FLASHCMDCTRL` writer"]
4pub type W = crate::W<FlashcmdctrlSpec>;
5#[doc = "Field `CMDEXEC` reader - Execute the command"]
6pub type CmdexecR = crate::BitReader;
7#[doc = "Field `CMDEXEC` writer - Execute the command"]
8pub type CmdexecW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CMDEXINPROG` reader - Command execution in progress"]
10pub type CmdexinprogR = crate::BitReader;
11#[doc = "Field `CMDEXINPROG` writer - Command execution in progress"]
12pub type CmdexinprogW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DUMCYCNUM` reader - Number of Dummy Cycles"]
14pub type DumcycnumR = crate::FieldReader;
15#[doc = "Field `DUMCYCNUM` writer - Number of Dummy Cycles"]
16pub type DumcycnumW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
17#[doc = "Field `WRDATABYTENUM` reader - Number of Write Data Bytes"]
18pub type WrdatabytenumR = crate::FieldReader;
19#[doc = "Field `WRDATABYTENUM` writer - Number of Write Data Bytes"]
20pub type WrdatabytenumW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
21#[doc = "Field `WRDATAEN` reader - Write Data Enable"]
22pub type WrdataenR = crate::BitReader;
23#[doc = "Field `WRDATAEN` writer - Write Data Enable"]
24pub type WrdataenW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `ADDRBYTENUM` reader - Number of Address Bytes"]
26pub type AddrbytenumR = crate::FieldReader;
27#[doc = "Field `ADDRBYTENUM` writer - Number of Address Bytes"]
28pub type AddrbytenumW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29#[doc = "Field `MODEBITEN` reader - Mode Bit Enable"]
30pub type ModebitenR = crate::BitReader;
31#[doc = "Field `MODEBITEN` writer - Mode Bit Enable"]
32pub type ModebitenW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `CMDADDREN` reader - Command Address Enable"]
34pub type CmdaddrenR = crate::BitReader;
35#[doc = "Field `CMDADDREN` writer - Command Address Enable"]
36pub type CmdaddrenW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `RDATABYTENUM` reader - Number of Read Data Bytes"]
38pub type RdatabytenumR = crate::FieldReader;
39#[doc = "Field `RDATABYTENUM` writer - Number of Read Data Bytes"]
40pub type RdatabytenumW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
41#[doc = "Field `RDATAEN` reader - Read Data Enable"]
42pub type RdataenR = crate::BitReader;
43#[doc = "Field `RDATAEN` writer - Read Data Enable"]
44pub type RdataenW<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `CMDOPCODE` reader - Command Opcode"]
46pub type CmdopcodeR = crate::FieldReader;
47#[doc = "Field `CMDOPCODE` writer - Command Opcode"]
48pub type CmdopcodeW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
49impl R {
50 #[doc = "Bit 0 - Execute the command"]
51 #[inline(always)]
52 pub fn cmdexec(&self) -> CmdexecR {
53 CmdexecR::new((self.bits & 1) != 0)
54 }
55 #[doc = "Bit 1 - Command execution in progress"]
56 #[inline(always)]
57 pub fn cmdexinprog(&self) -> CmdexinprogR {
58 CmdexinprogR::new(((self.bits >> 1) & 1) != 0)
59 }
60 #[doc = "Bits 7:11 - Number of Dummy Cycles"]
61 #[inline(always)]
62 pub fn dumcycnum(&self) -> DumcycnumR {
63 DumcycnumR::new(((self.bits >> 7) & 0x1f) as u8)
64 }
65 #[doc = "Bits 12:14 - Number of Write Data Bytes"]
66 #[inline(always)]
67 pub fn wrdatabytenum(&self) -> WrdatabytenumR {
68 WrdatabytenumR::new(((self.bits >> 12) & 7) as u8)
69 }
70 #[doc = "Bit 15 - Write Data Enable"]
71 #[inline(always)]
72 pub fn wrdataen(&self) -> WrdataenR {
73 WrdataenR::new(((self.bits >> 15) & 1) != 0)
74 }
75 #[doc = "Bits 16:17 - Number of Address Bytes"]
76 #[inline(always)]
77 pub fn addrbytenum(&self) -> AddrbytenumR {
78 AddrbytenumR::new(((self.bits >> 16) & 3) as u8)
79 }
80 #[doc = "Bit 18 - Mode Bit Enable"]
81 #[inline(always)]
82 pub fn modebiten(&self) -> ModebitenR {
83 ModebitenR::new(((self.bits >> 18) & 1) != 0)
84 }
85 #[doc = "Bit 19 - Command Address Enable"]
86 #[inline(always)]
87 pub fn cmdaddren(&self) -> CmdaddrenR {
88 CmdaddrenR::new(((self.bits >> 19) & 1) != 0)
89 }
90 #[doc = "Bits 20:22 - Number of Read Data Bytes"]
91 #[inline(always)]
92 pub fn rdatabytenum(&self) -> RdatabytenumR {
93 RdatabytenumR::new(((self.bits >> 20) & 7) as u8)
94 }
95 #[doc = "Bit 23 - Read Data Enable"]
96 #[inline(always)]
97 pub fn rdataen(&self) -> RdataenR {
98 RdataenR::new(((self.bits >> 23) & 1) != 0)
99 }
100 #[doc = "Bits 24:31 - Command Opcode"]
101 #[inline(always)]
102 pub fn cmdopcode(&self) -> CmdopcodeR {
103 CmdopcodeR::new(((self.bits >> 24) & 0xff) as u8)
104 }
105}
106impl W {
107 #[doc = "Bit 0 - Execute the command"]
108 #[inline(always)]
109 pub fn cmdexec(&mut self) -> CmdexecW<FlashcmdctrlSpec> {
110 CmdexecW::new(self, 0)
111 }
112 #[doc = "Bit 1 - Command execution in progress"]
113 #[inline(always)]
114 pub fn cmdexinprog(&mut self) -> CmdexinprogW<FlashcmdctrlSpec> {
115 CmdexinprogW::new(self, 1)
116 }
117 #[doc = "Bits 7:11 - Number of Dummy Cycles"]
118 #[inline(always)]
119 pub fn dumcycnum(&mut self) -> DumcycnumW<FlashcmdctrlSpec> {
120 DumcycnumW::new(self, 7)
121 }
122 #[doc = "Bits 12:14 - Number of Write Data Bytes"]
123 #[inline(always)]
124 pub fn wrdatabytenum(&mut self) -> WrdatabytenumW<FlashcmdctrlSpec> {
125 WrdatabytenumW::new(self, 12)
126 }
127 #[doc = "Bit 15 - Write Data Enable"]
128 #[inline(always)]
129 pub fn wrdataen(&mut self) -> WrdataenW<FlashcmdctrlSpec> {
130 WrdataenW::new(self, 15)
131 }
132 #[doc = "Bits 16:17 - Number of Address Bytes"]
133 #[inline(always)]
134 pub fn addrbytenum(&mut self) -> AddrbytenumW<FlashcmdctrlSpec> {
135 AddrbytenumW::new(self, 16)
136 }
137 #[doc = "Bit 18 - Mode Bit Enable"]
138 #[inline(always)]
139 pub fn modebiten(&mut self) -> ModebitenW<FlashcmdctrlSpec> {
140 ModebitenW::new(self, 18)
141 }
142 #[doc = "Bit 19 - Command Address Enable"]
143 #[inline(always)]
144 pub fn cmdaddren(&mut self) -> CmdaddrenW<FlashcmdctrlSpec> {
145 CmdaddrenW::new(self, 19)
146 }
147 #[doc = "Bits 20:22 - Number of Read Data Bytes"]
148 #[inline(always)]
149 pub fn rdatabytenum(&mut self) -> RdatabytenumW<FlashcmdctrlSpec> {
150 RdatabytenumW::new(self, 20)
151 }
152 #[doc = "Bit 23 - Read Data Enable"]
153 #[inline(always)]
154 pub fn rdataen(&mut self) -> RdataenW<FlashcmdctrlSpec> {
155 RdataenW::new(self, 23)
156 }
157 #[doc = "Bits 24:31 - Command Opcode"]
158 #[inline(always)]
159 pub fn cmdopcode(&mut self) -> CmdopcodeW<FlashcmdctrlSpec> {
160 CmdopcodeW::new(self, 24)
161 }
162}
163#[doc = "Flash Command Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`flashcmdctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`flashcmdctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
164pub struct FlashcmdctrlSpec;
165impl crate::RegisterSpec for FlashcmdctrlSpec {
166 type Ux = u32;
167}
168#[doc = "`read()` method returns [`flashcmdctrl::R`](R) reader structure"]
169impl crate::Readable for FlashcmdctrlSpec {}
170#[doc = "`write(|w| ..)` method takes [`flashcmdctrl::W`](W) writer structure"]
171impl crate::Writable for FlashcmdctrlSpec {
172 type Safety = crate::Unsafe;
173 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
174 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
175}
176#[doc = "`reset()` method sets FLASHCMDCTRL to value 0"]
177impl crate::Resettable for FlashcmdctrlSpec {
178 const RESET_VALUE: u32 = 0;
179}