esp32c2/spi1/
flash_sus_cmd.rs

1#[doc = "Register `FLASH_SUS_CMD` reader"]
2pub type R = crate::R<FLASH_SUS_CMD_SPEC>;
3#[doc = "Register `FLASH_SUS_CMD` writer"]
4pub type W = crate::W<FLASH_SUS_CMD_SPEC>;
5#[doc = "Field `FLASH_PER_COMMAND` reader - Program/Erase resume command."]
6pub type FLASH_PER_COMMAND_R = crate::FieldReader;
7#[doc = "Field `FLASH_PER_COMMAND` writer - Program/Erase resume command."]
8pub type FLASH_PER_COMMAND_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `FLASH_PES_COMMAND` reader - Program/Erase suspend command."]
10pub type FLASH_PES_COMMAND_R = crate::FieldReader;
11#[doc = "Field `FLASH_PES_COMMAND` writer - Program/Erase suspend command."]
12pub type FLASH_PES_COMMAND_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `WAIT_PESR_COMMAND` reader - Flash SUS/SUS1/SUS2 status bit read command. The command should be sent when SUS/SUS1/SUS2 bit should be checked to insure the suspend or resume status of flash."]
14pub type WAIT_PESR_COMMAND_R = crate::FieldReader<u16>;
15#[doc = "Field `WAIT_PESR_COMMAND` writer - Flash SUS/SUS1/SUS2 status bit read command. The command should be sent when SUS/SUS1/SUS2 bit should be checked to insure the suspend or resume status of flash."]
16pub type WAIT_PESR_COMMAND_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
17impl R {
18    #[doc = "Bits 0:7 - Program/Erase resume command."]
19    #[inline(always)]
20    pub fn flash_per_command(&self) -> FLASH_PER_COMMAND_R {
21        FLASH_PER_COMMAND_R::new((self.bits & 0xff) as u8)
22    }
23    #[doc = "Bits 8:15 - Program/Erase suspend command."]
24    #[inline(always)]
25    pub fn flash_pes_command(&self) -> FLASH_PES_COMMAND_R {
26        FLASH_PES_COMMAND_R::new(((self.bits >> 8) & 0xff) as u8)
27    }
28    #[doc = "Bits 16:31 - Flash SUS/SUS1/SUS2 status bit read command. The command should be sent when SUS/SUS1/SUS2 bit should be checked to insure the suspend or resume status of flash."]
29    #[inline(always)]
30    pub fn wait_pesr_command(&self) -> WAIT_PESR_COMMAND_R {
31        WAIT_PESR_COMMAND_R::new(((self.bits >> 16) & 0xffff) as u16)
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("FLASH_SUS_CMD")
38            .field("flash_per_command", &self.flash_per_command())
39            .field("flash_pes_command", &self.flash_pes_command())
40            .field("wait_pesr_command", &self.wait_pesr_command())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:7 - Program/Erase resume command."]
46    #[inline(always)]
47    pub fn flash_per_command(&mut self) -> FLASH_PER_COMMAND_W<FLASH_SUS_CMD_SPEC> {
48        FLASH_PER_COMMAND_W::new(self, 0)
49    }
50    #[doc = "Bits 8:15 - Program/Erase suspend command."]
51    #[inline(always)]
52    pub fn flash_pes_command(&mut self) -> FLASH_PES_COMMAND_W<FLASH_SUS_CMD_SPEC> {
53        FLASH_PES_COMMAND_W::new(self, 8)
54    }
55    #[doc = "Bits 16:31 - Flash SUS/SUS1/SUS2 status bit read command. The command should be sent when SUS/SUS1/SUS2 bit should be checked to insure the suspend or resume status of flash."]
56    #[inline(always)]
57    pub fn wait_pesr_command(&mut self) -> WAIT_PESR_COMMAND_W<FLASH_SUS_CMD_SPEC> {
58        WAIT_PESR_COMMAND_W::new(self, 16)
59    }
60}
61#[doc = "SPI1 flash suspend command register\n\nYou can [`read`](crate::Reg::read) this register and get [`flash_sus_cmd::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`flash_sus_cmd::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct FLASH_SUS_CMD_SPEC;
63impl crate::RegisterSpec for FLASH_SUS_CMD_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`flash_sus_cmd::R`](R) reader structure"]
67impl crate::Readable for FLASH_SUS_CMD_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`flash_sus_cmd::W`](W) writer structure"]
69impl crate::Writable for FLASH_SUS_CMD_SPEC {
70    type Safety = crate::Unsafe;
71    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets FLASH_SUS_CMD to value 0x0005_757a"]
75impl crate::Resettable for FLASH_SUS_CMD_SPEC {
76    const RESET_VALUE: u32 = 0x0005_757a;
77}