1 | #![allow (clippy::missing_safety_doc)] |
2 | #![allow (clippy::identity_op)] |
3 | #![allow (clippy::unnecessary_cast)] |
4 | #![allow (clippy::erasing_op)] |
5 | |
6 | #[doc = "DMA2D controller" ] |
7 | #[derive (Copy, Clone, Eq, PartialEq)] |
8 | pub struct Dma2d { |
9 | ptr: *mut u8, |
10 | } |
11 | unsafe impl Send for Dma2d {} |
12 | unsafe impl Sync for Dma2d {} |
13 | impl Dma2d { |
14 | #[inline (always)] |
15 | pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { |
16 | Self { ptr: ptr as _ } |
17 | } |
18 | #[inline (always)] |
19 | pub const fn as_ptr(&self) -> *mut () { |
20 | self.ptr as _ |
21 | } |
22 | #[doc = "control register" ] |
23 | #[inline (always)] |
24 | pub const fn cr(self) -> crate::common::Reg<regs::Cr, crate::common::RW> { |
25 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0usize) as _) } |
26 | } |
27 | #[doc = "Interrupt Status Register" ] |
28 | #[inline (always)] |
29 | pub const fn isr(self) -> crate::common::Reg<regs::Isr, crate::common::R> { |
30 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x04usize) as _) } |
31 | } |
32 | #[doc = "interrupt flag clear register" ] |
33 | #[inline (always)] |
34 | pub const fn ifcr(self) -> crate::common::Reg<regs::Ifcr, crate::common::RW> { |
35 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) } |
36 | } |
37 | #[doc = "foreground memory address register" ] |
38 | #[inline (always)] |
39 | pub const fn fgmar(self) -> crate::common::Reg<regs::Fgmar, crate::common::RW> { |
40 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) } |
41 | } |
42 | #[doc = "foreground offset register" ] |
43 | #[inline (always)] |
44 | pub const fn fgor(self) -> crate::common::Reg<regs::Fgor, crate::common::RW> { |
45 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) } |
46 | } |
47 | #[doc = "background memory address register" ] |
48 | #[inline (always)] |
49 | pub const fn bgmar(self) -> crate::common::Reg<regs::Bgmar, crate::common::RW> { |
50 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) } |
51 | } |
52 | #[doc = "background offset register" ] |
53 | #[inline (always)] |
54 | pub const fn bgor(self) -> crate::common::Reg<regs::Bgor, crate::common::RW> { |
55 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) } |
56 | } |
57 | #[doc = "foreground PFC control register" ] |
58 | #[inline (always)] |
59 | pub const fn fgpfccr(self) -> crate::common::Reg<regs::Fgpfccr, crate::common::RW> { |
60 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1cusize) as _) } |
61 | } |
62 | #[doc = "foreground color register" ] |
63 | #[inline (always)] |
64 | pub const fn fgcolr(self) -> crate::common::Reg<regs::Fgcolr, crate::common::RW> { |
65 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x20usize) as _) } |
66 | } |
67 | #[doc = "background PFC control register" ] |
68 | #[inline (always)] |
69 | pub const fn bgpfccr(self) -> crate::common::Reg<regs::Bgpfccr, crate::common::RW> { |
70 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) } |
71 | } |
72 | #[doc = "background color register" ] |
73 | #[inline (always)] |
74 | pub const fn bgcolr(self) -> crate::common::Reg<regs::Bgcolr, crate::common::RW> { |
75 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x28usize) as _) } |
76 | } |
77 | #[doc = "foreground CLUT memory address register" ] |
78 | #[inline (always)] |
79 | pub const fn fgcmar(self) -> crate::common::Reg<regs::Fgcmar, crate::common::RW> { |
80 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2cusize) as _) } |
81 | } |
82 | #[doc = "background CLUT memory address register" ] |
83 | #[inline (always)] |
84 | pub const fn bgcmar(self) -> crate::common::Reg<regs::Bgcmar, crate::common::RW> { |
85 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x30usize) as _) } |
86 | } |
87 | #[doc = "output PFC control register" ] |
88 | #[inline (always)] |
89 | pub const fn opfccr(self) -> crate::common::Reg<regs::Opfccr, crate::common::RW> { |
90 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x34usize) as _) } |
91 | } |
92 | #[doc = "output color register" ] |
93 | #[inline (always)] |
94 | pub const fn ocolr(self) -> crate::common::Reg<regs::Ocolr, crate::common::RW> { |
95 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x38usize) as _) } |
96 | } |
97 | #[doc = "output memory address register" ] |
98 | #[inline (always)] |
99 | pub const fn omar(self) -> crate::common::Reg<regs::Omar, crate::common::RW> { |
100 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x3cusize) as _) } |
101 | } |
102 | #[doc = "output offset register" ] |
103 | #[inline (always)] |
104 | pub const fn oor(self) -> crate::common::Reg<regs::Oor, crate::common::RW> { |
105 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x40usize) as _) } |
106 | } |
107 | #[doc = "number of line register" ] |
108 | #[inline (always)] |
109 | pub const fn nlr(self) -> crate::common::Reg<regs::Nlr, crate::common::RW> { |
110 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x44usize) as _) } |
111 | } |
112 | #[doc = "line watermark register" ] |
113 | #[inline (always)] |
114 | pub const fn lwr(self) -> crate::common::Reg<regs::Lwr, crate::common::RW> { |
115 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x48usize) as _) } |
116 | } |
117 | #[doc = "AHB master timer configuration register" ] |
118 | #[inline (always)] |
119 | pub const fn amtcr(self) -> crate::common::Reg<regs::Amtcr, crate::common::RW> { |
120 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x4cusize) as _) } |
121 | } |
122 | #[doc = "FGCLUT" ] |
123 | #[inline (always)] |
124 | pub const fn fgclut(self) -> crate::common::Reg<regs::Fgclut, crate::common::RW> { |
125 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0400usize) as _) } |
126 | } |
127 | #[doc = "BGCLUT" ] |
128 | #[inline (always)] |
129 | pub const fn bgclut(self) -> crate::common::Reg<regs::Bgclut, crate::common::RW> { |
130 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0800usize) as _) } |
131 | } |
132 | } |
133 | pub mod regs { |
134 | #[doc = "AHB master timer configuration register" ] |
135 | #[repr (transparent)] |
136 | #[derive (Copy, Clone, Eq, PartialEq)] |
137 | pub struct Amtcr(pub u32); |
138 | impl Amtcr { |
139 | #[doc = "Enable" ] |
140 | #[inline (always)] |
141 | pub const fn en(&self) -> bool { |
142 | let val = (self.0 >> 0usize) & 0x01; |
143 | val != 0 |
144 | } |
145 | #[doc = "Enable" ] |
146 | #[inline (always)] |
147 | pub fn set_en(&mut self, val: bool) { |
148 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
149 | } |
150 | #[doc = "Dead Time" ] |
151 | #[inline (always)] |
152 | pub const fn dt(&self) -> u8 { |
153 | let val = (self.0 >> 8usize) & 0xff; |
154 | val as u8 |
155 | } |
156 | #[doc = "Dead Time" ] |
157 | #[inline (always)] |
158 | pub fn set_dt(&mut self, val: u8) { |
159 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
160 | } |
161 | } |
162 | impl Default for Amtcr { |
163 | #[inline (always)] |
164 | fn default() -> Amtcr { |
165 | Amtcr(0) |
166 | } |
167 | } |
168 | impl core::fmt::Debug for Amtcr { |
169 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
170 | f.debug_struct("Amtcr" ) |
171 | .field("en" , &self.en()) |
172 | .field("dt" , &self.dt()) |
173 | .finish() |
174 | } |
175 | } |
176 | #[cfg (feature = "defmt" )] |
177 | impl defmt::Format for Amtcr { |
178 | fn format(&self, f: defmt::Formatter) { |
179 | #[derive (defmt :: Format)] |
180 | struct Amtcr { |
181 | en: bool, |
182 | dt: u8, |
183 | } |
184 | let proxy = Amtcr { |
185 | en: self.en(), |
186 | dt: self.dt(), |
187 | }; |
188 | defmt::write!(f, "{}" , proxy) |
189 | } |
190 | } |
191 | #[doc = "BGCLUT" ] |
192 | #[repr (transparent)] |
193 | #[derive (Copy, Clone, Eq, PartialEq)] |
194 | pub struct Bgclut(pub u32); |
195 | impl Bgclut { |
196 | #[doc = "BLUE" ] |
197 | #[inline (always)] |
198 | pub const fn blue(&self) -> u8 { |
199 | let val = (self.0 >> 0usize) & 0xff; |
200 | val as u8 |
201 | } |
202 | #[doc = "BLUE" ] |
203 | #[inline (always)] |
204 | pub fn set_blue(&mut self, val: u8) { |
205 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
206 | } |
207 | #[doc = "GREEN" ] |
208 | #[inline (always)] |
209 | pub const fn green(&self) -> u8 { |
210 | let val = (self.0 >> 8usize) & 0xff; |
211 | val as u8 |
212 | } |
213 | #[doc = "GREEN" ] |
214 | #[inline (always)] |
215 | pub fn set_green(&mut self, val: u8) { |
216 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
217 | } |
218 | #[doc = "RED" ] |
219 | #[inline (always)] |
220 | pub const fn red(&self) -> u8 { |
221 | let val = (self.0 >> 16usize) & 0xff; |
222 | val as u8 |
223 | } |
224 | #[doc = "RED" ] |
225 | #[inline (always)] |
226 | pub fn set_red(&mut self, val: u8) { |
227 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
228 | } |
229 | #[doc = "APLHA" ] |
230 | #[inline (always)] |
231 | pub const fn aplha(&self) -> u8 { |
232 | let val = (self.0 >> 24usize) & 0xff; |
233 | val as u8 |
234 | } |
235 | #[doc = "APLHA" ] |
236 | #[inline (always)] |
237 | pub fn set_aplha(&mut self, val: u8) { |
238 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
239 | } |
240 | } |
241 | impl Default for Bgclut { |
242 | #[inline (always)] |
243 | fn default() -> Bgclut { |
244 | Bgclut(0) |
245 | } |
246 | } |
247 | impl core::fmt::Debug for Bgclut { |
248 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
249 | f.debug_struct("Bgclut" ) |
250 | .field("blue" , &self.blue()) |
251 | .field("green" , &self.green()) |
252 | .field("red" , &self.red()) |
253 | .field("aplha" , &self.aplha()) |
254 | .finish() |
255 | } |
256 | } |
257 | #[cfg (feature = "defmt" )] |
258 | impl defmt::Format for Bgclut { |
259 | fn format(&self, f: defmt::Formatter) { |
260 | #[derive (defmt :: Format)] |
261 | struct Bgclut { |
262 | blue: u8, |
263 | green: u8, |
264 | red: u8, |
265 | aplha: u8, |
266 | } |
267 | let proxy = Bgclut { |
268 | blue: self.blue(), |
269 | green: self.green(), |
270 | red: self.red(), |
271 | aplha: self.aplha(), |
272 | }; |
273 | defmt::write!(f, "{}" , proxy) |
274 | } |
275 | } |
276 | #[doc = "background CLUT memory address register" ] |
277 | #[repr (transparent)] |
278 | #[derive (Copy, Clone, Eq, PartialEq)] |
279 | pub struct Bgcmar(pub u32); |
280 | impl Bgcmar { |
281 | #[doc = "Memory address" ] |
282 | #[inline (always)] |
283 | pub const fn ma(&self) -> u32 { |
284 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
285 | val as u32 |
286 | } |
287 | #[doc = "Memory address" ] |
288 | #[inline (always)] |
289 | pub fn set_ma(&mut self, val: u32) { |
290 | self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
291 | } |
292 | } |
293 | impl Default for Bgcmar { |
294 | #[inline (always)] |
295 | fn default() -> Bgcmar { |
296 | Bgcmar(0) |
297 | } |
298 | } |
299 | impl core::fmt::Debug for Bgcmar { |
300 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
301 | f.debug_struct("Bgcmar" ).field("ma" , &self.ma()).finish() |
302 | } |
303 | } |
304 | #[cfg (feature = "defmt" )] |
305 | impl defmt::Format for Bgcmar { |
306 | fn format(&self, f: defmt::Formatter) { |
307 | #[derive (defmt :: Format)] |
308 | struct Bgcmar { |
309 | ma: u32, |
310 | } |
311 | let proxy = Bgcmar { ma: self.ma() }; |
312 | defmt::write!(f, "{}" , proxy) |
313 | } |
314 | } |
315 | #[doc = "background color register" ] |
316 | #[repr (transparent)] |
317 | #[derive (Copy, Clone, Eq, PartialEq)] |
318 | pub struct Bgcolr(pub u32); |
319 | impl Bgcolr { |
320 | #[doc = "Blue Value" ] |
321 | #[inline (always)] |
322 | pub const fn blue(&self) -> u8 { |
323 | let val = (self.0 >> 0usize) & 0xff; |
324 | val as u8 |
325 | } |
326 | #[doc = "Blue Value" ] |
327 | #[inline (always)] |
328 | pub fn set_blue(&mut self, val: u8) { |
329 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
330 | } |
331 | #[doc = "Green Value" ] |
332 | #[inline (always)] |
333 | pub const fn green(&self) -> u8 { |
334 | let val = (self.0 >> 8usize) & 0xff; |
335 | val as u8 |
336 | } |
337 | #[doc = "Green Value" ] |
338 | #[inline (always)] |
339 | pub fn set_green(&mut self, val: u8) { |
340 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
341 | } |
342 | #[doc = "Red Value" ] |
343 | #[inline (always)] |
344 | pub const fn red(&self) -> u8 { |
345 | let val = (self.0 >> 16usize) & 0xff; |
346 | val as u8 |
347 | } |
348 | #[doc = "Red Value" ] |
349 | #[inline (always)] |
350 | pub fn set_red(&mut self, val: u8) { |
351 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
352 | } |
353 | } |
354 | impl Default for Bgcolr { |
355 | #[inline (always)] |
356 | fn default() -> Bgcolr { |
357 | Bgcolr(0) |
358 | } |
359 | } |
360 | impl core::fmt::Debug for Bgcolr { |
361 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
362 | f.debug_struct("Bgcolr" ) |
363 | .field("blue" , &self.blue()) |
364 | .field("green" , &self.green()) |
365 | .field("red" , &self.red()) |
366 | .finish() |
367 | } |
368 | } |
369 | #[cfg (feature = "defmt" )] |
370 | impl defmt::Format for Bgcolr { |
371 | fn format(&self, f: defmt::Formatter) { |
372 | #[derive (defmt :: Format)] |
373 | struct Bgcolr { |
374 | blue: u8, |
375 | green: u8, |
376 | red: u8, |
377 | } |
378 | let proxy = Bgcolr { |
379 | blue: self.blue(), |
380 | green: self.green(), |
381 | red: self.red(), |
382 | }; |
383 | defmt::write!(f, "{}" , proxy) |
384 | } |
385 | } |
386 | #[doc = "background memory address register" ] |
387 | #[repr (transparent)] |
388 | #[derive (Copy, Clone, Eq, PartialEq)] |
389 | pub struct Bgmar(pub u32); |
390 | impl Bgmar { |
391 | #[doc = "Memory address" ] |
392 | #[inline (always)] |
393 | pub const fn ma(&self) -> u32 { |
394 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
395 | val as u32 |
396 | } |
397 | #[doc = "Memory address" ] |
398 | #[inline (always)] |
399 | pub fn set_ma(&mut self, val: u32) { |
400 | self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
401 | } |
402 | } |
403 | impl Default for Bgmar { |
404 | #[inline (always)] |
405 | fn default() -> Bgmar { |
406 | Bgmar(0) |
407 | } |
408 | } |
409 | impl core::fmt::Debug for Bgmar { |
410 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
411 | f.debug_struct("Bgmar" ).field("ma" , &self.ma()).finish() |
412 | } |
413 | } |
414 | #[cfg (feature = "defmt" )] |
415 | impl defmt::Format for Bgmar { |
416 | fn format(&self, f: defmt::Formatter) { |
417 | #[derive (defmt :: Format)] |
418 | struct Bgmar { |
419 | ma: u32, |
420 | } |
421 | let proxy = Bgmar { ma: self.ma() }; |
422 | defmt::write!(f, "{}" , proxy) |
423 | } |
424 | } |
425 | #[doc = "background offset register" ] |
426 | #[repr (transparent)] |
427 | #[derive (Copy, Clone, Eq, PartialEq)] |
428 | pub struct Bgor(pub u32); |
429 | impl Bgor { |
430 | #[doc = "Line offset" ] |
431 | #[inline (always)] |
432 | pub const fn lo(&self) -> u16 { |
433 | let val = (self.0 >> 0usize) & 0x3fff; |
434 | val as u16 |
435 | } |
436 | #[doc = "Line offset" ] |
437 | #[inline (always)] |
438 | pub fn set_lo(&mut self, val: u16) { |
439 | self.0 = (self.0 & !(0x3fff << 0usize)) | (((val as u32) & 0x3fff) << 0usize); |
440 | } |
441 | } |
442 | impl Default for Bgor { |
443 | #[inline (always)] |
444 | fn default() -> Bgor { |
445 | Bgor(0) |
446 | } |
447 | } |
448 | impl core::fmt::Debug for Bgor { |
449 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
450 | f.debug_struct("Bgor" ).field("lo" , &self.lo()).finish() |
451 | } |
452 | } |
453 | #[cfg (feature = "defmt" )] |
454 | impl defmt::Format for Bgor { |
455 | fn format(&self, f: defmt::Formatter) { |
456 | #[derive (defmt :: Format)] |
457 | struct Bgor { |
458 | lo: u16, |
459 | } |
460 | let proxy = Bgor { lo: self.lo() }; |
461 | defmt::write!(f, "{}" , proxy) |
462 | } |
463 | } |
464 | #[doc = "background PFC control register" ] |
465 | #[repr (transparent)] |
466 | #[derive (Copy, Clone, Eq, PartialEq)] |
467 | pub struct Bgpfccr(pub u32); |
468 | impl Bgpfccr { |
469 | #[doc = "Color mode" ] |
470 | #[inline (always)] |
471 | pub const fn cm(&self) -> super::vals::BgpfccrCm { |
472 | let val = (self.0 >> 0usize) & 0x0f; |
473 | super::vals::BgpfccrCm::from_bits(val as u8) |
474 | } |
475 | #[doc = "Color mode" ] |
476 | #[inline (always)] |
477 | pub fn set_cm(&mut self, val: super::vals::BgpfccrCm) { |
478 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val.to_bits() as u32) & 0x0f) << 0usize); |
479 | } |
480 | #[doc = "CLUT Color mode" ] |
481 | #[inline (always)] |
482 | pub const fn ccm(&self) -> super::vals::BgpfccrCcm { |
483 | let val = (self.0 >> 4usize) & 0x01; |
484 | super::vals::BgpfccrCcm::from_bits(val as u8) |
485 | } |
486 | #[doc = "CLUT Color mode" ] |
487 | #[inline (always)] |
488 | pub fn set_ccm(&mut self, val: super::vals::BgpfccrCcm) { |
489 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.to_bits() as u32) & 0x01) << 4usize); |
490 | } |
491 | #[doc = "Start" ] |
492 | #[inline (always)] |
493 | pub const fn start(&self) -> super::vals::BgpfccrStart { |
494 | let val = (self.0 >> 5usize) & 0x01; |
495 | super::vals::BgpfccrStart::from_bits(val as u8) |
496 | } |
497 | #[doc = "Start" ] |
498 | #[inline (always)] |
499 | pub fn set_start(&mut self, val: super::vals::BgpfccrStart) { |
500 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.to_bits() as u32) & 0x01) << 5usize); |
501 | } |
502 | #[doc = "CLUT size" ] |
503 | #[inline (always)] |
504 | pub const fn cs(&self) -> u8 { |
505 | let val = (self.0 >> 8usize) & 0xff; |
506 | val as u8 |
507 | } |
508 | #[doc = "CLUT size" ] |
509 | #[inline (always)] |
510 | pub fn set_cs(&mut self, val: u8) { |
511 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
512 | } |
513 | #[doc = "Alpha mode" ] |
514 | #[inline (always)] |
515 | pub const fn am(&self) -> super::vals::BgpfccrAm { |
516 | let val = (self.0 >> 16usize) & 0x03; |
517 | super::vals::BgpfccrAm::from_bits(val as u8) |
518 | } |
519 | #[doc = "Alpha mode" ] |
520 | #[inline (always)] |
521 | pub fn set_am(&mut self, val: super::vals::BgpfccrAm) { |
522 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.to_bits() as u32) & 0x03) << 16usize); |
523 | } |
524 | #[doc = "Alpha value" ] |
525 | #[inline (always)] |
526 | pub const fn alpha(&self) -> u8 { |
527 | let val = (self.0 >> 24usize) & 0xff; |
528 | val as u8 |
529 | } |
530 | #[doc = "Alpha value" ] |
531 | #[inline (always)] |
532 | pub fn set_alpha(&mut self, val: u8) { |
533 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
534 | } |
535 | } |
536 | impl Default for Bgpfccr { |
537 | #[inline (always)] |
538 | fn default() -> Bgpfccr { |
539 | Bgpfccr(0) |
540 | } |
541 | } |
542 | impl core::fmt::Debug for Bgpfccr { |
543 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
544 | f.debug_struct("Bgpfccr" ) |
545 | .field("cm" , &self.cm()) |
546 | .field("ccm" , &self.ccm()) |
547 | .field("start" , &self.start()) |
548 | .field("cs" , &self.cs()) |
549 | .field("am" , &self.am()) |
550 | .field("alpha" , &self.alpha()) |
551 | .finish() |
552 | } |
553 | } |
554 | #[cfg (feature = "defmt" )] |
555 | impl defmt::Format for Bgpfccr { |
556 | fn format(&self, f: defmt::Formatter) { |
557 | #[derive (defmt :: Format)] |
558 | struct Bgpfccr { |
559 | cm: super::vals::BgpfccrCm, |
560 | ccm: super::vals::BgpfccrCcm, |
561 | start: super::vals::BgpfccrStart, |
562 | cs: u8, |
563 | am: super::vals::BgpfccrAm, |
564 | alpha: u8, |
565 | } |
566 | let proxy = Bgpfccr { |
567 | cm: self.cm(), |
568 | ccm: self.ccm(), |
569 | start: self.start(), |
570 | cs: self.cs(), |
571 | am: self.am(), |
572 | alpha: self.alpha(), |
573 | }; |
574 | defmt::write!(f, "{}" , proxy) |
575 | } |
576 | } |
577 | #[doc = "control register" ] |
578 | #[repr (transparent)] |
579 | #[derive (Copy, Clone, Eq, PartialEq)] |
580 | pub struct Cr(pub u32); |
581 | impl Cr { |
582 | #[doc = "Start" ] |
583 | #[inline (always)] |
584 | pub const fn start(&self) -> super::vals::CrStart { |
585 | let val = (self.0 >> 0usize) & 0x01; |
586 | super::vals::CrStart::from_bits(val as u8) |
587 | } |
588 | #[doc = "Start" ] |
589 | #[inline (always)] |
590 | pub fn set_start(&mut self, val: super::vals::CrStart) { |
591 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize); |
592 | } |
593 | #[doc = "Suspend" ] |
594 | #[inline (always)] |
595 | pub const fn susp(&self) -> bool { |
596 | let val = (self.0 >> 1usize) & 0x01; |
597 | val != 0 |
598 | } |
599 | #[doc = "Suspend" ] |
600 | #[inline (always)] |
601 | pub fn set_susp(&mut self, val: bool) { |
602 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
603 | } |
604 | #[doc = "Abort" ] |
605 | #[inline (always)] |
606 | pub const fn abort(&self) -> super::vals::Abort { |
607 | let val = (self.0 >> 2usize) & 0x01; |
608 | super::vals::Abort::from_bits(val as u8) |
609 | } |
610 | #[doc = "Abort" ] |
611 | #[inline (always)] |
612 | pub fn set_abort(&mut self, val: super::vals::Abort) { |
613 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.to_bits() as u32) & 0x01) << 2usize); |
614 | } |
615 | #[doc = "Transfer error interrupt enable" ] |
616 | #[inline (always)] |
617 | pub const fn teie(&self) -> bool { |
618 | let val = (self.0 >> 8usize) & 0x01; |
619 | val != 0 |
620 | } |
621 | #[doc = "Transfer error interrupt enable" ] |
622 | #[inline (always)] |
623 | pub fn set_teie(&mut self, val: bool) { |
624 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
625 | } |
626 | #[doc = "Transfer complete interrupt enable" ] |
627 | #[inline (always)] |
628 | pub const fn tcie(&self) -> bool { |
629 | let val = (self.0 >> 9usize) & 0x01; |
630 | val != 0 |
631 | } |
632 | #[doc = "Transfer complete interrupt enable" ] |
633 | #[inline (always)] |
634 | pub fn set_tcie(&mut self, val: bool) { |
635 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
636 | } |
637 | #[doc = "Transfer watermark interrupt enable" ] |
638 | #[inline (always)] |
639 | pub const fn twie(&self) -> bool { |
640 | let val = (self.0 >> 10usize) & 0x01; |
641 | val != 0 |
642 | } |
643 | #[doc = "Transfer watermark interrupt enable" ] |
644 | #[inline (always)] |
645 | pub fn set_twie(&mut self, val: bool) { |
646 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
647 | } |
648 | #[doc = "CLUT access error interrupt enable" ] |
649 | #[inline (always)] |
650 | pub const fn caeie(&self) -> bool { |
651 | let val = (self.0 >> 11usize) & 0x01; |
652 | val != 0 |
653 | } |
654 | #[doc = "CLUT access error interrupt enable" ] |
655 | #[inline (always)] |
656 | pub fn set_caeie(&mut self, val: bool) { |
657 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
658 | } |
659 | #[doc = "CLUT transfer complete interrupt enable" ] |
660 | #[inline (always)] |
661 | pub const fn ctcie(&self) -> bool { |
662 | let val = (self.0 >> 12usize) & 0x01; |
663 | val != 0 |
664 | } |
665 | #[doc = "CLUT transfer complete interrupt enable" ] |
666 | #[inline (always)] |
667 | pub fn set_ctcie(&mut self, val: bool) { |
668 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
669 | } |
670 | #[doc = "Configuration Error Interrupt Enable" ] |
671 | #[inline (always)] |
672 | pub const fn ceie(&self) -> bool { |
673 | let val = (self.0 >> 13usize) & 0x01; |
674 | val != 0 |
675 | } |
676 | #[doc = "Configuration Error Interrupt Enable" ] |
677 | #[inline (always)] |
678 | pub fn set_ceie(&mut self, val: bool) { |
679 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
680 | } |
681 | #[doc = "DMA2D mode" ] |
682 | #[inline (always)] |
683 | pub const fn mode(&self) -> super::vals::Mode { |
684 | let val = (self.0 >> 16usize) & 0x03; |
685 | super::vals::Mode::from_bits(val as u8) |
686 | } |
687 | #[doc = "DMA2D mode" ] |
688 | #[inline (always)] |
689 | pub fn set_mode(&mut self, val: super::vals::Mode) { |
690 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.to_bits() as u32) & 0x03) << 16usize); |
691 | } |
692 | } |
693 | impl Default for Cr { |
694 | #[inline (always)] |
695 | fn default() -> Cr { |
696 | Cr(0) |
697 | } |
698 | } |
699 | impl core::fmt::Debug for Cr { |
700 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
701 | f.debug_struct("Cr" ) |
702 | .field("start" , &self.start()) |
703 | .field("susp" , &self.susp()) |
704 | .field("abort" , &self.abort()) |
705 | .field("teie" , &self.teie()) |
706 | .field("tcie" , &self.tcie()) |
707 | .field("twie" , &self.twie()) |
708 | .field("caeie" , &self.caeie()) |
709 | .field("ctcie" , &self.ctcie()) |
710 | .field("ceie" , &self.ceie()) |
711 | .field("mode" , &self.mode()) |
712 | .finish() |
713 | } |
714 | } |
715 | #[cfg (feature = "defmt" )] |
716 | impl defmt::Format for Cr { |
717 | fn format(&self, f: defmt::Formatter) { |
718 | #[derive (defmt :: Format)] |
719 | struct Cr { |
720 | start: super::vals::CrStart, |
721 | susp: bool, |
722 | abort: super::vals::Abort, |
723 | teie: bool, |
724 | tcie: bool, |
725 | twie: bool, |
726 | caeie: bool, |
727 | ctcie: bool, |
728 | ceie: bool, |
729 | mode: super::vals::Mode, |
730 | } |
731 | let proxy = Cr { |
732 | start: self.start(), |
733 | susp: self.susp(), |
734 | abort: self.abort(), |
735 | teie: self.teie(), |
736 | tcie: self.tcie(), |
737 | twie: self.twie(), |
738 | caeie: self.caeie(), |
739 | ctcie: self.ctcie(), |
740 | ceie: self.ceie(), |
741 | mode: self.mode(), |
742 | }; |
743 | defmt::write!(f, "{}" , proxy) |
744 | } |
745 | } |
746 | #[doc = "FGCLUT" ] |
747 | #[repr (transparent)] |
748 | #[derive (Copy, Clone, Eq, PartialEq)] |
749 | pub struct Fgclut(pub u32); |
750 | impl Fgclut { |
751 | #[doc = "BLUE" ] |
752 | #[inline (always)] |
753 | pub const fn blue(&self) -> u8 { |
754 | let val = (self.0 >> 0usize) & 0xff; |
755 | val as u8 |
756 | } |
757 | #[doc = "BLUE" ] |
758 | #[inline (always)] |
759 | pub fn set_blue(&mut self, val: u8) { |
760 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
761 | } |
762 | #[doc = "GREEN" ] |
763 | #[inline (always)] |
764 | pub const fn green(&self) -> u8 { |
765 | let val = (self.0 >> 8usize) & 0xff; |
766 | val as u8 |
767 | } |
768 | #[doc = "GREEN" ] |
769 | #[inline (always)] |
770 | pub fn set_green(&mut self, val: u8) { |
771 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
772 | } |
773 | #[doc = "RED" ] |
774 | #[inline (always)] |
775 | pub const fn red(&self) -> u8 { |
776 | let val = (self.0 >> 16usize) & 0xff; |
777 | val as u8 |
778 | } |
779 | #[doc = "RED" ] |
780 | #[inline (always)] |
781 | pub fn set_red(&mut self, val: u8) { |
782 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
783 | } |
784 | #[doc = "APLHA" ] |
785 | #[inline (always)] |
786 | pub const fn aplha(&self) -> u8 { |
787 | let val = (self.0 >> 24usize) & 0xff; |
788 | val as u8 |
789 | } |
790 | #[doc = "APLHA" ] |
791 | #[inline (always)] |
792 | pub fn set_aplha(&mut self, val: u8) { |
793 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
794 | } |
795 | } |
796 | impl Default for Fgclut { |
797 | #[inline (always)] |
798 | fn default() -> Fgclut { |
799 | Fgclut(0) |
800 | } |
801 | } |
802 | impl core::fmt::Debug for Fgclut { |
803 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
804 | f.debug_struct("Fgclut" ) |
805 | .field("blue" , &self.blue()) |
806 | .field("green" , &self.green()) |
807 | .field("red" , &self.red()) |
808 | .field("aplha" , &self.aplha()) |
809 | .finish() |
810 | } |
811 | } |
812 | #[cfg (feature = "defmt" )] |
813 | impl defmt::Format for Fgclut { |
814 | fn format(&self, f: defmt::Formatter) { |
815 | #[derive (defmt :: Format)] |
816 | struct Fgclut { |
817 | blue: u8, |
818 | green: u8, |
819 | red: u8, |
820 | aplha: u8, |
821 | } |
822 | let proxy = Fgclut { |
823 | blue: self.blue(), |
824 | green: self.green(), |
825 | red: self.red(), |
826 | aplha: self.aplha(), |
827 | }; |
828 | defmt::write!(f, "{}" , proxy) |
829 | } |
830 | } |
831 | #[doc = "foreground CLUT memory address register" ] |
832 | #[repr (transparent)] |
833 | #[derive (Copy, Clone, Eq, PartialEq)] |
834 | pub struct Fgcmar(pub u32); |
835 | impl Fgcmar { |
836 | #[doc = "Memory Address" ] |
837 | #[inline (always)] |
838 | pub const fn ma(&self) -> u32 { |
839 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
840 | val as u32 |
841 | } |
842 | #[doc = "Memory Address" ] |
843 | #[inline (always)] |
844 | pub fn set_ma(&mut self, val: u32) { |
845 | self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
846 | } |
847 | } |
848 | impl Default for Fgcmar { |
849 | #[inline (always)] |
850 | fn default() -> Fgcmar { |
851 | Fgcmar(0) |
852 | } |
853 | } |
854 | impl core::fmt::Debug for Fgcmar { |
855 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
856 | f.debug_struct("Fgcmar" ).field("ma" , &self.ma()).finish() |
857 | } |
858 | } |
859 | #[cfg (feature = "defmt" )] |
860 | impl defmt::Format for Fgcmar { |
861 | fn format(&self, f: defmt::Formatter) { |
862 | #[derive (defmt :: Format)] |
863 | struct Fgcmar { |
864 | ma: u32, |
865 | } |
866 | let proxy = Fgcmar { ma: self.ma() }; |
867 | defmt::write!(f, "{}" , proxy) |
868 | } |
869 | } |
870 | #[doc = "foreground color register" ] |
871 | #[repr (transparent)] |
872 | #[derive (Copy, Clone, Eq, PartialEq)] |
873 | pub struct Fgcolr(pub u32); |
874 | impl Fgcolr { |
875 | #[doc = "Blue Value" ] |
876 | #[inline (always)] |
877 | pub const fn blue(&self) -> u8 { |
878 | let val = (self.0 >> 0usize) & 0xff; |
879 | val as u8 |
880 | } |
881 | #[doc = "Blue Value" ] |
882 | #[inline (always)] |
883 | pub fn set_blue(&mut self, val: u8) { |
884 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
885 | } |
886 | #[doc = "Green Value" ] |
887 | #[inline (always)] |
888 | pub const fn green(&self) -> u8 { |
889 | let val = (self.0 >> 8usize) & 0xff; |
890 | val as u8 |
891 | } |
892 | #[doc = "Green Value" ] |
893 | #[inline (always)] |
894 | pub fn set_green(&mut self, val: u8) { |
895 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
896 | } |
897 | #[doc = "Red Value" ] |
898 | #[inline (always)] |
899 | pub const fn red(&self) -> u8 { |
900 | let val = (self.0 >> 16usize) & 0xff; |
901 | val as u8 |
902 | } |
903 | #[doc = "Red Value" ] |
904 | #[inline (always)] |
905 | pub fn set_red(&mut self, val: u8) { |
906 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
907 | } |
908 | } |
909 | impl Default for Fgcolr { |
910 | #[inline (always)] |
911 | fn default() -> Fgcolr { |
912 | Fgcolr(0) |
913 | } |
914 | } |
915 | impl core::fmt::Debug for Fgcolr { |
916 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
917 | f.debug_struct("Fgcolr" ) |
918 | .field("blue" , &self.blue()) |
919 | .field("green" , &self.green()) |
920 | .field("red" , &self.red()) |
921 | .finish() |
922 | } |
923 | } |
924 | #[cfg (feature = "defmt" )] |
925 | impl defmt::Format for Fgcolr { |
926 | fn format(&self, f: defmt::Formatter) { |
927 | #[derive (defmt :: Format)] |
928 | struct Fgcolr { |
929 | blue: u8, |
930 | green: u8, |
931 | red: u8, |
932 | } |
933 | let proxy = Fgcolr { |
934 | blue: self.blue(), |
935 | green: self.green(), |
936 | red: self.red(), |
937 | }; |
938 | defmt::write!(f, "{}" , proxy) |
939 | } |
940 | } |
941 | #[doc = "foreground memory address register" ] |
942 | #[repr (transparent)] |
943 | #[derive (Copy, Clone, Eq, PartialEq)] |
944 | pub struct Fgmar(pub u32); |
945 | impl Fgmar { |
946 | #[doc = "Memory address" ] |
947 | #[inline (always)] |
948 | pub const fn ma(&self) -> u32 { |
949 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
950 | val as u32 |
951 | } |
952 | #[doc = "Memory address" ] |
953 | #[inline (always)] |
954 | pub fn set_ma(&mut self, val: u32) { |
955 | self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
956 | } |
957 | } |
958 | impl Default for Fgmar { |
959 | #[inline (always)] |
960 | fn default() -> Fgmar { |
961 | Fgmar(0) |
962 | } |
963 | } |
964 | impl core::fmt::Debug for Fgmar { |
965 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
966 | f.debug_struct("Fgmar" ).field("ma" , &self.ma()).finish() |
967 | } |
968 | } |
969 | #[cfg (feature = "defmt" )] |
970 | impl defmt::Format for Fgmar { |
971 | fn format(&self, f: defmt::Formatter) { |
972 | #[derive (defmt :: Format)] |
973 | struct Fgmar { |
974 | ma: u32, |
975 | } |
976 | let proxy = Fgmar { ma: self.ma() }; |
977 | defmt::write!(f, "{}" , proxy) |
978 | } |
979 | } |
980 | #[doc = "foreground offset register" ] |
981 | #[repr (transparent)] |
982 | #[derive (Copy, Clone, Eq, PartialEq)] |
983 | pub struct Fgor(pub u32); |
984 | impl Fgor { |
985 | #[doc = "Line offset" ] |
986 | #[inline (always)] |
987 | pub const fn lo(&self) -> u16 { |
988 | let val = (self.0 >> 0usize) & 0x3fff; |
989 | val as u16 |
990 | } |
991 | #[doc = "Line offset" ] |
992 | #[inline (always)] |
993 | pub fn set_lo(&mut self, val: u16) { |
994 | self.0 = (self.0 & !(0x3fff << 0usize)) | (((val as u32) & 0x3fff) << 0usize); |
995 | } |
996 | } |
997 | impl Default for Fgor { |
998 | #[inline (always)] |
999 | fn default() -> Fgor { |
1000 | Fgor(0) |
1001 | } |
1002 | } |
1003 | impl core::fmt::Debug for Fgor { |
1004 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1005 | f.debug_struct("Fgor" ).field("lo" , &self.lo()).finish() |
1006 | } |
1007 | } |
1008 | #[cfg (feature = "defmt" )] |
1009 | impl defmt::Format for Fgor { |
1010 | fn format(&self, f: defmt::Formatter) { |
1011 | #[derive (defmt :: Format)] |
1012 | struct Fgor { |
1013 | lo: u16, |
1014 | } |
1015 | let proxy = Fgor { lo: self.lo() }; |
1016 | defmt::write!(f, "{}" , proxy) |
1017 | } |
1018 | } |
1019 | #[doc = "foreground PFC control register" ] |
1020 | #[repr (transparent)] |
1021 | #[derive (Copy, Clone, Eq, PartialEq)] |
1022 | pub struct Fgpfccr(pub u32); |
1023 | impl Fgpfccr { |
1024 | #[doc = "Color mode" ] |
1025 | #[inline (always)] |
1026 | pub const fn cm(&self) -> super::vals::FgpfccrCm { |
1027 | let val = (self.0 >> 0usize) & 0x0f; |
1028 | super::vals::FgpfccrCm::from_bits(val as u8) |
1029 | } |
1030 | #[doc = "Color mode" ] |
1031 | #[inline (always)] |
1032 | pub fn set_cm(&mut self, val: super::vals::FgpfccrCm) { |
1033 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val.to_bits() as u32) & 0x0f) << 0usize); |
1034 | } |
1035 | #[doc = "CLUT color mode" ] |
1036 | #[inline (always)] |
1037 | pub const fn ccm(&self) -> super::vals::FgpfccrCcm { |
1038 | let val = (self.0 >> 4usize) & 0x01; |
1039 | super::vals::FgpfccrCcm::from_bits(val as u8) |
1040 | } |
1041 | #[doc = "CLUT color mode" ] |
1042 | #[inline (always)] |
1043 | pub fn set_ccm(&mut self, val: super::vals::FgpfccrCcm) { |
1044 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.to_bits() as u32) & 0x01) << 4usize); |
1045 | } |
1046 | #[doc = "Start" ] |
1047 | #[inline (always)] |
1048 | pub const fn start(&self) -> super::vals::FgpfccrStart { |
1049 | let val = (self.0 >> 5usize) & 0x01; |
1050 | super::vals::FgpfccrStart::from_bits(val as u8) |
1051 | } |
1052 | #[doc = "Start" ] |
1053 | #[inline (always)] |
1054 | pub fn set_start(&mut self, val: super::vals::FgpfccrStart) { |
1055 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.to_bits() as u32) & 0x01) << 5usize); |
1056 | } |
1057 | #[doc = "CLUT size" ] |
1058 | #[inline (always)] |
1059 | pub const fn cs(&self) -> u8 { |
1060 | let val = (self.0 >> 8usize) & 0xff; |
1061 | val as u8 |
1062 | } |
1063 | #[doc = "CLUT size" ] |
1064 | #[inline (always)] |
1065 | pub fn set_cs(&mut self, val: u8) { |
1066 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
1067 | } |
1068 | #[doc = "Alpha mode" ] |
1069 | #[inline (always)] |
1070 | pub const fn am(&self) -> super::vals::FgpfccrAm { |
1071 | let val = (self.0 >> 16usize) & 0x03; |
1072 | super::vals::FgpfccrAm::from_bits(val as u8) |
1073 | } |
1074 | #[doc = "Alpha mode" ] |
1075 | #[inline (always)] |
1076 | pub fn set_am(&mut self, val: super::vals::FgpfccrAm) { |
1077 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.to_bits() as u32) & 0x03) << 16usize); |
1078 | } |
1079 | #[doc = "Alpha value" ] |
1080 | #[inline (always)] |
1081 | pub const fn alpha(&self) -> u8 { |
1082 | let val = (self.0 >> 24usize) & 0xff; |
1083 | val as u8 |
1084 | } |
1085 | #[doc = "Alpha value" ] |
1086 | #[inline (always)] |
1087 | pub fn set_alpha(&mut self, val: u8) { |
1088 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
1089 | } |
1090 | } |
1091 | impl Default for Fgpfccr { |
1092 | #[inline (always)] |
1093 | fn default() -> Fgpfccr { |
1094 | Fgpfccr(0) |
1095 | } |
1096 | } |
1097 | impl core::fmt::Debug for Fgpfccr { |
1098 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1099 | f.debug_struct("Fgpfccr" ) |
1100 | .field("cm" , &self.cm()) |
1101 | .field("ccm" , &self.ccm()) |
1102 | .field("start" , &self.start()) |
1103 | .field("cs" , &self.cs()) |
1104 | .field("am" , &self.am()) |
1105 | .field("alpha" , &self.alpha()) |
1106 | .finish() |
1107 | } |
1108 | } |
1109 | #[cfg (feature = "defmt" )] |
1110 | impl defmt::Format for Fgpfccr { |
1111 | fn format(&self, f: defmt::Formatter) { |
1112 | #[derive (defmt :: Format)] |
1113 | struct Fgpfccr { |
1114 | cm: super::vals::FgpfccrCm, |
1115 | ccm: super::vals::FgpfccrCcm, |
1116 | start: super::vals::FgpfccrStart, |
1117 | cs: u8, |
1118 | am: super::vals::FgpfccrAm, |
1119 | alpha: u8, |
1120 | } |
1121 | let proxy = Fgpfccr { |
1122 | cm: self.cm(), |
1123 | ccm: self.ccm(), |
1124 | start: self.start(), |
1125 | cs: self.cs(), |
1126 | am: self.am(), |
1127 | alpha: self.alpha(), |
1128 | }; |
1129 | defmt::write!(f, "{}" , proxy) |
1130 | } |
1131 | } |
1132 | #[doc = "interrupt flag clear register" ] |
1133 | #[repr (transparent)] |
1134 | #[derive (Copy, Clone, Eq, PartialEq)] |
1135 | pub struct Ifcr(pub u32); |
1136 | impl Ifcr { |
1137 | #[doc = "Clear Transfer error interrupt flag" ] |
1138 | #[inline (always)] |
1139 | pub const fn cteif(&self) -> super::vals::Cteif { |
1140 | let val = (self.0 >> 0usize) & 0x01; |
1141 | super::vals::Cteif::from_bits(val as u8) |
1142 | } |
1143 | #[doc = "Clear Transfer error interrupt flag" ] |
1144 | #[inline (always)] |
1145 | pub fn set_cteif(&mut self, val: super::vals::Cteif) { |
1146 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize); |
1147 | } |
1148 | #[doc = "Clear transfer complete interrupt flag" ] |
1149 | #[inline (always)] |
1150 | pub const fn ctcif(&self) -> super::vals::Ctcif { |
1151 | let val = (self.0 >> 1usize) & 0x01; |
1152 | super::vals::Ctcif::from_bits(val as u8) |
1153 | } |
1154 | #[doc = "Clear transfer complete interrupt flag" ] |
1155 | #[inline (always)] |
1156 | pub fn set_ctcif(&mut self, val: super::vals::Ctcif) { |
1157 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize); |
1158 | } |
1159 | #[doc = "Clear transfer watermark interrupt flag" ] |
1160 | #[inline (always)] |
1161 | pub const fn ctwif(&self) -> super::vals::Ctwif { |
1162 | let val = (self.0 >> 2usize) & 0x01; |
1163 | super::vals::Ctwif::from_bits(val as u8) |
1164 | } |
1165 | #[doc = "Clear transfer watermark interrupt flag" ] |
1166 | #[inline (always)] |
1167 | pub fn set_ctwif(&mut self, val: super::vals::Ctwif) { |
1168 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.to_bits() as u32) & 0x01) << 2usize); |
1169 | } |
1170 | #[doc = "Clear CLUT access error interrupt flag" ] |
1171 | #[inline (always)] |
1172 | pub const fn caecif(&self) -> super::vals::Caecif { |
1173 | let val = (self.0 >> 3usize) & 0x01; |
1174 | super::vals::Caecif::from_bits(val as u8) |
1175 | } |
1176 | #[doc = "Clear CLUT access error interrupt flag" ] |
1177 | #[inline (always)] |
1178 | pub fn set_caecif(&mut self, val: super::vals::Caecif) { |
1179 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.to_bits() as u32) & 0x01) << 3usize); |
1180 | } |
1181 | #[doc = "Clear CLUT transfer complete interrupt flag" ] |
1182 | #[inline (always)] |
1183 | pub const fn cctcif(&self) -> super::vals::Cctcif { |
1184 | let val = (self.0 >> 4usize) & 0x01; |
1185 | super::vals::Cctcif::from_bits(val as u8) |
1186 | } |
1187 | #[doc = "Clear CLUT transfer complete interrupt flag" ] |
1188 | #[inline (always)] |
1189 | pub fn set_cctcif(&mut self, val: super::vals::Cctcif) { |
1190 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.to_bits() as u32) & 0x01) << 4usize); |
1191 | } |
1192 | #[doc = "Clear configuration error interrupt flag" ] |
1193 | #[inline (always)] |
1194 | pub const fn cceif(&self) -> super::vals::Cceif { |
1195 | let val = (self.0 >> 5usize) & 0x01; |
1196 | super::vals::Cceif::from_bits(val as u8) |
1197 | } |
1198 | #[doc = "Clear configuration error interrupt flag" ] |
1199 | #[inline (always)] |
1200 | pub fn set_cceif(&mut self, val: super::vals::Cceif) { |
1201 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.to_bits() as u32) & 0x01) << 5usize); |
1202 | } |
1203 | } |
1204 | impl Default for Ifcr { |
1205 | #[inline (always)] |
1206 | fn default() -> Ifcr { |
1207 | Ifcr(0) |
1208 | } |
1209 | } |
1210 | impl core::fmt::Debug for Ifcr { |
1211 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1212 | f.debug_struct("Ifcr" ) |
1213 | .field("cteif" , &self.cteif()) |
1214 | .field("ctcif" , &self.ctcif()) |
1215 | .field("ctwif" , &self.ctwif()) |
1216 | .field("caecif" , &self.caecif()) |
1217 | .field("cctcif" , &self.cctcif()) |
1218 | .field("cceif" , &self.cceif()) |
1219 | .finish() |
1220 | } |
1221 | } |
1222 | #[cfg (feature = "defmt" )] |
1223 | impl defmt::Format for Ifcr { |
1224 | fn format(&self, f: defmt::Formatter) { |
1225 | #[derive (defmt :: Format)] |
1226 | struct Ifcr { |
1227 | cteif: super::vals::Cteif, |
1228 | ctcif: super::vals::Ctcif, |
1229 | ctwif: super::vals::Ctwif, |
1230 | caecif: super::vals::Caecif, |
1231 | cctcif: super::vals::Cctcif, |
1232 | cceif: super::vals::Cceif, |
1233 | } |
1234 | let proxy = Ifcr { |
1235 | cteif: self.cteif(), |
1236 | ctcif: self.ctcif(), |
1237 | ctwif: self.ctwif(), |
1238 | caecif: self.caecif(), |
1239 | cctcif: self.cctcif(), |
1240 | cceif: self.cceif(), |
1241 | }; |
1242 | defmt::write!(f, "{}" , proxy) |
1243 | } |
1244 | } |
1245 | #[doc = "Interrupt Status Register" ] |
1246 | #[repr (transparent)] |
1247 | #[derive (Copy, Clone, Eq, PartialEq)] |
1248 | pub struct Isr(pub u32); |
1249 | impl Isr { |
1250 | #[doc = "Transfer error interrupt flag" ] |
1251 | #[inline (always)] |
1252 | pub const fn teif(&self) -> bool { |
1253 | let val = (self.0 >> 0usize) & 0x01; |
1254 | val != 0 |
1255 | } |
1256 | #[doc = "Transfer error interrupt flag" ] |
1257 | #[inline (always)] |
1258 | pub fn set_teif(&mut self, val: bool) { |
1259 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
1260 | } |
1261 | #[doc = "Transfer complete interrupt flag" ] |
1262 | #[inline (always)] |
1263 | pub const fn tcif(&self) -> bool { |
1264 | let val = (self.0 >> 1usize) & 0x01; |
1265 | val != 0 |
1266 | } |
1267 | #[doc = "Transfer complete interrupt flag" ] |
1268 | #[inline (always)] |
1269 | pub fn set_tcif(&mut self, val: bool) { |
1270 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
1271 | } |
1272 | #[doc = "Transfer watermark interrupt flag" ] |
1273 | #[inline (always)] |
1274 | pub const fn twif(&self) -> bool { |
1275 | let val = (self.0 >> 2usize) & 0x01; |
1276 | val != 0 |
1277 | } |
1278 | #[doc = "Transfer watermark interrupt flag" ] |
1279 | #[inline (always)] |
1280 | pub fn set_twif(&mut self, val: bool) { |
1281 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
1282 | } |
1283 | #[doc = "CLUT access error interrupt flag" ] |
1284 | #[inline (always)] |
1285 | pub const fn caeif(&self) -> bool { |
1286 | let val = (self.0 >> 3usize) & 0x01; |
1287 | val != 0 |
1288 | } |
1289 | #[doc = "CLUT access error interrupt flag" ] |
1290 | #[inline (always)] |
1291 | pub fn set_caeif(&mut self, val: bool) { |
1292 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
1293 | } |
1294 | #[doc = "CLUT transfer complete interrupt flag" ] |
1295 | #[inline (always)] |
1296 | pub const fn ctcif(&self) -> bool { |
1297 | let val = (self.0 >> 4usize) & 0x01; |
1298 | val != 0 |
1299 | } |
1300 | #[doc = "CLUT transfer complete interrupt flag" ] |
1301 | #[inline (always)] |
1302 | pub fn set_ctcif(&mut self, val: bool) { |
1303 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
1304 | } |
1305 | #[doc = "Configuration error interrupt flag" ] |
1306 | #[inline (always)] |
1307 | pub const fn ceif(&self) -> bool { |
1308 | let val = (self.0 >> 5usize) & 0x01; |
1309 | val != 0 |
1310 | } |
1311 | #[doc = "Configuration error interrupt flag" ] |
1312 | #[inline (always)] |
1313 | pub fn set_ceif(&mut self, val: bool) { |
1314 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
1315 | } |
1316 | } |
1317 | impl Default for Isr { |
1318 | #[inline (always)] |
1319 | fn default() -> Isr { |
1320 | Isr(0) |
1321 | } |
1322 | } |
1323 | impl core::fmt::Debug for Isr { |
1324 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1325 | f.debug_struct("Isr" ) |
1326 | .field("teif" , &self.teif()) |
1327 | .field("tcif" , &self.tcif()) |
1328 | .field("twif" , &self.twif()) |
1329 | .field("caeif" , &self.caeif()) |
1330 | .field("ctcif" , &self.ctcif()) |
1331 | .field("ceif" , &self.ceif()) |
1332 | .finish() |
1333 | } |
1334 | } |
1335 | #[cfg (feature = "defmt" )] |
1336 | impl defmt::Format for Isr { |
1337 | fn format(&self, f: defmt::Formatter) { |
1338 | #[derive (defmt :: Format)] |
1339 | struct Isr { |
1340 | teif: bool, |
1341 | tcif: bool, |
1342 | twif: bool, |
1343 | caeif: bool, |
1344 | ctcif: bool, |
1345 | ceif: bool, |
1346 | } |
1347 | let proxy = Isr { |
1348 | teif: self.teif(), |
1349 | tcif: self.tcif(), |
1350 | twif: self.twif(), |
1351 | caeif: self.caeif(), |
1352 | ctcif: self.ctcif(), |
1353 | ceif: self.ceif(), |
1354 | }; |
1355 | defmt::write!(f, "{}" , proxy) |
1356 | } |
1357 | } |
1358 | #[doc = "line watermark register" ] |
1359 | #[repr (transparent)] |
1360 | #[derive (Copy, Clone, Eq, PartialEq)] |
1361 | pub struct Lwr(pub u32); |
1362 | impl Lwr { |
1363 | #[doc = "Line watermark" ] |
1364 | #[inline (always)] |
1365 | pub const fn lw(&self) -> u16 { |
1366 | let val = (self.0 >> 0usize) & 0xffff; |
1367 | val as u16 |
1368 | } |
1369 | #[doc = "Line watermark" ] |
1370 | #[inline (always)] |
1371 | pub fn set_lw(&mut self, val: u16) { |
1372 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
1373 | } |
1374 | } |
1375 | impl Default for Lwr { |
1376 | #[inline (always)] |
1377 | fn default() -> Lwr { |
1378 | Lwr(0) |
1379 | } |
1380 | } |
1381 | impl core::fmt::Debug for Lwr { |
1382 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1383 | f.debug_struct("Lwr" ).field("lw" , &self.lw()).finish() |
1384 | } |
1385 | } |
1386 | #[cfg (feature = "defmt" )] |
1387 | impl defmt::Format for Lwr { |
1388 | fn format(&self, f: defmt::Formatter) { |
1389 | #[derive (defmt :: Format)] |
1390 | struct Lwr { |
1391 | lw: u16, |
1392 | } |
1393 | let proxy = Lwr { lw: self.lw() }; |
1394 | defmt::write!(f, "{}" , proxy) |
1395 | } |
1396 | } |
1397 | #[doc = "number of line register" ] |
1398 | #[repr (transparent)] |
1399 | #[derive (Copy, Clone, Eq, PartialEq)] |
1400 | pub struct Nlr(pub u32); |
1401 | impl Nlr { |
1402 | #[doc = "Number of lines" ] |
1403 | #[inline (always)] |
1404 | pub const fn nl(&self) -> u16 { |
1405 | let val = (self.0 >> 0usize) & 0xffff; |
1406 | val as u16 |
1407 | } |
1408 | #[doc = "Number of lines" ] |
1409 | #[inline (always)] |
1410 | pub fn set_nl(&mut self, val: u16) { |
1411 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
1412 | } |
1413 | #[doc = "Pixel per lines" ] |
1414 | #[inline (always)] |
1415 | pub const fn pl(&self) -> u16 { |
1416 | let val = (self.0 >> 16usize) & 0x3fff; |
1417 | val as u16 |
1418 | } |
1419 | #[doc = "Pixel per lines" ] |
1420 | #[inline (always)] |
1421 | pub fn set_pl(&mut self, val: u16) { |
1422 | self.0 = (self.0 & !(0x3fff << 16usize)) | (((val as u32) & 0x3fff) << 16usize); |
1423 | } |
1424 | } |
1425 | impl Default for Nlr { |
1426 | #[inline (always)] |
1427 | fn default() -> Nlr { |
1428 | Nlr(0) |
1429 | } |
1430 | } |
1431 | impl core::fmt::Debug for Nlr { |
1432 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1433 | f.debug_struct("Nlr" ) |
1434 | .field("nl" , &self.nl()) |
1435 | .field("pl" , &self.pl()) |
1436 | .finish() |
1437 | } |
1438 | } |
1439 | #[cfg (feature = "defmt" )] |
1440 | impl defmt::Format for Nlr { |
1441 | fn format(&self, f: defmt::Formatter) { |
1442 | #[derive (defmt :: Format)] |
1443 | struct Nlr { |
1444 | nl: u16, |
1445 | pl: u16, |
1446 | } |
1447 | let proxy = Nlr { |
1448 | nl: self.nl(), |
1449 | pl: self.pl(), |
1450 | }; |
1451 | defmt::write!(f, "{}" , proxy) |
1452 | } |
1453 | } |
1454 | #[doc = "output color register" ] |
1455 | #[repr (transparent)] |
1456 | #[derive (Copy, Clone, Eq, PartialEq)] |
1457 | pub struct Ocolr(pub u32); |
1458 | impl Ocolr { |
1459 | #[doc = "Blue Value" ] |
1460 | #[inline (always)] |
1461 | pub const fn blue(&self) -> u8 { |
1462 | let val = (self.0 >> 0usize) & 0xff; |
1463 | val as u8 |
1464 | } |
1465 | #[doc = "Blue Value" ] |
1466 | #[inline (always)] |
1467 | pub fn set_blue(&mut self, val: u8) { |
1468 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
1469 | } |
1470 | #[doc = "Green Value" ] |
1471 | #[inline (always)] |
1472 | pub const fn green(&self) -> u8 { |
1473 | let val = (self.0 >> 8usize) & 0xff; |
1474 | val as u8 |
1475 | } |
1476 | #[doc = "Green Value" ] |
1477 | #[inline (always)] |
1478 | pub fn set_green(&mut self, val: u8) { |
1479 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); |
1480 | } |
1481 | #[doc = "Red Value" ] |
1482 | #[inline (always)] |
1483 | pub const fn red(&self) -> u8 { |
1484 | let val = (self.0 >> 16usize) & 0xff; |
1485 | val as u8 |
1486 | } |
1487 | #[doc = "Red Value" ] |
1488 | #[inline (always)] |
1489 | pub fn set_red(&mut self, val: u8) { |
1490 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
1491 | } |
1492 | #[doc = "Alpha Channel Value" ] |
1493 | #[inline (always)] |
1494 | pub const fn aplha(&self) -> u8 { |
1495 | let val = (self.0 >> 24usize) & 0xff; |
1496 | val as u8 |
1497 | } |
1498 | #[doc = "Alpha Channel Value" ] |
1499 | #[inline (always)] |
1500 | pub fn set_aplha(&mut self, val: u8) { |
1501 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
1502 | } |
1503 | } |
1504 | impl Default for Ocolr { |
1505 | #[inline (always)] |
1506 | fn default() -> Ocolr { |
1507 | Ocolr(0) |
1508 | } |
1509 | } |
1510 | impl core::fmt::Debug for Ocolr { |
1511 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1512 | f.debug_struct("Ocolr" ) |
1513 | .field("blue" , &self.blue()) |
1514 | .field("green" , &self.green()) |
1515 | .field("red" , &self.red()) |
1516 | .field("aplha" , &self.aplha()) |
1517 | .finish() |
1518 | } |
1519 | } |
1520 | #[cfg (feature = "defmt" )] |
1521 | impl defmt::Format for Ocolr { |
1522 | fn format(&self, f: defmt::Formatter) { |
1523 | #[derive (defmt :: Format)] |
1524 | struct Ocolr { |
1525 | blue: u8, |
1526 | green: u8, |
1527 | red: u8, |
1528 | aplha: u8, |
1529 | } |
1530 | let proxy = Ocolr { |
1531 | blue: self.blue(), |
1532 | green: self.green(), |
1533 | red: self.red(), |
1534 | aplha: self.aplha(), |
1535 | }; |
1536 | defmt::write!(f, "{}" , proxy) |
1537 | } |
1538 | } |
1539 | #[doc = "output memory address register" ] |
1540 | #[repr (transparent)] |
1541 | #[derive (Copy, Clone, Eq, PartialEq)] |
1542 | pub struct Omar(pub u32); |
1543 | impl Omar { |
1544 | #[doc = "Memory Address" ] |
1545 | #[inline (always)] |
1546 | pub const fn ma(&self) -> u32 { |
1547 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
1548 | val as u32 |
1549 | } |
1550 | #[doc = "Memory Address" ] |
1551 | #[inline (always)] |
1552 | pub fn set_ma(&mut self, val: u32) { |
1553 | self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
1554 | } |
1555 | } |
1556 | impl Default for Omar { |
1557 | #[inline (always)] |
1558 | fn default() -> Omar { |
1559 | Omar(0) |
1560 | } |
1561 | } |
1562 | impl core::fmt::Debug for Omar { |
1563 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1564 | f.debug_struct("Omar" ).field("ma" , &self.ma()).finish() |
1565 | } |
1566 | } |
1567 | #[cfg (feature = "defmt" )] |
1568 | impl defmt::Format for Omar { |
1569 | fn format(&self, f: defmt::Formatter) { |
1570 | #[derive (defmt :: Format)] |
1571 | struct Omar { |
1572 | ma: u32, |
1573 | } |
1574 | let proxy = Omar { ma: self.ma() }; |
1575 | defmt::write!(f, "{}" , proxy) |
1576 | } |
1577 | } |
1578 | #[doc = "output offset register" ] |
1579 | #[repr (transparent)] |
1580 | #[derive (Copy, Clone, Eq, PartialEq)] |
1581 | pub struct Oor(pub u32); |
1582 | impl Oor { |
1583 | #[doc = "Line Offset" ] |
1584 | #[inline (always)] |
1585 | pub const fn lo(&self) -> u16 { |
1586 | let val = (self.0 >> 0usize) & 0x3fff; |
1587 | val as u16 |
1588 | } |
1589 | #[doc = "Line Offset" ] |
1590 | #[inline (always)] |
1591 | pub fn set_lo(&mut self, val: u16) { |
1592 | self.0 = (self.0 & !(0x3fff << 0usize)) | (((val as u32) & 0x3fff) << 0usize); |
1593 | } |
1594 | } |
1595 | impl Default for Oor { |
1596 | #[inline (always)] |
1597 | fn default() -> Oor { |
1598 | Oor(0) |
1599 | } |
1600 | } |
1601 | impl core::fmt::Debug for Oor { |
1602 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1603 | f.debug_struct("Oor" ).field("lo" , &self.lo()).finish() |
1604 | } |
1605 | } |
1606 | #[cfg (feature = "defmt" )] |
1607 | impl defmt::Format for Oor { |
1608 | fn format(&self, f: defmt::Formatter) { |
1609 | #[derive (defmt :: Format)] |
1610 | struct Oor { |
1611 | lo: u16, |
1612 | } |
1613 | let proxy = Oor { lo: self.lo() }; |
1614 | defmt::write!(f, "{}" , proxy) |
1615 | } |
1616 | } |
1617 | #[doc = "output PFC control register" ] |
1618 | #[repr (transparent)] |
1619 | #[derive (Copy, Clone, Eq, PartialEq)] |
1620 | pub struct Opfccr(pub u32); |
1621 | impl Opfccr { |
1622 | #[doc = "Color mode" ] |
1623 | #[inline (always)] |
1624 | pub const fn cm(&self) -> super::vals::OpfccrCm { |
1625 | let val = (self.0 >> 0usize) & 0x07; |
1626 | super::vals::OpfccrCm::from_bits(val as u8) |
1627 | } |
1628 | #[doc = "Color mode" ] |
1629 | #[inline (always)] |
1630 | pub fn set_cm(&mut self, val: super::vals::OpfccrCm) { |
1631 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize); |
1632 | } |
1633 | } |
1634 | impl Default for Opfccr { |
1635 | #[inline (always)] |
1636 | fn default() -> Opfccr { |
1637 | Opfccr(0) |
1638 | } |
1639 | } |
1640 | impl core::fmt::Debug for Opfccr { |
1641 | fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { |
1642 | f.debug_struct("Opfccr" ).field("cm" , &self.cm()).finish() |
1643 | } |
1644 | } |
1645 | #[cfg (feature = "defmt" )] |
1646 | impl defmt::Format for Opfccr { |
1647 | fn format(&self, f: defmt::Formatter) { |
1648 | #[derive (defmt :: Format)] |
1649 | struct Opfccr { |
1650 | cm: super::vals::OpfccrCm, |
1651 | } |
1652 | let proxy = Opfccr { cm: self.cm() }; |
1653 | defmt::write!(f, "{}" , proxy) |
1654 | } |
1655 | } |
1656 | } |
1657 | pub mod vals { |
1658 | #[repr (u8)] |
1659 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1660 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1661 | pub enum Abort { |
1662 | _RESERVED_0 = 0x0, |
1663 | #[doc = "Transfer abort requested" ] |
1664 | ABORT_REQUEST = 0x01, |
1665 | } |
1666 | impl Abort { |
1667 | #[inline (always)] |
1668 | pub const fn from_bits(val: u8) -> Abort { |
1669 | unsafe { core::mem::transmute(val & 0x01) } |
1670 | } |
1671 | #[inline (always)] |
1672 | pub const fn to_bits(self) -> u8 { |
1673 | unsafe { core::mem::transmute(self) } |
1674 | } |
1675 | } |
1676 | impl From<u8> for Abort { |
1677 | #[inline (always)] |
1678 | fn from(val: u8) -> Abort { |
1679 | Abort::from_bits(val) |
1680 | } |
1681 | } |
1682 | impl From<Abort> for u8 { |
1683 | #[inline (always)] |
1684 | fn from(val: Abort) -> u8 { |
1685 | Abort::to_bits(val) |
1686 | } |
1687 | } |
1688 | #[repr (u8)] |
1689 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1690 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1691 | pub enum BgpfccrAm { |
1692 | #[doc = "No modification of alpha channel" ] |
1693 | NO_MODIFY = 0x0, |
1694 | #[doc = "Replace with value in ALPHA \\[7:0 \\]" ] |
1695 | REPLACE = 0x01, |
1696 | #[doc = "Multiply with value in ALPHA \\[7:0 \\]" ] |
1697 | MULTIPLY = 0x02, |
1698 | _RESERVED_3 = 0x03, |
1699 | } |
1700 | impl BgpfccrAm { |
1701 | #[inline (always)] |
1702 | pub const fn from_bits(val: u8) -> BgpfccrAm { |
1703 | unsafe { core::mem::transmute(val & 0x03) } |
1704 | } |
1705 | #[inline (always)] |
1706 | pub const fn to_bits(self) -> u8 { |
1707 | unsafe { core::mem::transmute(self) } |
1708 | } |
1709 | } |
1710 | impl From<u8> for BgpfccrAm { |
1711 | #[inline (always)] |
1712 | fn from(val: u8) -> BgpfccrAm { |
1713 | BgpfccrAm::from_bits(val) |
1714 | } |
1715 | } |
1716 | impl From<BgpfccrAm> for u8 { |
1717 | #[inline (always)] |
1718 | fn from(val: BgpfccrAm) -> u8 { |
1719 | BgpfccrAm::to_bits(val) |
1720 | } |
1721 | } |
1722 | #[repr (u8)] |
1723 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1724 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1725 | pub enum BgpfccrCcm { |
1726 | #[doc = "CLUT color format ARGB8888" ] |
1727 | ARGB8888 = 0x0, |
1728 | #[doc = "CLUT color format RGB888" ] |
1729 | RGB888 = 0x01, |
1730 | } |
1731 | impl BgpfccrCcm { |
1732 | #[inline (always)] |
1733 | pub const fn from_bits(val: u8) -> BgpfccrCcm { |
1734 | unsafe { core::mem::transmute(val & 0x01) } |
1735 | } |
1736 | #[inline (always)] |
1737 | pub const fn to_bits(self) -> u8 { |
1738 | unsafe { core::mem::transmute(self) } |
1739 | } |
1740 | } |
1741 | impl From<u8> for BgpfccrCcm { |
1742 | #[inline (always)] |
1743 | fn from(val: u8) -> BgpfccrCcm { |
1744 | BgpfccrCcm::from_bits(val) |
1745 | } |
1746 | } |
1747 | impl From<BgpfccrCcm> for u8 { |
1748 | #[inline (always)] |
1749 | fn from(val: BgpfccrCcm) -> u8 { |
1750 | BgpfccrCcm::to_bits(val) |
1751 | } |
1752 | } |
1753 | #[repr (u8)] |
1754 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1755 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1756 | pub enum BgpfccrCm { |
1757 | #[doc = "Color mode ARGB8888" ] |
1758 | ARGB8888 = 0x0, |
1759 | #[doc = "Color mode RGB888" ] |
1760 | RGB888 = 0x01, |
1761 | #[doc = "Color mode RGB565" ] |
1762 | RGB565 = 0x02, |
1763 | #[doc = "Color mode ARGB1555" ] |
1764 | ARGB1555 = 0x03, |
1765 | #[doc = "Color mode ARGB4444" ] |
1766 | ARGB4444 = 0x04, |
1767 | #[doc = "Color mode L8" ] |
1768 | L8 = 0x05, |
1769 | #[doc = "Color mode AL44" ] |
1770 | AL44 = 0x06, |
1771 | #[doc = "Color mode AL88" ] |
1772 | AL88 = 0x07, |
1773 | #[doc = "Color mode L4" ] |
1774 | L4 = 0x08, |
1775 | #[doc = "Color mode A8" ] |
1776 | A8 = 0x09, |
1777 | #[doc = "Color mode A4" ] |
1778 | A4 = 0x0a, |
1779 | _RESERVED_b = 0x0b, |
1780 | _RESERVED_c = 0x0c, |
1781 | _RESERVED_d = 0x0d, |
1782 | _RESERVED_e = 0x0e, |
1783 | _RESERVED_f = 0x0f, |
1784 | } |
1785 | impl BgpfccrCm { |
1786 | #[inline (always)] |
1787 | pub const fn from_bits(val: u8) -> BgpfccrCm { |
1788 | unsafe { core::mem::transmute(val & 0x0f) } |
1789 | } |
1790 | #[inline (always)] |
1791 | pub const fn to_bits(self) -> u8 { |
1792 | unsafe { core::mem::transmute(self) } |
1793 | } |
1794 | } |
1795 | impl From<u8> for BgpfccrCm { |
1796 | #[inline (always)] |
1797 | fn from(val: u8) -> BgpfccrCm { |
1798 | BgpfccrCm::from_bits(val) |
1799 | } |
1800 | } |
1801 | impl From<BgpfccrCm> for u8 { |
1802 | #[inline (always)] |
1803 | fn from(val: BgpfccrCm) -> u8 { |
1804 | BgpfccrCm::to_bits(val) |
1805 | } |
1806 | } |
1807 | #[repr (u8)] |
1808 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1809 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1810 | pub enum BgpfccrStart { |
1811 | _RESERVED_0 = 0x0, |
1812 | #[doc = "Start the automatic loading of the CLUT" ] |
1813 | START = 0x01, |
1814 | } |
1815 | impl BgpfccrStart { |
1816 | #[inline (always)] |
1817 | pub const fn from_bits(val: u8) -> BgpfccrStart { |
1818 | unsafe { core::mem::transmute(val & 0x01) } |
1819 | } |
1820 | #[inline (always)] |
1821 | pub const fn to_bits(self) -> u8 { |
1822 | unsafe { core::mem::transmute(self) } |
1823 | } |
1824 | } |
1825 | impl From<u8> for BgpfccrStart { |
1826 | #[inline (always)] |
1827 | fn from(val: u8) -> BgpfccrStart { |
1828 | BgpfccrStart::from_bits(val) |
1829 | } |
1830 | } |
1831 | impl From<BgpfccrStart> for u8 { |
1832 | #[inline (always)] |
1833 | fn from(val: BgpfccrStart) -> u8 { |
1834 | BgpfccrStart::to_bits(val) |
1835 | } |
1836 | } |
1837 | #[repr (u8)] |
1838 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1839 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1840 | pub enum Caecif { |
1841 | _RESERVED_0 = 0x0, |
1842 | #[doc = "Clear the CAEIF flag in the ISR register" ] |
1843 | CLEAR = 0x01, |
1844 | } |
1845 | impl Caecif { |
1846 | #[inline (always)] |
1847 | pub const fn from_bits(val: u8) -> Caecif { |
1848 | unsafe { core::mem::transmute(val & 0x01) } |
1849 | } |
1850 | #[inline (always)] |
1851 | pub const fn to_bits(self) -> u8 { |
1852 | unsafe { core::mem::transmute(self) } |
1853 | } |
1854 | } |
1855 | impl From<u8> for Caecif { |
1856 | #[inline (always)] |
1857 | fn from(val: u8) -> Caecif { |
1858 | Caecif::from_bits(val) |
1859 | } |
1860 | } |
1861 | impl From<Caecif> for u8 { |
1862 | #[inline (always)] |
1863 | fn from(val: Caecif) -> u8 { |
1864 | Caecif::to_bits(val) |
1865 | } |
1866 | } |
1867 | #[repr (u8)] |
1868 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1869 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1870 | pub enum Cceif { |
1871 | _RESERVED_0 = 0x0, |
1872 | #[doc = "Clear the CEIF flag in the ISR register" ] |
1873 | CLEAR = 0x01, |
1874 | } |
1875 | impl Cceif { |
1876 | #[inline (always)] |
1877 | pub const fn from_bits(val: u8) -> Cceif { |
1878 | unsafe { core::mem::transmute(val & 0x01) } |
1879 | } |
1880 | #[inline (always)] |
1881 | pub const fn to_bits(self) -> u8 { |
1882 | unsafe { core::mem::transmute(self) } |
1883 | } |
1884 | } |
1885 | impl From<u8> for Cceif { |
1886 | #[inline (always)] |
1887 | fn from(val: u8) -> Cceif { |
1888 | Cceif::from_bits(val) |
1889 | } |
1890 | } |
1891 | impl From<Cceif> for u8 { |
1892 | #[inline (always)] |
1893 | fn from(val: Cceif) -> u8 { |
1894 | Cceif::to_bits(val) |
1895 | } |
1896 | } |
1897 | #[repr (u8)] |
1898 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1899 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1900 | pub enum Cctcif { |
1901 | _RESERVED_0 = 0x0, |
1902 | #[doc = "Clear the CTCIF flag in the ISR register" ] |
1903 | CLEAR = 0x01, |
1904 | } |
1905 | impl Cctcif { |
1906 | #[inline (always)] |
1907 | pub const fn from_bits(val: u8) -> Cctcif { |
1908 | unsafe { core::mem::transmute(val & 0x01) } |
1909 | } |
1910 | #[inline (always)] |
1911 | pub const fn to_bits(self) -> u8 { |
1912 | unsafe { core::mem::transmute(self) } |
1913 | } |
1914 | } |
1915 | impl From<u8> for Cctcif { |
1916 | #[inline (always)] |
1917 | fn from(val: u8) -> Cctcif { |
1918 | Cctcif::from_bits(val) |
1919 | } |
1920 | } |
1921 | impl From<Cctcif> for u8 { |
1922 | #[inline (always)] |
1923 | fn from(val: Cctcif) -> u8 { |
1924 | Cctcif::to_bits(val) |
1925 | } |
1926 | } |
1927 | #[repr (u8)] |
1928 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1929 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1930 | pub enum CrStart { |
1931 | _RESERVED_0 = 0x0, |
1932 | #[doc = "Launch the DMA2D" ] |
1933 | START = 0x01, |
1934 | } |
1935 | impl CrStart { |
1936 | #[inline (always)] |
1937 | pub const fn from_bits(val: u8) -> CrStart { |
1938 | unsafe { core::mem::transmute(val & 0x01) } |
1939 | } |
1940 | #[inline (always)] |
1941 | pub const fn to_bits(self) -> u8 { |
1942 | unsafe { core::mem::transmute(self) } |
1943 | } |
1944 | } |
1945 | impl From<u8> for CrStart { |
1946 | #[inline (always)] |
1947 | fn from(val: u8) -> CrStart { |
1948 | CrStart::from_bits(val) |
1949 | } |
1950 | } |
1951 | impl From<CrStart> for u8 { |
1952 | #[inline (always)] |
1953 | fn from(val: CrStart) -> u8 { |
1954 | CrStart::to_bits(val) |
1955 | } |
1956 | } |
1957 | #[repr (u8)] |
1958 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1959 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1960 | pub enum Ctcif { |
1961 | _RESERVED_0 = 0x0, |
1962 | #[doc = "Clear the TCIF flag in the ISR register" ] |
1963 | CLEAR = 0x01, |
1964 | } |
1965 | impl Ctcif { |
1966 | #[inline (always)] |
1967 | pub const fn from_bits(val: u8) -> Ctcif { |
1968 | unsafe { core::mem::transmute(val & 0x01) } |
1969 | } |
1970 | #[inline (always)] |
1971 | pub const fn to_bits(self) -> u8 { |
1972 | unsafe { core::mem::transmute(self) } |
1973 | } |
1974 | } |
1975 | impl From<u8> for Ctcif { |
1976 | #[inline (always)] |
1977 | fn from(val: u8) -> Ctcif { |
1978 | Ctcif::from_bits(val) |
1979 | } |
1980 | } |
1981 | impl From<Ctcif> for u8 { |
1982 | #[inline (always)] |
1983 | fn from(val: Ctcif) -> u8 { |
1984 | Ctcif::to_bits(val) |
1985 | } |
1986 | } |
1987 | #[repr (u8)] |
1988 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
1989 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
1990 | pub enum Cteif { |
1991 | _RESERVED_0 = 0x0, |
1992 | #[doc = "Clear the TEIF flag in the ISR register" ] |
1993 | CLEAR = 0x01, |
1994 | } |
1995 | impl Cteif { |
1996 | #[inline (always)] |
1997 | pub const fn from_bits(val: u8) -> Cteif { |
1998 | unsafe { core::mem::transmute(val & 0x01) } |
1999 | } |
2000 | #[inline (always)] |
2001 | pub const fn to_bits(self) -> u8 { |
2002 | unsafe { core::mem::transmute(self) } |
2003 | } |
2004 | } |
2005 | impl From<u8> for Cteif { |
2006 | #[inline (always)] |
2007 | fn from(val: u8) -> Cteif { |
2008 | Cteif::from_bits(val) |
2009 | } |
2010 | } |
2011 | impl From<Cteif> for u8 { |
2012 | #[inline (always)] |
2013 | fn from(val: Cteif) -> u8 { |
2014 | Cteif::to_bits(val) |
2015 | } |
2016 | } |
2017 | #[repr (u8)] |
2018 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2019 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2020 | pub enum Ctwif { |
2021 | _RESERVED_0 = 0x0, |
2022 | #[doc = "Clear the TWIF flag in the ISR register" ] |
2023 | CLEAR = 0x01, |
2024 | } |
2025 | impl Ctwif { |
2026 | #[inline (always)] |
2027 | pub const fn from_bits(val: u8) -> Ctwif { |
2028 | unsafe { core::mem::transmute(val & 0x01) } |
2029 | } |
2030 | #[inline (always)] |
2031 | pub const fn to_bits(self) -> u8 { |
2032 | unsafe { core::mem::transmute(self) } |
2033 | } |
2034 | } |
2035 | impl From<u8> for Ctwif { |
2036 | #[inline (always)] |
2037 | fn from(val: u8) -> Ctwif { |
2038 | Ctwif::from_bits(val) |
2039 | } |
2040 | } |
2041 | impl From<Ctwif> for u8 { |
2042 | #[inline (always)] |
2043 | fn from(val: Ctwif) -> u8 { |
2044 | Ctwif::to_bits(val) |
2045 | } |
2046 | } |
2047 | #[repr (u8)] |
2048 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2049 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2050 | pub enum FgpfccrAm { |
2051 | #[doc = "No modification of alpha channel" ] |
2052 | NO_MODIFY = 0x0, |
2053 | #[doc = "Replace with value in ALPHA \\[7:0 \\]" ] |
2054 | REPLACE = 0x01, |
2055 | #[doc = "Multiply with value in ALPHA \\[7:0 \\]" ] |
2056 | MULTIPLY = 0x02, |
2057 | _RESERVED_3 = 0x03, |
2058 | } |
2059 | impl FgpfccrAm { |
2060 | #[inline (always)] |
2061 | pub const fn from_bits(val: u8) -> FgpfccrAm { |
2062 | unsafe { core::mem::transmute(val & 0x03) } |
2063 | } |
2064 | #[inline (always)] |
2065 | pub const fn to_bits(self) -> u8 { |
2066 | unsafe { core::mem::transmute(self) } |
2067 | } |
2068 | } |
2069 | impl From<u8> for FgpfccrAm { |
2070 | #[inline (always)] |
2071 | fn from(val: u8) -> FgpfccrAm { |
2072 | FgpfccrAm::from_bits(val) |
2073 | } |
2074 | } |
2075 | impl From<FgpfccrAm> for u8 { |
2076 | #[inline (always)] |
2077 | fn from(val: FgpfccrAm) -> u8 { |
2078 | FgpfccrAm::to_bits(val) |
2079 | } |
2080 | } |
2081 | #[repr (u8)] |
2082 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2083 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2084 | pub enum FgpfccrCcm { |
2085 | #[doc = "CLUT color format ARGB8888" ] |
2086 | ARGB8888 = 0x0, |
2087 | #[doc = "CLUT color format RGB888" ] |
2088 | RGB888 = 0x01, |
2089 | } |
2090 | impl FgpfccrCcm { |
2091 | #[inline (always)] |
2092 | pub const fn from_bits(val: u8) -> FgpfccrCcm { |
2093 | unsafe { core::mem::transmute(val & 0x01) } |
2094 | } |
2095 | #[inline (always)] |
2096 | pub const fn to_bits(self) -> u8 { |
2097 | unsafe { core::mem::transmute(self) } |
2098 | } |
2099 | } |
2100 | impl From<u8> for FgpfccrCcm { |
2101 | #[inline (always)] |
2102 | fn from(val: u8) -> FgpfccrCcm { |
2103 | FgpfccrCcm::from_bits(val) |
2104 | } |
2105 | } |
2106 | impl From<FgpfccrCcm> for u8 { |
2107 | #[inline (always)] |
2108 | fn from(val: FgpfccrCcm) -> u8 { |
2109 | FgpfccrCcm::to_bits(val) |
2110 | } |
2111 | } |
2112 | #[repr (u8)] |
2113 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2114 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2115 | pub enum FgpfccrCm { |
2116 | #[doc = "Color mode ARGB8888" ] |
2117 | ARGB8888 = 0x0, |
2118 | #[doc = "Color mode RGB888" ] |
2119 | RGB888 = 0x01, |
2120 | #[doc = "Color mode RGB565" ] |
2121 | RGB565 = 0x02, |
2122 | #[doc = "Color mode ARGB1555" ] |
2123 | ARGB1555 = 0x03, |
2124 | #[doc = "Color mode ARGB4444" ] |
2125 | ARGB4444 = 0x04, |
2126 | #[doc = "Color mode L8" ] |
2127 | L8 = 0x05, |
2128 | #[doc = "Color mode AL44" ] |
2129 | AL44 = 0x06, |
2130 | #[doc = "Color mode AL88" ] |
2131 | AL88 = 0x07, |
2132 | #[doc = "Color mode L4" ] |
2133 | L4 = 0x08, |
2134 | #[doc = "Color mode A8" ] |
2135 | A8 = 0x09, |
2136 | #[doc = "Color mode A4" ] |
2137 | A4 = 0x0a, |
2138 | _RESERVED_b = 0x0b, |
2139 | _RESERVED_c = 0x0c, |
2140 | _RESERVED_d = 0x0d, |
2141 | _RESERVED_e = 0x0e, |
2142 | _RESERVED_f = 0x0f, |
2143 | } |
2144 | impl FgpfccrCm { |
2145 | #[inline (always)] |
2146 | pub const fn from_bits(val: u8) -> FgpfccrCm { |
2147 | unsafe { core::mem::transmute(val & 0x0f) } |
2148 | } |
2149 | #[inline (always)] |
2150 | pub const fn to_bits(self) -> u8 { |
2151 | unsafe { core::mem::transmute(self) } |
2152 | } |
2153 | } |
2154 | impl From<u8> for FgpfccrCm { |
2155 | #[inline (always)] |
2156 | fn from(val: u8) -> FgpfccrCm { |
2157 | FgpfccrCm::from_bits(val) |
2158 | } |
2159 | } |
2160 | impl From<FgpfccrCm> for u8 { |
2161 | #[inline (always)] |
2162 | fn from(val: FgpfccrCm) -> u8 { |
2163 | FgpfccrCm::to_bits(val) |
2164 | } |
2165 | } |
2166 | #[repr (u8)] |
2167 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2168 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2169 | pub enum FgpfccrStart { |
2170 | _RESERVED_0 = 0x0, |
2171 | #[doc = "Start the automatic loading of the CLUT" ] |
2172 | START = 0x01, |
2173 | } |
2174 | impl FgpfccrStart { |
2175 | #[inline (always)] |
2176 | pub const fn from_bits(val: u8) -> FgpfccrStart { |
2177 | unsafe { core::mem::transmute(val & 0x01) } |
2178 | } |
2179 | #[inline (always)] |
2180 | pub const fn to_bits(self) -> u8 { |
2181 | unsafe { core::mem::transmute(self) } |
2182 | } |
2183 | } |
2184 | impl From<u8> for FgpfccrStart { |
2185 | #[inline (always)] |
2186 | fn from(val: u8) -> FgpfccrStart { |
2187 | FgpfccrStart::from_bits(val) |
2188 | } |
2189 | } |
2190 | impl From<FgpfccrStart> for u8 { |
2191 | #[inline (always)] |
2192 | fn from(val: FgpfccrStart) -> u8 { |
2193 | FgpfccrStart::to_bits(val) |
2194 | } |
2195 | } |
2196 | #[repr (u8)] |
2197 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2198 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2199 | pub enum Mode { |
2200 | #[doc = "Memory-to-memory (FG fetch only)" ] |
2201 | MEMORY_TO_MEMORY = 0x0, |
2202 | #[doc = "Memory-to-memory with PFC (FG fetch only with FG PFC active)" ] |
2203 | MEMORY_TO_MEMORY_PFC = 0x01, |
2204 | #[doc = "Memory-to-memory with blending (FG and BG fetch with PFC and blending)" ] |
2205 | MEMORY_TO_MEMORY_PFCBLENDING = 0x02, |
2206 | #[doc = "Register-to-memory" ] |
2207 | REGISTER_TO_MEMORY = 0x03, |
2208 | } |
2209 | impl Mode { |
2210 | #[inline (always)] |
2211 | pub const fn from_bits(val: u8) -> Mode { |
2212 | unsafe { core::mem::transmute(val & 0x03) } |
2213 | } |
2214 | #[inline (always)] |
2215 | pub const fn to_bits(self) -> u8 { |
2216 | unsafe { core::mem::transmute(self) } |
2217 | } |
2218 | } |
2219 | impl From<u8> for Mode { |
2220 | #[inline (always)] |
2221 | fn from(val: u8) -> Mode { |
2222 | Mode::from_bits(val) |
2223 | } |
2224 | } |
2225 | impl From<Mode> for u8 { |
2226 | #[inline (always)] |
2227 | fn from(val: Mode) -> u8 { |
2228 | Mode::to_bits(val) |
2229 | } |
2230 | } |
2231 | #[repr (u8)] |
2232 | #[derive (Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] |
2233 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
2234 | pub enum OpfccrCm { |
2235 | #[doc = "ARGB8888" ] |
2236 | ARGB8888 = 0x0, |
2237 | #[doc = "RGB888" ] |
2238 | RGB888 = 0x01, |
2239 | #[doc = "RGB565" ] |
2240 | RGB565 = 0x02, |
2241 | #[doc = "ARGB1555" ] |
2242 | ARGB1555 = 0x03, |
2243 | #[doc = "ARGB4444" ] |
2244 | ARGB4444 = 0x04, |
2245 | _RESERVED_5 = 0x05, |
2246 | _RESERVED_6 = 0x06, |
2247 | _RESERVED_7 = 0x07, |
2248 | } |
2249 | impl OpfccrCm { |
2250 | #[inline (always)] |
2251 | pub const fn from_bits(val: u8) -> OpfccrCm { |
2252 | unsafe { core::mem::transmute(val & 0x07) } |
2253 | } |
2254 | #[inline (always)] |
2255 | pub const fn to_bits(self) -> u8 { |
2256 | unsafe { core::mem::transmute(self) } |
2257 | } |
2258 | } |
2259 | impl From<u8> for OpfccrCm { |
2260 | #[inline (always)] |
2261 | fn from(val: u8) -> OpfccrCm { |
2262 | OpfccrCm::from_bits(val) |
2263 | } |
2264 | } |
2265 | impl From<OpfccrCm> for u8 { |
2266 | #[inline (always)] |
2267 | fn from(val: OpfccrCm) -> u8 { |
2268 | OpfccrCm::to_bits(val) |
2269 | } |
2270 | } |
2271 | } |
2272 | |