stm32l4/stm32l4x5/rcc/
ahb1enr.rs1pub type R = crate::R<AHB1ENRrs>;
3pub type W = crate::W<AHB1ENRrs>;
5pub type DMA1EN_R = crate::BitReader;
7pub type DMA1EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type DMA2EN_R = crate::BitReader;
11pub type DMA2EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type FLASHEN_R = crate::BitReader;
15pub type FLASHEN_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type CRCEN_R = crate::BitReader;
19pub type CRCEN_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type TSCEN_R = crate::BitReader;
23pub type TSCEN_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26 #[inline(always)]
28 pub fn dma1en(&self) -> DMA1EN_R {
29 DMA1EN_R::new((self.bits & 1) != 0)
30 }
31 #[inline(always)]
33 pub fn dma2en(&self) -> DMA2EN_R {
34 DMA2EN_R::new(((self.bits >> 1) & 1) != 0)
35 }
36 #[inline(always)]
38 pub fn flashen(&self) -> FLASHEN_R {
39 FLASHEN_R::new(((self.bits >> 8) & 1) != 0)
40 }
41 #[inline(always)]
43 pub fn crcen(&self) -> CRCEN_R {
44 CRCEN_R::new(((self.bits >> 12) & 1) != 0)
45 }
46 #[inline(always)]
48 pub fn tscen(&self) -> TSCEN_R {
49 TSCEN_R::new(((self.bits >> 16) & 1) != 0)
50 }
51}
52impl core::fmt::Debug for R {
53 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
54 f.debug_struct("AHB1ENR")
55 .field("tscen", &self.tscen())
56 .field("crcen", &self.crcen())
57 .field("flashen", &self.flashen())
58 .field("dma2en", &self.dma2en())
59 .field("dma1en", &self.dma1en())
60 .finish()
61 }
62}
63impl W {
64 #[inline(always)]
66 pub fn dma1en(&mut self) -> DMA1EN_W<AHB1ENRrs> {
67 DMA1EN_W::new(self, 0)
68 }
69 #[inline(always)]
71 pub fn dma2en(&mut self) -> DMA2EN_W<AHB1ENRrs> {
72 DMA2EN_W::new(self, 1)
73 }
74 #[inline(always)]
76 pub fn flashen(&mut self) -> FLASHEN_W<AHB1ENRrs> {
77 FLASHEN_W::new(self, 8)
78 }
79 #[inline(always)]
81 pub fn crcen(&mut self) -> CRCEN_W<AHB1ENRrs> {
82 CRCEN_W::new(self, 12)
83 }
84 #[inline(always)]
86 pub fn tscen(&mut self) -> TSCEN_W<AHB1ENRrs> {
87 TSCEN_W::new(self, 16)
88 }
89}
90pub struct AHB1ENRrs;
96impl crate::RegisterSpec for AHB1ENRrs {
97 type Ux = u32;
98}
99impl crate::Readable for AHB1ENRrs {}
101impl crate::Writable for AHB1ENRrs {
103 type Safety = crate::Unsafe;
104}
105impl crate::Resettable for AHB1ENRrs {
107 const RESET_VALUE: u32 = 0x0100;
108}