ra2e2/flcn/
fstatr1.rs

1#[doc = "Register `FSTATR1` reader"]
2pub struct R(crate::R<FSTATR1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FSTATR1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FSTATR1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FSTATR1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `DRRDY` reader - Data Read Ready Flag"]
17pub type DRRDY_R = crate::BitReader<DRRDY_A>;
18#[doc = "Data Read Ready Flag\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum DRRDY_A {
21    #[doc = "0: The read processing of the consecutive read command at each address is not terminated."]
22    _0 = 0,
23    #[doc = "1: The read processing of the consecutive read command at each address is terminated and read data is stored to the FRBH and FRBL registers."]
24    _1 = 1,
25}
26impl From<DRRDY_A> for bool {
27    #[inline(always)]
28    fn from(variant: DRRDY_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl DRRDY_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> DRRDY_A {
36        match self.bits {
37            false => DRRDY_A::_0,
38            true => DRRDY_A::_1,
39        }
40    }
41    #[doc = "Checks if the value of the field is `_0`"]
42    #[inline(always)]
43    pub fn is_0(&self) -> bool {
44        *self == DRRDY_A::_0
45    }
46    #[doc = "Checks if the value of the field is `_1`"]
47    #[inline(always)]
48    pub fn is_1(&self) -> bool {
49        *self == DRRDY_A::_1
50    }
51}
52#[doc = "Field `FRDY` reader - Flash Ready Flag"]
53pub type FRDY_R = crate::BitReader<FRDY_A>;
54#[doc = "Flash Ready Flag\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum FRDY_A {
57    #[doc = "0: The software command of the FCR register is not terminated."]
58    _0 = 0,
59    #[doc = "1: The software command of the FCR register is terminated."]
60    _1 = 1,
61}
62impl From<FRDY_A> for bool {
63    #[inline(always)]
64    fn from(variant: FRDY_A) -> Self {
65        variant as u8 != 0
66    }
67}
68impl FRDY_R {
69    #[doc = "Get enumerated values variant"]
70    #[inline(always)]
71    pub fn variant(&self) -> FRDY_A {
72        match self.bits {
73            false => FRDY_A::_0,
74            true => FRDY_A::_1,
75        }
76    }
77    #[doc = "Checks if the value of the field is `_0`"]
78    #[inline(always)]
79    pub fn is_0(&self) -> bool {
80        *self == FRDY_A::_0
81    }
82    #[doc = "Checks if the value of the field is `_1`"]
83    #[inline(always)]
84    pub fn is_1(&self) -> bool {
85        *self == FRDY_A::_1
86    }
87}
88#[doc = "Field `EXRDY` reader - Extra Area Ready Flag"]
89pub type EXRDY_R = crate::BitReader<EXRDY_A>;
90#[doc = "Extra Area Ready Flag\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum EXRDY_A {
93    #[doc = "0: The software command of the FEXCR register is not terminated."]
94    _0 = 0,
95    #[doc = "1: The software command of the FEXCR register is terminated."]
96    _1 = 1,
97}
98impl From<EXRDY_A> for bool {
99    #[inline(always)]
100    fn from(variant: EXRDY_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl EXRDY_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> EXRDY_A {
108        match self.bits {
109            false => EXRDY_A::_0,
110            true => EXRDY_A::_1,
111        }
112    }
113    #[doc = "Checks if the value of the field is `_0`"]
114    #[inline(always)]
115    pub fn is_0(&self) -> bool {
116        *self == EXRDY_A::_0
117    }
118    #[doc = "Checks if the value of the field is `_1`"]
119    #[inline(always)]
120    pub fn is_1(&self) -> bool {
121        *self == EXRDY_A::_1
122    }
123}
124impl R {
125    #[doc = "Bit 1 - Data Read Ready Flag"]
126    #[inline(always)]
127    pub fn drrdy(&self) -> DRRDY_R {
128        DRRDY_R::new(((self.bits >> 1) & 1) != 0)
129    }
130    #[doc = "Bit 6 - Flash Ready Flag"]
131    #[inline(always)]
132    pub fn frdy(&self) -> FRDY_R {
133        FRDY_R::new(((self.bits >> 6) & 1) != 0)
134    }
135    #[doc = "Bit 7 - Extra Area Ready Flag"]
136    #[inline(always)]
137    pub fn exrdy(&self) -> EXRDY_R {
138        EXRDY_R::new(((self.bits >> 7) & 1) != 0)
139    }
140}
141#[doc = "Flash Status Register 1\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 [fstatr1](index.html) module"]
142pub struct FSTATR1_SPEC;
143impl crate::RegisterSpec for FSTATR1_SPEC {
144    type Ux = u8;
145}
146#[doc = "`read()` method returns [fstatr1::R](R) reader structure"]
147impl crate::Readable for FSTATR1_SPEC {
148    type Reader = R;
149}
150#[doc = "`reset()` method sets FSTATR1 to value 0x04"]
151impl crate::Resettable for FSTATR1_SPEC {
152    const RESET_VALUE: Self::Ux = 0x04;
153}