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 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572
#[doc = "Reader of register CTRL_CLR"] pub type R = crate::R<u32, super::CTRL_CLR>; #[doc = "Writer for register CTRL_CLR"] pub type W = crate::W<u32, super::CTRL_CLR>; #[doc = "Register CTRL_CLR `reset()`'s with value 0xc000_0000"] impl crate::ResetValue for super::CTRL_CLR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0xc000_0000 } } #[doc = "Reader of field `ENABLE`"] pub type ENABLE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `ENABLE`"] pub struct ENABLE_W<'a> { w: &'a mut W, } impl<'a> ENABLE_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) | ((value as u32) & 0x01); self.w } } #[doc = "Reader of field `IRQ_ENABLE`"] pub type IRQ_ENABLE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `IRQ_ENABLE`"] pub struct IRQ_ENABLE_W<'a> { w: &'a mut W, } impl<'a> IRQ_ENABLE_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 << 1)) | (((value as u32) & 0x01) << 1); self.w } } #[doc = "Reader of field `NEXT_IRQ_ENABLE`"] pub type NEXT_IRQ_ENABLE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `NEXT_IRQ_ENABLE`"] pub struct NEXT_IRQ_ENABLE_W<'a> { w: &'a mut W, } impl<'a> NEXT_IRQ_ENABLE_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 << 2)) | (((value as u32) & 0x01) << 2); self.w } } #[doc = "Reader of field `ENABLE_LCD_HANDSHAKE`"] pub type ENABLE_LCD_HANDSHAKE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `ENABLE_LCD_HANDSHAKE`"] pub struct ENABLE_LCD_HANDSHAKE_W<'a> { w: &'a mut W, } impl<'a> ENABLE_LCD_HANDSHAKE_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 << 4)) | (((value as u32) & 0x01) << 4); self.w } } #[doc = "Reader of field `RSVD0`"] pub type RSVD0_R = crate::R<u8, u8>; #[doc = "Indicates the clockwise rotation to be applied at the output buffer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum ROTATE_A { #[doc = "0: ROT_0"] ROT_0 = 0, #[doc = "1: ROT_90"] ROT_90 = 1, #[doc = "2: ROT_180"] ROT_180 = 2, #[doc = "3: ROT_270"] ROT_270 = 3, } impl From<ROTATE_A> for u8 { #[inline(always)] fn from(variant: ROTATE_A) -> Self { variant as _ } } #[doc = "Reader of field `ROTATE`"] pub type ROTATE_R = crate::R<u8, ROTATE_A>; impl ROTATE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ROTATE_A { match self.bits { 0 => ROTATE_A::ROT_0, 1 => ROTATE_A::ROT_90, 2 => ROTATE_A::ROT_180, 3 => ROTATE_A::ROT_270, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `ROT_0`"] #[inline(always)] pub fn is_rot_0(&self) -> bool { *self == ROTATE_A::ROT_0 } #[doc = "Checks if the value of the field is `ROT_90`"] #[inline(always)] pub fn is_rot_90(&self) -> bool { *self == ROTATE_A::ROT_90 } #[doc = "Checks if the value of the field is `ROT_180`"] #[inline(always)] pub fn is_rot_180(&self) -> bool { *self == ROTATE_A::ROT_180 } #[doc = "Checks if the value of the field is `ROT_270`"] #[inline(always)] pub fn is_rot_270(&self) -> bool { *self == ROTATE_A::ROT_270 } } #[doc = "Write proxy for field `ROTATE`"] pub struct ROTATE_W<'a> { w: &'a mut W, } impl<'a> ROTATE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ROTATE_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "ROT_0"] #[inline(always)] pub fn rot_0(self) -> &'a mut W { self.variant(ROTATE_A::ROT_0) } #[doc = "ROT_90"] #[inline(always)] pub fn rot_90(self) -> &'a mut W { self.variant(ROTATE_A::ROT_90) } #[doc = "ROT_180"] #[inline(always)] pub fn rot_180(self) -> &'a mut W { self.variant(ROTATE_A::ROT_180) } #[doc = "ROT_270"] #[inline(always)] pub fn rot_270(self) -> &'a mut W { self.variant(ROTATE_A::ROT_270) } #[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 `HFLIP`"] pub type HFLIP_R = crate::R<bool, bool>; #[doc = "Write proxy for field `HFLIP`"] pub struct HFLIP_W<'a> { w: &'a mut W, } impl<'a> HFLIP_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 << 10)) | (((value as u32) & 0x01) << 10); self.w } } #[doc = "Reader of field `VFLIP`"] pub type VFLIP_R = crate::R<bool, bool>; #[doc = "Write proxy for field `VFLIP`"] pub struct VFLIP_W<'a> { w: &'a mut W, } impl<'a> VFLIP_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 << 11)) | (((value as u32) & 0x01) << 11); self.w } } #[doc = "Reader of field `RSVD1`"] pub type RSVD1_R = crate::R<u16, u16>; #[doc = "Reader of field `ROT_POS`"] pub type ROT_POS_R = crate::R<bool, bool>; #[doc = "Write proxy for field `ROT_POS`"] pub struct ROT_POS_W<'a> { w: &'a mut W, } impl<'a> ROT_POS_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 << 22)) | (((value as u32) & 0x01) << 22); self.w } } #[doc = "Select the block size to process.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum BLOCK_SIZE_A { #[doc = "0: Process 8x8 pixel blocks."] _8X8 = 0, #[doc = "1: Process 16x16 pixel blocks."] _16X16 = 1, } impl From<BLOCK_SIZE_A> for bool { #[inline(always)] fn from(variant: BLOCK_SIZE_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `BLOCK_SIZE`"] pub type BLOCK_SIZE_R = crate::R<bool, BLOCK_SIZE_A>; impl BLOCK_SIZE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BLOCK_SIZE_A { match self.bits { false => BLOCK_SIZE_A::_8X8, true => BLOCK_SIZE_A::_16X16, } } #[doc = "Checks if the value of the field is `_8X8`"] #[inline(always)] pub fn is_8x8(&self) -> bool { *self == BLOCK_SIZE_A::_8X8 } #[doc = "Checks if the value of the field is `_16X16`"] #[inline(always)] pub fn is_16x16(&self) -> bool { *self == BLOCK_SIZE_A::_16X16 } } #[doc = "Write proxy for field `BLOCK_SIZE`"] pub struct BLOCK_SIZE_W<'a> { w: &'a mut W, } impl<'a> BLOCK_SIZE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: BLOCK_SIZE_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Process 8x8 pixel blocks."] #[inline(always)] pub fn _8x8(self) -> &'a mut W { self.variant(BLOCK_SIZE_A::_8X8) } #[doc = "Process 16x16 pixel blocks."] #[inline(always)] pub fn _16x16(self) -> &'a mut W { self.variant(BLOCK_SIZE_A::_16X16) } #[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 `RSVD3`"] pub type RSVD3_R = crate::R<u8, u8>; #[doc = "Reader of field `EN_REPEAT`"] pub type EN_REPEAT_R = crate::R<bool, bool>; #[doc = "Write proxy for field `EN_REPEAT`"] pub struct EN_REPEAT_W<'a> { w: &'a mut W, } impl<'a> EN_REPEAT_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 << 28)) | (((value as u32) & 0x01) << 28); self.w } } #[doc = "Reader of field `RSVD4`"] pub type RSVD4_R = crate::R<bool, bool>; #[doc = "Reader of field `CLKGATE`"] pub type CLKGATE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `CLKGATE`"] pub struct CLKGATE_W<'a> { w: &'a mut W, } impl<'a> CLKGATE_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 << 30)) | (((value as u32) & 0x01) << 30); self.w } } #[doc = "Reader of field `SFTRST`"] pub type SFTRST_R = crate::R<bool, bool>; #[doc = "Write proxy for field `SFTRST`"] pub struct SFTRST_W<'a> { w: &'a mut W, } impl<'a> SFTRST_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 << 31)) | (((value as u32) & 0x01) << 31); self.w } } impl R { #[doc = "Bit 0 - Enables PXP operation with specified parameters"] #[inline(always)] pub fn enable(&self) -> ENABLE_R { ENABLE_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - Interrupt enable"] #[inline(always)] pub fn irq_enable(&self) -> IRQ_ENABLE_R { IRQ_ENABLE_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - Next command interrupt enable"] #[inline(always)] pub fn next_irq_enable(&self) -> NEXT_IRQ_ENABLE_R { NEXT_IRQ_ENABLE_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 4 - Enable handshake with LCD controller"] #[inline(always)] pub fn enable_lcd_handshake(&self) -> ENABLE_LCD_HANDSHAKE_R { ENABLE_LCD_HANDSHAKE_R::new(((self.bits >> 4) & 0x01) != 0) } #[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 - Indicates the clockwise rotation to be applied at the output buffer"] #[inline(always)] pub fn rotate(&self) -> ROTATE_R { ROTATE_R::new(((self.bits >> 8) & 0x03) as u8) } #[doc = "Bit 10 - Indicates that the output buffer should be flipped horizontally (effect applied before rotation)."] #[inline(always)] pub fn hflip(&self) -> HFLIP_R { HFLIP_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 11 - Indicates that the output buffer should be flipped vertically (effect applied before rotation)."] #[inline(always)] pub fn vflip(&self) -> VFLIP_R { VFLIP_R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bits 12:21 - Reserved, always set to zero."] #[inline(always)] pub fn rsvd1(&self) -> RSVD1_R { RSVD1_R::new(((self.bits >> 12) & 0x03ff) as u16) } #[doc = "Bit 22 - This bit controls where rotation will occur in the PXP datapath"] #[inline(always)] pub fn rot_pos(&self) -> ROT_POS_R { ROT_POS_R::new(((self.bits >> 22) & 0x01) != 0) } #[doc = "Bit 23 - Select the block size to process."] #[inline(always)] pub fn block_size(&self) -> BLOCK_SIZE_R { BLOCK_SIZE_R::new(((self.bits >> 23) & 0x01) != 0) } #[doc = "Bits 24:27 - Reserved, always set to zero."] #[inline(always)] pub fn rsvd3(&self) -> RSVD3_R { RSVD3_R::new(((self.bits >> 24) & 0x0f) as u8) } #[doc = "Bit 28 - Enable the PXP to run continuously"] #[inline(always)] pub fn en_repeat(&self) -> EN_REPEAT_R { EN_REPEAT_R::new(((self.bits >> 28) & 0x01) != 0) } #[doc = "Bit 29 - Reserved, always set to zero."] #[inline(always)] pub fn rsvd4(&self) -> RSVD4_R { RSVD4_R::new(((self.bits >> 29) & 0x01) != 0) } #[doc = "Bit 30 - This bit must be set to zero for normal operation"] #[inline(always)] pub fn clkgate(&self) -> CLKGATE_R { CLKGATE_R::new(((self.bits >> 30) & 0x01) != 0) } #[doc = "Bit 31 - Set this bit to zero to enable normal PXP operation"] #[inline(always)] pub fn sftrst(&self) -> SFTRST_R { SFTRST_R::new(((self.bits >> 31) & 0x01) != 0) } } impl W { #[doc = "Bit 0 - Enables PXP operation with specified parameters"] #[inline(always)] pub fn enable(&mut self) -> ENABLE_W { ENABLE_W { w: self } } #[doc = "Bit 1 - Interrupt enable"] #[inline(always)] pub fn irq_enable(&mut self) -> IRQ_ENABLE_W { IRQ_ENABLE_W { w: self } } #[doc = "Bit 2 - Next command interrupt enable"] #[inline(always)] pub fn next_irq_enable(&mut self) -> NEXT_IRQ_ENABLE_W { NEXT_IRQ_ENABLE_W { w: self } } #[doc = "Bit 4 - Enable handshake with LCD controller"] #[inline(always)] pub fn enable_lcd_handshake(&mut self) -> ENABLE_LCD_HANDSHAKE_W { ENABLE_LCD_HANDSHAKE_W { w: self } } #[doc = "Bits 8:9 - Indicates the clockwise rotation to be applied at the output buffer"] #[inline(always)] pub fn rotate(&mut self) -> ROTATE_W { ROTATE_W { w: self } } #[doc = "Bit 10 - Indicates that the output buffer should be flipped horizontally (effect applied before rotation)."] #[inline(always)] pub fn hflip(&mut self) -> HFLIP_W { HFLIP_W { w: self } } #[doc = "Bit 11 - Indicates that the output buffer should be flipped vertically (effect applied before rotation)."] #[inline(always)] pub fn vflip(&mut self) -> VFLIP_W { VFLIP_W { w: self } } #[doc = "Bit 22 - This bit controls where rotation will occur in the PXP datapath"] #[inline(always)] pub fn rot_pos(&mut self) -> ROT_POS_W { ROT_POS_W { w: self } } #[doc = "Bit 23 - Select the block size to process."] #[inline(always)] pub fn block_size(&mut self) -> BLOCK_SIZE_W { BLOCK_SIZE_W { w: self } } #[doc = "Bit 28 - Enable the PXP to run continuously"] #[inline(always)] pub fn en_repeat(&mut self) -> EN_REPEAT_W { EN_REPEAT_W { w: self } } #[doc = "Bit 30 - This bit must be set to zero for normal operation"] #[inline(always)] pub fn clkgate(&mut self) -> CLKGATE_W { CLKGATE_W { w: self } } #[doc = "Bit 31 - Set this bit to zero to enable normal PXP operation"] #[inline(always)] pub fn sftrst(&mut self) -> SFTRST_W { SFTRST_W { w: self } } }