xmc4400/usic0_ch0/
ccfg.rs

1#[doc = "Register `CCFG` reader"]
2pub type R = crate::R<CCFG_SPEC>;
3#[doc = "SSC Protocol Available\n\nValue on reset: 1"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum SSC_A {
6    #[doc = "0: The SSC protocol is not available."]
7    VALUE1 = 0,
8    #[doc = "1: The SSC protocol is available."]
9    VALUE2 = 1,
10}
11impl From<SSC_A> for bool {
12    #[inline(always)]
13    fn from(variant: SSC_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `SSC` reader - SSC Protocol Available"]
18pub type SSC_R = crate::BitReader<SSC_A>;
19impl SSC_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> SSC_A {
23        match self.bits {
24            false => SSC_A::VALUE1,
25            true => SSC_A::VALUE2,
26        }
27    }
28    #[doc = "The SSC protocol is not available."]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == SSC_A::VALUE1
32    }
33    #[doc = "The SSC protocol is available."]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == SSC_A::VALUE2
37    }
38}
39#[doc = "ASC Protocol Available\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum ASC_A {
42    #[doc = "0: The ASC protocol is not available."]
43    VALUE1 = 0,
44    #[doc = "1: The ASC protocol is available."]
45    VALUE2 = 1,
46}
47impl From<ASC_A> for bool {
48    #[inline(always)]
49    fn from(variant: ASC_A) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `ASC` reader - ASC Protocol Available"]
54pub type ASC_R = crate::BitReader<ASC_A>;
55impl ASC_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> ASC_A {
59        match self.bits {
60            false => ASC_A::VALUE1,
61            true => ASC_A::VALUE2,
62        }
63    }
64    #[doc = "The ASC protocol is not available."]
65    #[inline(always)]
66    pub fn is_value1(&self) -> bool {
67        *self == ASC_A::VALUE1
68    }
69    #[doc = "The ASC protocol is available."]
70    #[inline(always)]
71    pub fn is_value2(&self) -> bool {
72        *self == ASC_A::VALUE2
73    }
74}
75#[doc = "IIC Protocol Available\n\nValue on reset: 1"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum IIC_A {
78    #[doc = "0: The IIC protocol is not available."]
79    VALUE1 = 0,
80    #[doc = "1: The IIC protocol is available."]
81    VALUE2 = 1,
82}
83impl From<IIC_A> for bool {
84    #[inline(always)]
85    fn from(variant: IIC_A) -> Self {
86        variant as u8 != 0
87    }
88}
89#[doc = "Field `IIC` reader - IIC Protocol Available"]
90pub type IIC_R = crate::BitReader<IIC_A>;
91impl IIC_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub const fn variant(&self) -> IIC_A {
95        match self.bits {
96            false => IIC_A::VALUE1,
97            true => IIC_A::VALUE2,
98        }
99    }
100    #[doc = "The IIC protocol is not available."]
101    #[inline(always)]
102    pub fn is_value1(&self) -> bool {
103        *self == IIC_A::VALUE1
104    }
105    #[doc = "The IIC protocol is available."]
106    #[inline(always)]
107    pub fn is_value2(&self) -> bool {
108        *self == IIC_A::VALUE2
109    }
110}
111#[doc = "IIS Protocol Available\n\nValue on reset: 1"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum IIS_A {
114    #[doc = "0: The IIS protocol is not available."]
115    VALUE1 = 0,
116    #[doc = "1: The IIS protocol is available."]
117    VALUE2 = 1,
118}
119impl From<IIS_A> for bool {
120    #[inline(always)]
121    fn from(variant: IIS_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `IIS` reader - IIS Protocol Available"]
126pub type IIS_R = crate::BitReader<IIS_A>;
127impl IIS_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> IIS_A {
131        match self.bits {
132            false => IIS_A::VALUE1,
133            true => IIS_A::VALUE2,
134        }
135    }
136    #[doc = "The IIS protocol is not available."]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == IIS_A::VALUE1
140    }
141    #[doc = "The IIS protocol is available."]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == IIS_A::VALUE2
145    }
146}
147#[doc = "Receive FIFO Buffer Available\n\nValue on reset: 1"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum RB_A {
150    #[doc = "0: A receive FIFO buffer is not available."]
151    VALUE1 = 0,
152    #[doc = "1: A receive FIFO buffer is available."]
153    VALUE2 = 1,
154}
155impl From<RB_A> for bool {
156    #[inline(always)]
157    fn from(variant: RB_A) -> Self {
158        variant as u8 != 0
159    }
160}
161#[doc = "Field `RB` reader - Receive FIFO Buffer Available"]
162pub type RB_R = crate::BitReader<RB_A>;
163impl RB_R {
164    #[doc = "Get enumerated values variant"]
165    #[inline(always)]
166    pub const fn variant(&self) -> RB_A {
167        match self.bits {
168            false => RB_A::VALUE1,
169            true => RB_A::VALUE2,
170        }
171    }
172    #[doc = "A receive FIFO buffer is not available."]
173    #[inline(always)]
174    pub fn is_value1(&self) -> bool {
175        *self == RB_A::VALUE1
176    }
177    #[doc = "A receive FIFO buffer is available."]
178    #[inline(always)]
179    pub fn is_value2(&self) -> bool {
180        *self == RB_A::VALUE2
181    }
182}
183#[doc = "Transmit FIFO Buffer Available\n\nValue on reset: 1"]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum TB_A {
186    #[doc = "0: A transmit FIFO buffer is not available."]
187    VALUE1 = 0,
188    #[doc = "1: A transmit FIFO buffer is available."]
189    VALUE2 = 1,
190}
191impl From<TB_A> for bool {
192    #[inline(always)]
193    fn from(variant: TB_A) -> Self {
194        variant as u8 != 0
195    }
196}
197#[doc = "Field `TB` reader - Transmit FIFO Buffer Available"]
198pub type TB_R = crate::BitReader<TB_A>;
199impl TB_R {
200    #[doc = "Get enumerated values variant"]
201    #[inline(always)]
202    pub const fn variant(&self) -> TB_A {
203        match self.bits {
204            false => TB_A::VALUE1,
205            true => TB_A::VALUE2,
206        }
207    }
208    #[doc = "A transmit FIFO buffer is not available."]
209    #[inline(always)]
210    pub fn is_value1(&self) -> bool {
211        *self == TB_A::VALUE1
212    }
213    #[doc = "A transmit FIFO buffer is available."]
214    #[inline(always)]
215    pub fn is_value2(&self) -> bool {
216        *self == TB_A::VALUE2
217    }
218}
219impl R {
220    #[doc = "Bit 0 - SSC Protocol Available"]
221    #[inline(always)]
222    pub fn ssc(&self) -> SSC_R {
223        SSC_R::new((self.bits & 1) != 0)
224    }
225    #[doc = "Bit 1 - ASC Protocol Available"]
226    #[inline(always)]
227    pub fn asc(&self) -> ASC_R {
228        ASC_R::new(((self.bits >> 1) & 1) != 0)
229    }
230    #[doc = "Bit 2 - IIC Protocol Available"]
231    #[inline(always)]
232    pub fn iic(&self) -> IIC_R {
233        IIC_R::new(((self.bits >> 2) & 1) != 0)
234    }
235    #[doc = "Bit 3 - IIS Protocol Available"]
236    #[inline(always)]
237    pub fn iis(&self) -> IIS_R {
238        IIS_R::new(((self.bits >> 3) & 1) != 0)
239    }
240    #[doc = "Bit 6 - Receive FIFO Buffer Available"]
241    #[inline(always)]
242    pub fn rb(&self) -> RB_R {
243        RB_R::new(((self.bits >> 6) & 1) != 0)
244    }
245    #[doc = "Bit 7 - Transmit FIFO Buffer Available"]
246    #[inline(always)]
247    pub fn tb(&self) -> TB_R {
248        TB_R::new(((self.bits >> 7) & 1) != 0)
249    }
250}
251#[doc = "Channel Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ccfg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
252pub struct CCFG_SPEC;
253impl crate::RegisterSpec for CCFG_SPEC {
254    type Ux = u32;
255}
256#[doc = "`read()` method returns [`ccfg::R`](R) reader structure"]
257impl crate::Readable for CCFG_SPEC {}
258#[doc = "`reset()` method sets CCFG to value 0xcf"]
259impl crate::Resettable for CCFG_SPEC {
260    const RESET_VALUE: u32 = 0xcf;
261}