1#[doc = "Register `CMD` reader"]
2pub type R = crate::R<CMD_SPEC>;
3#[doc = "Register `CMD` writer"]
4pub type W = crate::W<CMD_SPEC>;
5#[doc = "Field `READ_CMD` reader - Set this bit to send read command."]
6pub type READ_CMD_R = crate::BitReader;
7#[doc = "Field `READ_CMD` writer - Set this bit to send read command."]
8pub type READ_CMD_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `PGM_CMD` reader - Set this bit to send programming command."]
10pub type PGM_CMD_R = crate::BitReader;
11#[doc = "Field `PGM_CMD` writer - Set this bit to send programming command."]
12pub type PGM_CMD_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `BLK_NUM` reader - The serial number of the block to be programmed. Value 0-10 corresponds to block number 0-10, respectively."]
14pub type BLK_NUM_R = crate::FieldReader;
15#[doc = "Field `BLK_NUM` writer - The serial number of the block to be programmed. Value 0-10 corresponds to block number 0-10, respectively."]
16pub type BLK_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17impl R {
18 #[doc = "Bit 0 - Set this bit to send read command."]
19 #[inline(always)]
20 pub fn read_cmd(&self) -> READ_CMD_R {
21 READ_CMD_R::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - Set this bit to send programming command."]
24 #[inline(always)]
25 pub fn pgm_cmd(&self) -> PGM_CMD_R {
26 PGM_CMD_R::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bits 2:5 - The serial number of the block to be programmed. Value 0-10 corresponds to block number 0-10, respectively."]
29 #[inline(always)]
30 pub fn blk_num(&self) -> BLK_NUM_R {
31 BLK_NUM_R::new(((self.bits >> 2) & 0x0f) 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("CMD")
38 .field("read_cmd", &self.read_cmd())
39 .field("pgm_cmd", &self.pgm_cmd())
40 .field("blk_num", &self.blk_num())
41 .finish()
42 }
43}
44impl W {
45 #[doc = "Bit 0 - Set this bit to send read command."]
46 #[inline(always)]
47 pub fn read_cmd(&mut self) -> READ_CMD_W<CMD_SPEC> {
48 READ_CMD_W::new(self, 0)
49 }
50 #[doc = "Bit 1 - Set this bit to send programming command."]
51 #[inline(always)]
52 pub fn pgm_cmd(&mut self) -> PGM_CMD_W<CMD_SPEC> {
53 PGM_CMD_W::new(self, 1)
54 }
55 #[doc = "Bits 2:5 - The serial number of the block to be programmed. Value 0-10 corresponds to block number 0-10, respectively."]
56 #[inline(always)]
57 pub fn blk_num(&mut self) -> BLK_NUM_W<CMD_SPEC> {
58 BLK_NUM_W::new(self, 2)
59 }
60}
61#[doc = "eFuse command register.\n\nYou can [`read`](crate::Reg::read) this register and get [`cmd::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmd::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct CMD_SPEC;
63impl crate::RegisterSpec for CMD_SPEC {
64 type Ux = u32;
65}
66#[doc = "`read()` method returns [`cmd::R`](R) reader structure"]
67impl crate::Readable for CMD_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`cmd::W`](W) writer structure"]
69impl crate::Writable for 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 CMD to value 0"]
75impl crate::Resettable for CMD_SPEC {
76 const RESET_VALUE: u32 = 0;
77}