msp430f6736/rtc_c_real_time_clock/
rtcday.rs

1#[doc = "Register `RTCDAY` reader"]
2pub struct R(crate::R<RTCDAY_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RTCDAY_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RTCDAY_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RTCDAY_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `RTCDAY` writer"]
17pub struct W(crate::W<RTCDAY_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<RTCDAY_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<RTCDAY_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<RTCDAY_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DAY0` reader - Real Time Clock Day Bit: 0"]
38pub type DAY0_R = crate::BitReader<bool>;
39#[doc = "Field `DAY0` writer - Real Time Clock Day Bit: 0"]
40pub type DAY0_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 0>;
41#[doc = "Field `DAY1` reader - Real Time Clock Day Bit: 1"]
42pub type DAY1_R = crate::BitReader<bool>;
43#[doc = "Field `DAY1` writer - Real Time Clock Day Bit: 1"]
44pub type DAY1_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 1>;
45#[doc = "Field `DAY2` reader - Real Time Clock Day Bit: 2"]
46pub type DAY2_R = crate::BitReader<bool>;
47#[doc = "Field `DAY2` writer - Real Time Clock Day Bit: 2"]
48pub type DAY2_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 2>;
49#[doc = "Field `DAY3` reader - Real Time Clock Day Bit: 3"]
50pub type DAY3_R = crate::BitReader<bool>;
51#[doc = "Field `DAY3` writer - Real Time Clock Day Bit: 3"]
52pub type DAY3_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 3>;
53#[doc = "Field `DAY4` reader - Real Time Clock Day Bit: 4"]
54pub type DAY4_R = crate::BitReader<bool>;
55#[doc = "Field `DAY4` writer - Real Time Clock Day Bit: 4"]
56pub type DAY4_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 4>;
57#[doc = "Field `DAY5` reader - Real Time Clock Day Bit: 5"]
58pub type DAY5_R = crate::BitReader<bool>;
59#[doc = "Field `DAY5` writer - Real Time Clock Day Bit: 5"]
60pub type DAY5_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 5>;
61#[doc = "Field `DAY6` reader - Real Time Clock Day Bit: 6"]
62pub type DAY6_R = crate::BitReader<bool>;
63#[doc = "Field `DAY6` writer - Real Time Clock Day Bit: 6"]
64pub type DAY6_W<'a> = crate::BitWriter<'a, u8, RTCDAY_SPEC, bool, 6>;
65impl R {
66    #[doc = "Bit 0 - Real Time Clock Day Bit: 0"]
67    #[inline(always)]
68    pub fn day0(&self) -> DAY0_R {
69        DAY0_R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 1 - Real Time Clock Day Bit: 1"]
72    #[inline(always)]
73    pub fn day1(&self) -> DAY1_R {
74        DAY1_R::new(((self.bits >> 1) & 1) != 0)
75    }
76    #[doc = "Bit 2 - Real Time Clock Day Bit: 2"]
77    #[inline(always)]
78    pub fn day2(&self) -> DAY2_R {
79        DAY2_R::new(((self.bits >> 2) & 1) != 0)
80    }
81    #[doc = "Bit 3 - Real Time Clock Day Bit: 3"]
82    #[inline(always)]
83    pub fn day3(&self) -> DAY3_R {
84        DAY3_R::new(((self.bits >> 3) & 1) != 0)
85    }
86    #[doc = "Bit 4 - Real Time Clock Day Bit: 4"]
87    #[inline(always)]
88    pub fn day4(&self) -> DAY4_R {
89        DAY4_R::new(((self.bits >> 4) & 1) != 0)
90    }
91    #[doc = "Bit 5 - Real Time Clock Day Bit: 5"]
92    #[inline(always)]
93    pub fn day5(&self) -> DAY5_R {
94        DAY5_R::new(((self.bits >> 5) & 1) != 0)
95    }
96    #[doc = "Bit 6 - Real Time Clock Day Bit: 6"]
97    #[inline(always)]
98    pub fn day6(&self) -> DAY6_R {
99        DAY6_R::new(((self.bits >> 6) & 1) != 0)
100    }
101}
102impl W {
103    #[doc = "Bit 0 - Real Time Clock Day Bit: 0"]
104    #[inline(always)]
105    pub fn day0(&mut self) -> DAY0_W {
106        DAY0_W::new(self)
107    }
108    #[doc = "Bit 1 - Real Time Clock Day Bit: 1"]
109    #[inline(always)]
110    pub fn day1(&mut self) -> DAY1_W {
111        DAY1_W::new(self)
112    }
113    #[doc = "Bit 2 - Real Time Clock Day Bit: 2"]
114    #[inline(always)]
115    pub fn day2(&mut self) -> DAY2_W {
116        DAY2_W::new(self)
117    }
118    #[doc = "Bit 3 - Real Time Clock Day Bit: 3"]
119    #[inline(always)]
120    pub fn day3(&mut self) -> DAY3_W {
121        DAY3_W::new(self)
122    }
123    #[doc = "Bit 4 - Real Time Clock Day Bit: 4"]
124    #[inline(always)]
125    pub fn day4(&mut self) -> DAY4_W {
126        DAY4_W::new(self)
127    }
128    #[doc = "Bit 5 - Real Time Clock Day Bit: 5"]
129    #[inline(always)]
130    pub fn day5(&mut self) -> DAY5_W {
131        DAY5_W::new(self)
132    }
133    #[doc = "Bit 6 - Real Time Clock Day Bit: 6"]
134    #[inline(always)]
135    pub fn day6(&mut self) -> DAY6_W {
136        DAY6_W::new(self)
137    }
138    #[doc = "Writes raw bits to the register."]
139    #[inline(always)]
140    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
141        self.0.bits(bits);
142        self
143    }
144}
145#[doc = "Real Time Clock Day\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rtcday](index.html) module"]
146pub struct RTCDAY_SPEC;
147impl crate::RegisterSpec for RTCDAY_SPEC {
148    type Ux = u8;
149}
150#[doc = "`read()` method returns [rtcday::R](R) reader structure"]
151impl crate::Readable for RTCDAY_SPEC {
152    type Reader = R;
153}
154#[doc = "`write(|w| ..)` method takes [rtcday::W](W) writer structure"]
155impl crate::Writable for RTCDAY_SPEC {
156    type Writer = W;
157}
158#[doc = "`reset()` method sets RTCDAY to value 0"]
159impl crate::Resettable for RTCDAY_SPEC {
160    #[inline(always)]
161    fn reset_value() -> Self::Ux {
162        0
163    }
164}