esp32p4/ppa/
blend_trans_mode.rs

1#[doc = "Register `BLEND_TRANS_MODE` reader"]
2pub type R = crate::R<BLEND_TRANS_MODE_SPEC>;
3#[doc = "Register `BLEND_TRANS_MODE` writer"]
4pub type W = crate::W<BLEND_TRANS_MODE_SPEC>;
5#[doc = "Field `BLEND_EN` reader - Set this bit to enable alpha blending."]
6pub type BLEND_EN_R = crate::BitReader;
7#[doc = "Field `BLEND_EN` writer - Set this bit to enable alpha blending."]
8pub type BLEND_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `BLEND_BYPASS` reader - Set this bit to bypass blender. Then background date would be output."]
10pub type BLEND_BYPASS_R = crate::BitReader;
11#[doc = "Field `BLEND_BYPASS` writer - Set this bit to bypass blender. Then background date would be output."]
12pub type BLEND_BYPASS_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `BLEND_FIX_PIXEL_FILL_EN` reader - This bit is used to enable fix pixel filling. When this mode is enable only Tx channel is work and the output pixel is configured by PPA_OUT_FIX_PIXEL."]
14pub type BLEND_FIX_PIXEL_FILL_EN_R = crate::BitReader;
15#[doc = "Field `BLEND_FIX_PIXEL_FILL_EN` writer - This bit is used to enable fix pixel filling. When this mode is enable only Tx channel is work and the output pixel is configured by PPA_OUT_FIX_PIXEL."]
16pub type BLEND_FIX_PIXEL_FILL_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `UPDATE` writer - Set this bit to update the transfer mode. Only the bit is set the transfer mode is valid."]
18pub type UPDATE_W<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `BLEND_RST` reader - write 1 then write 0 to reset blending engine."]
20pub type BLEND_RST_R = crate::BitReader;
21#[doc = "Field `BLEND_RST` writer - write 1 then write 0 to reset blending engine."]
22pub type BLEND_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
23impl R {
24    #[doc = "Bit 0 - Set this bit to enable alpha blending."]
25    #[inline(always)]
26    pub fn blend_en(&self) -> BLEND_EN_R {
27        BLEND_EN_R::new((self.bits & 1) != 0)
28    }
29    #[doc = "Bit 1 - Set this bit to bypass blender. Then background date would be output."]
30    #[inline(always)]
31    pub fn blend_bypass(&self) -> BLEND_BYPASS_R {
32        BLEND_BYPASS_R::new(((self.bits >> 1) & 1) != 0)
33    }
34    #[doc = "Bit 2 - This bit is used to enable fix pixel filling. When this mode is enable only Tx channel is work and the output pixel is configured by PPA_OUT_FIX_PIXEL."]
35    #[inline(always)]
36    pub fn blend_fix_pixel_fill_en(&self) -> BLEND_FIX_PIXEL_FILL_EN_R {
37        BLEND_FIX_PIXEL_FILL_EN_R::new(((self.bits >> 2) & 1) != 0)
38    }
39    #[doc = "Bit 4 - write 1 then write 0 to reset blending engine."]
40    #[inline(always)]
41    pub fn blend_rst(&self) -> BLEND_RST_R {
42        BLEND_RST_R::new(((self.bits >> 4) & 1) != 0)
43    }
44}
45#[cfg(feature = "impl-register-debug")]
46impl core::fmt::Debug for R {
47    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
48        f.debug_struct("BLEND_TRANS_MODE")
49            .field("blend_en", &format_args!("{}", self.blend_en().bit()))
50            .field(
51                "blend_bypass",
52                &format_args!("{}", self.blend_bypass().bit()),
53            )
54            .field(
55                "blend_fix_pixel_fill_en",
56                &format_args!("{}", self.blend_fix_pixel_fill_en().bit()),
57            )
58            .field("blend_rst", &format_args!("{}", self.blend_rst().bit()))
59            .finish()
60    }
61}
62#[cfg(feature = "impl-register-debug")]
63impl core::fmt::Debug for crate::generic::Reg<BLEND_TRANS_MODE_SPEC> {
64    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
65        core::fmt::Debug::fmt(&self.read(), f)
66    }
67}
68impl W {
69    #[doc = "Bit 0 - Set this bit to enable alpha blending."]
70    #[inline(always)]
71    #[must_use]
72    pub fn blend_en(&mut self) -> BLEND_EN_W<BLEND_TRANS_MODE_SPEC> {
73        BLEND_EN_W::new(self, 0)
74    }
75    #[doc = "Bit 1 - Set this bit to bypass blender. Then background date would be output."]
76    #[inline(always)]
77    #[must_use]
78    pub fn blend_bypass(&mut self) -> BLEND_BYPASS_W<BLEND_TRANS_MODE_SPEC> {
79        BLEND_BYPASS_W::new(self, 1)
80    }
81    #[doc = "Bit 2 - This bit is used to enable fix pixel filling. When this mode is enable only Tx channel is work and the output pixel is configured by PPA_OUT_FIX_PIXEL."]
82    #[inline(always)]
83    #[must_use]
84    pub fn blend_fix_pixel_fill_en(&mut self) -> BLEND_FIX_PIXEL_FILL_EN_W<BLEND_TRANS_MODE_SPEC> {
85        BLEND_FIX_PIXEL_FILL_EN_W::new(self, 2)
86    }
87    #[doc = "Bit 3 - Set this bit to update the transfer mode. Only the bit is set the transfer mode is valid."]
88    #[inline(always)]
89    #[must_use]
90    pub fn update(&mut self) -> UPDATE_W<BLEND_TRANS_MODE_SPEC> {
91        UPDATE_W::new(self, 3)
92    }
93    #[doc = "Bit 4 - write 1 then write 0 to reset blending engine."]
94    #[inline(always)]
95    #[must_use]
96    pub fn blend_rst(&mut self) -> BLEND_RST_W<BLEND_TRANS_MODE_SPEC> {
97        BLEND_RST_W::new(self, 4)
98    }
99}
100#[doc = "Blending engine mode configure register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`blend_trans_mode::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 [`blend_trans_mode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
101pub struct BLEND_TRANS_MODE_SPEC;
102impl crate::RegisterSpec for BLEND_TRANS_MODE_SPEC {
103    type Ux = u32;
104}
105#[doc = "`read()` method returns [`blend_trans_mode::R`](R) reader structure"]
106impl crate::Readable for BLEND_TRANS_MODE_SPEC {}
107#[doc = "`write(|w| ..)` method takes [`blend_trans_mode::W`](W) writer structure"]
108impl crate::Writable for BLEND_TRANS_MODE_SPEC {
109    type Safety = crate::Unsafe;
110    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
112}
113#[doc = "`reset()` method sets BLEND_TRANS_MODE to value 0"]
114impl crate::Resettable for BLEND_TRANS_MODE_SPEC {
115    const RESET_VALUE: u32 = 0;
116}