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
#[doc = "Register `CAPAB0` reader"]
pub struct R(crate::R<CAPAB0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CAPAB0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<CAPAB0_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<CAPAB0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `TMOUTCLKFREQ` reader - Timeout Clock Frequency"]
pub type TMOUTCLKFREQ_R = crate::FieldReader<u8, u8>;
#[doc = "Field `TMOUTCLKUNIT` reader - Timeout Clock Unit"]
pub type TMOUTCLKUNIT_R = crate::BitReader<bool>;
#[doc = "Field `BASECLKFREQSD` reader - Base Clock Frequency for SD_CLK"]
pub type BASECLKFREQSD_R = crate::FieldReader<u8, u8>;
#[doc = "Field `MAXBLOCKLEN` reader - Maximum Block Length"]
pub type MAXBLOCKLEN_R = crate::FieldReader<u8, u8>;
#[doc = "Field `EXTMEDIABUSSUP` reader - Extended Media Bus Support"]
pub type EXTMEDIABUSSUP_R = crate::BitReader<bool>;
#[doc = "Field `ADMA2SUP` reader - ADMA2 Support"]
pub type ADMA2SUP_R = crate::BitReader<bool>;
#[doc = "Field `HSSUP` reader - High Speed Support"]
pub type HSSUP_R = crate::BitReader<bool>;
#[doc = "Field `SDMASUP` reader - SDMA Support"]
pub type SDMASUP_R = crate::BitReader<bool>;
#[doc = "Field `SUSRESSUP` reader - Suspend / Resume Support"]
pub type SUSRESSUP_R = crate::BitReader<bool>;
#[doc = "Field `VOLTSUP3P3V` reader - Voltage Support 3.3V"]
pub type VOLTSUP3P3V_R = crate::BitReader<bool>;
#[doc = "Field `VOLTSUP3P0V` reader - Voltage Support 3.0V"]
pub type VOLTSUP3P0V_R = crate::BitReader<bool>;
#[doc = "Field `VOLTSUP1P8V` reader - Voltage Support 1.8V"]
pub type VOLTSUP1P8V_R = crate::BitReader<bool>;
#[doc = "Field `SYSBUS64BSUP` reader - System Bus 64-bit Support"]
pub type SYSBUS64BSUP_R = crate::BitReader<bool>;
#[doc = "Field `ASYNCINTSUP` reader - Asynchronous Interrupt Support"]
pub type ASYNCINTSUP_R = crate::BitReader<bool>;
#[doc = "Field `IFSLOTTYPE` reader - Interface Card Slot Type"]
pub type IFSLOTTYPE_R = crate::FieldReader<u8, IFSLOTTYPE_A>;
#[doc = "Interface Card Slot Type\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IFSLOTTYPE_A {
    #[doc = "0: Removable Card Slot"]
    REMOVABLE = 0,
    #[doc = "1: Only one non-removable device is conected to a SD bus slot"]
    EMBEDDED = 1,
    #[doc = "2: Can be set if Host controller supports Shared Bus CTRL register"]
    SHARED = 2,
}
impl From<IFSLOTTYPE_A> for u8 {
    #[inline(always)]
    fn from(variant: IFSLOTTYPE_A) -> Self {
        variant as _
    }
}
impl IFSLOTTYPE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<IFSLOTTYPE_A> {
        match self.bits {
            0 => Some(IFSLOTTYPE_A::REMOVABLE),
            1 => Some(IFSLOTTYPE_A::EMBEDDED),
            2 => Some(IFSLOTTYPE_A::SHARED),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `REMOVABLE`"]
    #[inline(always)]
    pub fn is_removable(&self) -> bool {
        *self == IFSLOTTYPE_A::REMOVABLE
    }
    #[doc = "Checks if the value of the field is `EMBEDDED`"]
    #[inline(always)]
    pub fn is_embedded(&self) -> bool {
        *self == IFSLOTTYPE_A::EMBEDDED
    }
    #[doc = "Checks if the value of the field is `SHARED`"]
    #[inline(always)]
    pub fn is_shared(&self) -> bool {
        *self == IFSLOTTYPE_A::SHARED
    }
}
impl R {
    #[doc = "Bits 0:5 - Timeout Clock Frequency"]
    #[inline(always)]
    pub fn tmoutclkfreq(&self) -> TMOUTCLKFREQ_R {
        TMOUTCLKFREQ_R::new((self.bits & 0x3f) as u8)
    }
    #[doc = "Bit 7 - Timeout Clock Unit"]
    #[inline(always)]
    pub fn tmoutclkunit(&self) -> TMOUTCLKUNIT_R {
        TMOUTCLKUNIT_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 8:15 - Base Clock Frequency for SD_CLK"]
    #[inline(always)]
    pub fn baseclkfreqsd(&self) -> BASECLKFREQSD_R {
        BASECLKFREQSD_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bits 16:17 - Maximum Block Length"]
    #[inline(always)]
    pub fn maxblocklen(&self) -> MAXBLOCKLEN_R {
        MAXBLOCKLEN_R::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bit 18 - Extended Media Bus Support"]
    #[inline(always)]
    pub fn extmediabussup(&self) -> EXTMEDIABUSSUP_R {
        EXTMEDIABUSSUP_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - ADMA2 Support"]
    #[inline(always)]
    pub fn adma2sup(&self) -> ADMA2SUP_R {
        ADMA2SUP_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 21 - High Speed Support"]
    #[inline(always)]
    pub fn hssup(&self) -> HSSUP_R {
        HSSUP_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22 - SDMA Support"]
    #[inline(always)]
    pub fn sdmasup(&self) -> SDMASUP_R {
        SDMASUP_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - Suspend / Resume Support"]
    #[inline(always)]
    pub fn susressup(&self) -> SUSRESSUP_R {
        SUSRESSUP_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - Voltage Support 3.3V"]
    #[inline(always)]
    pub fn voltsup3p3v(&self) -> VOLTSUP3P3V_R {
        VOLTSUP3P3V_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - Voltage Support 3.0V"]
    #[inline(always)]
    pub fn voltsup3p0v(&self) -> VOLTSUP3P0V_R {
        VOLTSUP3P0V_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - Voltage Support 1.8V"]
    #[inline(always)]
    pub fn voltsup1p8v(&self) -> VOLTSUP1P8V_R {
        VOLTSUP1P8V_R::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 28 - System Bus 64-bit Support"]
    #[inline(always)]
    pub fn sysbus64bsup(&self) -> SYSBUS64BSUP_R {
        SYSBUS64BSUP_R::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Asynchronous Interrupt Support"]
    #[inline(always)]
    pub fn asyncintsup(&self) -> ASYNCINTSUP_R {
        ASYNCINTSUP_R::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bits 30:31 - Interface Card Slot Type"]
    #[inline(always)]
    pub fn ifslottype(&self) -> IFSLOTTYPE_R {
        IFSLOTTYPE_R::new(((self.bits >> 30) & 3) as u8)
    }
}
#[doc = "Capabilities Register to Hold Bits 31~0\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [capab0](index.html) module"]
pub struct CAPAB0_SPEC;
impl crate::RegisterSpec for CAPAB0_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [capab0::R](R) reader structure"]
impl crate::Readable for CAPAB0_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets CAPAB0 to value 0"]
impl crate::Resettable for CAPAB0_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}