max78000_pac/sir/
sfstat.rs

1#[doc = "Register `SFSTAT` reader"]
2pub type R = crate::R<SfstatSpec>;
3#[doc = "TRNG Function.\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum Trng {
6    #[doc = "0: `0`"]
7    No = 0,
8    #[doc = "1: `1`"]
9    Yes = 1,
10}
11impl From<Trng> for bool {
12    #[inline(always)]
13    fn from(variant: Trng) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `TRNG` reader - TRNG Function."]
18pub type TrngR = crate::BitReader<Trng>;
19impl TrngR {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> Trng {
23        match self.bits {
24            false => Trng::No,
25            true => Trng::Yes,
26        }
27    }
28    #[doc = "`0`"]
29    #[inline(always)]
30    pub fn is_no(&self) -> bool {
31        *self == Trng::No
32    }
33    #[doc = "`1`"]
34    #[inline(always)]
35    pub fn is_yes(&self) -> bool {
36        *self == Trng::Yes
37    }
38}
39#[doc = "AES Block.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum Aes {
42    #[doc = "0: `0`"]
43    No = 0,
44    #[doc = "1: `1`"]
45    Yes = 1,
46}
47impl From<Aes> for bool {
48    #[inline(always)]
49    fn from(variant: Aes) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `AES` reader - AES Block."]
54pub type AesR = crate::BitReader<Aes>;
55impl AesR {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> Aes {
59        match self.bits {
60            false => Aes::No,
61            true => Aes::Yes,
62        }
63    }
64    #[doc = "`0`"]
65    #[inline(always)]
66    pub fn is_no(&self) -> bool {
67        *self == Aes::No
68    }
69    #[doc = "`1`"]
70    #[inline(always)]
71    pub fn is_yes(&self) -> bool {
72        *self == Aes::Yes
73    }
74}
75impl R {
76    #[doc = "Bit 0 - TRNG Function."]
77    #[inline(always)]
78    pub fn trng(&self) -> TrngR {
79        TrngR::new((self.bits & 1) != 0)
80    }
81    #[doc = "Bit 2 - AES Block."]
82    #[inline(always)]
83    pub fn aes(&self) -> AesR {
84        AesR::new(((self.bits >> 2) & 1) != 0)
85    }
86}
87#[doc = "Security function status register.\n\nYou can [`read`](crate::Reg::read) this register and get [`sfstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
88pub struct SfstatSpec;
89impl crate::RegisterSpec for SfstatSpec {
90    type Ux = u32;
91}
92#[doc = "`read()` method returns [`sfstat::R`](R) reader structure"]
93impl crate::Readable for SfstatSpec {}
94#[doc = "`reset()` method sets SFSTAT to value 0"]
95impl crate::Resettable for SfstatSpec {
96    const RESET_VALUE: u32 = 0;
97}