stm32l1/stm32l100/adc/ccr.rs
1///Register `CCR` reader
2pub type R = crate::R<CCRrs>;
3///Register `CCR` writer
4pub type W = crate::W<CCRrs>;
5///Field `ADCPRE` reader - ADC prescaler
6pub type ADCPRE_R = crate::FieldReader;
7///Field `ADCPRE` writer - ADC prescaler
8pub type ADCPRE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9///Field `TSVREFE` reader - Temperature sensor and VREFINT enable
10pub type TSVREFE_R = crate::BitReader;
11///Field `TSVREFE` writer - Temperature sensor and VREFINT enable
12pub type TSVREFE_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 ///Bits 16:17 - ADC prescaler
15 #[inline(always)]
16 pub fn adcpre(&self) -> ADCPRE_R {
17 ADCPRE_R::new(((self.bits >> 16) & 3) as u8)
18 }
19 ///Bit 23 - Temperature sensor and VREFINT enable
20 #[inline(always)]
21 pub fn tsvrefe(&self) -> TSVREFE_R {
22 TSVREFE_R::new(((self.bits >> 23) & 1) != 0)
23 }
24}
25impl core::fmt::Debug for R {
26 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27 f.debug_struct("CCR")
28 .field("adcpre", &self.adcpre())
29 .field("tsvrefe", &self.tsvrefe())
30 .finish()
31 }
32}
33impl W {
34 ///Bits 16:17 - ADC prescaler
35 #[inline(always)]
36 pub fn adcpre(&mut self) -> ADCPRE_W<CCRrs> {
37 ADCPRE_W::new(self, 16)
38 }
39 ///Bit 23 - Temperature sensor and VREFINT enable
40 #[inline(always)]
41 pub fn tsvrefe(&mut self) -> TSVREFE_W<CCRrs> {
42 TSVREFE_W::new(self, 23)
43 }
44}
45/**ADC common control register
46
47You can [`read`](crate::Reg::read) this register and get [`ccr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
48
49See register [structure](https://stm32-rs.github.io/stm32-rs/STM32L100.html#ADC:CCR)*/
50pub struct CCRrs;
51impl crate::RegisterSpec for CCRrs {
52 type Ux = u32;
53}
54///`read()` method returns [`ccr::R`](R) reader structure
55impl crate::Readable for CCRrs {}
56///`write(|w| ..)` method takes [`ccr::W`](W) writer structure
57impl crate::Writable for CCRrs {
58 type Safety = crate::Unsafe;
59}
60///`reset()` method sets CCR to value 0
61impl crate::Resettable for CCRrs {}