esp32s3/sdhost/
cardthrctl.rs1#[doc = "Register `CARDTHRCTL` reader"]
2pub type R = crate::R<CARDTHRCTL_SPEC>;
3#[doc = "Register `CARDTHRCTL` writer"]
4pub type W = crate::W<CARDTHRCTL_SPEC>;
5#[doc = "Field `CARDRDTHREN` reader - Card read threshold enable. 1'b0-Card read threshold disabled. 1'b1-Card read threshold enabled."]
6pub type CARDRDTHREN_R = crate::BitReader;
7#[doc = "Field `CARDRDTHREN` writer - Card read threshold enable. 1'b0-Card read threshold disabled. 1'b1-Card read threshold enabled."]
8pub type CARDRDTHREN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CARDCLRINTEN` reader - Busy clear interrupt generation: 1'b0-Busy clear interrypt disabled. 1'b1-Busy clear interrypt enabled."]
10pub type CARDCLRINTEN_R = crate::BitReader;
11#[doc = "Field `CARDCLRINTEN` writer - Busy clear interrupt generation: 1'b0-Busy clear interrypt disabled. 1'b1-Busy clear interrypt enabled."]
12pub type CARDCLRINTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CARDWRTHREN` reader - Applicable when HS400 mode is enabled. 1'b0-Card write Threshold disabled. 1'b1-Card write Threshold enabled."]
14pub type CARDWRTHREN_R = crate::BitReader;
15#[doc = "Field `CARDWRTHREN` writer - Applicable when HS400 mode is enabled. 1'b0-Card write Threshold disabled. 1'b1-Card write Threshold enabled."]
16pub type CARDWRTHREN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `CARDTHRESHOLD` reader - The inside FIFO size is 512,This register is applicable when SDHOST_CARDERTHREN_REG is set to 1 or SDHOST_CARDRDTHREN_REG set to 1."]
18pub type CARDTHRESHOLD_R = crate::FieldReader<u16>;
19#[doc = "Field `CARDTHRESHOLD` writer - The inside FIFO size is 512,This register is applicable when SDHOST_CARDERTHREN_REG is set to 1 or SDHOST_CARDRDTHREN_REG set to 1."]
20pub type CARDTHRESHOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
21impl R {
22 #[doc = "Bit 0 - Card read threshold enable. 1'b0-Card read threshold disabled. 1'b1-Card read threshold enabled."]
23 #[inline(always)]
24 pub fn cardrdthren(&self) -> CARDRDTHREN_R {
25 CARDRDTHREN_R::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - Busy clear interrupt generation: 1'b0-Busy clear interrypt disabled. 1'b1-Busy clear interrypt enabled."]
28 #[inline(always)]
29 pub fn cardclrinten(&self) -> CARDCLRINTEN_R {
30 CARDCLRINTEN_R::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bit 2 - Applicable when HS400 mode is enabled. 1'b0-Card write Threshold disabled. 1'b1-Card write Threshold enabled."]
33 #[inline(always)]
34 pub fn cardwrthren(&self) -> CARDWRTHREN_R {
35 CARDWRTHREN_R::new(((self.bits >> 2) & 1) != 0)
36 }
37 #[doc = "Bits 16:31 - The inside FIFO size is 512,This register is applicable when SDHOST_CARDERTHREN_REG is set to 1 or SDHOST_CARDRDTHREN_REG set to 1."]
38 #[inline(always)]
39 pub fn cardthreshold(&self) -> CARDTHRESHOLD_R {
40 CARDTHRESHOLD_R::new(((self.bits >> 16) & 0xffff) as u16)
41 }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("CARDTHRCTL")
47 .field("cardrdthren", &self.cardrdthren())
48 .field("cardclrinten", &self.cardclrinten())
49 .field("cardwrthren", &self.cardwrthren())
50 .field("cardthreshold", &self.cardthreshold())
51 .finish()
52 }
53}
54impl W {
55 #[doc = "Bit 0 - Card read threshold enable. 1'b0-Card read threshold disabled. 1'b1-Card read threshold enabled."]
56 #[inline(always)]
57 pub fn cardrdthren(&mut self) -> CARDRDTHREN_W<CARDTHRCTL_SPEC> {
58 CARDRDTHREN_W::new(self, 0)
59 }
60 #[doc = "Bit 1 - Busy clear interrupt generation: 1'b0-Busy clear interrypt disabled. 1'b1-Busy clear interrypt enabled."]
61 #[inline(always)]
62 pub fn cardclrinten(&mut self) -> CARDCLRINTEN_W<CARDTHRCTL_SPEC> {
63 CARDCLRINTEN_W::new(self, 1)
64 }
65 #[doc = "Bit 2 - Applicable when HS400 mode is enabled. 1'b0-Card write Threshold disabled. 1'b1-Card write Threshold enabled."]
66 #[inline(always)]
67 pub fn cardwrthren(&mut self) -> CARDWRTHREN_W<CARDTHRCTL_SPEC> {
68 CARDWRTHREN_W::new(self, 2)
69 }
70 #[doc = "Bits 16:31 - The inside FIFO size is 512,This register is applicable when SDHOST_CARDERTHREN_REG is set to 1 or SDHOST_CARDRDTHREN_REG set to 1."]
71 #[inline(always)]
72 pub fn cardthreshold(&mut self) -> CARDTHRESHOLD_W<CARDTHRCTL_SPEC> {
73 CARDTHRESHOLD_W::new(self, 16)
74 }
75}
76#[doc = "Card Threshold Control register\n\nYou can [`read`](crate::Reg::read) this register and get [`cardthrctl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cardthrctl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct CARDTHRCTL_SPEC;
78impl crate::RegisterSpec for CARDTHRCTL_SPEC {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`cardthrctl::R`](R) reader structure"]
82impl crate::Readable for CARDTHRCTL_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`cardthrctl::W`](W) writer structure"]
84impl crate::Writable for CARDTHRCTL_SPEC {
85 type Safety = crate::Unsafe;
86 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets CARDTHRCTL to value 0"]
90impl crate::Resettable for CARDTHRCTL_SPEC {
91 const RESET_VALUE: u32 = 0;
92}