esp32/spi0/
rd_status.rs

1#[doc = "Register `RD_STATUS` reader"]
2pub type R = crate::R<RD_STATUS_SPEC>;
3#[doc = "Register `RD_STATUS` writer"]
4pub type W = crate::W<RD_STATUS_SPEC>;
5#[doc = "Field `STATUS` reader - In the slave mode, it is the status for master to read out."]
6pub type STATUS_R = crate::FieldReader<u16>;
7#[doc = "Field `STATUS` writer - In the slave mode, it is the status for master to read out."]
8pub type STATUS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `WB_MODE` reader - Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit."]
10pub type WB_MODE_R = crate::FieldReader;
11#[doc = "Field `WB_MODE` writer - Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit."]
12pub type WB_MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `STATUS_EXT` reader - In the slave mode,it is the status for master to read out."]
14pub type STATUS_EXT_R = crate::FieldReader;
15#[doc = "Field `STATUS_EXT` writer - In the slave mode,it is the status for master to read out."]
16pub type STATUS_EXT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17impl R {
18    #[doc = "Bits 0:15 - In the slave mode, it is the status for master to read out."]
19    #[inline(always)]
20    pub fn status(&self) -> STATUS_R {
21        STATUS_R::new((self.bits & 0xffff) as u16)
22    }
23    #[doc = "Bits 16:23 - Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit."]
24    #[inline(always)]
25    pub fn wb_mode(&self) -> WB_MODE_R {
26        WB_MODE_R::new(((self.bits >> 16) & 0xff) as u8)
27    }
28    #[doc = "Bits 24:31 - In the slave mode,it is the status for master to read out."]
29    #[inline(always)]
30    pub fn status_ext(&self) -> STATUS_EXT_R {
31        STATUS_EXT_R::new(((self.bits >> 24) & 0xff) as u8)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("RD_STATUS")
38            .field("status", &self.status())
39            .field("wb_mode", &self.wb_mode())
40            .field("status_ext", &self.status_ext())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:15 - In the slave mode, it is the status for master to read out."]
46    #[inline(always)]
47    pub fn status(&mut self) -> STATUS_W<RD_STATUS_SPEC> {
48        STATUS_W::new(self, 0)
49    }
50    #[doc = "Bits 16:23 - Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit."]
51    #[inline(always)]
52    pub fn wb_mode(&mut self) -> WB_MODE_W<RD_STATUS_SPEC> {
53        WB_MODE_W::new(self, 16)
54    }
55    #[doc = "Bits 24:31 - In the slave mode,it is the status for master to read out."]
56    #[inline(always)]
57    pub fn status_ext(&mut self) -> STATUS_EXT_W<RD_STATUS_SPEC> {
58        STATUS_EXT_W::new(self, 24)
59    }
60}
61#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`rd_status::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rd_status::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct RD_STATUS_SPEC;
63impl crate::RegisterSpec for RD_STATUS_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`rd_status::R`](R) reader structure"]
67impl crate::Readable for RD_STATUS_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`rd_status::W`](W) writer structure"]
69impl crate::Writable for RD_STATUS_SPEC {
70    type Safety = crate::Unsafe;
71}
72#[doc = "`reset()` method sets RD_STATUS to value 0"]
73impl crate::Resettable for RD_STATUS_SPEC {}