mcxa_pac/smartdma0/
pendtrap.rs1#[doc = "Register `PENDTRAP` reader"]
2pub type R = crate::R<PendtrapSpec>;
3#[doc = "Register `PENDTRAP` writer"]
4pub type W = crate::W<PendtrapSpec>;
5#[doc = "Field `STATUS` reader - Status Flag or Pending Trap Request"]
6pub type StatusR = crate::FieldReader;
7#[doc = "Field `STATUS` writer - Status Flag or Pending Trap Request"]
8pub type StatusW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `POL` reader - Polarity"]
10pub type PolR = crate::FieldReader;
11#[doc = "Field `POL` writer - Polarity"]
12pub type PolW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `EN` reader - Enable Pending Trap"]
14pub type EnR = crate::FieldReader;
15#[doc = "Field `EN` writer - Enable Pending Trap"]
16pub type EnW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17impl R {
18 #[doc = "Bits 0:7 - Status Flag or Pending Trap Request"]
19 #[inline(always)]
20 pub fn status(&self) -> StatusR {
21 StatusR::new((self.bits & 0xff) as u8)
22 }
23 #[doc = "Bits 8:15 - Polarity"]
24 #[inline(always)]
25 pub fn pol(&self) -> PolR {
26 PolR::new(((self.bits >> 8) & 0xff) as u8)
27 }
28 #[doc = "Bits 16:23 - Enable Pending Trap"]
29 #[inline(always)]
30 pub fn en(&self) -> EnR {
31 EnR::new(((self.bits >> 16) & 0xff) as u8)
32 }
33}
34#[cfg(feature = "debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("PENDTRAP")
38 .field("status", &self.status())
39 .field("pol", &self.pol())
40 .field("en", &self.en())
41 .finish()
42 }
43}
44impl W {
45 #[doc = "Bits 0:7 - Status Flag or Pending Trap Request"]
46 #[inline(always)]
47 pub fn status(&mut self) -> StatusW<'_, PendtrapSpec> {
48 StatusW::new(self, 0)
49 }
50 #[doc = "Bits 8:15 - Polarity"]
51 #[inline(always)]
52 pub fn pol(&mut self) -> PolW<'_, PendtrapSpec> {
53 PolW::new(self, 8)
54 }
55 #[doc = "Bits 16:23 - Enable Pending Trap"]
56 #[inline(always)]
57 pub fn en(&mut self) -> EnW<'_, PendtrapSpec> {
58 EnW::new(self, 16)
59 }
60}
61#[doc = "Pending Trap Control\n\nYou can [`read`](crate::Reg::read) this register and get [`pendtrap::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pendtrap::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct PendtrapSpec;
63impl crate::RegisterSpec for PendtrapSpec {
64 type Ux = u32;
65}
66#[doc = "`read()` method returns [`pendtrap::R`](R) reader structure"]
67impl crate::Readable for PendtrapSpec {}
68#[doc = "`write(|w| ..)` method takes [`pendtrap::W`](W) writer structure"]
69impl crate::Writable for PendtrapSpec {
70 type Safety = crate::Unsafe;
71}
72#[doc = "`reset()` method sets PENDTRAP to value 0"]
73impl crate::Resettable for PendtrapSpec {}