bl602_pac/sf_ctrl/
sf_aes.rs1#[doc = "Register `sf_aes` reader"]
2pub struct R(crate::R<SF_AES_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SF_AES_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SF_AES_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SF_AES_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `sf_aes` writer"]
17pub struct W(crate::W<SF_AES_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SF_AES_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<SF_AES_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SF_AES_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `sf_aes_en` reader - "]
38pub type SF_AES_EN_R = crate::BitReader<bool>;
39#[doc = "Field `sf_aes_en` writer - "]
40pub type SF_AES_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_AES_SPEC, bool, O>;
41#[doc = "Field `sf_aes_mode` reader - "]
42pub type SF_AES_MODE_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `sf_aes_mode` writer - "]
44pub type SF_AES_MODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SF_AES_SPEC, u8, u8, 2, O>;
45#[doc = "Field `sf_aes_pref_trig` reader - "]
46pub type SF_AES_PREF_TRIG_R = crate::BitReader<bool>;
47#[doc = "Field `sf_aes_pref_trig` writer - "]
48pub type SF_AES_PREF_TRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_AES_SPEC, bool, O>;
49#[doc = "Field `sf_aes_pref_busy` reader - "]
50pub type SF_AES_PREF_BUSY_R = crate::BitReader<bool>;
51#[doc = "Field `sf_aes_status` reader - "]
52pub type SF_AES_STATUS_R = crate::FieldReader<u32, u32>;
53impl R {
54 #[doc = "Bit 0"]
55 #[inline(always)]
56 pub fn sf_aes_en(&self) -> SF_AES_EN_R {
57 SF_AES_EN_R::new((self.bits & 1) != 0)
58 }
59 #[doc = "Bits 1:2"]
60 #[inline(always)]
61 pub fn sf_aes_mode(&self) -> SF_AES_MODE_R {
62 SF_AES_MODE_R::new(((self.bits >> 1) & 3) as u8)
63 }
64 #[doc = "Bit 3"]
65 #[inline(always)]
66 pub fn sf_aes_pref_trig(&self) -> SF_AES_PREF_TRIG_R {
67 SF_AES_PREF_TRIG_R::new(((self.bits >> 3) & 1) != 0)
68 }
69 #[doc = "Bit 4"]
70 #[inline(always)]
71 pub fn sf_aes_pref_busy(&self) -> SF_AES_PREF_BUSY_R {
72 SF_AES_PREF_BUSY_R::new(((self.bits >> 4) & 1) != 0)
73 }
74 #[doc = "Bits 5:31"]
75 #[inline(always)]
76 pub fn sf_aes_status(&self) -> SF_AES_STATUS_R {
77 SF_AES_STATUS_R::new((self.bits >> 5) & 0x07ff_ffff)
78 }
79}
80impl W {
81 #[doc = "Bit 0"]
82 #[inline(always)]
83 #[must_use]
84 pub fn sf_aes_en(&mut self) -> SF_AES_EN_W<0> {
85 SF_AES_EN_W::new(self)
86 }
87 #[doc = "Bits 1:2"]
88 #[inline(always)]
89 #[must_use]
90 pub fn sf_aes_mode(&mut self) -> SF_AES_MODE_W<1> {
91 SF_AES_MODE_W::new(self)
92 }
93 #[doc = "Bit 3"]
94 #[inline(always)]
95 #[must_use]
96 pub fn sf_aes_pref_trig(&mut self) -> SF_AES_PREF_TRIG_W<3> {
97 SF_AES_PREF_TRIG_W::new(self)
98 }
99 #[doc = "Writes raw bits to the register."]
100 #[inline(always)]
101 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
102 self.0.bits(bits);
103 self
104 }
105}
106#[doc = "sf_aes.\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 [sf_aes](index.html) module"]
107pub struct SF_AES_SPEC;
108impl crate::RegisterSpec for SF_AES_SPEC {
109 type Ux = u32;
110}
111#[doc = "`read()` method returns [sf_aes::R](R) reader structure"]
112impl crate::Readable for SF_AES_SPEC {
113 type Reader = R;
114}
115#[doc = "`write(|w| ..)` method takes [sf_aes::W](W) writer structure"]
116impl crate::Writable for SF_AES_SPEC {
117 type Writer = W;
118 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
119 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
120}
121#[doc = "`reset()` method sets sf_aes to value 0x40"]
122impl crate::Resettable for SF_AES_SPEC {
123 const RESET_VALUE: Self::Ux = 0x40;
124}