bl702_pac/mjpeg/
mjpeg_control_2.rs1#[doc = "Register `mjpeg_control_2` reader"]
2pub struct R(crate::R<MJPEG_CONTROL_2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MJPEG_CONTROL_2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MJPEG_CONTROL_2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MJPEG_CONTROL_2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `mjpeg_control_2` writer"]
17pub struct W(crate::W<MJPEG_CONTROL_2_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MJPEG_CONTROL_2_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<MJPEG_CONTROL_2_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MJPEG_CONTROL_2_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `reg_sw_frame` reader - "]
38pub type REG_SW_FRAME_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `reg_sw_frame` writer - "]
40pub type REG_SW_FRAME_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, MJPEG_CONTROL_2_SPEC, u8, u8, 5, O>;
42#[doc = "Field `reg_mjpeg_sw_mode` reader - "]
43pub type REG_MJPEG_SW_MODE_R = crate::BitReader<bool>;
44#[doc = "Field `reg_mjpeg_sw_mode` writer - "]
45pub type REG_MJPEG_SW_MODE_W<'a, const O: u8> =
46    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
47#[doc = "Field `reg_mjpeg_sw_run` reader - "]
48pub type REG_MJPEG_SW_RUN_R = crate::BitReader<bool>;
49#[doc = "Field `reg_mjpeg_sw_run` writer - "]
50pub type REG_MJPEG_SW_RUN_W<'a, const O: u8> =
51    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
52#[doc = "Field `reg_yy_dvp2ahb_lsel` reader - "]
53pub type REG_YY_DVP2AHB_LSEL_R = crate::BitReader<bool>;
54#[doc = "Field `reg_yy_dvp2ahb_lsel` writer - "]
55pub type REG_YY_DVP2AHB_LSEL_W<'a, const O: u8> =
56    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
57#[doc = "Field `reg_yy_dvp2ahb_fsel` reader - "]
58pub type REG_YY_DVP2AHB_FSEL_R = crate::BitReader<bool>;
59#[doc = "Field `reg_yy_dvp2ahb_fsel` writer - "]
60pub type REG_YY_DVP2AHB_FSEL_W<'a, const O: u8> =
61    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
62#[doc = "Field `reg_uv_dvp2ahb_lsel` reader - "]
63pub type REG_UV_DVP2AHB_LSEL_R = crate::BitReader<bool>;
64#[doc = "Field `reg_uv_dvp2ahb_lsel` writer - "]
65pub type REG_UV_DVP2AHB_LSEL_W<'a, const O: u8> =
66    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
67#[doc = "Field `reg_uv_dvp2ahb_fsel` reader - "]
68pub type REG_UV_DVP2AHB_FSEL_R = crate::BitReader<bool>;
69#[doc = "Field `reg_uv_dvp2ahb_fsel` writer - "]
70pub type REG_UV_DVP2AHB_FSEL_W<'a, const O: u8> =
71    crate::BitWriter<'a, u32, MJPEG_CONTROL_2_SPEC, bool, O>;
72#[doc = "Field `reg_mjpeg_wait_cycle` reader - "]
73pub type REG_MJPEG_WAIT_CYCLE_R = crate::FieldReader<u16, u16>;
74#[doc = "Field `reg_mjpeg_wait_cycle` writer - "]
75pub type REG_MJPEG_WAIT_CYCLE_W<'a, const O: u8> =
76    crate::FieldWriter<'a, u32, MJPEG_CONTROL_2_SPEC, u16, u16, 16, O>;
77impl R {
78    #[doc = "Bits 0:4"]
79    #[inline(always)]
80    pub fn reg_sw_frame(&self) -> REG_SW_FRAME_R {
81        REG_SW_FRAME_R::new((self.bits & 0x1f) as u8)
82    }
83    #[doc = "Bit 8"]
84    #[inline(always)]
85    pub fn reg_mjpeg_sw_mode(&self) -> REG_MJPEG_SW_MODE_R {
86        REG_MJPEG_SW_MODE_R::new(((self.bits >> 8) & 1) != 0)
87    }
88    #[doc = "Bit 9"]
89    #[inline(always)]
90    pub fn reg_mjpeg_sw_run(&self) -> REG_MJPEG_SW_RUN_R {
91        REG_MJPEG_SW_RUN_R::new(((self.bits >> 9) & 1) != 0)
92    }
93    #[doc = "Bit 12"]
94    #[inline(always)]
95    pub fn reg_yy_dvp2ahb_lsel(&self) -> REG_YY_DVP2AHB_LSEL_R {
96        REG_YY_DVP2AHB_LSEL_R::new(((self.bits >> 12) & 1) != 0)
97    }
98    #[doc = "Bit 13"]
99    #[inline(always)]
100    pub fn reg_yy_dvp2ahb_fsel(&self) -> REG_YY_DVP2AHB_FSEL_R {
101        REG_YY_DVP2AHB_FSEL_R::new(((self.bits >> 13) & 1) != 0)
102    }
103    #[doc = "Bit 14"]
104    #[inline(always)]
105    pub fn reg_uv_dvp2ahb_lsel(&self) -> REG_UV_DVP2AHB_LSEL_R {
106        REG_UV_DVP2AHB_LSEL_R::new(((self.bits >> 14) & 1) != 0)
107    }
108    #[doc = "Bit 15"]
109    #[inline(always)]
110    pub fn reg_uv_dvp2ahb_fsel(&self) -> REG_UV_DVP2AHB_FSEL_R {
111        REG_UV_DVP2AHB_FSEL_R::new(((self.bits >> 15) & 1) != 0)
112    }
113    #[doc = "Bits 16:31"]
114    #[inline(always)]
115    pub fn reg_mjpeg_wait_cycle(&self) -> REG_MJPEG_WAIT_CYCLE_R {
116        REG_MJPEG_WAIT_CYCLE_R::new(((self.bits >> 16) & 0xffff) as u16)
117    }
118}
119impl W {
120    #[doc = "Bits 0:4"]
121    #[inline(always)]
122    #[must_use]
123    pub fn reg_sw_frame(&mut self) -> REG_SW_FRAME_W<0> {
124        REG_SW_FRAME_W::new(self)
125    }
126    #[doc = "Bit 8"]
127    #[inline(always)]
128    #[must_use]
129    pub fn reg_mjpeg_sw_mode(&mut self) -> REG_MJPEG_SW_MODE_W<8> {
130        REG_MJPEG_SW_MODE_W::new(self)
131    }
132    #[doc = "Bit 9"]
133    #[inline(always)]
134    #[must_use]
135    pub fn reg_mjpeg_sw_run(&mut self) -> REG_MJPEG_SW_RUN_W<9> {
136        REG_MJPEG_SW_RUN_W::new(self)
137    }
138    #[doc = "Bit 12"]
139    #[inline(always)]
140    #[must_use]
141    pub fn reg_yy_dvp2ahb_lsel(&mut self) -> REG_YY_DVP2AHB_LSEL_W<12> {
142        REG_YY_DVP2AHB_LSEL_W::new(self)
143    }
144    #[doc = "Bit 13"]
145    #[inline(always)]
146    #[must_use]
147    pub fn reg_yy_dvp2ahb_fsel(&mut self) -> REG_YY_DVP2AHB_FSEL_W<13> {
148        REG_YY_DVP2AHB_FSEL_W::new(self)
149    }
150    #[doc = "Bit 14"]
151    #[inline(always)]
152    #[must_use]
153    pub fn reg_uv_dvp2ahb_lsel(&mut self) -> REG_UV_DVP2AHB_LSEL_W<14> {
154        REG_UV_DVP2AHB_LSEL_W::new(self)
155    }
156    #[doc = "Bit 15"]
157    #[inline(always)]
158    #[must_use]
159    pub fn reg_uv_dvp2ahb_fsel(&mut self) -> REG_UV_DVP2AHB_FSEL_W<15> {
160        REG_UV_DVP2AHB_FSEL_W::new(self)
161    }
162    #[doc = "Bits 16:31"]
163    #[inline(always)]
164    #[must_use]
165    pub fn reg_mjpeg_wait_cycle(&mut self) -> REG_MJPEG_WAIT_CYCLE_W<16> {
166        REG_MJPEG_WAIT_CYCLE_W::new(self)
167    }
168    #[doc = "Writes raw bits to the register."]
169    #[inline(always)]
170    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
171        self.0.bits(bits);
172        self
173    }
174}
175#[doc = "mjpeg_control_2.\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 [mjpeg_control_2](index.html) module"]
176pub struct MJPEG_CONTROL_2_SPEC;
177impl crate::RegisterSpec for MJPEG_CONTROL_2_SPEC {
178    type Ux = u32;
179}
180#[doc = "`read()` method returns [mjpeg_control_2::R](R) reader structure"]
181impl crate::Readable for MJPEG_CONTROL_2_SPEC {
182    type Reader = R;
183}
184#[doc = "`write(|w| ..)` method takes [mjpeg_control_2::W](W) writer structure"]
185impl crate::Writable for MJPEG_CONTROL_2_SPEC {
186    type Writer = W;
187    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
188    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
189}
190#[doc = "`reset()` method sets mjpeg_control_2 to value 0"]
191impl crate::Resettable for MJPEG_CONTROL_2_SPEC {
192    const RESET_VALUE: Self::Ux = 0;
193}