bl702_pac/ir/
irrx_config.rs

1#[doc = "Register `irrx_config` reader"]
2pub struct R(crate::R<IRRX_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IRRX_CONFIG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IRRX_CONFIG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IRRX_CONFIG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `irrx_config` writer"]
17pub struct W(crate::W<IRRX_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IRRX_CONFIG_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<IRRX_CONFIG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IRRX_CONFIG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `cr_irrx_en` reader - "]
38pub type CR_IRRX_EN_R = crate::BitReader<bool>;
39#[doc = "Field `cr_irrx_en` writer - "]
40pub type CR_IRRX_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, IRRX_CONFIG_SPEC, bool, O>;
41#[doc = "Field `cr_irrx_in_inv` reader - "]
42pub type CR_IRRX_IN_INV_R = crate::BitReader<bool>;
43#[doc = "Field `cr_irrx_in_inv` writer - "]
44pub type CR_IRRX_IN_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, IRRX_CONFIG_SPEC, bool, O>;
45#[doc = "Field `cr_irrx_mode` reader - "]
46pub type CR_IRRX_MODE_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `cr_irrx_mode` writer - "]
48pub type CR_IRRX_MODE_W<'a, const O: u8> =
49    crate::FieldWriter<'a, u32, IRRX_CONFIG_SPEC, u8, u8, 2, O>;
50#[doc = "Field `cr_irrx_deg_en` reader - "]
51pub type CR_IRRX_DEG_EN_R = crate::BitReader<bool>;
52#[doc = "Field `cr_irrx_deg_en` writer - "]
53pub type CR_IRRX_DEG_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, IRRX_CONFIG_SPEC, bool, O>;
54#[doc = "Field `cr_irrx_deg_cnt` reader - "]
55pub type CR_IRRX_DEG_CNT_R = crate::FieldReader<u8, u8>;
56#[doc = "Field `cr_irrx_deg_cnt` writer - "]
57pub type CR_IRRX_DEG_CNT_W<'a, const O: u8> =
58    crate::FieldWriter<'a, u32, IRRX_CONFIG_SPEC, u8, u8, 4, O>;
59impl R {
60    #[doc = "Bit 0"]
61    #[inline(always)]
62    pub fn cr_irrx_en(&self) -> CR_IRRX_EN_R {
63        CR_IRRX_EN_R::new((self.bits & 1) != 0)
64    }
65    #[doc = "Bit 1"]
66    #[inline(always)]
67    pub fn cr_irrx_in_inv(&self) -> CR_IRRX_IN_INV_R {
68        CR_IRRX_IN_INV_R::new(((self.bits >> 1) & 1) != 0)
69    }
70    #[doc = "Bits 2:3"]
71    #[inline(always)]
72    pub fn cr_irrx_mode(&self) -> CR_IRRX_MODE_R {
73        CR_IRRX_MODE_R::new(((self.bits >> 2) & 3) as u8)
74    }
75    #[doc = "Bit 4"]
76    #[inline(always)]
77    pub fn cr_irrx_deg_en(&self) -> CR_IRRX_DEG_EN_R {
78        CR_IRRX_DEG_EN_R::new(((self.bits >> 4) & 1) != 0)
79    }
80    #[doc = "Bits 8:11"]
81    #[inline(always)]
82    pub fn cr_irrx_deg_cnt(&self) -> CR_IRRX_DEG_CNT_R {
83        CR_IRRX_DEG_CNT_R::new(((self.bits >> 8) & 0x0f) as u8)
84    }
85}
86impl W {
87    #[doc = "Bit 0"]
88    #[inline(always)]
89    #[must_use]
90    pub fn cr_irrx_en(&mut self) -> CR_IRRX_EN_W<0> {
91        CR_IRRX_EN_W::new(self)
92    }
93    #[doc = "Bit 1"]
94    #[inline(always)]
95    #[must_use]
96    pub fn cr_irrx_in_inv(&mut self) -> CR_IRRX_IN_INV_W<1> {
97        CR_IRRX_IN_INV_W::new(self)
98    }
99    #[doc = "Bits 2:3"]
100    #[inline(always)]
101    #[must_use]
102    pub fn cr_irrx_mode(&mut self) -> CR_IRRX_MODE_W<2> {
103        CR_IRRX_MODE_W::new(self)
104    }
105    #[doc = "Bit 4"]
106    #[inline(always)]
107    #[must_use]
108    pub fn cr_irrx_deg_en(&mut self) -> CR_IRRX_DEG_EN_W<4> {
109        CR_IRRX_DEG_EN_W::new(self)
110    }
111    #[doc = "Bits 8:11"]
112    #[inline(always)]
113    #[must_use]
114    pub fn cr_irrx_deg_cnt(&mut self) -> CR_IRRX_DEG_CNT_W<8> {
115        CR_IRRX_DEG_CNT_W::new(self)
116    }
117    #[doc = "Writes raw bits to the register."]
118    #[inline(always)]
119    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
120        self.0.bits(bits);
121        self
122    }
123}
124#[doc = "irrx_config.\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 [irrx_config](index.html) module"]
125pub struct IRRX_CONFIG_SPEC;
126impl crate::RegisterSpec for IRRX_CONFIG_SPEC {
127    type Ux = u32;
128}
129#[doc = "`read()` method returns [irrx_config::R](R) reader structure"]
130impl crate::Readable for IRRX_CONFIG_SPEC {
131    type Reader = R;
132}
133#[doc = "`write(|w| ..)` method takes [irrx_config::W](W) writer structure"]
134impl crate::Writable for IRRX_CONFIG_SPEC {
135    type Writer = W;
136    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
137    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
138}
139#[doc = "`reset()` method sets irrx_config to value 0"]
140impl crate::Resettable for IRRX_CONFIG_SPEC {
141    const RESET_VALUE: Self::Ux = 0;
142}