1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
///Register `CC1_DATE` reader
pub type R = crate::R<CC1_DATErs>;
///Register `CC1_DATE` writer
pub type W = crate::W<CC1_DATErs>;
///Field `DAYU` reader - Day of Month/week, Units
pub type DayuR = crate::FieldReader;
///Field `DAYU` writer - Day of Month/week, Units
pub type DayuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
///Field `DAYT` reader - Day of Month/week, Tens
pub type DaytR = crate::FieldReader;
///Field `DAYT` writer - Day of Month/week, Tens
pub type DaytW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
///Field `MONTHU` reader - Month, Units
pub type MonthuR = crate::FieldReader;
///Field `MONTHU` writer - Month, Units
pub type MonthuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
///Field `MONTHT` reader - Month, Tens
pub type MonthtR = crate::BitReader;
///Field `MONTHT` writer - Month, Tens
pub type MonthtW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
///Bits 0:3 - Day of Month/week, Units
#[inline(always)]
pub fn dayu(&self) -> DayuR {
DayuR::new((self.bits & 0x0f) as u8)
}
///Bits 4:5 - Day of Month/week, Tens
#[inline(always)]
pub fn dayt(&self) -> DaytR {
DaytR::new(((self.bits >> 4) & 3) as u8)
}
///Bits 8:11 - Month, Units
#[inline(always)]
pub fn monthu(&self) -> MonthuR {
MonthuR::new(((self.bits >> 8) & 0x0f) as u8)
}
///Bit 12 - Month, Tens
#[inline(always)]
pub fn montht(&self) -> MonthtR {
MonthtR::new(((self.bits >> 12) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CC1_DATE")
.field("dayu", &self.dayu())
.field("dayt", &self.dayt())
.field("monthu", &self.monthu())
.field("montht", &self.montht())
.finish()
}
}
impl W {
///Bits 0:3 - Day of Month/week, Units
#[inline(always)]
pub fn dayu(&mut self) -> DayuW<'_, CC1_DATErs> {
DayuW::new(self, 0)
}
///Bits 4:5 - Day of Month/week, Tens
#[inline(always)]
pub fn dayt(&mut self) -> DaytW<'_, CC1_DATErs> {
DaytW::new(self, 4)
}
///Bits 8:11 - Month, Units
#[inline(always)]
pub fn monthu(&mut self) -> MonthuW<'_, CC1_DATErs> {
MonthuW::new(self, 8)
}
///Bit 12 - Month, Tens
#[inline(always)]
pub fn montht(&mut self) -> MonthtW<'_, CC1_DATErs> {
MonthtW::new(self, 12)
}
}
///Capture/Compare Date Register
///
///You can [`read`](crate::Reg::read) this register and get [`cc1_date::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cc1_date::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
pub struct CC1_DATErs;
impl crate::RegisterSpec for CC1_DATErs {
type Ux = u32;
}
///`read()` method returns [`cc1_date::R`](R) reader structure
impl crate::Readable for CC1_DATErs {}
///`write(|w| ..)` method takes [`cc1_date::W`](W) writer structure
impl crate::Writable for CC1_DATErs {
type Safety = crate::Unsafe;
}
///`reset()` method sets CC1_DATE to value 0
impl crate::Resettable for CC1_DATErs {}