xmc4200/scu_general/
dtsstat.rs1#[doc = "Register `DTSSTAT` reader"]
2pub type R = crate::R<DTSSTAT_SPEC>;
3#[doc = "Field `RESULT` reader - Result of the DTS Measurement"]
4pub type RESULT_R = crate::FieldReader<u16>;
5#[doc = "Sensor Ready Status\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum RDY_A {
8 #[doc = "0: The DTS is not ready"]
9 VALUE1 = 0,
10 #[doc = "1: The DTS is ready"]
11 VALUE2 = 1,
12}
13impl From<RDY_A> for bool {
14 #[inline(always)]
15 fn from(variant: RDY_A) -> Self {
16 variant as u8 != 0
17 }
18}
19#[doc = "Field `RDY` reader - Sensor Ready Status"]
20pub type RDY_R = crate::BitReader<RDY_A>;
21impl RDY_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> RDY_A {
25 match self.bits {
26 false => RDY_A::VALUE1,
27 true => RDY_A::VALUE2,
28 }
29 }
30 #[doc = "The DTS is not ready"]
31 #[inline(always)]
32 pub fn is_value1(&self) -> bool {
33 *self == RDY_A::VALUE1
34 }
35 #[doc = "The DTS is ready"]
36 #[inline(always)]
37 pub fn is_value2(&self) -> bool {
38 *self == RDY_A::VALUE2
39 }
40}
41#[doc = "Sensor Busy Status\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum BUSY_A {
44 #[doc = "0: not busy"]
45 VALUE1 = 0,
46 #[doc = "1: busy"]
47 VALUE2 = 1,
48}
49impl From<BUSY_A> for bool {
50 #[inline(always)]
51 fn from(variant: BUSY_A) -> Self {
52 variant as u8 != 0
53 }
54}
55#[doc = "Field `BUSY` reader - Sensor Busy Status"]
56pub type BUSY_R = crate::BitReader<BUSY_A>;
57impl BUSY_R {
58 #[doc = "Get enumerated values variant"]
59 #[inline(always)]
60 pub const fn variant(&self) -> BUSY_A {
61 match self.bits {
62 false => BUSY_A::VALUE1,
63 true => BUSY_A::VALUE2,
64 }
65 }
66 #[doc = "not busy"]
67 #[inline(always)]
68 pub fn is_value1(&self) -> bool {
69 *self == BUSY_A::VALUE1
70 }
71 #[doc = "busy"]
72 #[inline(always)]
73 pub fn is_value2(&self) -> bool {
74 *self == BUSY_A::VALUE2
75 }
76}
77impl R {
78 #[doc = "Bits 0:9 - Result of the DTS Measurement"]
79 #[inline(always)]
80 pub fn result(&self) -> RESULT_R {
81 RESULT_R::new((self.bits & 0x03ff) as u16)
82 }
83 #[doc = "Bit 14 - Sensor Ready Status"]
84 #[inline(always)]
85 pub fn rdy(&self) -> RDY_R {
86 RDY_R::new(((self.bits >> 14) & 1) != 0)
87 }
88 #[doc = "Bit 15 - Sensor Busy Status"]
89 #[inline(always)]
90 pub fn busy(&self) -> BUSY_R {
91 BUSY_R::new(((self.bits >> 15) & 1) != 0)
92 }
93}
94#[doc = "Die Temperature Sensor Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`dtsstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
95pub struct DTSSTAT_SPEC;
96impl crate::RegisterSpec for DTSSTAT_SPEC {
97 type Ux = u32;
98}
99#[doc = "`read()` method returns [`dtsstat::R`](R) reader structure"]
100impl crate::Readable for DTSSTAT_SPEC {}
101#[doc = "`reset()` method sets DTSSTAT to value 0"]
102impl crate::Resettable for DTSSTAT_SPEC {
103 const RESET_VALUE: u32 = 0;
104}