r528_pac/ce_ns/
ce_isr.rs

1#[doc = "Register `CE_ISR` reader"]
2pub struct R(crate::R<CE_ISR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CE_ISR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CE_ISR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CE_ISR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CE_ISR` writer"]
17pub struct W(crate::W<CE_ISR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CE_ISR_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<CE_ISR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CE_ISR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag.\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum TASK_PENDING_A {
41    #[doc = "0: Task not finished"]
42    NOT_FINISHED = 0,
43    #[doc = "1: Task finished"]
44    FINISHED = 1,
45}
46impl From<TASK_PENDING_A> for u8 {
47    #[inline(always)]
48    fn from(variant: TASK_PENDING_A) -> Self {
49        variant as _
50    }
51}
52#[doc = "Fields `TASK(0-3)_PENDING` reader - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
53pub type TASK_PENDING_R = crate::FieldReader<u8, TASK_PENDING_A>;
54impl TASK_PENDING_R {
55    #[doc = "Get enumerated values variant"]
56    #[inline(always)]
57    pub fn variant(&self) -> Option<TASK_PENDING_A> {
58        match self.bits {
59            0 => Some(TASK_PENDING_A::NOT_FINISHED),
60            1 => Some(TASK_PENDING_A::FINISHED),
61            _ => None,
62        }
63    }
64    #[doc = "Checks if the value of the field is `NOT_FINISHED`"]
65    #[inline(always)]
66    pub fn is_not_finished(&self) -> bool {
67        *self == TASK_PENDING_A::NOT_FINISHED
68    }
69    #[doc = "Checks if the value of the field is `FINISHED`"]
70    #[inline(always)]
71    pub fn is_finished(&self) -> bool {
72        *self == TASK_PENDING_A::FINISHED
73    }
74}
75#[doc = "Fields `TASK(0-3)_PENDING` writer - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
76pub type TASK_PENDING_W<'a, const O: u8> =
77    crate::FieldWriter<'a, u32, CE_ISR_SPEC, u8, TASK_PENDING_A, 4, O>;
78impl<'a, const O: u8> TASK_PENDING_W<'a, O> {
79    #[doc = "Task not finished"]
80    #[inline(always)]
81    pub fn not_finished(self) -> &'a mut W {
82        self.variant(TASK_PENDING_A::NOT_FINISHED)
83    }
84    #[doc = "Task finished"]
85    #[inline(always)]
86    pub fn finished(self) -> &'a mut W {
87        self.variant(TASK_PENDING_A::FINISHED)
88    }
89}
90impl R {
91    #[doc = "Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
92    #[inline(always)]
93    pub unsafe fn task_pending(&self, n: u8) -> TASK_PENDING_R {
94        TASK_PENDING_R::new(((self.bits >> n) & 0x0f) as u8)
95    }
96    #[doc = "Bits 0:3 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
97    #[inline(always)]
98    pub fn task0_pending(&self) -> TASK_PENDING_R {
99        TASK_PENDING_R::new((self.bits & 0x0f) as u8)
100    }
101    #[doc = "Bits 1:4 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
102    #[inline(always)]
103    pub fn task1_pending(&self) -> TASK_PENDING_R {
104        TASK_PENDING_R::new(((self.bits >> 1) & 0x0f) as u8)
105    }
106    #[doc = "Bits 2:5 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
107    #[inline(always)]
108    pub fn task2_pending(&self) -> TASK_PENDING_R {
109        TASK_PENDING_R::new(((self.bits >> 2) & 0x0f) as u8)
110    }
111    #[doc = "Bits 3:6 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
112    #[inline(always)]
113    pub fn task3_pending(&self) -> TASK_PENDING_R {
114        TASK_PENDING_R::new(((self.bits >> 3) & 0x0f) as u8)
115    }
116}
117impl W {
118    #[doc = "Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
119    #[inline(always)]
120    pub unsafe fn task_pending<const O: u8>(&mut self) -> TASK_PENDING_W<O> {
121        TASK_PENDING_W::new(self)
122    }
123    #[doc = "Bits 0:3 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
124    #[inline(always)]
125    pub fn task0_pending(&mut self) -> TASK_PENDING_W<0> {
126        TASK_PENDING_W::new(self)
127    }
128    #[doc = "Bits 1:4 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
129    #[inline(always)]
130    pub fn task1_pending(&mut self) -> TASK_PENDING_W<1> {
131        TASK_PENDING_W::new(self)
132    }
133    #[doc = "Bits 2:5 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
134    #[inline(always)]
135    pub fn task2_pending(&mut self) -> TASK_PENDING_W<2> {
136        TASK_PENDING_W::new(self)
137    }
138    #[doc = "Bits 3:6 - Task Channel 3-0 End Pending\n\nIt indicates whether task is completed.\n\nWrite the corresponding channel bit of the register to clear the end flag."]
139    #[inline(always)]
140    pub fn task3_pending(&mut self) -> TASK_PENDING_W<3> {
141        TASK_PENDING_W::new(self)
142    }
143    #[doc = "Writes raw bits to the register."]
144    #[inline(always)]
145    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
146        self.0.bits(bits);
147        self
148    }
149}
150#[doc = "Interrupt Status 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 [ce_isr](index.html) module"]
151pub struct CE_ISR_SPEC;
152impl crate::RegisterSpec for CE_ISR_SPEC {
153    type Ux = u32;
154}
155#[doc = "`read()` method returns [ce_isr::R](R) reader structure"]
156impl crate::Readable for CE_ISR_SPEC {
157    type Reader = R;
158}
159#[doc = "`write(|w| ..)` method takes [ce_isr::W](W) writer structure"]
160impl crate::Writable for CE_ISR_SPEC {
161    type Writer = W;
162}
163#[doc = "`reset()` method sets CE_ISR to value 0"]
164impl crate::Resettable for CE_ISR_SPEC {
165    #[inline(always)]
166    fn reset_value() -> Self::Ux {
167        0
168    }
169}