xmc4500/ppb/
nvic_icpr0.rs1#[doc = "Register `NVIC_ICPR0` reader"]
2pub type R = crate::R<NVIC_ICPR0_SPEC>;
3#[doc = "Register `NVIC_ICPR0` writer"]
4pub type W = crate::W<NVIC_ICPR0_SPEC>;
5#[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u32)]
8pub enum CLRPEND_A {
9 #[doc = "0: interrupt is not pending"]
10 VALUE3 = 0,
11 #[doc = "1: interrupt is pending."]
12 VALUE4 = 1,
13}
14impl From<CLRPEND_A> for u32 {
15 #[inline(always)]
16 fn from(variant: CLRPEND_A) -> Self {
17 variant as _
18 }
19}
20impl crate::FieldSpec for CLRPEND_A {
21 type Ux = u32;
22}
23impl crate::IsEnum for CLRPEND_A {}
24#[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."]
25pub type CLRPEND_R = crate::FieldReader<CLRPEND_A>;
26impl CLRPEND_R {
27 #[doc = "Get enumerated values variant"]
28 #[inline(always)]
29 pub const fn variant(&self) -> Option<CLRPEND_A> {
30 match self.bits {
31 0 => Some(CLRPEND_A::VALUE3),
32 1 => Some(CLRPEND_A::VALUE4),
33 _ => None,
34 }
35 }
36 #[doc = "interrupt is not pending"]
37 #[inline(always)]
38 pub fn is_value3(&self) -> bool {
39 *self == CLRPEND_A::VALUE3
40 }
41 #[doc = "interrupt is pending."]
42 #[inline(always)]
43 pub fn is_value4(&self) -> bool {
44 *self == CLRPEND_A::VALUE4
45 }
46}
47#[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."]
48pub type CLRPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRPEND_A>;
49impl<'a, REG> CLRPEND_W<'a, REG>
50where
51 REG: crate::Writable + crate::RegisterSpec,
52 REG::Ux: From<u32>,
53{
54 #[doc = "interrupt is not pending"]
55 #[inline(always)]
56 pub fn value3(self) -> &'a mut crate::W<REG> {
57 self.variant(CLRPEND_A::VALUE3)
58 }
59 #[doc = "interrupt is pending."]
60 #[inline(always)]
61 pub fn value4(self) -> &'a mut crate::W<REG> {
62 self.variant(CLRPEND_A::VALUE4)
63 }
64}
65impl R {
66 #[doc = "Bits 0:31 - Interrupt set-pending bits."]
67 #[inline(always)]
68 pub fn clrpend(&self) -> CLRPEND_R {
69 CLRPEND_R::new(self.bits)
70 }
71}
72impl W {
73 #[doc = "Bits 0:31 - Interrupt set-pending bits."]
74 #[inline(always)]
75 pub fn clrpend(&mut self) -> CLRPEND_W<NVIC_ICPR0_SPEC> {
76 CLRPEND_W::new(self, 0)
77 }
78}
79#[doc = "Interrupt Clear-pending Register 0\n\nYou can [`read`](crate::Reg::read) this register and get [`nvic_icpr0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`nvic_icpr0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct NVIC_ICPR0_SPEC;
81impl crate::RegisterSpec for NVIC_ICPR0_SPEC {
82 type Ux = u32;
83}
84#[doc = "`read()` method returns [`nvic_icpr0::R`](R) reader structure"]
85impl crate::Readable for NVIC_ICPR0_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`nvic_icpr0::W`](W) writer structure"]
87impl crate::Writable for NVIC_ICPR0_SPEC {
88 type Safety = crate::Unsafe;
89 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
90 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91}
92#[doc = "`reset()` method sets NVIC_ICPR0 to value 0"]
93impl crate::Resettable for NVIC_ICPR0_SPEC {
94 const RESET_VALUE: u32 = 0;
95}