bl602_pac/sec_dbg/
sd_status.rs

1#[doc = "Register `sd_status` reader"]
2pub struct R(crate::R<SD_STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SD_STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SD_STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SD_STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `sd_status` writer"]
17pub struct W(crate::W<SD_STATUS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SD_STATUS_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<SD_STATUS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SD_STATUS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `sd_dbg_pwd_busy` reader - "]
38pub type SD_DBG_PWD_BUSY_R = crate::BitReader<bool>;
39#[doc = "Field `sd_dbg_pwd_trig` reader - "]
40pub type SD_DBG_PWD_TRIG_R = crate::BitReader<bool>;
41#[doc = "Field `sd_dbg_pwd_trig` writer - "]
42pub type SD_DBG_PWD_TRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, SD_STATUS_SPEC, bool, O>;
43#[doc = "Field `sd_dbg_cci_read_en` reader - "]
44pub type SD_DBG_CCI_READ_EN_R = crate::BitReader<bool>;
45#[doc = "Field `sd_dbg_cci_read_en` writer - "]
46pub type SD_DBG_CCI_READ_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SD_STATUS_SPEC, bool, O>;
47#[doc = "Field `sd_dbg_cci_clk_sel` reader - "]
48pub type SD_DBG_CCI_CLK_SEL_R = crate::BitReader<bool>;
49#[doc = "Field `sd_dbg_cci_clk_sel` writer - "]
50pub type SD_DBG_CCI_CLK_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SD_STATUS_SPEC, bool, O>;
51#[doc = "Field `sd_dbg_pwd_cnt` reader - "]
52pub type SD_DBG_PWD_CNT_R = crate::FieldReader<u32, u32>;
53#[doc = "Field `sd_dbg_mode` reader - "]
54pub type SD_DBG_MODE_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `sd_dbg_ena` reader - "]
56pub type SD_DBG_ENA_R = crate::FieldReader<u8, u8>;
57impl R {
58    #[doc = "Bit 0"]
59    #[inline(always)]
60    pub fn sd_dbg_pwd_busy(&self) -> SD_DBG_PWD_BUSY_R {
61        SD_DBG_PWD_BUSY_R::new((self.bits & 1) != 0)
62    }
63    #[doc = "Bit 1"]
64    #[inline(always)]
65    pub fn sd_dbg_pwd_trig(&self) -> SD_DBG_PWD_TRIG_R {
66        SD_DBG_PWD_TRIG_R::new(((self.bits >> 1) & 1) != 0)
67    }
68    #[doc = "Bit 2"]
69    #[inline(always)]
70    pub fn sd_dbg_cci_read_en(&self) -> SD_DBG_CCI_READ_EN_R {
71        SD_DBG_CCI_READ_EN_R::new(((self.bits >> 2) & 1) != 0)
72    }
73    #[doc = "Bit 3"]
74    #[inline(always)]
75    pub fn sd_dbg_cci_clk_sel(&self) -> SD_DBG_CCI_CLK_SEL_R {
76        SD_DBG_CCI_CLK_SEL_R::new(((self.bits >> 3) & 1) != 0)
77    }
78    #[doc = "Bits 4:23"]
79    #[inline(always)]
80    pub fn sd_dbg_pwd_cnt(&self) -> SD_DBG_PWD_CNT_R {
81        SD_DBG_PWD_CNT_R::new((self.bits >> 4) & 0x000f_ffff)
82    }
83    #[doc = "Bits 24:27"]
84    #[inline(always)]
85    pub fn sd_dbg_mode(&self) -> SD_DBG_MODE_R {
86        SD_DBG_MODE_R::new(((self.bits >> 24) & 0x0f) as u8)
87    }
88    #[doc = "Bits 28:31"]
89    #[inline(always)]
90    pub fn sd_dbg_ena(&self) -> SD_DBG_ENA_R {
91        SD_DBG_ENA_R::new(((self.bits >> 28) & 0x0f) as u8)
92    }
93}
94impl W {
95    #[doc = "Bit 1"]
96    #[inline(always)]
97    #[must_use]
98    pub fn sd_dbg_pwd_trig(&mut self) -> SD_DBG_PWD_TRIG_W<1> {
99        SD_DBG_PWD_TRIG_W::new(self)
100    }
101    #[doc = "Bit 2"]
102    #[inline(always)]
103    #[must_use]
104    pub fn sd_dbg_cci_read_en(&mut self) -> SD_DBG_CCI_READ_EN_W<2> {
105        SD_DBG_CCI_READ_EN_W::new(self)
106    }
107    #[doc = "Bit 3"]
108    #[inline(always)]
109    #[must_use]
110    pub fn sd_dbg_cci_clk_sel(&mut self) -> SD_DBG_CCI_CLK_SEL_W<3> {
111        SD_DBG_CCI_CLK_SEL_W::new(self)
112    }
113    #[doc = "Writes raw bits to the register."]
114    #[inline(always)]
115    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
116        self.0.bits(bits);
117        self
118    }
119}
120#[doc = "sd_status.\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 [sd_status](index.html) module"]
121pub struct SD_STATUS_SPEC;
122impl crate::RegisterSpec for SD_STATUS_SPEC {
123    type Ux = u32;
124}
125#[doc = "`read()` method returns [sd_status::R](R) reader structure"]
126impl crate::Readable for SD_STATUS_SPEC {
127    type Reader = R;
128}
129#[doc = "`write(|w| ..)` method takes [sd_status::W](W) writer structure"]
130impl crate::Writable for SD_STATUS_SPEC {
131    type Writer = W;
132    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
133    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
134}
135#[doc = "`reset()` method sets sd_status to value 0"]
136impl crate::Resettable for SD_STATUS_SPEC {
137    const RESET_VALUE: Self::Ux = 0;
138}