ra6m3/glcdc/
syscnt_stmon.rs

1#[doc = "Register `SYSCNT_STMON` reader"]
2pub struct R(crate::R<SYSCNT_STMON_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SYSCNT_STMON_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SYSCNT_STMON_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SYSCNT_STMON_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VPOS` reader - Graphics 2 specified line detection flag"]
17pub type VPOS_R = crate::BitReader<VPOS_A>;
18#[doc = "Graphics 2 specified line detection flag\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum VPOS_A {
21    #[doc = "1: A specified line notification has been detected in graphics 2."]
22    _1 = 1,
23    #[doc = "0: No specified line notification has been detected in graphics 2."]
24    _0 = 0,
25}
26impl From<VPOS_A> for bool {
27    #[inline(always)]
28    fn from(variant: VPOS_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl VPOS_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> VPOS_A {
36        match self.bits {
37            true => VPOS_A::_1,
38            false => VPOS_A::_0,
39        }
40    }
41    #[doc = "Checks if the value of the field is `_1`"]
42    #[inline(always)]
43    pub fn is_1(&self) -> bool {
44        *self == VPOS_A::_1
45    }
46    #[doc = "Checks if the value of the field is `_0`"]
47    #[inline(always)]
48    pub fn is_0(&self) -> bool {
49        *self == VPOS_A::_0
50    }
51}
52#[doc = "Field `L1UNDF` reader - Graphics 1 underflow detection flag"]
53pub type L1UNDF_R = crate::BitReader<L1UNDF_A>;
54#[doc = "Graphics 1 underflow detection flag\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum L1UNDF_A {
57    #[doc = "1: An underflow has been detected in graphics 1."]
58    _1 = 1,
59    #[doc = "0: No underflow has been detected in graphics 1."]
60    _0 = 0,
61}
62impl From<L1UNDF_A> for bool {
63    #[inline(always)]
64    fn from(variant: L1UNDF_A) -> Self {
65        variant as u8 != 0
66    }
67}
68impl L1UNDF_R {
69    #[doc = "Get enumerated values variant"]
70    #[inline(always)]
71    pub fn variant(&self) -> L1UNDF_A {
72        match self.bits {
73            true => L1UNDF_A::_1,
74            false => L1UNDF_A::_0,
75        }
76    }
77    #[doc = "Checks if the value of the field is `_1`"]
78    #[inline(always)]
79    pub fn is_1(&self) -> bool {
80        *self == L1UNDF_A::_1
81    }
82    #[doc = "Checks if the value of the field is `_0`"]
83    #[inline(always)]
84    pub fn is_0(&self) -> bool {
85        *self == L1UNDF_A::_0
86    }
87}
88#[doc = "Field `L2UNDF` reader - Graphics 2 underflow detection flag"]
89pub type L2UNDF_R = crate::BitReader<L2UNDF_A>;
90#[doc = "Graphics 2 underflow detection flag\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum L2UNDF_A {
93    #[doc = "1: An underflow has been detected in graphics 2."]
94    _1 = 1,
95    #[doc = "0: No underflow has been detected in graphics 2."]
96    _0 = 0,
97}
98impl From<L2UNDF_A> for bool {
99    #[inline(always)]
100    fn from(variant: L2UNDF_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl L2UNDF_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> L2UNDF_A {
108        match self.bits {
109            true => L2UNDF_A::_1,
110            false => L2UNDF_A::_0,
111        }
112    }
113    #[doc = "Checks if the value of the field is `_1`"]
114    #[inline(always)]
115    pub fn is_1(&self) -> bool {
116        *self == L2UNDF_A::_1
117    }
118    #[doc = "Checks if the value of the field is `_0`"]
119    #[inline(always)]
120    pub fn is_0(&self) -> bool {
121        *self == L2UNDF_A::_0
122    }
123}
124impl R {
125    #[doc = "Bit 0 - Graphics 2 specified line detection flag"]
126    #[inline(always)]
127    pub fn vpos(&self) -> VPOS_R {
128        VPOS_R::new((self.bits & 1) != 0)
129    }
130    #[doc = "Bit 1 - Graphics 1 underflow detection flag"]
131    #[inline(always)]
132    pub fn l1undf(&self) -> L1UNDF_R {
133        L1UNDF_R::new(((self.bits >> 1) & 1) != 0)
134    }
135    #[doc = "Bit 2 - Graphics 2 underflow detection flag"]
136    #[inline(always)]
137    pub fn l2undf(&self) -> L2UNDF_R {
138        L2UNDF_R::new(((self.bits >> 2) & 1) != 0)
139    }
140}
141#[doc = "System Control Block Status Monitor 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 [syscnt_stmon](index.html) module"]
142pub struct SYSCNT_STMON_SPEC;
143impl crate::RegisterSpec for SYSCNT_STMON_SPEC {
144    type Ux = u32;
145}
146#[doc = "`read()` method returns [syscnt_stmon::R](R) reader structure"]
147impl crate::Readable for SYSCNT_STMON_SPEC {
148    type Reader = R;
149}
150#[doc = "`reset()` method sets SYSCNT_STMON to value 0"]
151impl crate::Resettable for SYSCNT_STMON_SPEC {
152    const RESET_VALUE: Self::Ux = 0;
153}