cc2650/trng/
irqflagstat.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::IRQFLAGSTAT {
6    #[doc = r" Reads the contents of the register"]
7    #[inline]
8    pub fn read(&self) -> R {
9        R { bits: self.register.get() }
10    }
11}
12#[doc = r" Value of the field"]
13pub struct NEED_CLOCKR {
14    bits: bool,
15}
16impl NEED_CLOCKR {
17    #[doc = r" Value of the field as raw bits"]
18    #[inline]
19    pub fn bit(&self) -> bool {
20        self.bits
21    }
22    #[doc = r" Returns `true` if the bit is clear (0)"]
23    #[inline]
24    pub fn bit_is_clear(&self) -> bool {
25        !self.bit()
26    }
27    #[doc = r" Returns `true` if the bit is set (1)"]
28    #[inline]
29    pub fn bit_is_set(&self) -> bool {
30        self.bit()
31    }
32}
33#[doc = r" Value of the field"]
34pub struct RESERVED2R {
35    bits: u32,
36}
37impl RESERVED2R {
38    #[doc = r" Value of the field as raw bits"]
39    #[inline]
40    pub fn bits(&self) -> u32 {
41        self.bits
42    }
43}
44#[doc = r" Value of the field"]
45pub struct SHUTDOWN_OVFR {
46    bits: bool,
47}
48impl SHUTDOWN_OVFR {
49    #[doc = r" Value of the field as raw bits"]
50    #[inline]
51    pub fn bit(&self) -> bool {
52        self.bits
53    }
54    #[doc = r" Returns `true` if the bit is clear (0)"]
55    #[inline]
56    pub fn bit_is_clear(&self) -> bool {
57        !self.bit()
58    }
59    #[doc = r" Returns `true` if the bit is set (1)"]
60    #[inline]
61    pub fn bit_is_set(&self) -> bool {
62        self.bit()
63    }
64}
65#[doc = r" Value of the field"]
66pub struct RDYR {
67    bits: bool,
68}
69impl RDYR {
70    #[doc = r" Value of the field as raw bits"]
71    #[inline]
72    pub fn bit(&self) -> bool {
73        self.bits
74    }
75    #[doc = r" Returns `true` if the bit is clear (0)"]
76    #[inline]
77    pub fn bit_is_clear(&self) -> bool {
78        !self.bit()
79    }
80    #[doc = r" Returns `true` if the bit is set (1)"]
81    #[inline]
82    pub fn bit_is_set(&self) -> bool {
83        self.bit()
84    }
85}
86impl R {
87    #[doc = r" Value of the register as raw bits"]
88    #[inline]
89    pub fn bits(&self) -> u32 {
90        self.bits
91    }
92    #[doc = "Bit 31 - 1: Indicates that the TRNG is busy generating entropy or is in one of its test modes - clocks may not be turned off and the power supply voltage must be kept stable. 0: TRNG is idle and can be shut down"]
93    #[inline]
94    pub fn need_clock(&self) -> NEED_CLOCKR {
95        let bits = {
96            const MASK: bool = true;
97            const OFFSET: u8 = 31;
98            ((self.bits >> OFFSET) & MASK as u32) != 0
99        };
100        NEED_CLOCKR { bits }
101    }
102    #[doc = "Bits 2:30 - Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
103    #[inline]
104    pub fn reserved2(&self) -> RESERVED2R {
105        let bits = {
106            const MASK: u32 = 536870911;
107            const OFFSET: u8 = 2;
108            ((self.bits >> OFFSET) & MASK as u32) as u32
109        };
110        RESERVED2R { bits }
111    }
112    #[doc = "Bit 1 - 1: The number of FROs shut down (i.e. the number of '1' bits in the ALARMSTOP register) has exceeded the threshold set by ALARMCNT.SHUTDOWN_THR Writing '1' to IRQFLAGCLR.SHUTDOWN_OVF clears this bit to '0' again."]
113    #[inline]
114    pub fn shutdown_ovf(&self) -> SHUTDOWN_OVFR {
115        let bits = {
116            const MASK: bool = true;
117            const OFFSET: u8 = 1;
118            ((self.bits >> OFFSET) & MASK as u32) != 0
119        };
120        SHUTDOWN_OVFR { bits }
121    }
122    #[doc = "Bit 0 - 1: Data are available in OUT0 and OUT1. Acknowledging this state by writing '1' to IRQFLAGCLR.RDY clears this bit to '0'. If a new number is already available in the internal register of the TRNG, the number is directly clocked into the result register. In this case the status bit is asserted again, after one clock cycle."]
123    #[inline]
124    pub fn rdy(&self) -> RDYR {
125        let bits = {
126            const MASK: bool = true;
127            const OFFSET: u8 = 0;
128            ((self.bits >> OFFSET) & MASK as u32) != 0
129        };
130        RDYR { bits }
131    }
132}