lpc82x_pac/mrt0/channel/
timer.rs1#[doc = "Register `TIMER` reader"]
2pub struct R(crate::R<TIMER_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<TIMER_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<TIMER_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<TIMER_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `VALUE` reader - Holds the current timer value of the down-counter. The initial value of the TIMERn register is loaded as IVALUE - 1 from the INTVALn register either at the end of the time interval or immediately in the following cases: INTVALn register is updated in the idle state. INTVALn register is updated with LOAD = 1. When the timer is in idle state, reading this bit fields returns -1 (0x00FF FFFF)."]
17pub struct VALUE_R(crate::FieldReader<u32, u32>);
18impl VALUE_R {
19 pub(crate) fn new(bits: u32) -> Self {
20 VALUE_R(crate::FieldReader::new(bits))
21 }
22}
23impl core::ops::Deref for VALUE_R {
24 type Target = crate::FieldReader<u32, u32>;
25 #[inline(always)]
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29}
30impl R {
31 #[doc = "Bits 0:30 - Holds the current timer value of the down-counter. The initial value of the TIMERn register is loaded as IVALUE - 1 from the INTVALn register either at the end of the time interval or immediately in the following cases: INTVALn register is updated in the idle state. INTVALn register is updated with LOAD = 1. When the timer is in idle state, reading this bit fields returns -1 (0x00FF FFFF)."]
32 #[inline(always)]
33 pub fn value(&self) -> VALUE_R {
34 VALUE_R::new((self.bits & 0x7fff_ffff) as u32)
35 }
36}
37#[doc = "MRT Timer register. This register reads the value of the down-counter.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [timer](index.html) module"]
38pub struct TIMER_SPEC;
39impl crate::RegisterSpec for TIMER_SPEC {
40 type Ux = u32;
41}
42#[doc = "`read()` method returns [timer::R](R) reader structure"]
43impl crate::Readable for TIMER_SPEC {
44 type Reader = R;
45}
46#[doc = "`reset()` method sets TIMER to value 0x00ff_ffff"]
47impl crate::Resettable for TIMER_SPEC {
48 #[inline(always)]
49 fn reset_value() -> Self::Ux {
50 0x00ff_ffff
51 }
52}