efm32pg12_pac/rtcc/
cc0_date.rs1#[doc = "Reader of register CC0_DATE"]
2pub type R = crate::R<u32, super::CC0_DATE>;
3#[doc = "Writer for register CC0_DATE"]
4pub type W = crate::W<u32, super::CC0_DATE>;
5#[doc = "Register CC0_DATE `reset()`'s with value 0"]
6impl crate::ResetValue for super::CC0_DATE {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `DAYU`"]
14pub type DAYU_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `DAYU`"]
16pub struct DAYU_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> DAYU_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) | ((value as u32) & 0x0f);
24 self.w
25 }
26}
27#[doc = "Reader of field `DAYT`"]
28pub type DAYT_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `DAYT`"]
30pub struct DAYT_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> DAYT_W<'a> {
34 #[doc = r"Writes raw bits to the field"]
35 #[inline(always)]
36 pub unsafe fn bits(self, value: u8) -> &'a mut W {
37 self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
38 self.w
39 }
40}
41#[doc = "Reader of field `MONTHU`"]
42pub type MONTHU_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `MONTHU`"]
44pub struct MONTHU_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> MONTHU_W<'a> {
48 #[doc = r"Writes raw bits to the field"]
49 #[inline(always)]
50 pub unsafe fn bits(self, value: u8) -> &'a mut W {
51 self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
52 self.w
53 }
54}
55#[doc = "Reader of field `MONTHT`"]
56pub type MONTHT_R = crate::R<bool, bool>;
57#[doc = "Write proxy for field `MONTHT`"]
58pub struct MONTHT_W<'a> {
59 w: &'a mut W,
60}
61impl<'a> MONTHT_W<'a> {
62 #[doc = r"Sets the field bit"]
63 #[inline(always)]
64 pub fn set_bit(self) -> &'a mut W {
65 self.bit(true)
66 }
67 #[doc = r"Clears the field bit"]
68 #[inline(always)]
69 pub fn clear_bit(self) -> &'a mut W {
70 self.bit(false)
71 }
72 #[doc = r"Writes raw bits to the field"]
73 #[inline(always)]
74 pub fn bit(self, value: bool) -> &'a mut W {
75 self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
76 self.w
77 }
78}
79impl R {
80 #[doc = "Bits 0:3 - Day of Month/week, Units"]
81 #[inline(always)]
82 pub fn dayu(&self) -> DAYU_R {
83 DAYU_R::new((self.bits & 0x0f) as u8)
84 }
85 #[doc = "Bits 4:5 - Day of Month/week, Tens"]
86 #[inline(always)]
87 pub fn dayt(&self) -> DAYT_R {
88 DAYT_R::new(((self.bits >> 4) & 0x03) as u8)
89 }
90 #[doc = "Bits 8:11 - Month, Units"]
91 #[inline(always)]
92 pub fn monthu(&self) -> MONTHU_R {
93 MONTHU_R::new(((self.bits >> 8) & 0x0f) as u8)
94 }
95 #[doc = "Bit 12 - Month, Tens"]
96 #[inline(always)]
97 pub fn montht(&self) -> MONTHT_R {
98 MONTHT_R::new(((self.bits >> 12) & 0x01) != 0)
99 }
100}
101impl W {
102 #[doc = "Bits 0:3 - Day of Month/week, Units"]
103 #[inline(always)]
104 pub fn dayu(&mut self) -> DAYU_W {
105 DAYU_W { w: self }
106 }
107 #[doc = "Bits 4:5 - Day of Month/week, Tens"]
108 #[inline(always)]
109 pub fn dayt(&mut self) -> DAYT_W {
110 DAYT_W { w: self }
111 }
112 #[doc = "Bits 8:11 - Month, Units"]
113 #[inline(always)]
114 pub fn monthu(&mut self) -> MONTHU_W {
115 MONTHU_W { w: self }
116 }
117 #[doc = "Bit 12 - Month, Tens"]
118 #[inline(always)]
119 pub fn montht(&mut self) -> MONTHT_W {
120 MONTHT_W { w: self }
121 }
122}