Skip to main content

mcxa_pac/smartdma0/
arm2ezh.rs

1#[doc = "Register `ARM2EZH` reader"]
2pub type R = crate::R<Arm2ezhSpec>;
3#[doc = "Register `ARM2EZH` writer"]
4pub type W = crate::W<Arm2ezhSpec>;
5#[doc = "Field `IE` reader - Interrupt Enable"]
6pub type IeR = crate::FieldReader;
7#[doc = "Field `IE` writer - Interrupt Enable"]
8pub type IeW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `GP` reader - General purpose register bits"]
10pub type GpR = crate::FieldReader<u32>;
11#[doc = "Field `GP` writer - General purpose register bits"]
12pub type GpW<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>;
13impl R {
14    #[doc = "Bits 0:1 - Interrupt Enable"]
15    #[inline(always)]
16    pub fn ie(&self) -> IeR {
17        IeR::new((self.bits & 3) as u8)
18    }
19    #[doc = "Bits 2:31 - General purpose register bits"]
20    #[inline(always)]
21    pub fn gp(&self) -> GpR {
22        GpR::new((self.bits >> 2) & 0x3fff_ffff)
23    }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("ARM2EZH")
29            .field("ie", &self.ie())
30            .field("gp", &self.gp())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:1 - Interrupt Enable"]
36    #[inline(always)]
37    pub fn ie(&mut self) -> IeW<'_, Arm2ezhSpec> {
38        IeW::new(self, 0)
39    }
40    #[doc = "Bits 2:31 - General purpose register bits"]
41    #[inline(always)]
42    pub fn gp(&mut self) -> GpW<'_, Arm2ezhSpec> {
43        GpW::new(self, 2)
44    }
45}
46#[doc = "ARM to EZH Interrupt Control\n\nYou can [`read`](crate::Reg::read) this register and get [`arm2ezh::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`arm2ezh::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct Arm2ezhSpec;
48impl crate::RegisterSpec for Arm2ezhSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`arm2ezh::R`](R) reader structure"]
52impl crate::Readable for Arm2ezhSpec {}
53#[doc = "`write(|w| ..)` method takes [`arm2ezh::W`](W) writer structure"]
54impl crate::Writable for Arm2ezhSpec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets ARM2EZH to value 0"]
58impl crate::Resettable for Arm2ezhSpec {}