Skip to main content

ra2e2/i3c/
inctl.rs

1#[doc = "Register `INCTL` reader"]
2pub struct R(crate::R<INCTL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INCTL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INCTL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INCTL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INCTL` writer"]
17pub struct W(crate::W<INCTL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INCTL_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<INCTL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INCTL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DNFS` reader - Digital Noise Filter Stage Selection"]
38pub type DNFS_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `DNFS` writer - Digital Noise Filter Stage Selection"]
40pub type DNFS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INCTL_SPEC, u8, u8, 4, O>;
41#[doc = "Field `DNFE` reader - Digital Noise Filter Circuit Enable"]
42pub type DNFE_R = crate::BitReader<DNFE_A>;
43#[doc = "Digital Noise Filter Circuit Enable\n\nValue on reset: 1"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum DNFE_A {
46    #[doc = "0: No digital noise filter circuit is used."]
47    _0 = 0,
48    #[doc = "1: A digital noise filter circuit is used."]
49    _1 = 1,
50}
51impl From<DNFE_A> for bool {
52    #[inline(always)]
53    fn from(variant: DNFE_A) -> Self {
54        variant as u8 != 0
55    }
56}
57impl DNFE_R {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> DNFE_A {
61        match self.bits {
62            false => DNFE_A::_0,
63            true => DNFE_A::_1,
64        }
65    }
66    #[doc = "Checks if the value of the field is `_0`"]
67    #[inline(always)]
68    pub fn is_0(&self) -> bool {
69        *self == DNFE_A::_0
70    }
71    #[doc = "Checks if the value of the field is `_1`"]
72    #[inline(always)]
73    pub fn is_1(&self) -> bool {
74        *self == DNFE_A::_1
75    }
76}
77#[doc = "Field `DNFE` writer - Digital Noise Filter Circuit Enable"]
78pub type DNFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INCTL_SPEC, DNFE_A, O>;
79impl<'a, const O: u8> DNFE_W<'a, O> {
80    #[doc = "No digital noise filter circuit is used."]
81    #[inline(always)]
82    pub fn _0(self) -> &'a mut W {
83        self.variant(DNFE_A::_0)
84    }
85    #[doc = "A digital noise filter circuit is used."]
86    #[inline(always)]
87    pub fn _1(self) -> &'a mut W {
88        self.variant(DNFE_A::_1)
89    }
90}
91impl R {
92    #[doc = "Bits 0:3 - Digital Noise Filter Stage Selection"]
93    #[inline(always)]
94    pub fn dnfs(&self) -> DNFS_R {
95        DNFS_R::new((self.bits & 0x0f) as u8)
96    }
97    #[doc = "Bit 4 - Digital Noise Filter Circuit Enable"]
98    #[inline(always)]
99    pub fn dnfe(&self) -> DNFE_R {
100        DNFE_R::new(((self.bits >> 4) & 1) != 0)
101    }
102}
103impl W {
104    #[doc = "Bits 0:3 - Digital Noise Filter Stage Selection"]
105    #[inline(always)]
106    #[must_use]
107    pub fn dnfs(&mut self) -> DNFS_W<0> {
108        DNFS_W::new(self)
109    }
110    #[doc = "Bit 4 - Digital Noise Filter Circuit Enable"]
111    #[inline(always)]
112    #[must_use]
113    pub fn dnfe(&mut self) -> DNFE_W<4> {
114        DNFE_W::new(self)
115    }
116    #[doc = "Writes raw bits to the register."]
117    #[inline(always)]
118    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
119        self.0.bits(bits);
120        self
121    }
122}
123#[doc = "Input Control 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 [inctl](index.html) module"]
124pub struct INCTL_SPEC;
125impl crate::RegisterSpec for INCTL_SPEC {
126    type Ux = u32;
127}
128#[doc = "`read()` method returns [inctl::R](R) reader structure"]
129impl crate::Readable for INCTL_SPEC {
130    type Reader = R;
131}
132#[doc = "`write(|w| ..)` method takes [inctl::W](W) writer structure"]
133impl crate::Writable for INCTL_SPEC {
134    type Writer = W;
135    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
136    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
137}
138#[doc = "`reset()` method sets INCTL to value 0xd0"]
139impl crate::Resettable for INCTL_SPEC {
140    const RESET_VALUE: Self::Ux = 0xd0;
141}