cyt3dl_c/m0/videoss0/videoio/subio/compeng/fetchlayer0/
colorcomponentshift7.rs

1#[doc = "Register `COLORCOMPONENTSHIFT7` reader"]
2pub struct R(crate::R<COLORCOMPONENTSHIFT7_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<COLORCOMPONENTSHIFT7_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<COLORCOMPONENTSHIFT7_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<COLORCOMPONENTSHIFT7_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `COLORCOMPONENTSHIFT7` writer"]
17pub struct W(crate::W<COLORCOMPONENTSHIFT7_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<COLORCOMPONENTSHIFT7_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<COLORCOMPONENTSHIFT7_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<COLORCOMPONENTSHIFT7_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `COMPONENTSHIFTALPHA7` reader - Alpha."]
38pub type COMPONENTSHIFTALPHA7_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `COMPONENTSHIFTALPHA7` writer - Alpha."]
40pub type COMPONENTSHIFTALPHA7_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, COLORCOMPONENTSHIFT7_SPEC, u8, u8, 5, O>;
42#[doc = "Field `COMPONENTSHIFTBLUE7` reader - Blue and V (chroma)."]
43pub type COMPONENTSHIFTBLUE7_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `COMPONENTSHIFTBLUE7` writer - Blue and V (chroma)."]
45pub type COMPONENTSHIFTBLUE7_W<'a, const O: u8> =
46    crate::FieldWriter<'a, u32, COLORCOMPONENTSHIFT7_SPEC, u8, u8, 5, O>;
47#[doc = "Field `COMPONENTSHIFTGREEN7` reader - Green and U (chroma)."]
48pub type COMPONENTSHIFTGREEN7_R = crate::FieldReader<u8, u8>;
49#[doc = "Field `COMPONENTSHIFTGREEN7` writer - Green and U (chroma)."]
50pub type COMPONENTSHIFTGREEN7_W<'a, const O: u8> =
51    crate::FieldWriter<'a, u32, COLORCOMPONENTSHIFT7_SPEC, u8, u8, 5, O>;
52#[doc = "Field `COMPONENTSHIFTRED7` reader - Red, Y (luma) and palette index."]
53pub type COMPONENTSHIFTRED7_R = crate::FieldReader<u8, u8>;
54#[doc = "Field `COMPONENTSHIFTRED7` writer - Red, Y (luma) and palette index."]
55pub type COMPONENTSHIFTRED7_W<'a, const O: u8> =
56    crate::FieldWriter<'a, u32, COLORCOMPONENTSHIFT7_SPEC, u8, u8, 5, O>;
57impl R {
58    #[doc = "Bits 0:4 - Alpha."]
59    #[inline(always)]
60    pub fn componentshiftalpha7(&self) -> COMPONENTSHIFTALPHA7_R {
61        COMPONENTSHIFTALPHA7_R::new((self.bits & 0x1f) as u8)
62    }
63    #[doc = "Bits 8:12 - Blue and V (chroma)."]
64    #[inline(always)]
65    pub fn componentshiftblue7(&self) -> COMPONENTSHIFTBLUE7_R {
66        COMPONENTSHIFTBLUE7_R::new(((self.bits >> 8) & 0x1f) as u8)
67    }
68    #[doc = "Bits 16:20 - Green and U (chroma)."]
69    #[inline(always)]
70    pub fn componentshiftgreen7(&self) -> COMPONENTSHIFTGREEN7_R {
71        COMPONENTSHIFTGREEN7_R::new(((self.bits >> 16) & 0x1f) as u8)
72    }
73    #[doc = "Bits 24:28 - Red, Y (luma) and palette index."]
74    #[inline(always)]
75    pub fn componentshiftred7(&self) -> COMPONENTSHIFTRED7_R {
76        COMPONENTSHIFTRED7_R::new(((self.bits >> 24) & 0x1f) as u8)
77    }
78}
79impl W {
80    #[doc = "Bits 0:4 - Alpha."]
81    #[inline(always)]
82    #[must_use]
83    pub fn componentshiftalpha7(&mut self) -> COMPONENTSHIFTALPHA7_W<0> {
84        COMPONENTSHIFTALPHA7_W::new(self)
85    }
86    #[doc = "Bits 8:12 - Blue and V (chroma)."]
87    #[inline(always)]
88    #[must_use]
89    pub fn componentshiftblue7(&mut self) -> COMPONENTSHIFTBLUE7_W<8> {
90        COMPONENTSHIFTBLUE7_W::new(self)
91    }
92    #[doc = "Bits 16:20 - Green and U (chroma)."]
93    #[inline(always)]
94    #[must_use]
95    pub fn componentshiftgreen7(&mut self) -> COMPONENTSHIFTGREEN7_W<16> {
96        COMPONENTSHIFTGREEN7_W::new(self)
97    }
98    #[doc = "Bits 24:28 - Red, Y (luma) and palette index."]
99    #[inline(always)]
100    #[must_use]
101    pub fn componentshiftred7(&mut self) -> COMPONENTSHIFTRED7_W<24> {
102        COMPONENTSHIFTRED7_W::new(self)
103    }
104    #[doc = "Writes raw bits to the register."]
105    #[inline(always)]
106    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
107        self.0.bits(bits);
108        self
109    }
110}
111#[doc = "Bit position of color components for RGB, YUV and index formats (layer 7).\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 [colorcomponentshift7](index.html) module"]
112pub struct COLORCOMPONENTSHIFT7_SPEC;
113impl crate::RegisterSpec for COLORCOMPONENTSHIFT7_SPEC {
114    type Ux = u32;
115}
116#[doc = "`read()` method returns [colorcomponentshift7::R](R) reader structure"]
117impl crate::Readable for COLORCOMPONENTSHIFT7_SPEC {
118    type Reader = R;
119}
120#[doc = "`write(|w| ..)` method takes [colorcomponentshift7::W](W) writer structure"]
121impl crate::Writable for COLORCOMPONENTSHIFT7_SPEC {
122    type Writer = W;
123    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
124    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
125}
126#[doc = "`reset()` method sets COLORCOMPONENTSHIFT7 to value 0x1810_0800"]
127impl crate::Resettable for COLORCOMPONENTSHIFT7_SPEC {
128    const RESET_VALUE: Self::Ux = 0x1810_0800;
129}