ra6m3/sdhi0/
sdio_mode.rs

1#[doc = "Register `SDIO_MODE` reader"]
2pub struct R(crate::R<SDIO_MODE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SDIO_MODE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SDIO_MODE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SDIO_MODE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SDIO_MODE` writer"]
17pub struct W(crate::W<SDIO_MODE_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SDIO_MODE_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<SDIO_MODE_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SDIO_MODE_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `INTEN` reader - SDIO Mode"]
38pub type INTEN_R = crate::BitReader<INTEN_A>;
39#[doc = "SDIO Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum INTEN_A {
42    #[doc = "1: Enables the SD host interface to receive SDIO interrupt from the SDIO card"]
43    _1 = 1,
44    #[doc = "0: Disables the SD host interface to receive SDIO interrupt from the SDIO card"]
45    _0 = 0,
46}
47impl From<INTEN_A> for bool {
48    #[inline(always)]
49    fn from(variant: INTEN_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl INTEN_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> INTEN_A {
57        match self.bits {
58            true => INTEN_A::_1,
59            false => INTEN_A::_0,
60        }
61    }
62    #[doc = "Checks if the value of the field is `_1`"]
63    #[inline(always)]
64    pub fn is_1(&self) -> bool {
65        *self == INTEN_A::_1
66    }
67    #[doc = "Checks if the value of the field is `_0`"]
68    #[inline(always)]
69    pub fn is_0(&self) -> bool {
70        *self == INTEN_A::_0
71    }
72}
73#[doc = "Field `INTEN` writer - SDIO Mode"]
74pub type INTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SDIO_MODE_SPEC, INTEN_A, O>;
75impl<'a, const O: u8> INTEN_W<'a, O> {
76    #[doc = "Enables the SD host interface to receive SDIO interrupt from the SDIO card"]
77    #[inline(always)]
78    pub fn _1(self) -> &'a mut W {
79        self.variant(INTEN_A::_1)
80    }
81    #[doc = "Disables the SD host interface to receive SDIO interrupt from the SDIO card"]
82    #[inline(always)]
83    pub fn _0(self) -> &'a mut W {
84        self.variant(INTEN_A::_0)
85    }
86}
87#[doc = "Field `RWREQ` reader - Read Wait Request"]
88pub type RWREQ_R = crate::BitReader<RWREQ_A>;
89#[doc = "Read Wait Request\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum RWREQ_A {
92    #[doc = "0: Allow SD/MMC to exit read wait state"]
93    _0 = 0,
94    #[doc = "1: Request for SD/MMC to enter read wait state."]
95    _1 = 1,
96}
97impl From<RWREQ_A> for bool {
98    #[inline(always)]
99    fn from(variant: RWREQ_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl RWREQ_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> RWREQ_A {
107        match self.bits {
108            false => RWREQ_A::_0,
109            true => RWREQ_A::_1,
110        }
111    }
112    #[doc = "Checks if the value of the field is `_0`"]
113    #[inline(always)]
114    pub fn is_0(&self) -> bool {
115        *self == RWREQ_A::_0
116    }
117    #[doc = "Checks if the value of the field is `_1`"]
118    #[inline(always)]
119    pub fn is_1(&self) -> bool {
120        *self == RWREQ_A::_1
121    }
122}
123#[doc = "Field `RWREQ` writer - Read Wait Request"]
124pub type RWREQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, SDIO_MODE_SPEC, RWREQ_A, O>;
125impl<'a, const O: u8> RWREQ_W<'a, O> {
126    #[doc = "Allow SD/MMC to exit read wait state"]
127    #[inline(always)]
128    pub fn _0(self) -> &'a mut W {
129        self.variant(RWREQ_A::_0)
130    }
131    #[doc = "Request for SD/MMC to enter read wait state."]
132    #[inline(always)]
133    pub fn _1(self) -> &'a mut W {
134        self.variant(RWREQ_A::_1)
135    }
136}
137#[doc = "Field `IOABT` reader - SDIO AbortNOTE: See manual"]
138pub type IOABT_R = crate::BitReader<bool>;
139#[doc = "Field `IOABT` writer - SDIO AbortNOTE: See manual"]
140pub type IOABT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SDIO_MODE_SPEC, bool, O>;
141#[doc = "Field `C52PUB` reader - SDIO None AbortNOTE: See manual"]
142pub type C52PUB_R = crate::BitReader<bool>;
143#[doc = "Field `C52PUB` writer - SDIO None AbortNOTE: See manual"]
144pub type C52PUB_W<'a, const O: u8> = crate::BitWriter<'a, u32, SDIO_MODE_SPEC, bool, O>;
145impl R {
146    #[doc = "Bit 0 - SDIO Mode"]
147    #[inline(always)]
148    pub fn inten(&self) -> INTEN_R {
149        INTEN_R::new((self.bits & 1) != 0)
150    }
151    #[doc = "Bit 2 - Read Wait Request"]
152    #[inline(always)]
153    pub fn rwreq(&self) -> RWREQ_R {
154        RWREQ_R::new(((self.bits >> 2) & 1) != 0)
155    }
156    #[doc = "Bit 8 - SDIO AbortNOTE: See manual"]
157    #[inline(always)]
158    pub fn ioabt(&self) -> IOABT_R {
159        IOABT_R::new(((self.bits >> 8) & 1) != 0)
160    }
161    #[doc = "Bit 9 - SDIO None AbortNOTE: See manual"]
162    #[inline(always)]
163    pub fn c52pub(&self) -> C52PUB_R {
164        C52PUB_R::new(((self.bits >> 9) & 1) != 0)
165    }
166}
167impl W {
168    #[doc = "Bit 0 - SDIO Mode"]
169    #[inline(always)]
170    #[must_use]
171    pub fn inten(&mut self) -> INTEN_W<0> {
172        INTEN_W::new(self)
173    }
174    #[doc = "Bit 2 - Read Wait Request"]
175    #[inline(always)]
176    #[must_use]
177    pub fn rwreq(&mut self) -> RWREQ_W<2> {
178        RWREQ_W::new(self)
179    }
180    #[doc = "Bit 8 - SDIO AbortNOTE: See manual"]
181    #[inline(always)]
182    #[must_use]
183    pub fn ioabt(&mut self) -> IOABT_W<8> {
184        IOABT_W::new(self)
185    }
186    #[doc = "Bit 9 - SDIO None AbortNOTE: See manual"]
187    #[inline(always)]
188    #[must_use]
189    pub fn c52pub(&mut self) -> C52PUB_W<9> {
190        C52PUB_W::new(self)
191    }
192    #[doc = "Writes raw bits to the register."]
193    #[inline(always)]
194    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
195        self.0.bits(bits);
196        self
197    }
198}
199#[doc = "SDIO Mode Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdio_mode](index.html) module"]
200pub struct SDIO_MODE_SPEC;
201impl crate::RegisterSpec for SDIO_MODE_SPEC {
202    type Ux = u32;
203}
204#[doc = "`read()` method returns [sdio_mode::R](R) reader structure"]
205impl crate::Readable for SDIO_MODE_SPEC {
206    type Reader = R;
207}
208#[doc = "`write(|w| ..)` method takes [sdio_mode::W](W) writer structure"]
209impl crate::Writable for SDIO_MODE_SPEC {
210    type Writer = W;
211    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
212    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
213}
214#[doc = "`reset()` method sets SDIO_MODE to value 0"]
215impl crate::Resettable for SDIO_MODE_SPEC {
216    const RESET_VALUE: Self::Ux = 0;
217}