d1_pac/tcon_lcd0/
lcd_ceu_ctl.rs

1#[doc = "Register `lcd_ceu_ctl` reader"]
2pub type R = crate::R<LCD_CEU_CTL_SPEC>;
3#[doc = "Register `lcd_ceu_ctl` writer"]
4pub type W = crate::W<LCD_CEU_CTL_SPEC>;
5#[doc = "Field `bt656_f_mask_value` reader - BT656 F Mask Value"]
6pub type BT656_F_MASK_VALUE_R = crate::BitReader;
7#[doc = "Field `bt656_f_mask_value` writer - BT656 F Mask Value"]
8pub type BT656_F_MASK_VALUE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `bt656_f_mask` reader - BT656 F Mask"]
10pub type BT656_F_MASK_R = crate::BitReader<BT656_F_MASK_A>;
11#[doc = "BT656 F Mask\n\nValue on reset: 0"]
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub enum BT656_F_MASK_A {
14    #[doc = "0: Disable"]
15    DISABLE = 0,
16    #[doc = "1: Enable"]
17    ENABLE = 1,
18}
19impl From<BT656_F_MASK_A> for bool {
20    #[inline(always)]
21    fn from(variant: BT656_F_MASK_A) -> Self {
22        variant as u8 != 0
23    }
24}
25impl BT656_F_MASK_R {
26    #[doc = "Get enumerated values variant"]
27    #[inline(always)]
28    pub const fn variant(&self) -> BT656_F_MASK_A {
29        match self.bits {
30            false => BT656_F_MASK_A::DISABLE,
31            true => BT656_F_MASK_A::ENABLE,
32        }
33    }
34    #[doc = "Disable"]
35    #[inline(always)]
36    pub fn is_disable(&self) -> bool {
37        *self == BT656_F_MASK_A::DISABLE
38    }
39    #[doc = "Enable"]
40    #[inline(always)]
41    pub fn is_enable(&self) -> bool {
42        *self == BT656_F_MASK_A::ENABLE
43    }
44}
45#[doc = "Field `bt656_f_mask` writer - BT656 F Mask"]
46pub type BT656_F_MASK_W<'a, REG> = crate::BitWriter<'a, REG, BT656_F_MASK_A>;
47impl<'a, REG> BT656_F_MASK_W<'a, REG>
48where
49    REG: crate::Writable + crate::RegisterSpec,
50{
51    #[doc = "Disable"]
52    #[inline(always)]
53    pub fn disable(self) -> &'a mut crate::W<REG> {
54        self.variant(BT656_F_MASK_A::DISABLE)
55    }
56    #[doc = "Enable"]
57    #[inline(always)]
58    pub fn enable(self) -> &'a mut crate::W<REG> {
59        self.variant(BT656_F_MASK_A::ENABLE)
60    }
61}
62#[doc = "Field `ceu_en` reader - Enable CEU function"]
63pub type CEU_EN_R = crate::BitReader<CEU_EN_A>;
64#[doc = "Enable CEU function\n\nValue on reset: 0"]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum CEU_EN_A {
67    #[doc = "0: Bypass"]
68    BYPASS = 0,
69    #[doc = "1: Enable"]
70    ENABLE = 1,
71}
72impl From<CEU_EN_A> for bool {
73    #[inline(always)]
74    fn from(variant: CEU_EN_A) -> Self {
75        variant as u8 != 0
76    }
77}
78impl CEU_EN_R {
79    #[doc = "Get enumerated values variant"]
80    #[inline(always)]
81    pub const fn variant(&self) -> CEU_EN_A {
82        match self.bits {
83            false => CEU_EN_A::BYPASS,
84            true => CEU_EN_A::ENABLE,
85        }
86    }
87    #[doc = "Bypass"]
88    #[inline(always)]
89    pub fn is_bypass(&self) -> bool {
90        *self == CEU_EN_A::BYPASS
91    }
92    #[doc = "Enable"]
93    #[inline(always)]
94    pub fn is_enable(&self) -> bool {
95        *self == CEU_EN_A::ENABLE
96    }
97}
98#[doc = "Field `ceu_en` writer - Enable CEU function"]
99pub type CEU_EN_W<'a, REG> = crate::BitWriter<'a, REG, CEU_EN_A>;
100impl<'a, REG> CEU_EN_W<'a, REG>
101where
102    REG: crate::Writable + crate::RegisterSpec,
103{
104    #[doc = "Bypass"]
105    #[inline(always)]
106    pub fn bypass(self) -> &'a mut crate::W<REG> {
107        self.variant(CEU_EN_A::BYPASS)
108    }
109    #[doc = "Enable"]
110    #[inline(always)]
111    pub fn enable(self) -> &'a mut crate::W<REG> {
112        self.variant(CEU_EN_A::ENABLE)
113    }
114}
115impl R {
116    #[doc = "Bit 29 - BT656 F Mask Value"]
117    #[inline(always)]
118    pub fn bt656_f_mask_value(&self) -> BT656_F_MASK_VALUE_R {
119        BT656_F_MASK_VALUE_R::new(((self.bits >> 29) & 1) != 0)
120    }
121    #[doc = "Bit 30 - BT656 F Mask"]
122    #[inline(always)]
123    pub fn bt656_f_mask(&self) -> BT656_F_MASK_R {
124        BT656_F_MASK_R::new(((self.bits >> 30) & 1) != 0)
125    }
126    #[doc = "Bit 31 - Enable CEU function"]
127    #[inline(always)]
128    pub fn ceu_en(&self) -> CEU_EN_R {
129        CEU_EN_R::new(((self.bits >> 31) & 1) != 0)
130    }
131}
132impl W {
133    #[doc = "Bit 29 - BT656 F Mask Value"]
134    #[inline(always)]
135    #[must_use]
136    pub fn bt656_f_mask_value(&mut self) -> BT656_F_MASK_VALUE_W<LCD_CEU_CTL_SPEC> {
137        BT656_F_MASK_VALUE_W::new(self, 29)
138    }
139    #[doc = "Bit 30 - BT656 F Mask"]
140    #[inline(always)]
141    #[must_use]
142    pub fn bt656_f_mask(&mut self) -> BT656_F_MASK_W<LCD_CEU_CTL_SPEC> {
143        BT656_F_MASK_W::new(self, 30)
144    }
145    #[doc = "Bit 31 - Enable CEU function"]
146    #[inline(always)]
147    #[must_use]
148    pub fn ceu_en(&mut self) -> CEU_EN_W<LCD_CEU_CTL_SPEC> {
149        CEU_EN_W::new(self, 31)
150    }
151    #[doc = r" Writes raw bits to the register."]
152    #[doc = r""]
153    #[doc = r" # Safety"]
154    #[doc = r""]
155    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
156    #[inline(always)]
157    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
158        self.bits = bits;
159        self
160    }
161}
162#[doc = "LCD CEU Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lcd_ceu_ctl::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lcd_ceu_ctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
163pub struct LCD_CEU_CTL_SPEC;
164impl crate::RegisterSpec for LCD_CEU_CTL_SPEC {
165    type Ux = u32;
166}
167#[doc = "`read()` method returns [`lcd_ceu_ctl::R`](R) reader structure"]
168impl crate::Readable for LCD_CEU_CTL_SPEC {}
169#[doc = "`write(|w| ..)` method takes [`lcd_ceu_ctl::W`](W) writer structure"]
170impl crate::Writable for LCD_CEU_CTL_SPEC {
171    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
172    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
173}
174#[doc = "`reset()` method sets lcd_ceu_ctl to value 0"]
175impl crate::Resettable for LCD_CEU_CTL_SPEC {
176    const RESET_VALUE: Self::Ux = 0;
177}