mimxrt595s/trng/
int_status.rs1#[doc = "Register `INT_STATUS` reader"]
2pub struct R(crate::R<INT_STATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<INT_STATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<INT_STATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<INT_STATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `HW_ERR` reader - Read: Error status"]
17pub type HW_ERR_R = crate::BitReader<HW_ERR_A>;
18#[doc = "Read: Error status\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum HW_ERR_A {
21 #[doc = "0: no error"]
22 HW_ERR_NO = 0,
23 #[doc = "1: error detected."]
24 HW_ERR_YES = 1,
25}
26impl From<HW_ERR_A> for bool {
27 #[inline(always)]
28 fn from(variant: HW_ERR_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl HW_ERR_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> HW_ERR_A {
36 match self.bits {
37 false => HW_ERR_A::HW_ERR_NO,
38 true => HW_ERR_A::HW_ERR_YES,
39 }
40 }
41 #[doc = "Checks if the value of the field is `HW_ERR_NO`"]
42 #[inline(always)]
43 pub fn is_hw_err_no(&self) -> bool {
44 *self == HW_ERR_A::HW_ERR_NO
45 }
46 #[doc = "Checks if the value of the field is `HW_ERR_YES`"]
47 #[inline(always)]
48 pub fn is_hw_err_yes(&self) -> bool {
49 *self == HW_ERR_A::HW_ERR_YES
50 }
51}
52#[doc = "Field `ENT_VAL` reader - Read only: Entropy Valid"]
53pub type ENT_VAL_R = crate::BitReader<ENT_VAL_A>;
54#[doc = "Read only: Entropy Valid\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum ENT_VAL_A {
57 #[doc = "0: Busy generation entropy. Any value read is invalid."]
58 ENT_VAL_INVALID = 0,
59 #[doc = "1: TRNG can be stopped and entropy is valid if read."]
60 ENT_VAL_VALID = 1,
61}
62impl From<ENT_VAL_A> for bool {
63 #[inline(always)]
64 fn from(variant: ENT_VAL_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl ENT_VAL_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> ENT_VAL_A {
72 match self.bits {
73 false => ENT_VAL_A::ENT_VAL_INVALID,
74 true => ENT_VAL_A::ENT_VAL_VALID,
75 }
76 }
77 #[doc = "Checks if the value of the field is `ENT_VAL_INVALID`"]
78 #[inline(always)]
79 pub fn is_ent_val_invalid(&self) -> bool {
80 *self == ENT_VAL_A::ENT_VAL_INVALID
81 }
82 #[doc = "Checks if the value of the field is `ENT_VAL_VALID`"]
83 #[inline(always)]
84 pub fn is_ent_val_valid(&self) -> bool {
85 *self == ENT_VAL_A::ENT_VAL_VALID
86 }
87}
88#[doc = "Field `FRQ_CT_FAIL` reader - Read only: Frequency Count Fail"]
89pub type FRQ_CT_FAIL_R = crate::BitReader<FRQ_CT_FAIL_A>;
90#[doc = "Read only: Frequency Count Fail\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum FRQ_CT_FAIL_A {
93 #[doc = "0: No hardware nor self test frequency errors."]
94 FRQ_CT_FAIL_NO_ERR = 0,
95 #[doc = "1: The frequency counter has detected a failure."]
96 FRQ_CT_FAIL_ERR = 1,
97}
98impl From<FRQ_CT_FAIL_A> for bool {
99 #[inline(always)]
100 fn from(variant: FRQ_CT_FAIL_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl FRQ_CT_FAIL_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> FRQ_CT_FAIL_A {
108 match self.bits {
109 false => FRQ_CT_FAIL_A::FRQ_CT_FAIL_NO_ERR,
110 true => FRQ_CT_FAIL_A::FRQ_CT_FAIL_ERR,
111 }
112 }
113 #[doc = "Checks if the value of the field is `FRQ_CT_FAIL_NO_ERR`"]
114 #[inline(always)]
115 pub fn is_frq_ct_fail_no_err(&self) -> bool {
116 *self == FRQ_CT_FAIL_A::FRQ_CT_FAIL_NO_ERR
117 }
118 #[doc = "Checks if the value of the field is `FRQ_CT_FAIL_ERR`"]
119 #[inline(always)]
120 pub fn is_frq_ct_fail_err(&self) -> bool {
121 *self == FRQ_CT_FAIL_A::FRQ_CT_FAIL_ERR
122 }
123}
124impl R {
125 #[doc = "Bit 0 - Read: Error status"]
126 #[inline(always)]
127 pub fn hw_err(&self) -> HW_ERR_R {
128 HW_ERR_R::new((self.bits & 1) != 0)
129 }
130 #[doc = "Bit 1 - Read only: Entropy Valid"]
131 #[inline(always)]
132 pub fn ent_val(&self) -> ENT_VAL_R {
133 ENT_VAL_R::new(((self.bits >> 1) & 1) != 0)
134 }
135 #[doc = "Bit 2 - Read only: Frequency Count Fail"]
136 #[inline(always)]
137 pub fn frq_ct_fail(&self) -> FRQ_CT_FAIL_R {
138 FRQ_CT_FAIL_R::new(((self.bits >> 2) & 1) != 0)
139 }
140}
141#[doc = "Interrupt Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [int_status](index.html) module"]
142pub struct INT_STATUS_SPEC;
143impl crate::RegisterSpec for INT_STATUS_SPEC {
144 type Ux = u32;
145}
146#[doc = "`read()` method returns [int_status::R](R) reader structure"]
147impl crate::Readable for INT_STATUS_SPEC {
148 type Reader = R;
149}
150#[doc = "`reset()` method sets INT_STATUS to value 0"]
151impl crate::Resettable for INT_STATUS_SPEC {
152 const RESET_VALUE: Self::Ux = 0;
153}