lpc82x_pac/mrt0/
modcfg.rs

1#[doc = "Register `MODCFG` reader"]
2pub struct R(crate::R<MODCFG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MODCFG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MODCFG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MODCFG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MODCFG` writer"]
17pub struct W(crate::W<MODCFG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MODCFG_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<MODCFG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MODCFG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `NOC` reader - Identifies the number of channels in this MRT.(4 channels on this device.)"]
38pub struct NOC_R(crate::FieldReader<u8, u8>);
39impl NOC_R {
40    pub(crate) fn new(bits: u8) -> Self {
41        NOC_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for NOC_R {
45    type Target = crate::FieldReader<u8, u8>;
46    #[inline(always)]
47    fn deref(&self) -> &Self::Target {
48        &self.0
49    }
50}
51#[doc = "Field `NOB` reader - Identifies the number of timer bits in this MRT. (31 bits wide on this device.)"]
52pub struct NOB_R(crate::FieldReader<u8, u8>);
53impl NOB_R {
54    pub(crate) fn new(bits: u8) -> Self {
55        NOB_R(crate::FieldReader::new(bits))
56    }
57}
58impl core::ops::Deref for NOB_R {
59    type Target = crate::FieldReader<u8, u8>;
60    #[inline(always)]
61    fn deref(&self) -> &Self::Target {
62        &self.0
63    }
64}
65impl R {
66    #[doc = "Bits 0:3 - Identifies the number of channels in this MRT.(4 channels on this device.)"]
67    #[inline(always)]
68    pub fn noc(&self) -> NOC_R {
69        NOC_R::new((self.bits & 0x0f) as u8)
70    }
71    #[doc = "Bits 4:8 - Identifies the number of timer bits in this MRT. (31 bits wide on this device.)"]
72    #[inline(always)]
73    pub fn nob(&self) -> NOB_R {
74        NOB_R::new(((self.bits >> 4) & 0x1f) as u8)
75    }
76}
77impl W {
78    #[doc = "Writes raw bits to the register."]
79    #[inline(always)]
80    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
81        self.0.bits(bits);
82        self
83    }
84}
85#[doc = "Module Configuration register. This register provides information about this particular MRT instance.\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 [modcfg](index.html) module"]
86pub struct MODCFG_SPEC;
87impl crate::RegisterSpec for MODCFG_SPEC {
88    type Ux = u32;
89}
90#[doc = "`read()` method returns [modcfg::R](R) reader structure"]
91impl crate::Readable for MODCFG_SPEC {
92    type Reader = R;
93}
94#[doc = "`write(|w| ..)` method takes [modcfg::W](W) writer structure"]
95impl crate::Writable for MODCFG_SPEC {
96    type Writer = W;
97}
98#[doc = "`reset()` method sets MODCFG to value 0x01f4"]
99impl crate::Resettable for MODCFG_SPEC {
100    #[inline(always)]
101    fn reset_value() -> Self::Ux {
102        0x01f4
103    }
104}