da14531/patch/
patch_addr4_reg.rs

1#[doc = "Register `PATCH_ADDR4_REG` reader"]
2pub struct R(crate::R<PATCH_ADDR4_REG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PATCH_ADDR4_REG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PATCH_ADDR4_REG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PATCH_ADDR4_REG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PATCH_ADDR4_REG` writer"]
17pub struct W(crate::W<PATCH_ADDR4_REG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PATCH_ADDR4_REG_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<PATCH_ADDR4_REG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PATCH_ADDR4_REG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PATCH_ADDR_19` reader - "]
38pub struct PATCH_ADDR_19_R(crate::FieldReader<bool, bool>);
39impl PATCH_ADDR_19_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        PATCH_ADDR_19_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for PATCH_ADDR_19_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `PATCH_ADDR_19` writer - "]
53pub struct PATCH_ADDR_19_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> PATCH_ADDR_19_W<'a> {
57    #[doc = r"Sets the field bit"]
58    #[inline(always)]
59    pub fn set_bit(self) -> &'a mut W {
60        self.bit(true)
61    }
62    #[doc = r"Clears the field bit"]
63    #[inline(always)]
64    pub fn clear_bit(self) -> &'a mut W {
65        self.bit(false)
66    }
67    #[doc = r"Writes raw bits to the field"]
68    #[inline(always)]
69    pub fn bit(self, value: bool) -> &'a mut W {
70        self.w.bits = (self.w.bits & !(1 << 19)) | ((value as u32 & 1) << 19);
71        self.w
72    }
73}
74#[doc = "Field `PATCH_ADDR_C` reader - "]
75pub struct PATCH_ADDR_C_R(crate::FieldReader<u32, u32>);
76impl PATCH_ADDR_C_R {
77    #[inline(always)]
78    pub(crate) fn new(bits: u32) -> Self {
79        PATCH_ADDR_C_R(crate::FieldReader::new(bits))
80    }
81}
82impl core::ops::Deref for PATCH_ADDR_C_R {
83    type Target = crate::FieldReader<u32, u32>;
84    #[inline(always)]
85    fn deref(&self) -> &Self::Target {
86        &self.0
87    }
88}
89#[doc = "Field `PATCH_ADDR_C` writer - "]
90pub struct PATCH_ADDR_C_W<'a> {
91    w: &'a mut W,
92}
93impl<'a> PATCH_ADDR_C_W<'a> {
94    #[doc = r"Writes raw bits to the field"]
95    #[inline(always)]
96    pub unsafe fn bits(self, value: u32) -> &'a mut W {
97        self.w.bits = (self.w.bits & !(0x0001_ffff << 1)) | ((value as u32 & 0x0001_ffff) << 1);
98        self.w
99    }
100}
101impl R {
102    #[doc = "Bit 19"]
103    #[inline(always)]
104    pub fn patch_addr_19(&self) -> PATCH_ADDR_19_R {
105        PATCH_ADDR_19_R::new(((self.bits >> 19) & 1) != 0)
106    }
107    #[doc = "Bits 1:17"]
108    #[inline(always)]
109    pub fn patch_addr_c(&self) -> PATCH_ADDR_C_R {
110        PATCH_ADDR_C_R::new(((self.bits >> 1) & 0x0001_ffff) as u32)
111    }
112}
113impl W {
114    #[doc = "Bit 19"]
115    #[inline(always)]
116    pub fn patch_addr_19(&mut self) -> PATCH_ADDR_19_W {
117        PATCH_ADDR_19_W { w: self }
118    }
119    #[doc = "Bits 1:17"]
120    #[inline(always)]
121    pub fn patch_addr_c(&mut self) -> PATCH_ADDR_C_W {
122        PATCH_ADDR_C_W { w: self }
123    }
124    #[doc = "Writes raw bits to the register."]
125    #[inline(always)]
126    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
127        self.0.bits(bits);
128        self
129    }
130}
131#[doc = "\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 [patch_addr4_reg](index.html) module"]
132pub struct PATCH_ADDR4_REG_SPEC;
133impl crate::RegisterSpec for PATCH_ADDR4_REG_SPEC {
134    type Ux = u32;
135}
136#[doc = "`read()` method returns [patch_addr4_reg::R](R) reader structure"]
137impl crate::Readable for PATCH_ADDR4_REG_SPEC {
138    type Reader = R;
139}
140#[doc = "`write(|w| ..)` method takes [patch_addr4_reg::W](W) writer structure"]
141impl crate::Writable for PATCH_ADDR4_REG_SPEC {
142    type Writer = W;
143}
144#[doc = "`reset()` method sets PATCH_ADDR4_REG to value 0x07f0_0000"]
145impl crate::Resettable for PATCH_ADDR4_REG_SPEC {
146    #[inline(always)]
147    fn reset_value() -> Self::Ux {
148        0x07f0_0000
149    }
150}