bl702_pac/glb/
gpdac_actrl.rs1#[doc = "Register `gpdac_actrl` reader"]
2pub struct R(crate::R<GPDAC_ACTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<GPDAC_ACTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<GPDAC_ACTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<GPDAC_ACTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `gpdac_actrl` writer"]
17pub struct W(crate::W<GPDAC_ACTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<GPDAC_ACTRL_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<GPDAC_ACTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<GPDAC_ACTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `gpdac_a_en` reader - "]
38pub type GPDAC_A_EN_R = crate::BitReader<bool>;
39#[doc = "Field `gpdac_a_en` writer - "]
40pub type GPDAC_A_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_ACTRL_SPEC, bool, O>;
41#[doc = "Field `gpdac_ioa_en` reader - "]
42pub type GPDAC_IOA_EN_R = crate::BitReader<bool>;
43#[doc = "Field `gpdac_ioa_en` writer - "]
44pub type GPDAC_IOA_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPDAC_ACTRL_SPEC, bool, O>;
45#[doc = "Field `gpdac_a_rng` reader - "]
46pub type GPDAC_A_RNG_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `gpdac_a_rng` writer - "]
48pub type GPDAC_A_RNG_W<'a, const O: u8> =
49 crate::FieldWriter<'a, u32, GPDAC_ACTRL_SPEC, u8, u8, 2, O>;
50#[doc = "Field `gpdac_a_outmux` reader - "]
51pub type GPDAC_A_OUTMUX_R = crate::FieldReader<u8, u8>;
52#[doc = "Field `gpdac_a_outmux` writer - "]
53pub type GPDAC_A_OUTMUX_W<'a, const O: u8> =
54 crate::FieldWriter<'a, u32, GPDAC_ACTRL_SPEC, u8, u8, 3, O>;
55impl R {
56 #[doc = "Bit 0"]
57 #[inline(always)]
58 pub fn gpdac_a_en(&self) -> GPDAC_A_EN_R {
59 GPDAC_A_EN_R::new((self.bits & 1) != 0)
60 }
61 #[doc = "Bit 1"]
62 #[inline(always)]
63 pub fn gpdac_ioa_en(&self) -> GPDAC_IOA_EN_R {
64 GPDAC_IOA_EN_R::new(((self.bits >> 1) & 1) != 0)
65 }
66 #[doc = "Bits 18:19"]
67 #[inline(always)]
68 pub fn gpdac_a_rng(&self) -> GPDAC_A_RNG_R {
69 GPDAC_A_RNG_R::new(((self.bits >> 18) & 3) as u8)
70 }
71 #[doc = "Bits 20:22"]
72 #[inline(always)]
73 pub fn gpdac_a_outmux(&self) -> GPDAC_A_OUTMUX_R {
74 GPDAC_A_OUTMUX_R::new(((self.bits >> 20) & 7) as u8)
75 }
76}
77impl W {
78 #[doc = "Bit 0"]
79 #[inline(always)]
80 #[must_use]
81 pub fn gpdac_a_en(&mut self) -> GPDAC_A_EN_W<0> {
82 GPDAC_A_EN_W::new(self)
83 }
84 #[doc = "Bit 1"]
85 #[inline(always)]
86 #[must_use]
87 pub fn gpdac_ioa_en(&mut self) -> GPDAC_IOA_EN_W<1> {
88 GPDAC_IOA_EN_W::new(self)
89 }
90 #[doc = "Bits 18:19"]
91 #[inline(always)]
92 #[must_use]
93 pub fn gpdac_a_rng(&mut self) -> GPDAC_A_RNG_W<18> {
94 GPDAC_A_RNG_W::new(self)
95 }
96 #[doc = "Bits 20:22"]
97 #[inline(always)]
98 #[must_use]
99 pub fn gpdac_a_outmux(&mut self) -> GPDAC_A_OUTMUX_W<20> {
100 GPDAC_A_OUTMUX_W::new(self)
101 }
102 #[doc = "Writes raw bits to the register."]
103 #[inline(always)]
104 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
105 self.0.bits(bits);
106 self
107 }
108}
109#[doc = "gpdac_actrl.\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 [gpdac_actrl](index.html) module"]
110pub struct GPDAC_ACTRL_SPEC;
111impl crate::RegisterSpec for GPDAC_ACTRL_SPEC {
112 type Ux = u32;
113}
114#[doc = "`read()` method returns [gpdac_actrl::R](R) reader structure"]
115impl crate::Readable for GPDAC_ACTRL_SPEC {
116 type Reader = R;
117}
118#[doc = "`write(|w| ..)` method takes [gpdac_actrl::W](W) writer structure"]
119impl crate::Writable for GPDAC_ACTRL_SPEC {
120 type Writer = W;
121 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
122 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
123}
124#[doc = "`reset()` method sets gpdac_actrl to value 0"]
125impl crate::Resettable for GPDAC_ACTRL_SPEC {
126 const RESET_VALUE: Self::Ux = 0;
127}