efm32tg11b340_pac/crypto0/
cmd.rs

1#[doc = "Register `CMD` reader"]
2pub struct R(crate::R<CMD_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CMD_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CMD_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CMD_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CMD` writer"]
17pub struct W(crate::W<CMD_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CMD_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<CMD_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CMD_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `INSTR` reader - Execute Instruction"]
38pub type INSTR_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `INSTR` writer - Execute Instruction"]
40pub type INSTR_W<'a> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, u8, 8, 0>;
41#[doc = "Field `SEQSTART` writer - Encryption/Decryption SEQUENCE Start"]
42pub type SEQSTART_W<'a> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 9>;
43#[doc = "Field `SEQSTOP` writer - Sequence Stop"]
44pub type SEQSTOP_W<'a> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 10>;
45#[doc = "Field `SEQSTEP` writer - Sequence Step"]
46pub type SEQSTEP_W<'a> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 11>;
47impl R {
48    #[doc = "Bits 0:7 - Execute Instruction"]
49    #[inline(always)]
50    pub fn instr(&self) -> INSTR_R {
51        INSTR_R::new((self.bits & 0xff) as u8)
52    }
53}
54impl W {
55    #[doc = "Bits 0:7 - Execute Instruction"]
56    #[inline(always)]
57    pub fn instr(&mut self) -> INSTR_W {
58        INSTR_W::new(self)
59    }
60    #[doc = "Bit 9 - Encryption/Decryption SEQUENCE Start"]
61    #[inline(always)]
62    pub fn seqstart(&mut self) -> SEQSTART_W {
63        SEQSTART_W::new(self)
64    }
65    #[doc = "Bit 10 - Sequence Stop"]
66    #[inline(always)]
67    pub fn seqstop(&mut self) -> SEQSTOP_W {
68        SEQSTOP_W::new(self)
69    }
70    #[doc = "Bit 11 - Sequence Step"]
71    #[inline(always)]
72    pub fn seqstep(&mut self) -> SEQSTEP_W {
73        SEQSTEP_W::new(self)
74    }
75    #[doc = "Writes raw bits to the register."]
76    #[inline(always)]
77    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
78        self.0.bits(bits);
79        self
80    }
81}
82#[doc = "Command Register\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 [cmd](index.html) module"]
83pub struct CMD_SPEC;
84impl crate::RegisterSpec for CMD_SPEC {
85    type Ux = u32;
86}
87#[doc = "`read()` method returns [cmd::R](R) reader structure"]
88impl crate::Readable for CMD_SPEC {
89    type Reader = R;
90}
91#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
92impl crate::Writable for CMD_SPEC {
93    type Writer = W;
94}
95#[doc = "`reset()` method sets CMD to value 0"]
96impl crate::Resettable for CMD_SPEC {
97    #[inline(always)]
98    fn reset_value() -> Self::Ux {
99        0
100    }
101}