stm32f1/stm32f107/fsmc/
btr1.rs1#[doc = "Register `BTR1` reader"]
2pub struct R(crate::R<BTR1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BTR1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BTR1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BTR1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `BTR1` writer"]
17pub struct W(crate::W<BTR1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BTR1_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<BTR1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BTR1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ACCMOD` reader - ACCMOD"]
38pub type ACCMOD_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `ACCMOD` writer - ACCMOD"]
40pub type ACCMOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 2, O>;
41#[doc = "Field `DATLAT` reader - DATLAT"]
42pub type DATLAT_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `DATLAT` writer - DATLAT"]
44pub type DATLAT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 4, O>;
45#[doc = "Field `CLKDIV` reader - CLKDIV"]
46pub type CLKDIV_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `CLKDIV` writer - CLKDIV"]
48pub type CLKDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 4, O>;
49#[doc = "Field `BUSTURN` reader - BUSTURN"]
50pub type BUSTURN_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `BUSTURN` writer - BUSTURN"]
52pub type BUSTURN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 4, O>;
53#[doc = "Field `DATAST` reader - DATAST"]
54pub type DATAST_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `DATAST` writer - DATAST"]
56pub type DATAST_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 8, O>;
57#[doc = "Field `ADDHLD` reader - ADDHLD"]
58pub type ADDHLD_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `ADDHLD` writer - ADDHLD"]
60pub type ADDHLD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 4, O>;
61#[doc = "Field `ADDSET` reader - ADDSET"]
62pub type ADDSET_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `ADDSET` writer - ADDSET"]
64pub type ADDSET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BTR1_SPEC, u8, u8, 4, O>;
65impl R {
66 #[doc = "Bits 28:29 - ACCMOD"]
67 #[inline(always)]
68 pub fn accmod(&self) -> ACCMOD_R {
69 ACCMOD_R::new(((self.bits >> 28) & 3) as u8)
70 }
71 #[doc = "Bits 24:27 - DATLAT"]
72 #[inline(always)]
73 pub fn datlat(&self) -> DATLAT_R {
74 DATLAT_R::new(((self.bits >> 24) & 0x0f) as u8)
75 }
76 #[doc = "Bits 20:23 - CLKDIV"]
77 #[inline(always)]
78 pub fn clkdiv(&self) -> CLKDIV_R {
79 CLKDIV_R::new(((self.bits >> 20) & 0x0f) as u8)
80 }
81 #[doc = "Bits 16:19 - BUSTURN"]
82 #[inline(always)]
83 pub fn busturn(&self) -> BUSTURN_R {
84 BUSTURN_R::new(((self.bits >> 16) & 0x0f) as u8)
85 }
86 #[doc = "Bits 8:15 - DATAST"]
87 #[inline(always)]
88 pub fn datast(&self) -> DATAST_R {
89 DATAST_R::new(((self.bits >> 8) & 0xff) as u8)
90 }
91 #[doc = "Bits 4:7 - ADDHLD"]
92 #[inline(always)]
93 pub fn addhld(&self) -> ADDHLD_R {
94 ADDHLD_R::new(((self.bits >> 4) & 0x0f) as u8)
95 }
96 #[doc = "Bits 0:3 - ADDSET"]
97 #[inline(always)]
98 pub fn addset(&self) -> ADDSET_R {
99 ADDSET_R::new((self.bits & 0x0f) as u8)
100 }
101}
102impl W {
103 #[doc = "Bits 28:29 - ACCMOD"]
104 #[inline(always)]
105 pub fn accmod(&mut self) -> ACCMOD_W<28> {
106 ACCMOD_W::new(self)
107 }
108 #[doc = "Bits 24:27 - DATLAT"]
109 #[inline(always)]
110 pub fn datlat(&mut self) -> DATLAT_W<24> {
111 DATLAT_W::new(self)
112 }
113 #[doc = "Bits 20:23 - CLKDIV"]
114 #[inline(always)]
115 pub fn clkdiv(&mut self) -> CLKDIV_W<20> {
116 CLKDIV_W::new(self)
117 }
118 #[doc = "Bits 16:19 - BUSTURN"]
119 #[inline(always)]
120 pub fn busturn(&mut self) -> BUSTURN_W<16> {
121 BUSTURN_W::new(self)
122 }
123 #[doc = "Bits 8:15 - DATAST"]
124 #[inline(always)]
125 pub fn datast(&mut self) -> DATAST_W<8> {
126 DATAST_W::new(self)
127 }
128 #[doc = "Bits 4:7 - ADDHLD"]
129 #[inline(always)]
130 pub fn addhld(&mut self) -> ADDHLD_W<4> {
131 ADDHLD_W::new(self)
132 }
133 #[doc = "Bits 0:3 - ADDSET"]
134 #[inline(always)]
135 pub fn addset(&mut self) -> ADDSET_W<0> {
136 ADDSET_W::new(self)
137 }
138 #[doc = "Writes raw bits to the register."]
139 #[inline(always)]
140 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
141 self.0.bits(bits);
142 self
143 }
144}
145#[doc = "SRAM/NOR-Flash chip-select timing register 1\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 [btr1](index.html) module"]
146pub struct BTR1_SPEC;
147impl crate::RegisterSpec for BTR1_SPEC {
148 type Ux = u32;
149}
150#[doc = "`read()` method returns [btr1::R](R) reader structure"]
151impl crate::Readable for BTR1_SPEC {
152 type Reader = R;
153}
154#[doc = "`write(|w| ..)` method takes [btr1::W](W) writer structure"]
155impl crate::Writable for BTR1_SPEC {
156 type Writer = W;
157}
158#[doc = "`reset()` method sets BTR1 to value 0xffff_ffff"]
159impl crate::Resettable for BTR1_SPEC {
160 #[inline(always)]
161 fn reset_value() -> Self::Ux {
162 0xffff_ffff
163 }
164}