ambiq_apollo4p_pac/gpu/
drawcodeptr.rs

1#[doc = "Register `DRAWCODEPTR` reader"]
2pub type R = crate::R<DrawcodeptrSpec>;
3#[doc = "Register `DRAWCODEPTR` writer"]
4pub type W = crate::W<DrawcodeptrSpec>;
5#[doc = "Field `FRGND` reader - the pointer for the instruction that will be executed for foreground pixel"]
6pub type FrgndR = crate::FieldReader<u16>;
7#[doc = "Field `FRGND` writer - the pointer for the instruction that will be executed for foreground pixel"]
8pub type FrgndW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `BKGND` reader - the pointer for the instruction that will be executed for background pixel"]
10pub type BkgndR = crate::FieldReader<u16>;
11#[doc = "Field `BKGND` writer - the pointer for the instruction that will be executed for background pixel"]
12pub type BkgndW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    #[doc = "Bits 0:15 - the pointer for the instruction that will be executed for foreground pixel"]
15    #[inline(always)]
16    pub fn frgnd(&self) -> FrgndR {
17        FrgndR::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bits 16:31 - the pointer for the instruction that will be executed for background pixel"]
20    #[inline(always)]
21    pub fn bkgnd(&self) -> BkgndR {
22        BkgndR::new(((self.bits >> 16) & 0xffff) as u16)
23    }
24}
25impl W {
26    #[doc = "Bits 0:15 - the pointer for the instruction that will be executed for foreground pixel"]
27    #[inline(always)]
28    #[must_use]
29    pub fn frgnd(&mut self) -> FrgndW<DrawcodeptrSpec> {
30        FrgndW::new(self, 0)
31    }
32    #[doc = "Bits 16:31 - the pointer for the instruction that will be executed for background pixel"]
33    #[inline(always)]
34    #[must_use]
35    pub fn bkgnd(&mut self) -> BkgndW<DrawcodeptrSpec> {
36        BkgndW::new(self, 16)
37    }
38}
39#[doc = "DRAWCODEPTR register description needed here.\n\nYou can [`read`](crate::Reg::read) this register and get [`drawcodeptr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`drawcodeptr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct DrawcodeptrSpec;
41impl crate::RegisterSpec for DrawcodeptrSpec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`drawcodeptr::R`](R) reader structure"]
45impl crate::Readable for DrawcodeptrSpec {}
46#[doc = "`write(|w| ..)` method takes [`drawcodeptr::W`](W) writer structure"]
47impl crate::Writable for DrawcodeptrSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets DRAWCODEPTR to value 0"]
53impl crate::Resettable for DrawcodeptrSpec {
54    const RESET_VALUE: u32 = 0;
55}