esp32s2/wifi/crypto_control/
interface_crypto_control.rs

1#[doc = "Register `INTERFACE_CRYPTO_CONTROL%s` reader"]
2pub type R = crate::R<INTERFACE_CRYPTO_CONTROL_SPEC>;
3#[doc = "Register `INTERFACE_CRYPTO_CONTROL%s` writer"]
4pub type W = crate::W<INTERFACE_CRYPTO_CONTROL_SPEC>;
5#[doc = "Field `SPP_ENABLE` reader - Enable Signaling and Payload Protection (SPP) for A-MSDUs"]
6pub type SPP_ENABLE_R = crate::BitReader;
7#[doc = "Field `SPP_ENABLE` writer - Enable Signaling and Payload Protection (SPP) for A-MSDUs"]
8pub type SPP_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `PMF_DISABLE` reader - Disable Protected Management Frames (PMF)"]
10pub type PMF_DISABLE_R = crate::BitReader;
11#[doc = "Field `PMF_DISABLE` writer - Disable Protected Management Frames (PMF)"]
12pub type PMF_DISABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `AEAD_CIPHER` reader - Does the cipher employ Authenticated Encryption with Associated Data (AEAD)"]
14pub type AEAD_CIPHER_R = crate::BitReader;
15#[doc = "Field `AEAD_CIPHER` writer - Does the cipher employ Authenticated Encryption with Associated Data (AEAD)"]
16pub type AEAD_CIPHER_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SMS4` reader - Cipher is SMS4"]
18pub type SMS4_R = crate::BitReader;
19#[doc = "Field `SMS4` writer - Cipher is SMS4"]
20pub type SMS4_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 9 - Enable Signaling and Payload Protection (SPP) for A-MSDUs"]
23    #[inline(always)]
24    pub fn spp_enable(&self) -> SPP_ENABLE_R {
25        SPP_ENABLE_R::new(((self.bits >> 9) & 1) != 0)
26    }
27    #[doc = "Bit 17 - Disable Protected Management Frames (PMF)"]
28    #[inline(always)]
29    pub fn pmf_disable(&self) -> PMF_DISABLE_R {
30        PMF_DISABLE_R::new(((self.bits >> 17) & 1) != 0)
31    }
32    #[doc = "Bit 28 - Does the cipher employ Authenticated Encryption with Associated Data (AEAD)"]
33    #[inline(always)]
34    pub fn aead_cipher(&self) -> AEAD_CIPHER_R {
35        AEAD_CIPHER_R::new(((self.bits >> 28) & 1) != 0)
36    }
37    #[doc = "Bit 31 - Cipher is SMS4"]
38    #[inline(always)]
39    pub fn sms4(&self) -> SMS4_R {
40        SMS4_R::new(((self.bits >> 31) & 1) != 0)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("INTERFACE_CRYPTO_CONTROL")
47            .field("spp_enable", &self.spp_enable())
48            .field("pmf_disable", &self.pmf_disable())
49            .field("aead_cipher", &self.aead_cipher())
50            .field("sms4", &self.sms4())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bit 9 - Enable Signaling and Payload Protection (SPP) for A-MSDUs"]
56    #[inline(always)]
57    pub fn spp_enable(&mut self) -> SPP_ENABLE_W<INTERFACE_CRYPTO_CONTROL_SPEC> {
58        SPP_ENABLE_W::new(self, 9)
59    }
60    #[doc = "Bit 17 - Disable Protected Management Frames (PMF)"]
61    #[inline(always)]
62    pub fn pmf_disable(&mut self) -> PMF_DISABLE_W<INTERFACE_CRYPTO_CONTROL_SPEC> {
63        PMF_DISABLE_W::new(self, 17)
64    }
65    #[doc = "Bit 28 - Does the cipher employ Authenticated Encryption with Associated Data (AEAD)"]
66    #[inline(always)]
67    pub fn aead_cipher(&mut self) -> AEAD_CIPHER_W<INTERFACE_CRYPTO_CONTROL_SPEC> {
68        AEAD_CIPHER_W::new(self, 28)
69    }
70    #[doc = "Bit 31 - Cipher is SMS4"]
71    #[inline(always)]
72    pub fn sms4(&mut self) -> SMS4_W<INTERFACE_CRYPTO_CONTROL_SPEC> {
73        SMS4_W::new(self, 31)
74    }
75}
76#[doc = "Control over cryptographic parameters for a specific interface\n\nYou can [`read`](crate::Reg::read) this register and get [`interface_crypto_control::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`interface_crypto_control::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct INTERFACE_CRYPTO_CONTROL_SPEC;
78impl crate::RegisterSpec for INTERFACE_CRYPTO_CONTROL_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`interface_crypto_control::R`](R) reader structure"]
82impl crate::Readable for INTERFACE_CRYPTO_CONTROL_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`interface_crypto_control::W`](W) writer structure"]
84impl crate::Writable for INTERFACE_CRYPTO_CONTROL_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets INTERFACE_CRYPTO_CONTROL%s to value 0"]
90impl crate::Resettable for INTERFACE_CRYPTO_CONTROL_SPEC {
91    const RESET_VALUE: u32 = 0;
92}