lpc82x_pac/mrt0/
idle_ch.rs1#[doc = "Register `IDLE_CH` reader"]
2pub struct R(crate::R<IDLE_CH_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IDLE_CH_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IDLE_CH_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IDLE_CH_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CHAN` reader - Idle channel. Reading the CHAN bits, returns the lowest idle timer channel. The number is positioned such that it can be used as an offset from the MRT base address in order to access the registers for the allocated channel. If all timer channels are running, CHAN = 0xF. See text above for more details."]
17pub struct CHAN_R(crate::FieldReader<u8, u8>);
18impl CHAN_R {
19    pub(crate) fn new(bits: u8) -> Self {
20        CHAN_R(crate::FieldReader::new(bits))
21    }
22}
23impl core::ops::Deref for CHAN_R {
24    type Target = crate::FieldReader<u8, u8>;
25    #[inline(always)]
26    fn deref(&self) -> &Self::Target {
27        &self.0
28    }
29}
30impl R {
31    #[doc = "Bits 4:7 - Idle channel. Reading the CHAN bits, returns the lowest idle timer channel. The number is positioned such that it can be used as an offset from the MRT base address in order to access the registers for the allocated channel. If all timer channels are running, CHAN = 0xF. See text above for more details."]
32    #[inline(always)]
33    pub fn chan(&self) -> CHAN_R {
34        CHAN_R::new(((self.bits >> 4) & 0x0f) as u8)
35    }
36}
37#[doc = "Idle channel register. This register returns the number of the first idle channel.\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 [idle_ch](index.html) module"]
38pub struct IDLE_CH_SPEC;
39impl crate::RegisterSpec for IDLE_CH_SPEC {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [idle_ch::R](R) reader structure"]
43impl crate::Readable for IDLE_CH_SPEC {
44    type Reader = R;
45}
46#[doc = "`reset()` method sets IDLE_CH to value 0"]
47impl crate::Resettable for IDLE_CH_SPEC {
48    #[inline(always)]
49    fn reset_value() -> Self::Ux {
50        0
51    }
52}