tm4c129x/adc0/
ssdc0.rs

1#[doc = "Reader of register SSDC0"]
2pub type R = crate::R<u32, super::SSDC0>;
3#[doc = "Writer for register SSDC0"]
4pub type W = crate::W<u32, super::SSDC0>;
5#[doc = "Register SSDC0 `reset()`'s with value 0"]
6impl crate::ResetValue for super::SSDC0 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `S0DCSEL`"]
14pub type S0DCSEL_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `S0DCSEL`"]
16pub struct S0DCSEL_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> S0DCSEL_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f);
24        self.w
25    }
26}
27#[doc = "Reader of field `S1DCSEL`"]
28pub type S1DCSEL_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `S1DCSEL`"]
30pub struct S1DCSEL_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> S1DCSEL_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u32) & 0x0f) << 4);
38        self.w
39    }
40}
41#[doc = "Reader of field `S2DCSEL`"]
42pub type S2DCSEL_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `S2DCSEL`"]
44pub struct S2DCSEL_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> S2DCSEL_W<'a> {
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub unsafe fn bits(self, value: u8) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
52        self.w
53    }
54}
55#[doc = "Reader of field `S3DCSEL`"]
56pub type S3DCSEL_R = crate::R<u8, u8>;
57#[doc = "Write proxy for field `S3DCSEL`"]
58pub struct S3DCSEL_W<'a> {
59    w: &'a mut W,
60}
61impl<'a> S3DCSEL_W<'a> {
62    #[doc = r"Writes raw bits to the field"]
63    #[inline(always)]
64    pub unsafe fn bits(self, value: u8) -> &'a mut W {
65        self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12);
66        self.w
67    }
68}
69#[doc = "Reader of field `S4DCSEL`"]
70pub type S4DCSEL_R = crate::R<u8, u8>;
71#[doc = "Write proxy for field `S4DCSEL`"]
72pub struct S4DCSEL_W<'a> {
73    w: &'a mut W,
74}
75impl<'a> S4DCSEL_W<'a> {
76    #[doc = r"Writes raw bits to the field"]
77    #[inline(always)]
78    pub unsafe fn bits(self, value: u8) -> &'a mut W {
79        self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16);
80        self.w
81    }
82}
83#[doc = "Reader of field `S5DCSEL`"]
84pub type S5DCSEL_R = crate::R<u8, u8>;
85#[doc = "Write proxy for field `S5DCSEL`"]
86pub struct S5DCSEL_W<'a> {
87    w: &'a mut W,
88}
89impl<'a> S5DCSEL_W<'a> {
90    #[doc = r"Writes raw bits to the field"]
91    #[inline(always)]
92    pub unsafe fn bits(self, value: u8) -> &'a mut W {
93        self.w.bits = (self.w.bits & !(0x0f << 20)) | (((value as u32) & 0x0f) << 20);
94        self.w
95    }
96}
97#[doc = "Reader of field `S6DCSEL`"]
98pub type S6DCSEL_R = crate::R<u8, u8>;
99#[doc = "Write proxy for field `S6DCSEL`"]
100pub struct S6DCSEL_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> S6DCSEL_W<'a> {
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub unsafe fn bits(self, value: u8) -> &'a mut W {
107        self.w.bits = (self.w.bits & !(0x0f << 24)) | (((value as u32) & 0x0f) << 24);
108        self.w
109    }
110}
111#[doc = "Reader of field `S7DCSEL`"]
112pub type S7DCSEL_R = crate::R<u8, u8>;
113#[doc = "Write proxy for field `S7DCSEL`"]
114pub struct S7DCSEL_W<'a> {
115    w: &'a mut W,
116}
117impl<'a> S7DCSEL_W<'a> {
118    #[doc = r"Writes raw bits to the field"]
119    #[inline(always)]
120    pub unsafe fn bits(self, value: u8) -> &'a mut W {
121        self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28);
122        self.w
123    }
124}
125impl R {
126    #[doc = "Bits 0:3 - Sample 0 Digital Comparator Select"]
127    #[inline(always)]
128    pub fn s0dcsel(&self) -> S0DCSEL_R {
129        S0DCSEL_R::new((self.bits & 0x0f) as u8)
130    }
131    #[doc = "Bits 4:7 - Sample 1 Digital Comparator Select"]
132    #[inline(always)]
133    pub fn s1dcsel(&self) -> S1DCSEL_R {
134        S1DCSEL_R::new(((self.bits >> 4) & 0x0f) as u8)
135    }
136    #[doc = "Bits 8:11 - Sample 2 Digital Comparator Select"]
137    #[inline(always)]
138    pub fn s2dcsel(&self) -> S2DCSEL_R {
139        S2DCSEL_R::new(((self.bits >> 8) & 0x0f) as u8)
140    }
141    #[doc = "Bits 12:15 - Sample 3 Digital Comparator Select"]
142    #[inline(always)]
143    pub fn s3dcsel(&self) -> S3DCSEL_R {
144        S3DCSEL_R::new(((self.bits >> 12) & 0x0f) as u8)
145    }
146    #[doc = "Bits 16:19 - Sample 4 Digital Comparator Select"]
147    #[inline(always)]
148    pub fn s4dcsel(&self) -> S4DCSEL_R {
149        S4DCSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
150    }
151    #[doc = "Bits 20:23 - Sample 5 Digital Comparator Select"]
152    #[inline(always)]
153    pub fn s5dcsel(&self) -> S5DCSEL_R {
154        S5DCSEL_R::new(((self.bits >> 20) & 0x0f) as u8)
155    }
156    #[doc = "Bits 24:27 - Sample 6 Digital Comparator Select"]
157    #[inline(always)]
158    pub fn s6dcsel(&self) -> S6DCSEL_R {
159        S6DCSEL_R::new(((self.bits >> 24) & 0x0f) as u8)
160    }
161    #[doc = "Bits 28:31 - Sample 7 Digital Comparator Select"]
162    #[inline(always)]
163    pub fn s7dcsel(&self) -> S7DCSEL_R {
164        S7DCSEL_R::new(((self.bits >> 28) & 0x0f) as u8)
165    }
166}
167impl W {
168    #[doc = "Bits 0:3 - Sample 0 Digital Comparator Select"]
169    #[inline(always)]
170    pub fn s0dcsel(&mut self) -> S0DCSEL_W {
171        S0DCSEL_W { w: self }
172    }
173    #[doc = "Bits 4:7 - Sample 1 Digital Comparator Select"]
174    #[inline(always)]
175    pub fn s1dcsel(&mut self) -> S1DCSEL_W {
176        S1DCSEL_W { w: self }
177    }
178    #[doc = "Bits 8:11 - Sample 2 Digital Comparator Select"]
179    #[inline(always)]
180    pub fn s2dcsel(&mut self) -> S2DCSEL_W {
181        S2DCSEL_W { w: self }
182    }
183    #[doc = "Bits 12:15 - Sample 3 Digital Comparator Select"]
184    #[inline(always)]
185    pub fn s3dcsel(&mut self) -> S3DCSEL_W {
186        S3DCSEL_W { w: self }
187    }
188    #[doc = "Bits 16:19 - Sample 4 Digital Comparator Select"]
189    #[inline(always)]
190    pub fn s4dcsel(&mut self) -> S4DCSEL_W {
191        S4DCSEL_W { w: self }
192    }
193    #[doc = "Bits 20:23 - Sample 5 Digital Comparator Select"]
194    #[inline(always)]
195    pub fn s5dcsel(&mut self) -> S5DCSEL_W {
196        S5DCSEL_W { w: self }
197    }
198    #[doc = "Bits 24:27 - Sample 6 Digital Comparator Select"]
199    #[inline(always)]
200    pub fn s6dcsel(&mut self) -> S6DCSEL_W {
201        S6DCSEL_W { w: self }
202    }
203    #[doc = "Bits 28:31 - Sample 7 Digital Comparator Select"]
204    #[inline(always)]
205    pub fn s7dcsel(&mut self) -> S7DCSEL_W {
206        S7DCSEL_W { w: self }
207    }
208}