stm32l476/fmc/
bwtr1.rs

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