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
#[doc = "Reader of register CTRL2_TOG"]
pub type R = crate::R<u32, super::CTRL2_TOG>;
#[doc = "Writer for register CTRL2_TOG"]
pub type W = crate::W<u32, super::CTRL2_TOG>;
#[doc = "Register CTRL2_TOG `reset()`'s with value 0x0020_0000"]
impl crate::ResetValue for super::CTRL2_TOG {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x0020_0000
    }
}
#[doc = "This field determines the order of the RGB components of each pixel in EVEN lines (line numbers 2,4,6,\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum EVEN_LINE_PATTERN_A {
    #[doc = "0: RGB"]
    RGB = 0,
    #[doc = "1: RBG"]
    RBG = 1,
    #[doc = "2: GBR"]
    GBR = 2,
    #[doc = "3: GRB"]
    GRB = 3,
    #[doc = "4: BRG"]
    BRG = 4,
    #[doc = "5: BGR"]
    BGR = 5,
}
impl From<EVEN_LINE_PATTERN_A> for u8 {
    #[inline(always)]
    fn from(variant: EVEN_LINE_PATTERN_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `EVEN_LINE_PATTERN`"]
pub type EVEN_LINE_PATTERN_R = crate::R<u8, EVEN_LINE_PATTERN_A>;
impl EVEN_LINE_PATTERN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, EVEN_LINE_PATTERN_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(EVEN_LINE_PATTERN_A::RGB),
            1 => Val(EVEN_LINE_PATTERN_A::RBG),
            2 => Val(EVEN_LINE_PATTERN_A::GBR),
            3 => Val(EVEN_LINE_PATTERN_A::GRB),
            4 => Val(EVEN_LINE_PATTERN_A::BRG),
            5 => Val(EVEN_LINE_PATTERN_A::BGR),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `RGB`"]
    #[inline(always)]
    pub fn is_rgb(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::RGB
    }
    #[doc = "Checks if the value of the field is `RBG`"]
    #[inline(always)]
    pub fn is_rbg(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::RBG
    }
    #[doc = "Checks if the value of the field is `GBR`"]
    #[inline(always)]
    pub fn is_gbr(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::GBR
    }
    #[doc = "Checks if the value of the field is `GRB`"]
    #[inline(always)]
    pub fn is_grb(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::GRB
    }
    #[doc = "Checks if the value of the field is `BRG`"]
    #[inline(always)]
    pub fn is_brg(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::BRG
    }
    #[doc = "Checks if the value of the field is `BGR`"]
    #[inline(always)]
    pub fn is_bgr(&self) -> bool {
        *self == EVEN_LINE_PATTERN_A::BGR
    }
}
#[doc = "Write proxy for field `EVEN_LINE_PATTERN`"]
pub struct EVEN_LINE_PATTERN_W<'a> {
    w: &'a mut W,
}
impl<'a> EVEN_LINE_PATTERN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: EVEN_LINE_PATTERN_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "RGB"]
    #[inline(always)]
    pub fn rgb(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::RGB)
    }
    #[doc = "RBG"]
    #[inline(always)]
    pub fn rbg(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::RBG)
    }
    #[doc = "GBR"]
    #[inline(always)]
    pub fn gbr(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::GBR)
    }
    #[doc = "GRB"]
    #[inline(always)]
    pub fn grb(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::GRB)
    }
    #[doc = "BRG"]
    #[inline(always)]
    pub fn brg(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::BRG)
    }
    #[doc = "BGR"]
    #[inline(always)]
    pub fn bgr(self) -> &'a mut W {
        self.variant(EVEN_LINE_PATTERN_A::BGR)
    }
    #[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 & !(0x07 << 12)) | (((value as u32) & 0x07) << 12);
        self.w
    }
}
#[doc = "This field determines the order of the RGB components of each pixel in ODD lines (line numbers 1,3,5,\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum ODD_LINE_PATTERN_A {
    #[doc = "0: RGB"]
    RGB = 0,
    #[doc = "1: RBG"]
    RBG = 1,
    #[doc = "2: GBR"]
    GBR = 2,
    #[doc = "3: GRB"]
    GRB = 3,
    #[doc = "4: BRG"]
    BRG = 4,
    #[doc = "5: BGR"]
    BGR = 5,
}
impl From<ODD_LINE_PATTERN_A> for u8 {
    #[inline(always)]
    fn from(variant: ODD_LINE_PATTERN_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `ODD_LINE_PATTERN`"]
pub type ODD_LINE_PATTERN_R = crate::R<u8, ODD_LINE_PATTERN_A>;
impl ODD_LINE_PATTERN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, ODD_LINE_PATTERN_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(ODD_LINE_PATTERN_A::RGB),
            1 => Val(ODD_LINE_PATTERN_A::RBG),
            2 => Val(ODD_LINE_PATTERN_A::GBR),
            3 => Val(ODD_LINE_PATTERN_A::GRB),
            4 => Val(ODD_LINE_PATTERN_A::BRG),
            5 => Val(ODD_LINE_PATTERN_A::BGR),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `RGB`"]
    #[inline(always)]
    pub fn is_rgb(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::RGB
    }
    #[doc = "Checks if the value of the field is `RBG`"]
    #[inline(always)]
    pub fn is_rbg(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::RBG
    }
    #[doc = "Checks if the value of the field is `GBR`"]
    #[inline(always)]
    pub fn is_gbr(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::GBR
    }
    #[doc = "Checks if the value of the field is `GRB`"]
    #[inline(always)]
    pub fn is_grb(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::GRB
    }
    #[doc = "Checks if the value of the field is `BRG`"]
    #[inline(always)]
    pub fn is_brg(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::BRG
    }
    #[doc = "Checks if the value of the field is `BGR`"]
    #[inline(always)]
    pub fn is_bgr(&self) -> bool {
        *self == ODD_LINE_PATTERN_A::BGR
    }
}
#[doc = "Write proxy for field `ODD_LINE_PATTERN`"]
pub struct ODD_LINE_PATTERN_W<'a> {
    w: &'a mut W,
}
impl<'a> ODD_LINE_PATTERN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: ODD_LINE_PATTERN_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "RGB"]
    #[inline(always)]
    pub fn rgb(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::RGB)
    }
    #[doc = "RBG"]
    #[inline(always)]
    pub fn rbg(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::RBG)
    }
    #[doc = "GBR"]
    #[inline(always)]
    pub fn gbr(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::GBR)
    }
    #[doc = "GRB"]
    #[inline(always)]
    pub fn grb(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::GRB)
    }
    #[doc = "BRG"]
    #[inline(always)]
    pub fn brg(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::BRG)
    }
    #[doc = "BGR"]
    #[inline(always)]
    pub fn bgr(self) -> &'a mut W {
        self.variant(ODD_LINE_PATTERN_A::BGR)
    }
    #[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 & !(0x07 << 16)) | (((value as u32) & 0x07) << 16);
        self.w
    }
}
#[doc = "Reader of field `BURST_LEN_8`"]
pub type BURST_LEN_8_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `BURST_LEN_8`"]
pub struct BURST_LEN_8_W<'a> {
    w: &'a mut W,
}
impl<'a> BURST_LEN_8_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 << 20)) | (((value as u32) & 0x01) << 20);
        self.w
    }
}
#[doc = "This bitfield indicates the maximum number of outstanding transactions that LCDIF should request when it is acting as a bus master\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUTSTANDING_REQS_A {
    #[doc = "0: REQ_1"]
    REQ_1 = 0,
    #[doc = "1: REQ_2"]
    REQ_2 = 1,
    #[doc = "2: REQ_4"]
    REQ_4 = 2,
    #[doc = "3: REQ_8"]
    REQ_8 = 3,
    #[doc = "4: REQ_16"]
    REQ_16 = 4,
}
impl From<OUTSTANDING_REQS_A> for u8 {
    #[inline(always)]
    fn from(variant: OUTSTANDING_REQS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `OUTSTANDING_REQS`"]
pub type OUTSTANDING_REQS_R = crate::R<u8, OUTSTANDING_REQS_A>;
impl OUTSTANDING_REQS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, OUTSTANDING_REQS_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(OUTSTANDING_REQS_A::REQ_1),
            1 => Val(OUTSTANDING_REQS_A::REQ_2),
            2 => Val(OUTSTANDING_REQS_A::REQ_4),
            3 => Val(OUTSTANDING_REQS_A::REQ_8),
            4 => Val(OUTSTANDING_REQS_A::REQ_16),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `REQ_1`"]
    #[inline(always)]
    pub fn is_req_1(&self) -> bool {
        *self == OUTSTANDING_REQS_A::REQ_1
    }
    #[doc = "Checks if the value of the field is `REQ_2`"]
    #[inline(always)]
    pub fn is_req_2(&self) -> bool {
        *self == OUTSTANDING_REQS_A::REQ_2
    }
    #[doc = "Checks if the value of the field is `REQ_4`"]
    #[inline(always)]
    pub fn is_req_4(&self) -> bool {
        *self == OUTSTANDING_REQS_A::REQ_4
    }
    #[doc = "Checks if the value of the field is `REQ_8`"]
    #[inline(always)]
    pub fn is_req_8(&self) -> bool {
        *self == OUTSTANDING_REQS_A::REQ_8
    }
    #[doc = "Checks if the value of the field is `REQ_16`"]
    #[inline(always)]
    pub fn is_req_16(&self) -> bool {
        *self == OUTSTANDING_REQS_A::REQ_16
    }
}
#[doc = "Write proxy for field `OUTSTANDING_REQS`"]
pub struct OUTSTANDING_REQS_W<'a> {
    w: &'a mut W,
}
impl<'a> OUTSTANDING_REQS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUTSTANDING_REQS_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "REQ_1"]
    #[inline(always)]
    pub fn req_1(self) -> &'a mut W {
        self.variant(OUTSTANDING_REQS_A::REQ_1)
    }
    #[doc = "REQ_2"]
    #[inline(always)]
    pub fn req_2(self) -> &'a mut W {
        self.variant(OUTSTANDING_REQS_A::REQ_2)
    }
    #[doc = "REQ_4"]
    #[inline(always)]
    pub fn req_4(self) -> &'a mut W {
        self.variant(OUTSTANDING_REQS_A::REQ_4)
    }
    #[doc = "REQ_8"]
    #[inline(always)]
    pub fn req_8(self) -> &'a mut W {
        self.variant(OUTSTANDING_REQS_A::REQ_8)
    }
    #[doc = "REQ_16"]
    #[inline(always)]
    pub fn req_16(self) -> &'a mut W {
        self.variant(OUTSTANDING_REQS_A::REQ_16)
    }
    #[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 & !(0x07 << 21)) | (((value as u32) & 0x07) << 21);
        self.w
    }
}
impl R {
    #[doc = "Bits 12:14 - This field determines the order of the RGB components of each pixel in EVEN lines (line numbers 2,4,6,"]
    #[inline(always)]
    pub fn even_line_pattern(&self) -> EVEN_LINE_PATTERN_R {
        EVEN_LINE_PATTERN_R::new(((self.bits >> 12) & 0x07) as u8)
    }
    #[doc = "Bits 16:18 - This field determines the order of the RGB components of each pixel in ODD lines (line numbers 1,3,5,"]
    #[inline(always)]
    pub fn odd_line_pattern(&self) -> ODD_LINE_PATTERN_R {
        ODD_LINE_PATTERN_R::new(((self.bits >> 16) & 0x07) as u8)
    }
    #[doc = "Bit 20 - By default, when the LCDIF is in the bus master mode, it will issue AXI bursts of length 16 (except when in packed 24 bpp mode, it will issue bursts of length 15)"]
    #[inline(always)]
    pub fn burst_len_8(&self) -> BURST_LEN_8_R {
        BURST_LEN_8_R::new(((self.bits >> 20) & 0x01) != 0)
    }
    #[doc = "Bits 21:23 - This bitfield indicates the maximum number of outstanding transactions that LCDIF should request when it is acting as a bus master"]
    #[inline(always)]
    pub fn outstanding_reqs(&self) -> OUTSTANDING_REQS_R {
        OUTSTANDING_REQS_R::new(((self.bits >> 21) & 0x07) as u8)
    }
}
impl W {
    #[doc = "Bits 12:14 - This field determines the order of the RGB components of each pixel in EVEN lines (line numbers 2,4,6,"]
    #[inline(always)]
    pub fn even_line_pattern(&mut self) -> EVEN_LINE_PATTERN_W {
        EVEN_LINE_PATTERN_W { w: self }
    }
    #[doc = "Bits 16:18 - This field determines the order of the RGB components of each pixel in ODD lines (line numbers 1,3,5,"]
    #[inline(always)]
    pub fn odd_line_pattern(&mut self) -> ODD_LINE_PATTERN_W {
        ODD_LINE_PATTERN_W { w: self }
    }
    #[doc = "Bit 20 - By default, when the LCDIF is in the bus master mode, it will issue AXI bursts of length 16 (except when in packed 24 bpp mode, it will issue bursts of length 15)"]
    #[inline(always)]
    pub fn burst_len_8(&mut self) -> BURST_LEN_8_W {
        BURST_LEN_8_W { w: self }
    }
    #[doc = "Bits 21:23 - This bitfield indicates the maximum number of outstanding transactions that LCDIF should request when it is acting as a bus master"]
    #[inline(always)]
    pub fn outstanding_reqs(&mut self) -> OUTSTANDING_REQS_W {
        OUTSTANDING_REQS_W { w: self }
    }
}