stm32wb_pac/rtc/
alrmassr.rs

1#[doc = "Reader of register ALRMASSR"]
2pub type R = crate::R<u32, super::ALRMASSR>;
3#[doc = "Writer for register ALRMASSR"]
4pub type W = crate::W<u32, super::ALRMASSR>;
5#[doc = "Register ALRMASSR `reset()`'s with value 0"]
6impl crate::ResetValue for super::ALRMASSR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `MASKSS`"]
14pub type MASKSS_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `MASKSS`"]
16pub struct MASKSS_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> MASKSS_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24);
24        self.w
25    }
26}
27#[doc = "Reader of field `SS`"]
28pub type SS_R = crate::R<u16, u16>;
29#[doc = "Write proxy for field `SS`"]
30pub struct SS_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> SS_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u16) -> &'a mut W {
37        self.w.bits = (self.w.bits & !0x7fff) | ((value as u32) & 0x7fff);
38        self.w
39    }
40}
41impl R {
42    #[doc = "Bits 24:27 - Mask the most-significant bits starting at this bit"]
43    #[inline(always)]
44    pub fn maskss(&self) -> MASKSS_R {
45        MASKSS_R::new(((self.bits >> 24) & 0x0f) as u8)
46    }
47    #[doc = "Bits 0:14 - Sub seconds value"]
48    #[inline(always)]
49    pub fn ss(&self) -> SS_R {
50        SS_R::new((self.bits & 0x7fff) as u16)
51    }
52}
53impl W {
54    #[doc = "Bits 24:27 - Mask the most-significant bits starting at this bit"]
55    #[inline(always)]
56    pub fn maskss(&mut self) -> MASKSS_W {
57        MASKSS_W { w: self }
58    }
59    #[doc = "Bits 0:14 - Sub seconds value"]
60    #[inline(always)]
61    pub fn ss(&mut self) -> SS_W {
62        SS_W { w: self }
63    }
64}