stm32l476/fmc/
btr3.rs

1#[doc = "Register `BTR3` reader"]
2pub type R = crate::R<Btr3Spec>;
3#[doc = "Register `BTR3` writer"]
4pub type W = crate::W<Btr3Spec>;
5#[doc = "Field `ADDSET` reader - ADDSET"]
6pub type AddsetR = crate::FieldReader;
7#[doc = "Field `ADDSET` writer - ADDSET"]
8pub type AddsetW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `ADDHLD` reader - ADDHLD"]
10pub type AddhldR = crate::FieldReader;
11#[doc = "Field `ADDHLD` writer - ADDHLD"]
12pub type AddhldW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `DATAST` reader - DATAST"]
14pub type DatastR = crate::FieldReader;
15#[doc = "Field `DATAST` writer - DATAST"]
16pub type DatastW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `BUSTURN` reader - BUSTURN"]
18pub type BusturnR = crate::FieldReader;
19#[doc = "Field `BUSTURN` writer - BUSTURN"]
20pub type BusturnW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
21#[doc = "Field `CLKDIV` reader - CLKDIV"]
22pub type ClkdivR = crate::FieldReader;
23#[doc = "Field `CLKDIV` writer - CLKDIV"]
24pub type ClkdivW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25#[doc = "Field `DATLAT` reader - DATLAT"]
26pub type DatlatR = crate::FieldReader;
27#[doc = "Field `DATLAT` writer - DATLAT"]
28pub type DatlatW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
29#[doc = "Field `ACCMOD` reader - ACCMOD"]
30pub type AccmodR = crate::FieldReader;
31#[doc = "Field `ACCMOD` writer - ACCMOD"]
32pub type AccmodW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
33impl R {
34    #[doc = "Bits 0:3 - ADDSET"]
35    #[inline(always)]
36    pub fn addset(&self) -> AddsetR {
37        AddsetR::new((self.bits & 0x0f) as u8)
38    }
39    #[doc = "Bits 4:7 - ADDHLD"]
40    #[inline(always)]
41    pub fn addhld(&self) -> AddhldR {
42        AddhldR::new(((self.bits >> 4) & 0x0f) as u8)
43    }
44    #[doc = "Bits 8:15 - DATAST"]
45    #[inline(always)]
46    pub fn datast(&self) -> DatastR {
47        DatastR::new(((self.bits >> 8) & 0xff) as u8)
48    }
49    #[doc = "Bits 16:19 - BUSTURN"]
50    #[inline(always)]
51    pub fn busturn(&self) -> BusturnR {
52        BusturnR::new(((self.bits >> 16) & 0x0f) as u8)
53    }
54    #[doc = "Bits 20:23 - CLKDIV"]
55    #[inline(always)]
56    pub fn clkdiv(&self) -> ClkdivR {
57        ClkdivR::new(((self.bits >> 20) & 0x0f) as u8)
58    }
59    #[doc = "Bits 24:27 - DATLAT"]
60    #[inline(always)]
61    pub fn datlat(&self) -> DatlatR {
62        DatlatR::new(((self.bits >> 24) & 0x0f) as u8)
63    }
64    #[doc = "Bits 28:29 - ACCMOD"]
65    #[inline(always)]
66    pub fn accmod(&self) -> AccmodR {
67        AccmodR::new(((self.bits >> 28) & 3) as u8)
68    }
69}
70impl W {
71    #[doc = "Bits 0:3 - ADDSET"]
72    #[inline(always)]
73    pub fn addset(&mut self) -> AddsetW<Btr3Spec> {
74        AddsetW::new(self, 0)
75    }
76    #[doc = "Bits 4:7 - ADDHLD"]
77    #[inline(always)]
78    pub fn addhld(&mut self) -> AddhldW<Btr3Spec> {
79        AddhldW::new(self, 4)
80    }
81    #[doc = "Bits 8:15 - DATAST"]
82    #[inline(always)]
83    pub fn datast(&mut self) -> DatastW<Btr3Spec> {
84        DatastW::new(self, 8)
85    }
86    #[doc = "Bits 16:19 - BUSTURN"]
87    #[inline(always)]
88    pub fn busturn(&mut self) -> BusturnW<Btr3Spec> {
89        BusturnW::new(self, 16)
90    }
91    #[doc = "Bits 20:23 - CLKDIV"]
92    #[inline(always)]
93    pub fn clkdiv(&mut self) -> ClkdivW<Btr3Spec> {
94        ClkdivW::new(self, 20)
95    }
96    #[doc = "Bits 24:27 - DATLAT"]
97    #[inline(always)]
98    pub fn datlat(&mut self) -> DatlatW<Btr3Spec> {
99        DatlatW::new(self, 24)
100    }
101    #[doc = "Bits 28:29 - ACCMOD"]
102    #[inline(always)]
103    pub fn accmod(&mut self) -> AccmodW<Btr3Spec> {
104        AccmodW::new(self, 28)
105    }
106}
107#[doc = "SRAM/NOR-Flash chip-select timing register 3\n\nYou can [`read`](crate::Reg::read) this register and get [`btr3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`btr3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
108pub struct Btr3Spec;
109impl crate::RegisterSpec for Btr3Spec {
110    type Ux = u32;
111}
112#[doc = "`read()` method returns [`btr3::R`](R) reader structure"]
113impl crate::Readable for Btr3Spec {}
114#[doc = "`write(|w| ..)` method takes [`btr3::W`](W) writer structure"]
115impl crate::Writable for Btr3Spec {
116    type Safety = crate::Unsafe;
117}
118#[doc = "`reset()` method sets BTR3 to value 0xffff_ffff"]
119impl crate::Resettable for Btr3Spec {
120    const RESET_VALUE: u32 = 0xffff_ffff;
121}