lpc550x/flash_cfpa0/
dcfg_cc_socu_pin.rs

1#[doc = "Register `DCFG_CC_SOCU_PIN` reader"]
2pub struct R(crate::R<DCFG_CC_SOCU_PIN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DCFG_CC_SOCU_PIN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DCFG_CC_SOCU_PIN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DCFG_CC_SOCU_PIN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DCFG_CC_SOCU_PIN` writer"]
17pub struct W(crate::W<DCFG_CC_SOCU_PIN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DCFG_CC_SOCU_PIN_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<DCFG_CC_SOCU_PIN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DCFG_CC_SOCU_PIN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `NIDEN` reader - Non Secure non-invasive debug enable."]
38pub type NIDEN_R = crate::BitReader<NIDEN_A>;
39#[doc = "Non Secure non-invasive debug enable.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum NIDEN_A {
42    #[doc = "0: Use DAP to enable."]
43    ENABLE = 0,
44    #[doc = "1: Fixed state."]
45    DISABLE = 1,
46}
47impl From<NIDEN_A> for bool {
48    #[inline(always)]
49    fn from(variant: NIDEN_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl NIDEN_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> NIDEN_A {
57        match self.bits {
58            false => NIDEN_A::ENABLE,
59            true => NIDEN_A::DISABLE,
60        }
61    }
62    #[doc = "Checks if the value of the field is `ENABLE`"]
63    #[inline(always)]
64    pub fn is_enable(&self) -> bool {
65        *self == NIDEN_A::ENABLE
66    }
67    #[doc = "Checks if the value of the field is `DISABLE`"]
68    #[inline(always)]
69    pub fn is_disable(&self) -> bool {
70        *self == NIDEN_A::DISABLE
71    }
72}
73#[doc = "Field `NIDEN` writer - Non Secure non-invasive debug enable."]
74pub type NIDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, NIDEN_A, O>;
75impl<'a, const O: u8> NIDEN_W<'a, O> {
76    #[doc = "Use DAP to enable."]
77    #[inline(always)]
78    pub fn enable(self) -> &'a mut W {
79        self.variant(NIDEN_A::ENABLE)
80    }
81    #[doc = "Fixed state."]
82    #[inline(always)]
83    pub fn disable(self) -> &'a mut W {
84        self.variant(NIDEN_A::DISABLE)
85    }
86}
87#[doc = "Field `DBGEN` reader - Non Secure debug enable."]
88pub type DBGEN_R = crate::BitReader<DBGEN_A>;
89#[doc = "Non Secure debug enable.\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum DBGEN_A {
92    #[doc = "0: Use DAP to enable."]
93    ENABLE = 0,
94    #[doc = "1: Fixed state."]
95    DISABLE = 1,
96}
97impl From<DBGEN_A> for bool {
98    #[inline(always)]
99    fn from(variant: DBGEN_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl DBGEN_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> DBGEN_A {
107        match self.bits {
108            false => DBGEN_A::ENABLE,
109            true => DBGEN_A::DISABLE,
110        }
111    }
112    #[doc = "Checks if the value of the field is `ENABLE`"]
113    #[inline(always)]
114    pub fn is_enable(&self) -> bool {
115        *self == DBGEN_A::ENABLE
116    }
117    #[doc = "Checks if the value of the field is `DISABLE`"]
118    #[inline(always)]
119    pub fn is_disable(&self) -> bool {
120        *self == DBGEN_A::DISABLE
121    }
122}
123#[doc = "Field `DBGEN` writer - Non Secure debug enable."]
124pub type DBGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, DBGEN_A, O>;
125impl<'a, const O: u8> DBGEN_W<'a, O> {
126    #[doc = "Use DAP to enable."]
127    #[inline(always)]
128    pub fn enable(self) -> &'a mut W {
129        self.variant(DBGEN_A::ENABLE)
130    }
131    #[doc = "Fixed state."]
132    #[inline(always)]
133    pub fn disable(self) -> &'a mut W {
134        self.variant(DBGEN_A::DISABLE)
135    }
136}
137#[doc = "Field `SPNIDEN` reader - Secure non-invasive debug enable."]
138pub type SPNIDEN_R = crate::BitReader<SPNIDEN_A>;
139#[doc = "Secure non-invasive debug enable.\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum SPNIDEN_A {
142    #[doc = "0: Use DAP to enable."]
143    ENABLE = 0,
144    #[doc = "1: Fixed state."]
145    DISABLE = 1,
146}
147impl From<SPNIDEN_A> for bool {
148    #[inline(always)]
149    fn from(variant: SPNIDEN_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl SPNIDEN_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> SPNIDEN_A {
157        match self.bits {
158            false => SPNIDEN_A::ENABLE,
159            true => SPNIDEN_A::DISABLE,
160        }
161    }
162    #[doc = "Checks if the value of the field is `ENABLE`"]
163    #[inline(always)]
164    pub fn is_enable(&self) -> bool {
165        *self == SPNIDEN_A::ENABLE
166    }
167    #[doc = "Checks if the value of the field is `DISABLE`"]
168    #[inline(always)]
169    pub fn is_disable(&self) -> bool {
170        *self == SPNIDEN_A::DISABLE
171    }
172}
173#[doc = "Field `SPNIDEN` writer - Secure non-invasive debug enable."]
174pub type SPNIDEN_W<'a, const O: u8> =
175    crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, SPNIDEN_A, O>;
176impl<'a, const O: u8> SPNIDEN_W<'a, O> {
177    #[doc = "Use DAP to enable."]
178    #[inline(always)]
179    pub fn enable(self) -> &'a mut W {
180        self.variant(SPNIDEN_A::ENABLE)
181    }
182    #[doc = "Fixed state."]
183    #[inline(always)]
184    pub fn disable(self) -> &'a mut W {
185        self.variant(SPNIDEN_A::DISABLE)
186    }
187}
188#[doc = "Field `SPIDEN` reader - Secure invasive debug enable."]
189pub type SPIDEN_R = crate::BitReader<SPIDEN_A>;
190#[doc = "Secure invasive debug enable.\n\nValue on reset: 0"]
191#[derive(Clone, Copy, Debug, PartialEq, Eq)]
192pub enum SPIDEN_A {
193    #[doc = "0: Use DAP to enable."]
194    ENABLE = 0,
195    #[doc = "1: Fixed state."]
196    DISABLE = 1,
197}
198impl From<SPIDEN_A> for bool {
199    #[inline(always)]
200    fn from(variant: SPIDEN_A) -> Self {
201        variant as u8 != 0
202    }
203}
204impl SPIDEN_R {
205    #[doc = "Get enumerated values variant"]
206    #[inline(always)]
207    pub fn variant(&self) -> SPIDEN_A {
208        match self.bits {
209            false => SPIDEN_A::ENABLE,
210            true => SPIDEN_A::DISABLE,
211        }
212    }
213    #[doc = "Checks if the value of the field is `ENABLE`"]
214    #[inline(always)]
215    pub fn is_enable(&self) -> bool {
216        *self == SPIDEN_A::ENABLE
217    }
218    #[doc = "Checks if the value of the field is `DISABLE`"]
219    #[inline(always)]
220    pub fn is_disable(&self) -> bool {
221        *self == SPIDEN_A::DISABLE
222    }
223}
224#[doc = "Field `SPIDEN` writer - Secure invasive debug enable."]
225pub type SPIDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, SPIDEN_A, O>;
226impl<'a, const O: u8> SPIDEN_W<'a, O> {
227    #[doc = "Use DAP to enable."]
228    #[inline(always)]
229    pub fn enable(self) -> &'a mut W {
230        self.variant(SPIDEN_A::ENABLE)
231    }
232    #[doc = "Fixed state."]
233    #[inline(always)]
234    pub fn disable(self) -> &'a mut W {
235        self.variant(SPIDEN_A::DISABLE)
236    }
237}
238#[doc = "Field `TAPEN` reader - JTAG TAP enable."]
239pub type TAPEN_R = crate::BitReader<TAPEN_A>;
240#[doc = "JTAG TAP enable.\n\nValue on reset: 0"]
241#[derive(Clone, Copy, Debug, PartialEq, Eq)]
242pub enum TAPEN_A {
243    #[doc = "0: Use DAP to enable."]
244    ENABLE = 0,
245    #[doc = "1: Fixed state."]
246    DISABLE = 1,
247}
248impl From<TAPEN_A> for bool {
249    #[inline(always)]
250    fn from(variant: TAPEN_A) -> Self {
251        variant as u8 != 0
252    }
253}
254impl TAPEN_R {
255    #[doc = "Get enumerated values variant"]
256    #[inline(always)]
257    pub fn variant(&self) -> TAPEN_A {
258        match self.bits {
259            false => TAPEN_A::ENABLE,
260            true => TAPEN_A::DISABLE,
261        }
262    }
263    #[doc = "Checks if the value of the field is `ENABLE`"]
264    #[inline(always)]
265    pub fn is_enable(&self) -> bool {
266        *self == TAPEN_A::ENABLE
267    }
268    #[doc = "Checks if the value of the field is `DISABLE`"]
269    #[inline(always)]
270    pub fn is_disable(&self) -> bool {
271        *self == TAPEN_A::DISABLE
272    }
273}
274#[doc = "Field `TAPEN` writer - JTAG TAP enable."]
275pub type TAPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, TAPEN_A, O>;
276impl<'a, const O: u8> TAPEN_W<'a, O> {
277    #[doc = "Use DAP to enable."]
278    #[inline(always)]
279    pub fn enable(self) -> &'a mut W {
280        self.variant(TAPEN_A::ENABLE)
281    }
282    #[doc = "Fixed state."]
283    #[inline(always)]
284    pub fn disable(self) -> &'a mut W {
285        self.variant(TAPEN_A::DISABLE)
286    }
287}
288#[doc = "Field `ISP_CMD_EN` reader - ISP Boot Command enable."]
289pub type ISP_CMD_EN_R = crate::BitReader<ISP_CMD_EN_A>;
290#[doc = "ISP Boot Command enable.\n\nValue on reset: 0"]
291#[derive(Clone, Copy, Debug, PartialEq, Eq)]
292pub enum ISP_CMD_EN_A {
293    #[doc = "0: Use DAP to enable."]
294    ENABLE = 0,
295    #[doc = "1: Fixed state."]
296    DISABLE = 1,
297}
298impl From<ISP_CMD_EN_A> for bool {
299    #[inline(always)]
300    fn from(variant: ISP_CMD_EN_A) -> Self {
301        variant as u8 != 0
302    }
303}
304impl ISP_CMD_EN_R {
305    #[doc = "Get enumerated values variant"]
306    #[inline(always)]
307    pub fn variant(&self) -> ISP_CMD_EN_A {
308        match self.bits {
309            false => ISP_CMD_EN_A::ENABLE,
310            true => ISP_CMD_EN_A::DISABLE,
311        }
312    }
313    #[doc = "Checks if the value of the field is `ENABLE`"]
314    #[inline(always)]
315    pub fn is_enable(&self) -> bool {
316        *self == ISP_CMD_EN_A::ENABLE
317    }
318    #[doc = "Checks if the value of the field is `DISABLE`"]
319    #[inline(always)]
320    pub fn is_disable(&self) -> bool {
321        *self == ISP_CMD_EN_A::DISABLE
322    }
323}
324#[doc = "Field `ISP_CMD_EN` writer - ISP Boot Command enable."]
325pub type ISP_CMD_EN_W<'a, const O: u8> =
326    crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, ISP_CMD_EN_A, O>;
327impl<'a, const O: u8> ISP_CMD_EN_W<'a, O> {
328    #[doc = "Use DAP to enable."]
329    #[inline(always)]
330    pub fn enable(self) -> &'a mut W {
331        self.variant(ISP_CMD_EN_A::ENABLE)
332    }
333    #[doc = "Fixed state."]
334    #[inline(always)]
335    pub fn disable(self) -> &'a mut W {
336        self.variant(ISP_CMD_EN_A::DISABLE)
337    }
338}
339#[doc = "Field `FA_ME_CMD_EN` reader - FA Command enable."]
340pub type FA_ME_CMD_EN_R = crate::BitReader<FA_ME_CMD_EN_A>;
341#[doc = "FA Command enable.\n\nValue on reset: 0"]
342#[derive(Clone, Copy, Debug, PartialEq, Eq)]
343pub enum FA_ME_CMD_EN_A {
344    #[doc = "0: Use DAP to enable."]
345    ENABLE = 0,
346    #[doc = "1: Fixed state."]
347    DISABLE = 1,
348}
349impl From<FA_ME_CMD_EN_A> for bool {
350    #[inline(always)]
351    fn from(variant: FA_ME_CMD_EN_A) -> Self {
352        variant as u8 != 0
353    }
354}
355impl FA_ME_CMD_EN_R {
356    #[doc = "Get enumerated values variant"]
357    #[inline(always)]
358    pub fn variant(&self) -> FA_ME_CMD_EN_A {
359        match self.bits {
360            false => FA_ME_CMD_EN_A::ENABLE,
361            true => FA_ME_CMD_EN_A::DISABLE,
362        }
363    }
364    #[doc = "Checks if the value of the field is `ENABLE`"]
365    #[inline(always)]
366    pub fn is_enable(&self) -> bool {
367        *self == FA_ME_CMD_EN_A::ENABLE
368    }
369    #[doc = "Checks if the value of the field is `DISABLE`"]
370    #[inline(always)]
371    pub fn is_disable(&self) -> bool {
372        *self == FA_ME_CMD_EN_A::DISABLE
373    }
374}
375#[doc = "Field `FA_ME_CMD_EN` writer - FA Command enable."]
376pub type FA_ME_CMD_EN_W<'a, const O: u8> =
377    crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, FA_ME_CMD_EN_A, O>;
378impl<'a, const O: u8> FA_ME_CMD_EN_W<'a, O> {
379    #[doc = "Use DAP to enable."]
380    #[inline(always)]
381    pub fn enable(self) -> &'a mut W {
382        self.variant(FA_ME_CMD_EN_A::ENABLE)
383    }
384    #[doc = "Fixed state."]
385    #[inline(always)]
386    pub fn disable(self) -> &'a mut W {
387        self.variant(FA_ME_CMD_EN_A::DISABLE)
388    }
389}
390#[doc = "Field `UUID_CHECK` reader - Enforce UUID match during Debug authentication."]
391pub type UUID_CHECK_R = crate::BitReader<bool>;
392#[doc = "Field `UUID_CHECK` writer - Enforce UUID match during Debug authentication."]
393pub type UUID_CHECK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, bool, O>;
394#[doc = "Field `INVERSE_VALUE` reader - inverse value of bits \\[15:0\\]"]
395pub type INVERSE_VALUE_R = crate::FieldReader<u16, u16>;
396#[doc = "Field `INVERSE_VALUE` writer - inverse value of bits \\[15:0\\]"]
397pub type INVERSE_VALUE_W<'a, const O: u8> =
398    crate::FieldWriter<'a, u32, DCFG_CC_SOCU_PIN_SPEC, u16, u16, 16, O>;
399impl R {
400    #[doc = "Bit 0 - Non Secure non-invasive debug enable."]
401    #[inline(always)]
402    pub fn niden(&self) -> NIDEN_R {
403        NIDEN_R::new((self.bits & 1) != 0)
404    }
405    #[doc = "Bit 1 - Non Secure debug enable."]
406    #[inline(always)]
407    pub fn dbgen(&self) -> DBGEN_R {
408        DBGEN_R::new(((self.bits >> 1) & 1) != 0)
409    }
410    #[doc = "Bit 2 - Secure non-invasive debug enable."]
411    #[inline(always)]
412    pub fn spniden(&self) -> SPNIDEN_R {
413        SPNIDEN_R::new(((self.bits >> 2) & 1) != 0)
414    }
415    #[doc = "Bit 3 - Secure invasive debug enable."]
416    #[inline(always)]
417    pub fn spiden(&self) -> SPIDEN_R {
418        SPIDEN_R::new(((self.bits >> 3) & 1) != 0)
419    }
420    #[doc = "Bit 4 - JTAG TAP enable."]
421    #[inline(always)]
422    pub fn tapen(&self) -> TAPEN_R {
423        TAPEN_R::new(((self.bits >> 4) & 1) != 0)
424    }
425    #[doc = "Bit 6 - ISP Boot Command enable."]
426    #[inline(always)]
427    pub fn isp_cmd_en(&self) -> ISP_CMD_EN_R {
428        ISP_CMD_EN_R::new(((self.bits >> 6) & 1) != 0)
429    }
430    #[doc = "Bit 7 - FA Command enable."]
431    #[inline(always)]
432    pub fn fa_me_cmd_en(&self) -> FA_ME_CMD_EN_R {
433        FA_ME_CMD_EN_R::new(((self.bits >> 7) & 1) != 0)
434    }
435    #[doc = "Bit 15 - Enforce UUID match during Debug authentication."]
436    #[inline(always)]
437    pub fn uuid_check(&self) -> UUID_CHECK_R {
438        UUID_CHECK_R::new(((self.bits >> 15) & 1) != 0)
439    }
440    #[doc = "Bits 16:31 - inverse value of bits \\[15:0\\]"]
441    #[inline(always)]
442    pub fn inverse_value(&self) -> INVERSE_VALUE_R {
443        INVERSE_VALUE_R::new(((self.bits >> 16) & 0xffff) as u16)
444    }
445}
446impl W {
447    #[doc = "Bit 0 - Non Secure non-invasive debug enable."]
448    #[inline(always)]
449    pub fn niden(&mut self) -> NIDEN_W<0> {
450        NIDEN_W::new(self)
451    }
452    #[doc = "Bit 1 - Non Secure debug enable."]
453    #[inline(always)]
454    pub fn dbgen(&mut self) -> DBGEN_W<1> {
455        DBGEN_W::new(self)
456    }
457    #[doc = "Bit 2 - Secure non-invasive debug enable."]
458    #[inline(always)]
459    pub fn spniden(&mut self) -> SPNIDEN_W<2> {
460        SPNIDEN_W::new(self)
461    }
462    #[doc = "Bit 3 - Secure invasive debug enable."]
463    #[inline(always)]
464    pub fn spiden(&mut self) -> SPIDEN_W<3> {
465        SPIDEN_W::new(self)
466    }
467    #[doc = "Bit 4 - JTAG TAP enable."]
468    #[inline(always)]
469    pub fn tapen(&mut self) -> TAPEN_W<4> {
470        TAPEN_W::new(self)
471    }
472    #[doc = "Bit 6 - ISP Boot Command enable."]
473    #[inline(always)]
474    pub fn isp_cmd_en(&mut self) -> ISP_CMD_EN_W<6> {
475        ISP_CMD_EN_W::new(self)
476    }
477    #[doc = "Bit 7 - FA Command enable."]
478    #[inline(always)]
479    pub fn fa_me_cmd_en(&mut self) -> FA_ME_CMD_EN_W<7> {
480        FA_ME_CMD_EN_W::new(self)
481    }
482    #[doc = "Bit 15 - Enforce UUID match during Debug authentication."]
483    #[inline(always)]
484    pub fn uuid_check(&mut self) -> UUID_CHECK_W<15> {
485        UUID_CHECK_W::new(self)
486    }
487    #[doc = "Bits 16:31 - inverse value of bits \\[15:0\\]"]
488    #[inline(always)]
489    pub fn inverse_value(&mut self) -> INVERSE_VALUE_W<16> {
490        INVERSE_VALUE_W::new(self)
491    }
492    #[doc = "Writes raw bits to the register."]
493    #[inline(always)]
494    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
495        self.0.bits(bits);
496        self
497    }
498}
499#[doc = "With TZ-M, the part can be sold by level 1 customers (secure code developer) to level-2 customers who develops non-secure code only. - In this scenario, or easy of development, Level-I customer releases the part to always allow non-secure debug. - To allow level-2 customers to further seal the part DCFG_CC_SOCU_NS is used. - ROM will use this word to further restrict the debug access.\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 [dcfg_cc_socu_pin](index.html) module"]
500pub struct DCFG_CC_SOCU_PIN_SPEC;
501impl crate::RegisterSpec for DCFG_CC_SOCU_PIN_SPEC {
502    type Ux = u32;
503}
504#[doc = "`read()` method returns [dcfg_cc_socu_pin::R](R) reader structure"]
505impl crate::Readable for DCFG_CC_SOCU_PIN_SPEC {
506    type Reader = R;
507}
508#[doc = "`write(|w| ..)` method takes [dcfg_cc_socu_pin::W](W) writer structure"]
509impl crate::Writable for DCFG_CC_SOCU_PIN_SPEC {
510    type Writer = W;
511}
512#[doc = "`reset()` method sets DCFG_CC_SOCU_PIN to value 0"]
513impl crate::Resettable for DCFG_CC_SOCU_PIN_SPEC {
514    #[inline(always)]
515    fn reset_value() -> Self::Ux {
516        0
517    }
518}