1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#[doc = "Reader of register CAPABILITY1"] pub type R = crate::R<u32, super::CAPABILITY1>; #[doc = "One-hot field indicating which cipher algorithms are available\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] pub enum CIPHER_ALGORITHMS_A { #[doc = "1: AES128"] AES128 = 1, } impl From<CIPHER_ALGORITHMS_A> for u16 { #[inline(always)] fn from(variant: CIPHER_ALGORITHMS_A) -> Self { variant as _ } } #[doc = "Reader of field `CIPHER_ALGORITHMS`"] pub type CIPHER_ALGORITHMS_R = crate::R<u16, CIPHER_ALGORITHMS_A>; impl CIPHER_ALGORITHMS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u16, CIPHER_ALGORITHMS_A> { use crate::Variant::*; match self.bits { 1 => Val(CIPHER_ALGORITHMS_A::AES128), i => Res(i), } } #[doc = "Checks if the value of the field is `AES128`"] #[inline(always)] pub fn is_aes128(&self) -> bool { *self == CIPHER_ALGORITHMS_A::AES128 } } #[doc = "One-hot field indicating which hashing features are implemented in the hardware\n\nValue on reset: 7"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] pub enum HASH_ALGORITHMS_A { #[doc = "1: SHA1"] SHA1 = 1, #[doc = "2: CRC32"] CRC32 = 2, #[doc = "4: SHA256"] SHA256 = 4, } impl From<HASH_ALGORITHMS_A> for u16 { #[inline(always)] fn from(variant: HASH_ALGORITHMS_A) -> Self { variant as _ } } #[doc = "Reader of field `HASH_ALGORITHMS`"] pub type HASH_ALGORITHMS_R = crate::R<u16, HASH_ALGORITHMS_A>; impl HASH_ALGORITHMS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u16, HASH_ALGORITHMS_A> { use crate::Variant::*; match self.bits { 1 => Val(HASH_ALGORITHMS_A::SHA1), 2 => Val(HASH_ALGORITHMS_A::CRC32), 4 => Val(HASH_ALGORITHMS_A::SHA256), i => Res(i), } } #[doc = "Checks if the value of the field is `SHA1`"] #[inline(always)] pub fn is_sha1(&self) -> bool { *self == HASH_ALGORITHMS_A::SHA1 } #[doc = "Checks if the value of the field is `CRC32`"] #[inline(always)] pub fn is_crc32(&self) -> bool { *self == HASH_ALGORITHMS_A::CRC32 } #[doc = "Checks if the value of the field is `SHA256`"] #[inline(always)] pub fn is_sha256(&self) -> bool { *self == HASH_ALGORITHMS_A::SHA256 } } impl R { #[doc = "Bits 0:15 - One-hot field indicating which cipher algorithms are available"] #[inline(always)] pub fn cipher_algorithms(&self) -> CIPHER_ALGORITHMS_R { CIPHER_ALGORITHMS_R::new((self.bits & 0xffff) as u16) } #[doc = "Bits 16:31 - One-hot field indicating which hashing features are implemented in the hardware"] #[inline(always)] pub fn hash_algorithms(&self) -> HASH_ALGORITHMS_R { HASH_ALGORITHMS_R::new(((self.bits >> 16) & 0xffff) as u16) } }