stm32l1/stm32l162/rtc/alrmssr.rs
1///Register `ALRM%sSSR` reader
2pub type R = crate::R<ALRMSSRrs>;
3///Register `ALRM%sSSR` writer
4pub type W = crate::W<ALRMSSRrs>;
5///Field `SS` reader - Sub seconds value
6pub type SS_R = crate::FieldReader<u16>;
7///Field `SS` writer - Sub seconds value
8pub type SS_W<'a, REG> = crate::FieldWriter<'a, REG, 15, u16, crate::Safe>;
9///Field `MASKSS` reader - Mask the most-significant bits starting at this bit
10pub type MASKSS_R = crate::FieldReader;
11///Field `MASKSS` writer - Mask the most-significant bits starting at this bit
12pub type MASKSS_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
13impl R {
14 ///Bits 0:14 - Sub seconds value
15 #[inline(always)]
16 pub fn ss(&self) -> SS_R {
17 SS_R::new((self.bits & 0x7fff) as u16)
18 }
19 ///Bits 24:27 - Mask the most-significant bits starting at this bit
20 #[inline(always)]
21 pub fn maskss(&self) -> MASKSS_R {
22 MASKSS_R::new(((self.bits >> 24) & 0x0f) as u8)
23 }
24}
25impl core::fmt::Debug for R {
26 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27 f.debug_struct("ALRMSSR")
28 .field("maskss", &self.maskss())
29 .field("ss", &self.ss())
30 .finish()
31 }
32}
33impl W {
34 ///Bits 0:14 - Sub seconds value
35 #[inline(always)]
36 pub fn ss(&mut self) -> SS_W<ALRMSSRrs> {
37 SS_W::new(self, 0)
38 }
39 ///Bits 24:27 - Mask the most-significant bits starting at this bit
40 #[inline(always)]
41 pub fn maskss(&mut self) -> MASKSS_W<ALRMSSRrs> {
42 MASKSS_W::new(self, 24)
43 }
44}
45/**Alarm %s sub-second register
46
47You can [`read`](crate::Reg::read) this register and get [`alrmssr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`alrmssr::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/STM32L162.html#RTC:ALRM[A]SSR)*/
50pub struct ALRMSSRrs;
51impl crate::RegisterSpec for ALRMSSRrs {
52 type Ux = u32;
53}
54///`read()` method returns [`alrmssr::R`](R) reader structure
55impl crate::Readable for ALRMSSRrs {}
56///`write(|w| ..)` method takes [`alrmssr::W`](W) writer structure
57impl crate::Writable for ALRMSSRrs {
58 type Safety = crate::Unsafe;
59}
60///`reset()` method sets ALRM%sSSR to value 0
61impl crate::Resettable for ALRMSSRrs {}