d1_pac/tve/
tve_front_back_porch.rs

1#[doc = "Register `tve_front_back_porch` reader"]
2pub type R = crate::R<TVE_FRONT_BACK_PORCH_SPEC>;
3#[doc = "Register `tve_front_back_porch` writer"]
4pub type W = crate::W<TVE_FRONT_BACK_PORCH_SPEC>;
5#[doc = "Field `front_porch` reader - Must be even\n\nSpecify the width of the front porch in encoder clock cycles. 6 bits unsigned even integer. Allowed range is form 10 to 62.\n\nThe default value is 32.\n\nFor 1080i mode, the value is 44."]
6pub type FRONT_PORCH_R = crate::FieldReader<u16>;
7#[doc = "Field `front_porch` writer - Must be even\n\nSpecify the width of the front porch in encoder clock cycles. 6 bits unsigned even integer. Allowed range is form 10 to 62.\n\nThe default value is 32.\n\nFor 1080i mode, the value is 44."]
8pub type FRONT_PORCH_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
9#[doc = "Field `back_porch` reader - Specify the width of the back porch in encoder clock cycles. Min value is (burst_width+breeze_way+17). 8 bits unsigned integer.\n\nThe default value is 118.\n\nFor 720p mode, the value is 260.\n\nFor 1080i/p mode, the value is 192."]
10pub type BACK_PORCH_R = crate::FieldReader<u16>;
11#[doc = "Field `back_porch` writer - Specify the width of the back porch in encoder clock cycles. Min value is (burst_width+breeze_way+17). 8 bits unsigned integer.\n\nThe default value is 118.\n\nFor 720p mode, the value is 260.\n\nFor 1080i/p mode, the value is 192."]
12pub type BACK_PORCH_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
13impl R {
14    #[doc = "Bits 0:11 - Must be even\n\nSpecify the width of the front porch in encoder clock cycles. 6 bits unsigned even integer. Allowed range is form 10 to 62.\n\nThe default value is 32.\n\nFor 1080i mode, the value is 44."]
15    #[inline(always)]
16    pub fn front_porch(&self) -> FRONT_PORCH_R {
17        FRONT_PORCH_R::new((self.bits & 0x0fff) as u16)
18    }
19    #[doc = "Bits 16:24 - Specify the width of the back porch in encoder clock cycles. Min value is (burst_width+breeze_way+17). 8 bits unsigned integer.\n\nThe default value is 118.\n\nFor 720p mode, the value is 260.\n\nFor 1080i/p mode, the value is 192."]
20    #[inline(always)]
21    pub fn back_porch(&self) -> BACK_PORCH_R {
22        BACK_PORCH_R::new(((self.bits >> 16) & 0x01ff) as u16)
23    }
24}
25impl W {
26    #[doc = "Bits 0:11 - Must be even\n\nSpecify the width of the front porch in encoder clock cycles. 6 bits unsigned even integer. Allowed range is form 10 to 62.\n\nThe default value is 32.\n\nFor 1080i mode, the value is 44."]
27    #[inline(always)]
28    #[must_use]
29    pub fn front_porch(&mut self) -> FRONT_PORCH_W<TVE_FRONT_BACK_PORCH_SPEC> {
30        FRONT_PORCH_W::new(self, 0)
31    }
32    #[doc = "Bits 16:24 - Specify the width of the back porch in encoder clock cycles. Min value is (burst_width+breeze_way+17). 8 bits unsigned integer.\n\nThe default value is 118.\n\nFor 720p mode, the value is 260.\n\nFor 1080i/p mode, the value is 192."]
33    #[inline(always)]
34    #[must_use]
35    pub fn back_porch(&mut self) -> BACK_PORCH_W<TVE_FRONT_BACK_PORCH_SPEC> {
36        BACK_PORCH_W::new(self, 16)
37    }
38    #[doc = r" Writes raw bits to the register."]
39    #[doc = r""]
40    #[doc = r" # Safety"]
41    #[doc = r""]
42    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
43    #[inline(always)]
44    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
45        self.bits = bits;
46        self
47    }
48}
49#[doc = "TV Encoder Front/Back Porch Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tve_front_back_porch::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 [`tve_front_back_porch::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
50pub struct TVE_FRONT_BACK_PORCH_SPEC;
51impl crate::RegisterSpec for TVE_FRONT_BACK_PORCH_SPEC {
52    type Ux = u32;
53}
54#[doc = "`read()` method returns [`tve_front_back_porch::R`](R) reader structure"]
55impl crate::Readable for TVE_FRONT_BACK_PORCH_SPEC {}
56#[doc = "`write(|w| ..)` method takes [`tve_front_back_porch::W`](W) writer structure"]
57impl crate::Writable for TVE_FRONT_BACK_PORCH_SPEC {
58    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
59    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
60}
61#[doc = "`reset()` method sets tve_front_back_porch to value 0x0076_0020"]
62impl crate::Resettable for TVE_FRONT_BACK_PORCH_SPEC {
63    const RESET_VALUE: Self::Ux = 0x0076_0020;
64}