pic32mx2xx/pic32mx2xxfxxxd/int/
intconset.rs

1#[doc = "Register `INTCONSET` reader"]
2pub struct R(crate::R<INTCONSET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTCONSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTCONSET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTCONSET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTCONSET` writer"]
17pub struct W(crate::W<INTCONSET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTCONSET_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<INTCONSET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTCONSET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `INT0EP` reader - "]
38pub type INT0EP_R = crate::BitReader;
39#[doc = "Field `INT0EP` writer - "]
40pub type INT0EP_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
41#[doc = "Field `INT1EP` reader - "]
42pub type INT1EP_R = crate::BitReader;
43#[doc = "Field `INT1EP` writer - "]
44pub type INT1EP_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
45#[doc = "Field `INT2EP` reader - "]
46pub type INT2EP_R = crate::BitReader;
47#[doc = "Field `INT2EP` writer - "]
48pub type INT2EP_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
49#[doc = "Field `INT3EP` reader - "]
50pub type INT3EP_R = crate::BitReader;
51#[doc = "Field `INT3EP` writer - "]
52pub type INT3EP_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
53#[doc = "Field `INT4EP` reader - "]
54pub type INT4EP_R = crate::BitReader;
55#[doc = "Field `INT4EP` writer - "]
56pub type INT4EP_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
57#[doc = "Field `TPC` reader - "]
58pub type TPC_R = crate::FieldReader;
59#[doc = "Field `TPC` writer - "]
60pub type TPC_W<'a, const O: u8> = crate::FieldWriter<'a, INTCONSET_SPEC, 3, O>;
61#[doc = "Field `MVEC` reader - "]
62pub type MVEC_R = crate::BitReader;
63#[doc = "Field `MVEC` writer - "]
64pub type MVEC_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
65#[doc = "Field `FRZ` reader - "]
66pub type FRZ_R = crate::BitReader;
67#[doc = "Field `FRZ` writer - "]
68pub type FRZ_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
69#[doc = "Field `SS0` reader - "]
70pub type SS0_R = crate::BitReader;
71#[doc = "Field `SS0` writer - "]
72pub type SS0_W<'a, const O: u8> = crate::BitWriter<'a, INTCONSET_SPEC, O>;
73impl R {
74    #[doc = "Bit 0"]
75    #[inline(always)]
76    pub fn int0ep(&self) -> INT0EP_R {
77        INT0EP_R::new((self.bits & 1) != 0)
78    }
79    #[doc = "Bit 1"]
80    #[inline(always)]
81    pub fn int1ep(&self) -> INT1EP_R {
82        INT1EP_R::new(((self.bits >> 1) & 1) != 0)
83    }
84    #[doc = "Bit 2"]
85    #[inline(always)]
86    pub fn int2ep(&self) -> INT2EP_R {
87        INT2EP_R::new(((self.bits >> 2) & 1) != 0)
88    }
89    #[doc = "Bit 3"]
90    #[inline(always)]
91    pub fn int3ep(&self) -> INT3EP_R {
92        INT3EP_R::new(((self.bits >> 3) & 1) != 0)
93    }
94    #[doc = "Bit 4"]
95    #[inline(always)]
96    pub fn int4ep(&self) -> INT4EP_R {
97        INT4EP_R::new(((self.bits >> 4) & 1) != 0)
98    }
99    #[doc = "Bits 8:10"]
100    #[inline(always)]
101    pub fn tpc(&self) -> TPC_R {
102        TPC_R::new(((self.bits >> 8) & 7) as u8)
103    }
104    #[doc = "Bit 12"]
105    #[inline(always)]
106    pub fn mvec(&self) -> MVEC_R {
107        MVEC_R::new(((self.bits >> 12) & 1) != 0)
108    }
109    #[doc = "Bit 14"]
110    #[inline(always)]
111    pub fn frz(&self) -> FRZ_R {
112        FRZ_R::new(((self.bits >> 14) & 1) != 0)
113    }
114    #[doc = "Bit 16"]
115    #[inline(always)]
116    pub fn ss0(&self) -> SS0_R {
117        SS0_R::new(((self.bits >> 16) & 1) != 0)
118    }
119}
120impl W {
121    #[doc = "Bit 0"]
122    #[inline(always)]
123    #[must_use]
124    pub fn int0ep(&mut self) -> INT0EP_W<0> {
125        INT0EP_W::new(self)
126    }
127    #[doc = "Bit 1"]
128    #[inline(always)]
129    #[must_use]
130    pub fn int1ep(&mut self) -> INT1EP_W<1> {
131        INT1EP_W::new(self)
132    }
133    #[doc = "Bit 2"]
134    #[inline(always)]
135    #[must_use]
136    pub fn int2ep(&mut self) -> INT2EP_W<2> {
137        INT2EP_W::new(self)
138    }
139    #[doc = "Bit 3"]
140    #[inline(always)]
141    #[must_use]
142    pub fn int3ep(&mut self) -> INT3EP_W<3> {
143        INT3EP_W::new(self)
144    }
145    #[doc = "Bit 4"]
146    #[inline(always)]
147    #[must_use]
148    pub fn int4ep(&mut self) -> INT4EP_W<4> {
149        INT4EP_W::new(self)
150    }
151    #[doc = "Bits 8:10"]
152    #[inline(always)]
153    #[must_use]
154    pub fn tpc(&mut self) -> TPC_W<8> {
155        TPC_W::new(self)
156    }
157    #[doc = "Bit 12"]
158    #[inline(always)]
159    #[must_use]
160    pub fn mvec(&mut self) -> MVEC_W<12> {
161        MVEC_W::new(self)
162    }
163    #[doc = "Bit 14"]
164    #[inline(always)]
165    #[must_use]
166    pub fn frz(&mut self) -> FRZ_W<14> {
167        FRZ_W::new(self)
168    }
169    #[doc = "Bit 16"]
170    #[inline(always)]
171    #[must_use]
172    pub fn ss0(&mut self) -> SS0_W<16> {
173        SS0_W::new(self)
174    }
175    #[doc = "Writes raw bits to the register."]
176    #[inline(always)]
177    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
178        self.0.bits(bits);
179        self
180    }
181}
182#[doc = "INTCONSET 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 [intconset](index.html) module"]
183pub struct INTCONSET_SPEC;
184impl crate::RegisterSpec for INTCONSET_SPEC {
185    type Ux = u32;
186}
187#[doc = "`read()` method returns [intconset::R](R) reader structure"]
188impl crate::Readable for INTCONSET_SPEC {
189    type Reader = R;
190}
191#[doc = "`write(|w| ..)` method takes [intconset::W](W) writer structure"]
192impl crate::Writable for INTCONSET_SPEC {
193    type Writer = W;
194    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
195    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
196}
197#[doc = "`reset()` method sets INTCONSET to value 0"]
198impl crate::Resettable for INTCONSET_SPEC {
199    const RESET_VALUE: Self::Ux = 0;
200}