lpc82x_pac/sct0/
conflag.rs1#[doc = "Register `CONFLAG` reader"]
2pub struct R(crate::R<CONFLAG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONFLAG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONFLAG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONFLAG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CONFLAG` writer"]
17pub struct W(crate::W<CONFLAG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CONFLAG_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CONFLAG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CONFLAG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `NCFLAG` reader - Bit n is one if a no-change conflict event occurred on output n since reset or a 1 was last written to this bit (output 0 = bit 0, output 1 = bit 1, etc.). The number of bits = number of outputs in this SCT."]
38pub struct NCFLAG_R(crate::FieldReader<u8, u8>);
39impl NCFLAG_R {
40 pub(crate) fn new(bits: u8) -> Self {
41 NCFLAG_R(crate::FieldReader::new(bits))
42 }
43}
44impl core::ops::Deref for NCFLAG_R {
45 type Target = crate::FieldReader<u8, u8>;
46 #[inline(always)]
47 fn deref(&self) -> &Self::Target {
48 &self.0
49 }
50}
51#[doc = "Field `NCFLAG` writer - Bit n is one if a no-change conflict event occurred on output n since reset or a 1 was last written to this bit (output 0 = bit 0, output 1 = bit 1, etc.). The number of bits = number of outputs in this SCT."]
52pub struct NCFLAG_W<'a> {
53 w: &'a mut W,
54}
55impl<'a> NCFLAG_W<'a> {
56 #[doc = r"Writes raw bits to the field"]
57 #[inline(always)]
58 pub unsafe fn bits(self, value: u8) -> &'a mut W {
59 self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f);
60 self.w
61 }
62}
63#[doc = "Field `BUSERRL` reader - The most recent bus error from this SCT involved writing CTR L/Unified, STATE L/Unified, MATCH L/Unified, or the Output register when the L/U counter was not halted. A word write to certain L and H registers can be half successful and half unsuccessful."]
64pub struct BUSERRL_R(crate::FieldReader<bool, bool>);
65impl BUSERRL_R {
66 pub(crate) fn new(bits: bool) -> Self {
67 BUSERRL_R(crate::FieldReader::new(bits))
68 }
69}
70impl core::ops::Deref for BUSERRL_R {
71 type Target = crate::FieldReader<bool, bool>;
72 #[inline(always)]
73 fn deref(&self) -> &Self::Target {
74 &self.0
75 }
76}
77#[doc = "Field `BUSERRL` writer - The most recent bus error from this SCT involved writing CTR L/Unified, STATE L/Unified, MATCH L/Unified, or the Output register when the L/U counter was not halted. A word write to certain L and H registers can be half successful and half unsuccessful."]
78pub struct BUSERRL_W<'a> {
79 w: &'a mut W,
80}
81impl<'a> BUSERRL_W<'a> {
82 #[doc = r"Sets the field bit"]
83 #[inline(always)]
84 pub fn set_bit(self) -> &'a mut W {
85 self.bit(true)
86 }
87 #[doc = r"Clears the field bit"]
88 #[inline(always)]
89 pub fn clear_bit(self) -> &'a mut W {
90 self.bit(false)
91 }
92 #[doc = r"Writes raw bits to the field"]
93 #[inline(always)]
94 pub fn bit(self, value: bool) -> &'a mut W {
95 self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30);
96 self.w
97 }
98}
99#[doc = "Field `BUSERRH` reader - The most recent bus error from this SCT involved writing CTR H, STATE H, MATCH H, or the Output register when the H counter was not halted."]
100pub struct BUSERRH_R(crate::FieldReader<bool, bool>);
101impl BUSERRH_R {
102 pub(crate) fn new(bits: bool) -> Self {
103 BUSERRH_R(crate::FieldReader::new(bits))
104 }
105}
106impl core::ops::Deref for BUSERRH_R {
107 type Target = crate::FieldReader<bool, bool>;
108 #[inline(always)]
109 fn deref(&self) -> &Self::Target {
110 &self.0
111 }
112}
113#[doc = "Field `BUSERRH` writer - The most recent bus error from this SCT involved writing CTR H, STATE H, MATCH H, or the Output register when the H counter was not halted."]
114pub struct BUSERRH_W<'a> {
115 w: &'a mut W,
116}
117impl<'a> BUSERRH_W<'a> {
118 #[doc = r"Sets the field bit"]
119 #[inline(always)]
120 pub fn set_bit(self) -> &'a mut W {
121 self.bit(true)
122 }
123 #[doc = r"Clears the field bit"]
124 #[inline(always)]
125 pub fn clear_bit(self) -> &'a mut W {
126 self.bit(false)
127 }
128 #[doc = r"Writes raw bits to the field"]
129 #[inline(always)]
130 pub fn bit(self, value: bool) -> &'a mut W {
131 self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31);
132 self.w
133 }
134}
135impl R {
136 #[doc = "Bits 0:5 - Bit n is one if a no-change conflict event occurred on output n since reset or a 1 was last written to this bit (output 0 = bit 0, output 1 = bit 1, etc.). The number of bits = number of outputs in this SCT."]
137 #[inline(always)]
138 pub fn ncflag(&self) -> NCFLAG_R {
139 NCFLAG_R::new((self.bits & 0x3f) as u8)
140 }
141 #[doc = "Bit 30 - The most recent bus error from this SCT involved writing CTR L/Unified, STATE L/Unified, MATCH L/Unified, or the Output register when the L/U counter was not halted. A word write to certain L and H registers can be half successful and half unsuccessful."]
142 #[inline(always)]
143 pub fn buserrl(&self) -> BUSERRL_R {
144 BUSERRL_R::new(((self.bits >> 30) & 0x01) != 0)
145 }
146 #[doc = "Bit 31 - The most recent bus error from this SCT involved writing CTR H, STATE H, MATCH H, or the Output register when the H counter was not halted."]
147 #[inline(always)]
148 pub fn buserrh(&self) -> BUSERRH_R {
149 BUSERRH_R::new(((self.bits >> 31) & 0x01) != 0)
150 }
151}
152impl W {
153 #[doc = "Bits 0:5 - Bit n is one if a no-change conflict event occurred on output n since reset or a 1 was last written to this bit (output 0 = bit 0, output 1 = bit 1, etc.). The number of bits = number of outputs in this SCT."]
154 #[inline(always)]
155 pub fn ncflag(&mut self) -> NCFLAG_W {
156 NCFLAG_W { w: self }
157 }
158 #[doc = "Bit 30 - The most recent bus error from this SCT involved writing CTR L/Unified, STATE L/Unified, MATCH L/Unified, or the Output register when the L/U counter was not halted. A word write to certain L and H registers can be half successful and half unsuccessful."]
159 #[inline(always)]
160 pub fn buserrl(&mut self) -> BUSERRL_W {
161 BUSERRL_W { w: self }
162 }
163 #[doc = "Bit 31 - The most recent bus error from this SCT involved writing CTR H, STATE H, MATCH H, or the Output register when the H counter was not halted."]
164 #[inline(always)]
165 pub fn buserrh(&mut self) -> BUSERRH_W {
166 BUSERRH_W { w: self }
167 }
168 #[doc = "Writes raw bits to the register."]
169 #[inline(always)]
170 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
171 self.0.bits(bits);
172 self
173 }
174}
175#[doc = "SCT conflict flag register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [conflag](index.html) module"]
176pub struct CONFLAG_SPEC;
177impl crate::RegisterSpec for CONFLAG_SPEC {
178 type Ux = u32;
179}
180#[doc = "`read()` method returns [conflag::R](R) reader structure"]
181impl crate::Readable for CONFLAG_SPEC {
182 type Reader = R;
183}
184#[doc = "`write(|w| ..)` method takes [conflag::W](W) writer structure"]
185impl crate::Writable for CONFLAG_SPEC {
186 type Writer = W;
187}
188#[doc = "`reset()` method sets CONFLAG to value 0"]
189impl crate::Resettable for CONFLAG_SPEC {
190 #[inline(always)]
191 fn reset_value() -> Self::Ux {
192 0
193 }
194}