1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#[doc = "Register `CFG_DATA7` reader"]
pub type R = crate::R<CFG_DATA7_SPEC>;
#[doc = "Register `CFG_DATA7` writer"]
pub type W = crate::W<CFG_DATA7_SPEC>;
#[doc = "Field `PIN_STATE` reader - configure cis addr 318 and 574"]
pub type PIN_STATE_R = crate::FieldReader;
#[doc = "Field `PIN_STATE` writer - configure cis addr 318 and 574"]
pub type PIN_STATE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "Field `CHIP_STATE` reader - configure cis addr 312, 315, 568 and 571"]
pub type CHIP_STATE_R = crate::FieldReader;
#[doc = "Field `CHIP_STATE` writer - configure cis addr 312, 315, 568 and 571"]
pub type CHIP_STATE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
#[doc = "Field `SDIO_RST` reader - soft reset control for sdio module"]
pub type SDIO_RST_R = crate::BitReader;
#[doc = "Field `SDIO_RST` writer - soft reset control for sdio module"]
pub type SDIO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDIO_IOREADY0` reader - sdio io ready, high enable"]
pub type SDIO_IOREADY0_R = crate::BitReader;
#[doc = "Field `SDIO_IOREADY0` writer - sdio io ready, high enable"]
pub type SDIO_IOREADY0_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDIO_MEM_PD` reader - sdio memory power down, high active"]
pub type SDIO_MEM_PD_R = crate::BitReader;
#[doc = "Field `SDIO_MEM_PD` writer - sdio memory power down, high active"]
pub type SDIO_MEM_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `ESDIO_DATA1_INT_EN` reader - enable sdio interrupt on data1 line"]
pub type ESDIO_DATA1_INT_EN_R = crate::BitReader;
#[doc = "Field `ESDIO_DATA1_INT_EN` writer - enable sdio interrupt on data1 line"]
pub type ESDIO_DATA1_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDIO_SWITCH_VOLT_SW` reader - control switch voltage change to 1.8V by software. 0:3.3V,1:1.8V"]
pub type SDIO_SWITCH_VOLT_SW_R = crate::BitReader;
#[doc = "Field `SDIO_SWITCH_VOLT_SW` writer - control switch voltage change to 1.8V by software. 0:3.3V,1:1.8V"]
pub type SDIO_SWITCH_VOLT_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `DDR50_BLK_LEN_FIX_EN` reader - enable block length to be fixed to 512 bytes in ddr50 mode"]
pub type DDR50_BLK_LEN_FIX_EN_R = crate::BitReader;
#[doc = "Field `DDR50_BLK_LEN_FIX_EN` writer - enable block length to be fixed to 512 bytes in ddr50 mode"]
pub type DDR50_BLK_LEN_FIX_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CLK_EN` reader - sdio apb clock for configuration force on control:0-gating,1-force on."]
pub type CLK_EN_R = crate::BitReader;
#[doc = "Field `CLK_EN` writer - sdio apb clock for configuration force on control:0-gating,1-force on."]
pub type CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDDR50` reader - configure if support sdr50 mode in cccr"]
pub type SDDR50_R = crate::BitReader;
#[doc = "Field `SDDR50` writer - configure if support sdr50 mode in cccr"]
pub type SDDR50_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SSDR104` reader - configure if support sdr104 mode in cccr"]
pub type SSDR104_R = crate::BitReader;
#[doc = "Field `SSDR104` writer - configure if support sdr104 mode in cccr"]
pub type SSDR104_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SSDR50` reader - configure if support ddr50 mode in cccr"]
pub type SSDR50_R = crate::BitReader;
#[doc = "Field `SSDR50` writer - configure if support ddr50 mode in cccr"]
pub type SSDR50_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDTD` reader - configure if support driver type D in cccr"]
pub type SDTD_R = crate::BitReader;
#[doc = "Field `SDTD` writer - configure if support driver type D in cccr"]
pub type SDTD_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDTA` reader - configure if support driver type A in cccr"]
pub type SDTA_R = crate::BitReader;
#[doc = "Field `SDTA` writer - configure if support driver type A in cccr"]
pub type SDTA_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDTC` reader - configure if support driver type C in cccr"]
pub type SDTC_R = crate::BitReader;
#[doc = "Field `SDTC` writer - configure if support driver type C in cccr"]
pub type SDTC_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SAI` reader - configure if support asynchronous interrupt in cccr"]
pub type SAI_R = crate::BitReader;
#[doc = "Field `SAI` writer - configure if support asynchronous interrupt in cccr"]
pub type SAI_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `SDIO_WAKEUP_CLR` writer - clear sdio_wake_up signal after the chip wakes up"]
pub type SDIO_WAKEUP_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bits 0:7 - configure cis addr 318 and 574"]
    #[inline(always)]
    pub fn pin_state(&self) -> PIN_STATE_R {
        PIN_STATE_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:15 - configure cis addr 312, 315, 568 and 571"]
    #[inline(always)]
    pub fn chip_state(&self) -> CHIP_STATE_R {
        CHIP_STATE_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bit 16 - soft reset control for sdio module"]
    #[inline(always)]
    pub fn sdio_rst(&self) -> SDIO_RST_R {
        SDIO_RST_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - sdio io ready, high enable"]
    #[inline(always)]
    pub fn sdio_ioready0(&self) -> SDIO_IOREADY0_R {
        SDIO_IOREADY0_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - sdio memory power down, high active"]
    #[inline(always)]
    pub fn sdio_mem_pd(&self) -> SDIO_MEM_PD_R {
        SDIO_MEM_PD_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - enable sdio interrupt on data1 line"]
    #[inline(always)]
    pub fn esdio_data1_int_en(&self) -> ESDIO_DATA1_INT_EN_R {
        ESDIO_DATA1_INT_EN_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 20 - control switch voltage change to 1.8V by software. 0:3.3V,1:1.8V"]
    #[inline(always)]
    pub fn sdio_switch_volt_sw(&self) -> SDIO_SWITCH_VOLT_SW_R {
        SDIO_SWITCH_VOLT_SW_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - enable block length to be fixed to 512 bytes in ddr50 mode"]
    #[inline(always)]
    pub fn ddr50_blk_len_fix_en(&self) -> DDR50_BLK_LEN_FIX_EN_R {
        DDR50_BLK_LEN_FIX_EN_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - sdio apb clock for configuration force on control:0-gating,1-force on."]
    #[inline(always)]
    pub fn clk_en(&self) -> CLK_EN_R {
        CLK_EN_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - configure if support sdr50 mode in cccr"]
    #[inline(always)]
    pub fn sddr50(&self) -> SDDR50_R {
        SDDR50_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - configure if support sdr104 mode in cccr"]
    #[inline(always)]
    pub fn ssdr104(&self) -> SSDR104_R {
        SSDR104_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - configure if support ddr50 mode in cccr"]
    #[inline(always)]
    pub fn ssdr50(&self) -> SSDR50_R {
        SSDR50_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - configure if support driver type D in cccr"]
    #[inline(always)]
    pub fn sdtd(&self) -> SDTD_R {
        SDTD_R::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 27 - configure if support driver type A in cccr"]
    #[inline(always)]
    pub fn sdta(&self) -> SDTA_R {
        SDTA_R::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 28 - configure if support driver type C in cccr"]
    #[inline(always)]
    pub fn sdtc(&self) -> SDTC_R {
        SDTC_R::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - configure if support asynchronous interrupt in cccr"]
    #[inline(always)]
    pub fn sai(&self) -> SAI_R {
        SAI_R::new(((self.bits >> 29) & 1) != 0)
    }
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CFG_DATA7")
            .field("pin_state", &format_args!("{}", self.pin_state().bits()))
            .field("chip_state", &format_args!("{}", self.chip_state().bits()))
            .field("sdio_rst", &format_args!("{}", self.sdio_rst().bit()))
            .field(
                "sdio_ioready0",
                &format_args!("{}", self.sdio_ioready0().bit()),
            )
            .field("sdio_mem_pd", &format_args!("{}", self.sdio_mem_pd().bit()))
            .field(
                "esdio_data1_int_en",
                &format_args!("{}", self.esdio_data1_int_en().bit()),
            )
            .field(
                "sdio_switch_volt_sw",
                &format_args!("{}", self.sdio_switch_volt_sw().bit()),
            )
            .field(
                "ddr50_blk_len_fix_en",
                &format_args!("{}", self.ddr50_blk_len_fix_en().bit()),
            )
            .field("clk_en", &format_args!("{}", self.clk_en().bit()))
            .field("sddr50", &format_args!("{}", self.sddr50().bit()))
            .field("ssdr104", &format_args!("{}", self.ssdr104().bit()))
            .field("ssdr50", &format_args!("{}", self.ssdr50().bit()))
            .field("sdtd", &format_args!("{}", self.sdtd().bit()))
            .field("sdta", &format_args!("{}", self.sdta().bit()))
            .field("sdtc", &format_args!("{}", self.sdtc().bit()))
            .field("sai", &format_args!("{}", self.sai().bit()))
            .finish()
    }
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for crate::generic::Reg<CFG_DATA7_SPEC> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        core::fmt::Debug::fmt(&self.read(), f)
    }
}
impl W {
    #[doc = "Bits 0:7 - configure cis addr 318 and 574"]
    #[inline(always)]
    #[must_use]
    pub fn pin_state(&mut self) -> PIN_STATE_W<CFG_DATA7_SPEC> {
        PIN_STATE_W::new(self, 0)
    }
    #[doc = "Bits 8:15 - configure cis addr 312, 315, 568 and 571"]
    #[inline(always)]
    #[must_use]
    pub fn chip_state(&mut self) -> CHIP_STATE_W<CFG_DATA7_SPEC> {
        CHIP_STATE_W::new(self, 8)
    }
    #[doc = "Bit 16 - soft reset control for sdio module"]
    #[inline(always)]
    #[must_use]
    pub fn sdio_rst(&mut self) -> SDIO_RST_W<CFG_DATA7_SPEC> {
        SDIO_RST_W::new(self, 16)
    }
    #[doc = "Bit 17 - sdio io ready, high enable"]
    #[inline(always)]
    #[must_use]
    pub fn sdio_ioready0(&mut self) -> SDIO_IOREADY0_W<CFG_DATA7_SPEC> {
        SDIO_IOREADY0_W::new(self, 17)
    }
    #[doc = "Bit 18 - sdio memory power down, high active"]
    #[inline(always)]
    #[must_use]
    pub fn sdio_mem_pd(&mut self) -> SDIO_MEM_PD_W<CFG_DATA7_SPEC> {
        SDIO_MEM_PD_W::new(self, 18)
    }
    #[doc = "Bit 19 - enable sdio interrupt on data1 line"]
    #[inline(always)]
    #[must_use]
    pub fn esdio_data1_int_en(&mut self) -> ESDIO_DATA1_INT_EN_W<CFG_DATA7_SPEC> {
        ESDIO_DATA1_INT_EN_W::new(self, 19)
    }
    #[doc = "Bit 20 - control switch voltage change to 1.8V by software. 0:3.3V,1:1.8V"]
    #[inline(always)]
    #[must_use]
    pub fn sdio_switch_volt_sw(&mut self) -> SDIO_SWITCH_VOLT_SW_W<CFG_DATA7_SPEC> {
        SDIO_SWITCH_VOLT_SW_W::new(self, 20)
    }
    #[doc = "Bit 21 - enable block length to be fixed to 512 bytes in ddr50 mode"]
    #[inline(always)]
    #[must_use]
    pub fn ddr50_blk_len_fix_en(&mut self) -> DDR50_BLK_LEN_FIX_EN_W<CFG_DATA7_SPEC> {
        DDR50_BLK_LEN_FIX_EN_W::new(self, 21)
    }
    #[doc = "Bit 22 - sdio apb clock for configuration force on control:0-gating,1-force on."]
    #[inline(always)]
    #[must_use]
    pub fn clk_en(&mut self) -> CLK_EN_W<CFG_DATA7_SPEC> {
        CLK_EN_W::new(self, 22)
    }
    #[doc = "Bit 23 - configure if support sdr50 mode in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn sddr50(&mut self) -> SDDR50_W<CFG_DATA7_SPEC> {
        SDDR50_W::new(self, 23)
    }
    #[doc = "Bit 24 - configure if support sdr104 mode in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn ssdr104(&mut self) -> SSDR104_W<CFG_DATA7_SPEC> {
        SSDR104_W::new(self, 24)
    }
    #[doc = "Bit 25 - configure if support ddr50 mode in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn ssdr50(&mut self) -> SSDR50_W<CFG_DATA7_SPEC> {
        SSDR50_W::new(self, 25)
    }
    #[doc = "Bit 26 - configure if support driver type D in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn sdtd(&mut self) -> SDTD_W<CFG_DATA7_SPEC> {
        SDTD_W::new(self, 26)
    }
    #[doc = "Bit 27 - configure if support driver type A in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn sdta(&mut self) -> SDTA_W<CFG_DATA7_SPEC> {
        SDTA_W::new(self, 27)
    }
    #[doc = "Bit 28 - configure if support driver type C in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn sdtc(&mut self) -> SDTC_W<CFG_DATA7_SPEC> {
        SDTC_W::new(self, 28)
    }
    #[doc = "Bit 29 - configure if support asynchronous interrupt in cccr"]
    #[inline(always)]
    #[must_use]
    pub fn sai(&mut self) -> SAI_W<CFG_DATA7_SPEC> {
        SAI_W::new(self, 29)
    }
    #[doc = "Bit 30 - clear sdio_wake_up signal after the chip wakes up"]
    #[inline(always)]
    #[must_use]
    pub fn sdio_wakeup_clr(&mut self) -> SDIO_WAKEUP_CLR_W<CFG_DATA7_SPEC> {
        SDIO_WAKEUP_CLR_W::new(self, 30)
    }
    #[doc = r" Writes raw bits to the register."]
    #[doc = r""]
    #[doc = r" # Safety"]
    #[doc = r""]
    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
}
#[doc = "SDIO configuration register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfg_data7::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfg_data7::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CFG_DATA7_SPEC;
impl crate::RegisterSpec for CFG_DATA7_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`cfg_data7::R`](R) reader structure"]
impl crate::Readable for CFG_DATA7_SPEC {}
#[doc = "`write(|w| ..)` method takes [`cfg_data7::W`](W) writer structure"]
impl crate::Writable for CFG_DATA7_SPEC {
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets CFG_DATA7 to value 0x2382_0000"]
impl crate::Resettable for CFG_DATA7_SPEC {
    const RESET_VALUE: Self::Ux = 0x2382_0000;
}