bl702_pac/sf_ctrl/
sf_aes.rs

1#[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_pref_busy` writer - "]
52pub type SF_AES_PREF_BUSY_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_AES_SPEC, bool, O>;
53#[doc = "Field `sf_aes_status` reader - "]
54pub type SF_AES_STATUS_R = crate::FieldReader<u32, u32>;
55#[doc = "Field `sf_aes_status` writer - "]
56pub type SF_AES_STATUS_W<'a, const O: u8> =
57    crate::FieldWriter<'a, u32, SF_AES_SPEC, u32, u32, 27, O>;
58impl R {
59    #[doc = "Bit 0"]
60    #[inline(always)]
61    pub fn sf_aes_en(&self) -> SF_AES_EN_R {
62        SF_AES_EN_R::new((self.bits & 1) != 0)
63    }
64    #[doc = "Bits 1:2"]
65    #[inline(always)]
66    pub fn sf_aes_mode(&self) -> SF_AES_MODE_R {
67        SF_AES_MODE_R::new(((self.bits >> 1) & 3) as u8)
68    }
69    #[doc = "Bit 3"]
70    #[inline(always)]
71    pub fn sf_aes_pref_trig(&self) -> SF_AES_PREF_TRIG_R {
72        SF_AES_PREF_TRIG_R::new(((self.bits >> 3) & 1) != 0)
73    }
74    #[doc = "Bit 4"]
75    #[inline(always)]
76    pub fn sf_aes_pref_busy(&self) -> SF_AES_PREF_BUSY_R {
77        SF_AES_PREF_BUSY_R::new(((self.bits >> 4) & 1) != 0)
78    }
79    #[doc = "Bits 5:31"]
80    #[inline(always)]
81    pub fn sf_aes_status(&self) -> SF_AES_STATUS_R {
82        SF_AES_STATUS_R::new((self.bits >> 5) & 0x07ff_ffff)
83    }
84}
85impl W {
86    #[doc = "Bit 0"]
87    #[inline(always)]
88    #[must_use]
89    pub fn sf_aes_en(&mut self) -> SF_AES_EN_W<0> {
90        SF_AES_EN_W::new(self)
91    }
92    #[doc = "Bits 1:2"]
93    #[inline(always)]
94    #[must_use]
95    pub fn sf_aes_mode(&mut self) -> SF_AES_MODE_W<1> {
96        SF_AES_MODE_W::new(self)
97    }
98    #[doc = "Bit 3"]
99    #[inline(always)]
100    #[must_use]
101    pub fn sf_aes_pref_trig(&mut self) -> SF_AES_PREF_TRIG_W<3> {
102        SF_AES_PREF_TRIG_W::new(self)
103    }
104    #[doc = "Bit 4"]
105    #[inline(always)]
106    #[must_use]
107    pub fn sf_aes_pref_busy(&mut self) -> SF_AES_PREF_BUSY_W<4> {
108        SF_AES_PREF_BUSY_W::new(self)
109    }
110    #[doc = "Bits 5:31"]
111    #[inline(always)]
112    #[must_use]
113    pub fn sf_aes_status(&mut self) -> SF_AES_STATUS_W<5> {
114        SF_AES_STATUS_W::new(self)
115    }
116    #[doc = "Writes raw bits to the register."]
117    #[inline(always)]
118    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
119        self.0.bits(bits);
120        self
121    }
122}
123#[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"]
124pub struct SF_AES_SPEC;
125impl crate::RegisterSpec for SF_AES_SPEC {
126    type Ux = u32;
127}
128#[doc = "`read()` method returns [sf_aes::R](R) reader structure"]
129impl crate::Readable for SF_AES_SPEC {
130    type Reader = R;
131}
132#[doc = "`write(|w| ..)` method takes [sf_aes::W](W) writer structure"]
133impl crate::Writable for SF_AES_SPEC {
134    type Writer = W;
135    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
136    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
137}
138#[doc = "`reset()` method sets sf_aes to value 0"]
139impl crate::Resettable for SF_AES_SPEC {
140    const RESET_VALUE: Self::Ux = 0;
141}