efm32gg11b/rtc/
compd_comp.rs

1#[doc = "Reader of register COMPD_COMP"]
2pub type R = crate::R<u32, super::COMPD_COMP>;
3#[doc = "Writer for register COMPD_COMP"]
4pub type W = crate::W<u32, super::COMPD_COMP>;
5#[doc = "Register COMPD_COMP `reset()`'s with value 0"]
6impl crate::ResetValue for super::COMPD_COMP {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type { 0 }
10}
11#[doc = "Reader of field `COMP`"]
12pub type COMP_R = crate::R<u32, u32>;
13#[doc = "Write proxy for field `COMP`"]
14pub struct COMP_W<'a> {
15    w: &'a mut W,
16}
17impl<'a> COMP_W<'a> {
18    #[doc = r"Writes raw bits to the field"]
19    #[inline(always)]
20    pub unsafe fn bits(self, value: u32) -> &'a mut W {
21        self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff);
22        self.w
23    }
24}
25impl R {
26    #[doc = "Bits 0:23 - Compare Value"]
27    #[inline(always)]
28    pub fn comp(&self) -> COMP_R { COMP_R::new((self.bits & 0x00ff_ffff) as u32) }
29}
30impl W {
31    #[doc = "Bits 0:23 - Compare Value"]
32    #[inline(always)]
33    pub fn comp(&mut self) -> COMP_W { COMP_W { w: self } }
34}