stm32l1/stm32l100/rtc/calibr.rs
1///Register `CALIBR` reader
2pub type R = crate::R<CALIBRrs>;
3///Register `CALIBR` writer
4pub type W = crate::W<CALIBRrs>;
5///Field `DC` reader - Digital calibration
6pub type DC_R = crate::FieldReader;
7///Field `DC` writer - Digital calibration
8pub type DC_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9///Field `DCS` reader - Digital calibration sign
10pub type DCS_R = crate::BitReader;
11///Field `DCS` writer - Digital calibration sign
12pub type DCS_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 ///Bits 0:4 - Digital calibration
15 #[inline(always)]
16 pub fn dc(&self) -> DC_R {
17 DC_R::new((self.bits & 0x1f) as u8)
18 }
19 ///Bit 7 - Digital calibration sign
20 #[inline(always)]
21 pub fn dcs(&self) -> DCS_R {
22 DCS_R::new(((self.bits >> 7) & 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("CALIBR")
28 .field("dcs", &self.dcs())
29 .field("dc", &self.dc())
30 .finish()
31 }
32}
33impl W {
34 ///Bits 0:4 - Digital calibration
35 #[inline(always)]
36 pub fn dc(&mut self) -> DC_W<CALIBRrs> {
37 DC_W::new(self, 0)
38 }
39 ///Bit 7 - Digital calibration sign
40 #[inline(always)]
41 pub fn dcs(&mut self) -> DCS_W<CALIBRrs> {
42 DCS_W::new(self, 7)
43 }
44}
45/**calibration register
46
47You can [`read`](crate::Reg::read) this register and get [`calibr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`calibr::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#RTC:CALIBR)*/
50pub struct CALIBRrs;
51impl crate::RegisterSpec for CALIBRrs {
52 type Ux = u32;
53}
54///`read()` method returns [`calibr::R`](R) reader structure
55impl crate::Readable for CALIBRrs {}
56///`write(|w| ..)` method takes [`calibr::W`](W) writer structure
57impl crate::Writable for CALIBRrs {
58 type Safety = crate::Unsafe;
59}
60///`reset()` method sets CALIBR to value 0
61impl crate::Resettable for CALIBRrs {}