eos_s3/spt/
update_tmr_val.rs

1#[doc = "Register `UPDATE_TMR_VAL` reader"]
2pub struct R(crate::R<UPDATE_TMR_VAL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<UPDATE_TMR_VAL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<UPDATE_TMR_VAL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<UPDATE_TMR_VAL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `UPDATE_TMR_VAL` writer"]
17pub struct W(crate::W<UPDATE_TMR_VAL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<UPDATE_TMR_VAL_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<UPDATE_TMR_VAL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<UPDATE_TMR_VAL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `UPDATE_TIMER_VALUE` reader - Update the 30-Bit Timer once write. Note: Please programmed SPT_EN (0x000, bit 0) to 0 before write this register to avoid any potential issue"]
38pub struct UPDATE_TIMER_VALUE_R(crate::FieldReader<u32, u32>);
39impl UPDATE_TIMER_VALUE_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u32) -> Self {
42        UPDATE_TIMER_VALUE_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for UPDATE_TIMER_VALUE_R {
46    type Target = crate::FieldReader<u32, u32>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `UPDATE_TIMER_VALUE` writer - Update the 30-Bit Timer once write. Note: Please programmed SPT_EN (0x000, bit 0) to 0 before write this register to avoid any potential issue"]
53pub struct UPDATE_TIMER_VALUE_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> UPDATE_TIMER_VALUE_W<'a> {
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u32) -> &'a mut W {
60        self.w.bits =
61            (self.w.bits & !0x3fff_ffff) | (value as u32 & 0x3fff_ffff);
62        self.w
63    }
64}
65impl R {
66    #[doc = "Bits 0:29 - Update the 30-Bit Timer once write. Note: Please programmed SPT_EN (0x000, bit 0) to 0 before write this register to avoid any potential issue"]
67    #[inline(always)]
68    pub fn update_timer_value(&self) -> UPDATE_TIMER_VALUE_R {
69        UPDATE_TIMER_VALUE_R::new((self.bits & 0x3fff_ffff) as u32)
70    }
71}
72impl W {
73    #[doc = "Bits 0:29 - Update the 30-Bit Timer once write. Note: Please programmed SPT_EN (0x000, bit 0) to 0 before write this register to avoid any potential issue"]
74    #[inline(always)]
75    pub fn update_timer_value(&mut self) -> UPDATE_TIMER_VALUE_W {
76        UPDATE_TIMER_VALUE_W { w: self }
77    }
78    #[doc = "Writes raw bits to the register."]
79    #[inline(always)]
80    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
81        self.0.bits(bits);
82        self
83    }
84}
85#[doc = "Update the 30-Bit Timer once write. Note: Please programmed SPT_EN (0x000, bit 0) to 0 before write this register to avoid any potential issue\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 [update_tmr_val](index.html) module"]
86pub struct UPDATE_TMR_VAL_SPEC;
87impl crate::RegisterSpec for UPDATE_TMR_VAL_SPEC {
88    type Ux = u32;
89}
90#[doc = "`read()` method returns [update_tmr_val::R](R) reader structure"]
91impl crate::Readable for UPDATE_TMR_VAL_SPEC {
92    type Reader = R;
93}
94#[doc = "`write(|w| ..)` method takes [update_tmr_val::W](W) writer structure"]
95impl crate::Writable for UPDATE_TMR_VAL_SPEC {
96    type Writer = W;
97}
98#[doc = "`reset()` method sets UPDATE_TMR_VAL to value 0"]
99impl crate::Resettable for UPDATE_TMR_VAL_SPEC {
100    #[inline(always)]
101    fn reset_value() -> Self::Ux {
102        0
103    }
104}