d1_pac/tcon_tv0/
tv_gctl.rs1#[doc = "Register `tv_gctl` reader"]
2pub type R = crate::R<TV_GCTL_SPEC>;
3#[doc = "Register `tv_gctl` writer"]
4pub type W = crate::W<TV_GCTL_SPEC>;
5#[doc = "Field `cec_ddc_pad_sel` reader - CEC DDC PAD Select"]
6pub type CEC_DDC_PAD_SEL_R = crate::BitReader<CEC_DDC_PAD_SEL_A>;
7#[doc = "CEC DDC PAD Select\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum CEC_DDC_PAD_SEL_A {
10 #[doc = "1: TCON_TV internal pad for cec scl sal"]
11 INTERNAL_PAD = 1,
12 #[doc = "0: GPIO pad for cec scl sal"]
13 GPIO_PAD = 0,
14}
15impl From<CEC_DDC_PAD_SEL_A> for bool {
16 #[inline(always)]
17 fn from(variant: CEC_DDC_PAD_SEL_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl CEC_DDC_PAD_SEL_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> CEC_DDC_PAD_SEL_A {
25 match self.bits {
26 true => CEC_DDC_PAD_SEL_A::INTERNAL_PAD,
27 false => CEC_DDC_PAD_SEL_A::GPIO_PAD,
28 }
29 }
30 #[doc = "TCON_TV internal pad for cec scl sal"]
31 #[inline(always)]
32 pub fn is_internal_pad(&self) -> bool {
33 *self == CEC_DDC_PAD_SEL_A::INTERNAL_PAD
34 }
35 #[doc = "GPIO pad for cec scl sal"]
36 #[inline(always)]
37 pub fn is_gpio_pad(&self) -> bool {
38 *self == CEC_DDC_PAD_SEL_A::GPIO_PAD
39 }
40}
41#[doc = "Field `cec_ddc_pad_sel` writer - CEC DDC PAD Select"]
42pub type CEC_DDC_PAD_SEL_W<'a, REG> = crate::BitWriter<'a, REG, CEC_DDC_PAD_SEL_A>;
43impl<'a, REG> CEC_DDC_PAD_SEL_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "TCON_TV internal pad for cec scl sal"]
48 #[inline(always)]
49 pub fn internal_pad(self) -> &'a mut crate::W<REG> {
50 self.variant(CEC_DDC_PAD_SEL_A::INTERNAL_PAD)
51 }
52 #[doc = "GPIO pad for cec scl sal"]
53 #[inline(always)]
54 pub fn gpio_pad(self) -> &'a mut crate::W<REG> {
55 self.variant(CEC_DDC_PAD_SEL_A::GPIO_PAD)
56 }
57}
58#[doc = "Field `tv_en` reader - When it is disabled, the module will be reset to idle state."]
59pub type TV_EN_R = crate::BitReader<TV_EN_A>;
60#[doc = "When it is disabled, the module will be reset to idle state.\n\nValue on reset: 0"]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum TV_EN_A {
63 #[doc = "0: Disable"]
64 DISABLE = 0,
65 #[doc = "1: Enable"]
66 ENABLE = 1,
67}
68impl From<TV_EN_A> for bool {
69 #[inline(always)]
70 fn from(variant: TV_EN_A) -> Self {
71 variant as u8 != 0
72 }
73}
74impl TV_EN_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub const fn variant(&self) -> TV_EN_A {
78 match self.bits {
79 false => TV_EN_A::DISABLE,
80 true => TV_EN_A::ENABLE,
81 }
82 }
83 #[doc = "Disable"]
84 #[inline(always)]
85 pub fn is_disable(&self) -> bool {
86 *self == TV_EN_A::DISABLE
87 }
88 #[doc = "Enable"]
89 #[inline(always)]
90 pub fn is_enable(&self) -> bool {
91 *self == TV_EN_A::ENABLE
92 }
93}
94#[doc = "Field `tv_en` writer - When it is disabled, the module will be reset to idle state."]
95pub type TV_EN_W<'a, REG> = crate::BitWriter<'a, REG, TV_EN_A>;
96impl<'a, REG> TV_EN_W<'a, REG>
97where
98 REG: crate::Writable + crate::RegisterSpec,
99{
100 #[doc = "Disable"]
101 #[inline(always)]
102 pub fn disable(self) -> &'a mut crate::W<REG> {
103 self.variant(TV_EN_A::DISABLE)
104 }
105 #[doc = "Enable"]
106 #[inline(always)]
107 pub fn enable(self) -> &'a mut crate::W<REG> {
108 self.variant(TV_EN_A::ENABLE)
109 }
110}
111impl R {
112 #[doc = "Bit 1 - CEC DDC PAD Select"]
113 #[inline(always)]
114 pub fn cec_ddc_pad_sel(&self) -> CEC_DDC_PAD_SEL_R {
115 CEC_DDC_PAD_SEL_R::new(((self.bits >> 1) & 1) != 0)
116 }
117 #[doc = "Bit 31 - When it is disabled, the module will be reset to idle state."]
118 #[inline(always)]
119 pub fn tv_en(&self) -> TV_EN_R {
120 TV_EN_R::new(((self.bits >> 31) & 1) != 0)
121 }
122}
123impl W {
124 #[doc = "Bit 1 - CEC DDC PAD Select"]
125 #[inline(always)]
126 #[must_use]
127 pub fn cec_ddc_pad_sel(&mut self) -> CEC_DDC_PAD_SEL_W<TV_GCTL_SPEC> {
128 CEC_DDC_PAD_SEL_W::new(self, 1)
129 }
130 #[doc = "Bit 31 - When it is disabled, the module will be reset to idle state."]
131 #[inline(always)]
132 #[must_use]
133 pub fn tv_en(&mut self) -> TV_EN_W<TV_GCTL_SPEC> {
134 TV_EN_W::new(self, 31)
135 }
136 #[doc = r" Writes raw bits to the register."]
137 #[doc = r""]
138 #[doc = r" # Safety"]
139 #[doc = r""]
140 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
141 #[inline(always)]
142 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
143 self.bits = bits;
144 self
145 }
146}
147#[doc = "TV Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tv_gctl::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 [`tv_gctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
148pub struct TV_GCTL_SPEC;
149impl crate::RegisterSpec for TV_GCTL_SPEC {
150 type Ux = u32;
151}
152#[doc = "`read()` method returns [`tv_gctl::R`](R) reader structure"]
153impl crate::Readable for TV_GCTL_SPEC {}
154#[doc = "`write(|w| ..)` method takes [`tv_gctl::W`](W) writer structure"]
155impl crate::Writable for TV_GCTL_SPEC {
156 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
157 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
158}
159#[doc = "`reset()` method sets tv_gctl to value 0"]
160impl crate::Resettable for TV_GCTL_SPEC {
161 const RESET_VALUE: Self::Ux = 0;
162}