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
#[doc = "Register `tve_configuration1` reader"]
pub struct R(crate::R<TVE_CONFIGURATION1_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<TVE_CONFIGURATION1_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<TVE_CONFIGURATION1_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<TVE_CONFIGURATION1_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `tve_configuration1` writer"]
pub struct W(crate::W<TVE_CONFIGURATION1_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<TVE_CONFIGURATION1_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<TVE_CONFIGURATION1_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<TVE_CONFIGURATION1_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `bypass_yclamp` reader - Y input clamping selection\n\nThis bit selects whether the Video Encoder Y input is clamped to 64 to 940 or not. When not clamped the expected range is 0 to 1023. The U and V inputs are always clamped to the range 64 to 960."]
pub type BYPASS_YCLAMP_R = crate::BitReader<BYPASS_YCLAMP_A>;
#[doc = "Y input clamping selection\n\nThis bit selects whether the Video Encoder Y input is clamped to 64 to 940 or not. When not clamped the expected range is 0 to 1023. The U and V inputs are always clamped to the range 64 to 960.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BYPASS_YCLAMP_A {
    #[doc = "0: The Video Encoder Y input is clamped"]
    CLAMPED = 0,
    #[doc = "1: The Video Encoder Y input is not clamped"]
    NOT_CLAMPED = 1,
}
impl From<BYPASS_YCLAMP_A> for bool {
    #[inline(always)]
    fn from(variant: BYPASS_YCLAMP_A) -> Self {
        variant as u8 != 0
    }
}
impl BYPASS_YCLAMP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BYPASS_YCLAMP_A {
        match self.bits {
            false => BYPASS_YCLAMP_A::CLAMPED,
            true => BYPASS_YCLAMP_A::NOT_CLAMPED,
        }
    }
    #[doc = "Checks if the value of the field is `CLAMPED`"]
    #[inline(always)]
    pub fn is_clamped(&self) -> bool {
        *self == BYPASS_YCLAMP_A::CLAMPED
    }
    #[doc = "Checks if the value of the field is `NOT_CLAMPED`"]
    #[inline(always)]
    pub fn is_not_clamped(&self) -> bool {
        *self == BYPASS_YCLAMP_A::NOT_CLAMPED
    }
}
#[doc = "Field `bypass_yclamp` writer - Y input clamping selection\n\nThis bit selects whether the Video Encoder Y input is clamped to 64 to 940 or not. When not clamped the expected range is 0 to 1023. The U and V inputs are always clamped to the range 64 to 960."]
pub type BYPASS_YCLAMP_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TVE_CONFIGURATION1_SPEC, BYPASS_YCLAMP_A, O>;
impl<'a, const O: u8> BYPASS_YCLAMP_W<'a, O> {
    #[doc = "The Video Encoder Y input is clamped"]
    #[inline(always)]
    pub fn clamped(self) -> &'a mut W {
        self.variant(BYPASS_YCLAMP_A::CLAMPED)
    }
    #[doc = "The Video Encoder Y input is not clamped"]
    #[inline(always)]
    pub fn not_clamped(self) -> &'a mut W {
        self.variant(BYPASS_YCLAMP_A::NOT_CLAMPED)
    }
}
#[doc = "Field `rgb_setup` reader - \"Set-up\" enable for RGB outputs. This bit specifies if the \"set-up\" implied value (black_level - blank_level) specified for the CVBS signal is used also for the RGB signals."]
pub type RGB_SETUP_R = crate::BitReader<RGB_SETUP_A>;
#[doc = "\"Set-up\" enable for RGB outputs. This bit specifies if the \"set-up\" implied value (black_level - blank_level) specified for the CVBS signal is used also for the RGB signals.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RGB_SETUP_A {
    #[doc = "0: The \"set-up\" is not used, or i.e. comp_yuv is equal to b'1'."]
    NOT_USED = 0,
    #[doc = "1: The implied \"set-up\" is used for the RGB signals"]
    USED = 1,
}
impl From<RGB_SETUP_A> for bool {
    #[inline(always)]
    fn from(variant: RGB_SETUP_A) -> Self {
        variant as u8 != 0
    }
}
impl RGB_SETUP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RGB_SETUP_A {
        match self.bits {
            false => RGB_SETUP_A::NOT_USED,
            true => RGB_SETUP_A::USED,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_USED`"]
    #[inline(always)]
    pub fn is_not_used(&self) -> bool {
        *self == RGB_SETUP_A::NOT_USED
    }
    #[doc = "Checks if the value of the field is `USED`"]
    #[inline(always)]
    pub fn is_used(&self) -> bool {
        *self == RGB_SETUP_A::USED
    }
}
#[doc = "Field `rgb_setup` writer - \"Set-up\" enable for RGB outputs. This bit specifies if the \"set-up\" implied value (black_level - blank_level) specified for the CVBS signal is used also for the RGB signals."]
pub type RGB_SETUP_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, TVE_CONFIGURATION1_SPEC, RGB_SETUP_A, O>;
impl<'a, const O: u8> RGB_SETUP_W<'a, O> {
    #[doc = "The \"set-up\" is not used, or i.e. comp_yuv is equal to b'1'."]
    #[inline(always)]
    pub fn not_used(self) -> &'a mut W {
        self.variant(RGB_SETUP_A::NOT_USED)
    }
    #[doc = "The implied \"set-up\" is used for the RGB signals"]
    #[inline(always)]
    pub fn used(self) -> &'a mut W {
        self.variant(RGB_SETUP_A::USED)
    }
}
#[doc = "Field `rgb_sync` reader - R, G and B signals sync embedding selection.\n\nThese bits specify whether the sync signal is added to each of the R, G and B components (b'1') or not (b'0'). The bit\\[26\\] specify if the R signal has embedded syncs, the bit\\[25\\] specify if the G signal has embedded syncs and the bit\\[24\\] specify if the B signal has embedded syncs. When comp_yuv is equal to b'1', these bits are N.A. and should be set to b'000'. When the value is different from b'000', RGB_Setup should be set to b'1'."]
pub type RGB_SYNC_R = crate::FieldReader<u8, u8>;
#[doc = "Field `rgb_sync` writer - R, G and B signals sync embedding selection.\n\nThese bits specify whether the sync signal is added to each of the R, G and B components (b'1') or not (b'0'). The bit\\[26\\] specify if the R signal has embedded syncs, the bit\\[25\\] specify if the G signal has embedded syncs and the bit\\[24\\] specify if the B signal has embedded syncs. When comp_yuv is equal to b'1', these bits are N.A. and should be set to b'000'. When the value is different from b'000', RGB_Setup should be set to b'1'."]
pub type RGB_SYNC_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, TVE_CONFIGURATION1_SPEC, u8, u8, 3, O>;
impl R {
    #[doc = "Bit 0 - Y input clamping selection\n\nThis bit selects whether the Video Encoder Y input is clamped to 64 to 940 or not. When not clamped the expected range is 0 to 1023. The U and V inputs are always clamped to the range 64 to 960."]
    #[inline(always)]
    pub fn bypass_yclamp(&self) -> BYPASS_YCLAMP_R {
        BYPASS_YCLAMP_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 16 - \"Set-up\" enable for RGB outputs. This bit specifies if the \"set-up\" implied value (black_level - blank_level) specified for the CVBS signal is used also for the RGB signals."]
    #[inline(always)]
    pub fn rgb_setup(&self) -> RGB_SETUP_R {
        RGB_SETUP_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bits 24:26 - R, G and B signals sync embedding selection.\n\nThese bits specify whether the sync signal is added to each of the R, G and B components (b'1') or not (b'0'). The bit\\[26\\] specify if the R signal has embedded syncs, the bit\\[25\\] specify if the G signal has embedded syncs and the bit\\[24\\] specify if the B signal has embedded syncs. When comp_yuv is equal to b'1', these bits are N.A. and should be set to b'000'. When the value is different from b'000', RGB_Setup should be set to b'1'."]
    #[inline(always)]
    pub fn rgb_sync(&self) -> RGB_SYNC_R {
        RGB_SYNC_R::new(((self.bits >> 24) & 7) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Y input clamping selection\n\nThis bit selects whether the Video Encoder Y input is clamped to 64 to 940 or not. When not clamped the expected range is 0 to 1023. The U and V inputs are always clamped to the range 64 to 960."]
    #[inline(always)]
    #[must_use]
    pub fn bypass_yclamp(&mut self) -> BYPASS_YCLAMP_W<0> {
        BYPASS_YCLAMP_W::new(self)
    }
    #[doc = "Bit 16 - \"Set-up\" enable for RGB outputs. This bit specifies if the \"set-up\" implied value (black_level - blank_level) specified for the CVBS signal is used also for the RGB signals."]
    #[inline(always)]
    #[must_use]
    pub fn rgb_setup(&mut self) -> RGB_SETUP_W<16> {
        RGB_SETUP_W::new(self)
    }
    #[doc = "Bits 24:26 - R, G and B signals sync embedding selection.\n\nThese bits specify whether the sync signal is added to each of the R, G and B components (b'1') or not (b'0'). The bit\\[26\\] specify if the R signal has embedded syncs, the bit\\[25\\] specify if the G signal has embedded syncs and the bit\\[24\\] specify if the B signal has embedded syncs. When comp_yuv is equal to b'1', these bits are N.A. and should be set to b'000'. When the value is different from b'000', RGB_Setup should be set to b'1'."]
    #[inline(always)]
    #[must_use]
    pub fn rgb_sync(&mut self) -> RGB_SYNC_W<24> {
        RGB_SYNC_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "TV Encoder Configuration Register1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tve_configuration1](index.html) module"]
pub struct TVE_CONFIGURATION1_SPEC;
impl crate::RegisterSpec for TVE_CONFIGURATION1_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [tve_configuration1::R](R) reader structure"]
impl crate::Readable for TVE_CONFIGURATION1_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [tve_configuration1::W](W) writer structure"]
impl crate::Writable for TVE_CONFIGURATION1_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets tve_configuration1 to value 0x01"]
impl crate::Resettable for TVE_CONFIGURATION1_SPEC {
    const RESET_VALUE: Self::Ux = 0x01;
}