efm32pg12b500_pac/crypto1/
dstatus.rs1#[doc = "Register `DSTATUS` reader"]
2pub struct R(crate::R<DSTATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DSTATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DSTATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DSTATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Data 0 Zero\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u8)]
19pub enum DATA0ZERO_A {
20 #[doc = "1: In DATA0 bits 0 to 31 are all zero."]
21 ZERO0TO31 = 1,
22 #[doc = "2: In DATA0 bits 32 to 63 are all zero."]
23 ZERO32TO63 = 2,
24 #[doc = "4: In DATA0 bits 64 to 95 are all zero."]
25 ZERO64TO95 = 4,
26 #[doc = "8: In DATA0 bits 96 to 127 are all zero."]
27 ZERO96TO127 = 8,
28}
29impl From<DATA0ZERO_A> for u8 {
30 #[inline(always)]
31 fn from(variant: DATA0ZERO_A) -> Self {
32 variant as _
33 }
34}
35#[doc = "Field `DATA0ZERO` reader - Data 0 Zero"]
36pub type DATA0ZERO_R = crate::FieldReader<u8, DATA0ZERO_A>;
37impl DATA0ZERO_R {
38 #[doc = "Get enumerated values variant"]
39 #[inline(always)]
40 pub fn variant(&self) -> Option<DATA0ZERO_A> {
41 match self.bits {
42 1 => Some(DATA0ZERO_A::ZERO0TO31),
43 2 => Some(DATA0ZERO_A::ZERO32TO63),
44 4 => Some(DATA0ZERO_A::ZERO64TO95),
45 8 => Some(DATA0ZERO_A::ZERO96TO127),
46 _ => None,
47 }
48 }
49 #[doc = "Checks if the value of the field is `ZERO0TO31`"]
50 #[inline(always)]
51 pub fn is_zero0to31(&self) -> bool {
52 *self == DATA0ZERO_A::ZERO0TO31
53 }
54 #[doc = "Checks if the value of the field is `ZERO32TO63`"]
55 #[inline(always)]
56 pub fn is_zero32to63(&self) -> bool {
57 *self == DATA0ZERO_A::ZERO32TO63
58 }
59 #[doc = "Checks if the value of the field is `ZERO64TO95`"]
60 #[inline(always)]
61 pub fn is_zero64to95(&self) -> bool {
62 *self == DATA0ZERO_A::ZERO64TO95
63 }
64 #[doc = "Checks if the value of the field is `ZERO96TO127`"]
65 #[inline(always)]
66 pub fn is_zero96to127(&self) -> bool {
67 *self == DATA0ZERO_A::ZERO96TO127
68 }
69}
70#[doc = "Field `DDATA0LSBS` reader - LSBs in DDATA0"]
71pub type DDATA0LSBS_R = crate::FieldReader<u8, u8>;
72#[doc = "Field `DDATA0MSBS` reader - MSB in DDATA0"]
73pub type DDATA0MSBS_R = crate::FieldReader<u8, u8>;
74#[doc = "Field `DDATA1MSB` reader - MSB in DDATA1"]
75pub type DDATA1MSB_R = crate::BitReader<bool>;
76#[doc = "Field `CARRY` reader - Carry From Arithmetic Operation"]
77pub type CARRY_R = crate::BitReader<bool>;
78impl R {
79 #[doc = "Bits 0:3 - Data 0 Zero"]
80 #[inline(always)]
81 pub fn data0zero(&self) -> DATA0ZERO_R {
82 DATA0ZERO_R::new((self.bits & 0x0f) as u8)
83 }
84 #[doc = "Bits 8:11 - LSBs in DDATA0"]
85 #[inline(always)]
86 pub fn ddata0lsbs(&self) -> DDATA0LSBS_R {
87 DDATA0LSBS_R::new(((self.bits >> 8) & 0x0f) as u8)
88 }
89 #[doc = "Bits 16:19 - MSB in DDATA0"]
90 #[inline(always)]
91 pub fn ddata0msbs(&self) -> DDATA0MSBS_R {
92 DDATA0MSBS_R::new(((self.bits >> 16) & 0x0f) as u8)
93 }
94 #[doc = "Bit 20 - MSB in DDATA1"]
95 #[inline(always)]
96 pub fn ddata1msb(&self) -> DDATA1MSB_R {
97 DDATA1MSB_R::new(((self.bits >> 20) & 1) != 0)
98 }
99 #[doc = "Bit 24 - Carry From Arithmetic Operation"]
100 #[inline(always)]
101 pub fn carry(&self) -> CARRY_R {
102 CARRY_R::new(((self.bits >> 24) & 1) != 0)
103 }
104}
105#[doc = "Data 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 [dstatus](index.html) module"]
106pub struct DSTATUS_SPEC;
107impl crate::RegisterSpec for DSTATUS_SPEC {
108 type Ux = u32;
109}
110#[doc = "`read()` method returns [dstatus::R](R) reader structure"]
111impl crate::Readable for DSTATUS_SPEC {
112 type Reader = R;
113}
114#[doc = "`reset()` method sets DSTATUS to value 0"]
115impl crate::Resettable for DSTATUS_SPEC {
116 #[inline(always)]
117 fn reset_value() -> Self::Ux {
118 0
119 }
120}