1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
#[doc = "Reader of register OUT_CTRL_TOG"]
pub type R = crate::R<u32, super::OUT_CTRL_TOG>;
#[doc = "Writer for register OUT_CTRL_TOG"]
pub type W = crate::W<u32, super::OUT_CTRL_TOG>;
#[doc = "Register OUT_CTRL_TOG `reset()`'s with value 0"]
impl crate::ResetValue for super::OUT_CTRL_TOG {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Output framebuffer format\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum FORMAT_A {
    #[doc = "0: 32-bit pixels"]
    ARGB8888 = 0,
    #[doc = "4: 32-bit pixels (unpacked 24-bit pixel in 32 bit DWORD.)"]
    RGB888 = 4,
    #[doc = "5: 24-bit pixels (packed 24-bit format)"]
    RGB888P = 5,
    #[doc = "8: 16-bit pixels"]
    ARGB1555 = 8,
    #[doc = "9: 16-bit pixels"]
    ARGB4444 = 9,
    #[doc = "12: 16-bit pixels"]
    RGB555 = 12,
    #[doc = "13: 16-bit pixels"]
    RGB444 = 13,
    #[doc = "14: 16-bit pixels"]
    RGB565 = 14,
    #[doc = "16: 32-bit pixels (1-plane XYUV unpacked)"]
    YUV1P444 = 16,
    #[doc = "18: 16-bit pixels (1-plane U0,Y0,V0,Y1 interleaved bytes)"]
    UYVY1P422 = 18,
    #[doc = "19: 16-bit pixels (1-plane V0,Y0,U0,Y1 interleaved bytes)"]
    VYUY1P422 = 19,
    #[doc = "20: 8-bit monochrome pixels (1-plane Y luma output)"]
    Y8 = 20,
    #[doc = "21: 4-bit monochrome pixels (1-plane Y luma, 4 bit truncation)"]
    Y4 = 21,
    #[doc = "24: 16-bit pixels (2-plane UV interleaved bytes)"]
    YUV2P422 = 24,
    #[doc = "25: 16-bit pixels (2-plane UV)"]
    YUV2P420 = 25,
    #[doc = "26: 16-bit pixels (2-plane VU interleaved bytes)"]
    YVU2P422 = 26,
    #[doc = "27: 16-bit pixels (2-plane VU)"]
    YVU2P420 = 27,
}
impl From<FORMAT_A> for u8 {
    #[inline(always)]
    fn from(variant: FORMAT_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `FORMAT`"]
pub type FORMAT_R = crate::R<u8, FORMAT_A>;
impl FORMAT_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, FORMAT_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(FORMAT_A::ARGB8888),
            4 => Val(FORMAT_A::RGB888),
            5 => Val(FORMAT_A::RGB888P),
            8 => Val(FORMAT_A::ARGB1555),
            9 => Val(FORMAT_A::ARGB4444),
            12 => Val(FORMAT_A::RGB555),
            13 => Val(FORMAT_A::RGB444),
            14 => Val(FORMAT_A::RGB565),
            16 => Val(FORMAT_A::YUV1P444),
            18 => Val(FORMAT_A::UYVY1P422),
            19 => Val(FORMAT_A::VYUY1P422),
            20 => Val(FORMAT_A::Y8),
            21 => Val(FORMAT_A::Y4),
            24 => Val(FORMAT_A::YUV2P422),
            25 => Val(FORMAT_A::YUV2P420),
            26 => Val(FORMAT_A::YVU2P422),
            27 => Val(FORMAT_A::YVU2P420),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `ARGB8888`"]
    #[inline(always)]
    pub fn is_argb8888(&self) -> bool {
        *self == FORMAT_A::ARGB8888
    }
    #[doc = "Checks if the value of the field is `RGB888`"]
    #[inline(always)]
    pub fn is_rgb888(&self) -> bool {
        *self == FORMAT_A::RGB888
    }
    #[doc = "Checks if the value of the field is `RGB888P`"]
    #[inline(always)]
    pub fn is_rgb888p(&self) -> bool {
        *self == FORMAT_A::RGB888P
    }
    #[doc = "Checks if the value of the field is `ARGB1555`"]
    #[inline(always)]
    pub fn is_argb1555(&self) -> bool {
        *self == FORMAT_A::ARGB1555
    }
    #[doc = "Checks if the value of the field is `ARGB4444`"]
    #[inline(always)]
    pub fn is_argb4444(&self) -> bool {
        *self == FORMAT_A::ARGB4444
    }
    #[doc = "Checks if the value of the field is `RGB555`"]
    #[inline(always)]
    pub fn is_rgb555(&self) -> bool {
        *self == FORMAT_A::RGB555
    }
    #[doc = "Checks if the value of the field is `RGB444`"]
    #[inline(always)]
    pub fn is_rgb444(&self) -> bool {
        *self == FORMAT_A::RGB444
    }
    #[doc = "Checks if the value of the field is `RGB565`"]
    #[inline(always)]
    pub fn is_rgb565(&self) -> bool {
        *self == FORMAT_A::RGB565
    }
    #[doc = "Checks if the value of the field is `YUV1P444`"]
    #[inline(always)]
    pub fn is_yuv1p444(&self) -> bool {
        *self == FORMAT_A::YUV1P444
    }
    #[doc = "Checks if the value of the field is `UYVY1P422`"]
    #[inline(always)]
    pub fn is_uyvy1p422(&self) -> bool {
        *self == FORMAT_A::UYVY1P422
    }
    #[doc = "Checks if the value of the field is `VYUY1P422`"]
    #[inline(always)]
    pub fn is_vyuy1p422(&self) -> bool {
        *self == FORMAT_A::VYUY1P422
    }
    #[doc = "Checks if the value of the field is `Y8`"]
    #[inline(always)]
    pub fn is_y8(&self) -> bool {
        *self == FORMAT_A::Y8
    }
    #[doc = "Checks if the value of the field is `Y4`"]
    #[inline(always)]
    pub fn is_y4(&self) -> bool {
        *self == FORMAT_A::Y4
    }
    #[doc = "Checks if the value of the field is `YUV2P422`"]
    #[inline(always)]
    pub fn is_yuv2p422(&self) -> bool {
        *self == FORMAT_A::YUV2P422
    }
    #[doc = "Checks if the value of the field is `YUV2P420`"]
    #[inline(always)]
    pub fn is_yuv2p420(&self) -> bool {
        *self == FORMAT_A::YUV2P420
    }
    #[doc = "Checks if the value of the field is `YVU2P422`"]
    #[inline(always)]
    pub fn is_yvu2p422(&self) -> bool {
        *self == FORMAT_A::YVU2P422
    }
    #[doc = "Checks if the value of the field is `YVU2P420`"]
    #[inline(always)]
    pub fn is_yvu2p420(&self) -> bool {
        *self == FORMAT_A::YVU2P420
    }
}
#[doc = "Write proxy for field `FORMAT`"]
pub struct FORMAT_W<'a> {
    w: &'a mut W,
}
impl<'a> FORMAT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FORMAT_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "32-bit pixels"]
    #[inline(always)]
    pub fn argb8888(self) -> &'a mut W {
        self.variant(FORMAT_A::ARGB8888)
    }
    #[doc = "32-bit pixels (unpacked 24-bit pixel in 32 bit DWORD.)"]
    #[inline(always)]
    pub fn rgb888(self) -> &'a mut W {
        self.variant(FORMAT_A::RGB888)
    }
    #[doc = "24-bit pixels (packed 24-bit format)"]
    #[inline(always)]
    pub fn rgb888p(self) -> &'a mut W {
        self.variant(FORMAT_A::RGB888P)
    }
    #[doc = "16-bit pixels"]
    #[inline(always)]
    pub fn argb1555(self) -> &'a mut W {
        self.variant(FORMAT_A::ARGB1555)
    }
    #[doc = "16-bit pixels"]
    #[inline(always)]
    pub fn argb4444(self) -> &'a mut W {
        self.variant(FORMAT_A::ARGB4444)
    }
    #[doc = "16-bit pixels"]
    #[inline(always)]
    pub fn rgb555(self) -> &'a mut W {
        self.variant(FORMAT_A::RGB555)
    }
    #[doc = "16-bit pixels"]
    #[inline(always)]
    pub fn rgb444(self) -> &'a mut W {
        self.variant(FORMAT_A::RGB444)
    }
    #[doc = "16-bit pixels"]
    #[inline(always)]
    pub fn rgb565(self) -> &'a mut W {
        self.variant(FORMAT_A::RGB565)
    }
    #[doc = "32-bit pixels (1-plane XYUV unpacked)"]
    #[inline(always)]
    pub fn yuv1p444(self) -> &'a mut W {
        self.variant(FORMAT_A::YUV1P444)
    }
    #[doc = "16-bit pixels (1-plane U0,Y0,V0,Y1 interleaved bytes)"]
    #[inline(always)]
    pub fn uyvy1p422(self) -> &'a mut W {
        self.variant(FORMAT_A::UYVY1P422)
    }
    #[doc = "16-bit pixels (1-plane V0,Y0,U0,Y1 interleaved bytes)"]
    #[inline(always)]
    pub fn vyuy1p422(self) -> &'a mut W {
        self.variant(FORMAT_A::VYUY1P422)
    }
    #[doc = "8-bit monochrome pixels (1-plane Y luma output)"]
    #[inline(always)]
    pub fn y8(self) -> &'a mut W {
        self.variant(FORMAT_A::Y8)
    }
    #[doc = "4-bit monochrome pixels (1-plane Y luma, 4 bit truncation)"]
    #[inline(always)]
    pub fn y4(self) -> &'a mut W {
        self.variant(FORMAT_A::Y4)
    }
    #[doc = "16-bit pixels (2-plane UV interleaved bytes)"]
    #[inline(always)]
    pub fn yuv2p422(self) -> &'a mut W {
        self.variant(FORMAT_A::YUV2P422)
    }
    #[doc = "16-bit pixels (2-plane UV)"]
    #[inline(always)]
    pub fn yuv2p420(self) -> &'a mut W {
        self.variant(FORMAT_A::YUV2P420)
    }
    #[doc = "16-bit pixels (2-plane VU interleaved bytes)"]
    #[inline(always)]
    pub fn yvu2p422(self) -> &'a mut W {
        self.variant(FORMAT_A::YVU2P422)
    }
    #[doc = "16-bit pixels (2-plane VU)"]
    #[inline(always)]
    pub fn yvu2p420(self) -> &'a mut W {
        self.variant(FORMAT_A::YVU2P420)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f);
        self.w
    }
}
#[doc = "Reader of field `RSVD0`"]
pub type RSVD0_R = crate::R<u8, u8>;
#[doc = "Determines how the PXP writes it's output data\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum INTERLACED_OUTPUT_A {
    #[doc = "0: All data written in progressive format to the OUTBUF Pointer."]
    PROGRESSIVE = 0,
    #[doc = "1: Interlaced output: only data for field 0 is written to the OUTBUF Pointer."]
    FIELD0 = 1,
    #[doc = "2: Interlaced output: only data for field 1 is written to the OUTBUF2 Pointer."]
    FIELD1 = 2,
    #[doc = "3: Interlaced output: data for field 0 is written to OUTBUF and data for field 1 is written to OUTBUF2."]
    INTERLACED = 3,
}
impl From<INTERLACED_OUTPUT_A> for u8 {
    #[inline(always)]
    fn from(variant: INTERLACED_OUTPUT_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `INTERLACED_OUTPUT`"]
pub type INTERLACED_OUTPUT_R = crate::R<u8, INTERLACED_OUTPUT_A>;
impl INTERLACED_OUTPUT_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> INTERLACED_OUTPUT_A {
        match self.bits {
            0 => INTERLACED_OUTPUT_A::PROGRESSIVE,
            1 => INTERLACED_OUTPUT_A::FIELD0,
            2 => INTERLACED_OUTPUT_A::FIELD1,
            3 => INTERLACED_OUTPUT_A::INTERLACED,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `PROGRESSIVE`"]
    #[inline(always)]
    pub fn is_progressive(&self) -> bool {
        *self == INTERLACED_OUTPUT_A::PROGRESSIVE
    }
    #[doc = "Checks if the value of the field is `FIELD0`"]
    #[inline(always)]
    pub fn is_field0(&self) -> bool {
        *self == INTERLACED_OUTPUT_A::FIELD0
    }
    #[doc = "Checks if the value of the field is `FIELD1`"]
    #[inline(always)]
    pub fn is_field1(&self) -> bool {
        *self == INTERLACED_OUTPUT_A::FIELD1
    }
    #[doc = "Checks if the value of the field is `INTERLACED`"]
    #[inline(always)]
    pub fn is_interlaced(&self) -> bool {
        *self == INTERLACED_OUTPUT_A::INTERLACED
    }
}
#[doc = "Write proxy for field `INTERLACED_OUTPUT`"]
pub struct INTERLACED_OUTPUT_W<'a> {
    w: &'a mut W,
}
impl<'a> INTERLACED_OUTPUT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: INTERLACED_OUTPUT_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "All data written in progressive format to the OUTBUF Pointer."]
    #[inline(always)]
    pub fn progressive(self) -> &'a mut W {
        self.variant(INTERLACED_OUTPUT_A::PROGRESSIVE)
    }
    #[doc = "Interlaced output: only data for field 0 is written to the OUTBUF Pointer."]
    #[inline(always)]
    pub fn field0(self) -> &'a mut W {
        self.variant(INTERLACED_OUTPUT_A::FIELD0)
    }
    #[doc = "Interlaced output: only data for field 1 is written to the OUTBUF2 Pointer."]
    #[inline(always)]
    pub fn field1(self) -> &'a mut W {
        self.variant(INTERLACED_OUTPUT_A::FIELD1)
    }
    #[doc = "Interlaced output: data for field 0 is written to OUTBUF and data for field 1 is written to OUTBUF2."]
    #[inline(always)]
    pub fn interlaced(self) -> &'a mut W {
        self.variant(INTERLACED_OUTPUT_A::INTERLACED)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
        self.w
    }
}
#[doc = "Reader of field `RSVD1`"]
pub type RSVD1_R = crate::R<u16, u16>;
#[doc = "Reader of field `ALPHA_OUTPUT`"]
pub type ALPHA_OUTPUT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ALPHA_OUTPUT`"]
pub struct ALPHA_OUTPUT_W<'a> {
    w: &'a mut W,
}
impl<'a> ALPHA_OUTPUT_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
        self.w
    }
}
#[doc = "Reader of field `ALPHA`"]
pub type ALPHA_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `ALPHA`"]
pub struct ALPHA_W<'a> {
    w: &'a mut W,
}
impl<'a> ALPHA_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:4 - Output framebuffer format"]
    #[inline(always)]
    pub fn format(&self) -> FORMAT_R {
        FORMAT_R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bits 5:7 - Reserved, always set to zero."]
    #[inline(always)]
    pub fn rsvd0(&self) -> RSVD0_R {
        RSVD0_R::new(((self.bits >> 5) & 0x07) as u8)
    }
    #[doc = "Bits 8:9 - Determines how the PXP writes it's output data"]
    #[inline(always)]
    pub fn interlaced_output(&self) -> INTERLACED_OUTPUT_R {
        INTERLACED_OUTPUT_R::new(((self.bits >> 8) & 0x03) as u8)
    }
    #[doc = "Bits 10:22 - Reserved, always set to zero."]
    #[inline(always)]
    pub fn rsvd1(&self) -> RSVD1_R {
        RSVD1_R::new(((self.bits >> 10) & 0x1fff) as u16)
    }
    #[doc = "Bit 23 - Indicates that alpha component in output buffer pixels should be overwritten by PXP_OUT_CTRL\\[ALPHA\\]"]
    #[inline(always)]
    pub fn alpha_output(&self) -> ALPHA_OUTPUT_R {
        ALPHA_OUTPUT_R::new(((self.bits >> 23) & 0x01) != 0)
    }
    #[doc = "Bits 24:31 - When generating an output buffer with an alpha component, the value in this field will be used when enabled to override the alpha passed through the pixel data pipeline"]
    #[inline(always)]
    pub fn alpha(&self) -> ALPHA_R {
        ALPHA_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bits 0:4 - Output framebuffer format"]
    #[inline(always)]
    pub fn format(&mut self) -> FORMAT_W {
        FORMAT_W { w: self }
    }
    #[doc = "Bits 8:9 - Determines how the PXP writes it's output data"]
    #[inline(always)]
    pub fn interlaced_output(&mut self) -> INTERLACED_OUTPUT_W {
        INTERLACED_OUTPUT_W { w: self }
    }
    #[doc = "Bit 23 - Indicates that alpha component in output buffer pixels should be overwritten by PXP_OUT_CTRL\\[ALPHA\\]"]
    #[inline(always)]
    pub fn alpha_output(&mut self) -> ALPHA_OUTPUT_W {
        ALPHA_OUTPUT_W { w: self }
    }
    #[doc = "Bits 24:31 - When generating an output buffer with an alpha component, the value in this field will be used when enabled to override the alpha passed through the pixel data pipeline"]
    #[inline(always)]
    pub fn alpha(&mut self) -> ALPHA_W {
        ALPHA_W { w: self }
    }
}