Skip to main content

efm32pg1b_pac/prs/
peek.rs

1///Register `PEEK` reader
2pub type R = crate::R<PEEKrs>;
3///Field `CH0VAL` reader - Channel 0 Current Value
4pub type Ch0valR = crate::BitReader;
5///Field `CH1VAL` reader - Channel 1 Current Value
6pub type Ch1valR = crate::BitReader;
7///Field `CH2VAL` reader - Channel 2 Current Value
8pub type Ch2valR = crate::BitReader;
9///Field `CH3VAL` reader - Channel 3 Current Value
10pub type Ch3valR = crate::BitReader;
11///Field `CH4VAL` reader - Channel 4 Current Value
12pub type Ch4valR = crate::BitReader;
13///Field `CH5VAL` reader - Channel 5 Current Value
14pub type Ch5valR = crate::BitReader;
15///Field `CH6VAL` reader - Channel 6 Current Value
16pub type Ch6valR = crate::BitReader;
17///Field `CH7VAL` reader - Channel 7 Current Value
18pub type Ch7valR = crate::BitReader;
19///Field `CH8VAL` reader - Channel 8 Current Value
20pub type Ch8valR = crate::BitReader;
21///Field `CH9VAL` reader - Channel 9 Current Value
22pub type Ch9valR = crate::BitReader;
23///Field `CH10VAL` reader - Channel 10 Current Value
24pub type Ch10valR = crate::BitReader;
25///Field `CH11VAL` reader - Channel 11 Current Value
26pub type Ch11valR = crate::BitReader;
27impl R {
28    ///Bit 0 - Channel 0 Current Value
29    #[inline(always)]
30    pub fn ch0val(&self) -> Ch0valR {
31        Ch0valR::new((self.bits & 1) != 0)
32    }
33    ///Bit 1 - Channel 1 Current Value
34    #[inline(always)]
35    pub fn ch1val(&self) -> Ch1valR {
36        Ch1valR::new(((self.bits >> 1) & 1) != 0)
37    }
38    ///Bit 2 - Channel 2 Current Value
39    #[inline(always)]
40    pub fn ch2val(&self) -> Ch2valR {
41        Ch2valR::new(((self.bits >> 2) & 1) != 0)
42    }
43    ///Bit 3 - Channel 3 Current Value
44    #[inline(always)]
45    pub fn ch3val(&self) -> Ch3valR {
46        Ch3valR::new(((self.bits >> 3) & 1) != 0)
47    }
48    ///Bit 4 - Channel 4 Current Value
49    #[inline(always)]
50    pub fn ch4val(&self) -> Ch4valR {
51        Ch4valR::new(((self.bits >> 4) & 1) != 0)
52    }
53    ///Bit 5 - Channel 5 Current Value
54    #[inline(always)]
55    pub fn ch5val(&self) -> Ch5valR {
56        Ch5valR::new(((self.bits >> 5) & 1) != 0)
57    }
58    ///Bit 6 - Channel 6 Current Value
59    #[inline(always)]
60    pub fn ch6val(&self) -> Ch6valR {
61        Ch6valR::new(((self.bits >> 6) & 1) != 0)
62    }
63    ///Bit 7 - Channel 7 Current Value
64    #[inline(always)]
65    pub fn ch7val(&self) -> Ch7valR {
66        Ch7valR::new(((self.bits >> 7) & 1) != 0)
67    }
68    ///Bit 8 - Channel 8 Current Value
69    #[inline(always)]
70    pub fn ch8val(&self) -> Ch8valR {
71        Ch8valR::new(((self.bits >> 8) & 1) != 0)
72    }
73    ///Bit 9 - Channel 9 Current Value
74    #[inline(always)]
75    pub fn ch9val(&self) -> Ch9valR {
76        Ch9valR::new(((self.bits >> 9) & 1) != 0)
77    }
78    ///Bit 10 - Channel 10 Current Value
79    #[inline(always)]
80    pub fn ch10val(&self) -> Ch10valR {
81        Ch10valR::new(((self.bits >> 10) & 1) != 0)
82    }
83    ///Bit 11 - Channel 11 Current Value
84    #[inline(always)]
85    pub fn ch11val(&self) -> Ch11valR {
86        Ch11valR::new(((self.bits >> 11) & 1) != 0)
87    }
88}
89impl core::fmt::Debug for R {
90    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
91        f.debug_struct("PEEK")
92            .field("ch0val", &self.ch0val())
93            .field("ch1val", &self.ch1val())
94            .field("ch2val", &self.ch2val())
95            .field("ch3val", &self.ch3val())
96            .field("ch4val", &self.ch4val())
97            .field("ch5val", &self.ch5val())
98            .field("ch6val", &self.ch6val())
99            .field("ch7val", &self.ch7val())
100            .field("ch8val", &self.ch8val())
101            .field("ch9val", &self.ch9val())
102            .field("ch10val", &self.ch10val())
103            .field("ch11val", &self.ch11val())
104            .finish()
105    }
106}
107///PRS Channel Values
108///
109///You can [`read`](crate::Reg::read) this register and get [`peek::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
110pub struct PEEKrs;
111impl crate::RegisterSpec for PEEKrs {
112    type Ux = u32;
113}
114///`read()` method returns [`peek::R`](R) reader structure
115impl crate::Readable for PEEKrs {}
116///`reset()` method sets PEEK to value 0
117impl crate::Resettable for PEEKrs {}