bl702_pac/pwm/
pwm1_config.rs1#[doc = "Register `pwm1_config` reader"]
2pub struct R(crate::R<PWM1_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PWM1_CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PWM1_CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PWM1_CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `pwm1_config` writer"]
17pub struct W(crate::W<PWM1_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PWM1_CONFIG_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<PWM1_CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PWM1_CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `reg_clk_sel` reader - "]
38pub type REG_CLK_SEL_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `reg_clk_sel` writer - "]
40pub type REG_CLK_SEL_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, PWM1_CONFIG_SPEC, u8, u8, 2, O>;
42#[doc = "Field `pwm_out_inv` reader - "]
43pub type PWM_OUT_INV_R = crate::BitReader<bool>;
44#[doc = "Field `pwm_out_inv` writer - "]
45pub type PWM_OUT_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
46#[doc = "Field `pwm_stop_mode` reader - "]
47pub type PWM_STOP_MODE_R = crate::BitReader<bool>;
48#[doc = "Field `pwm_stop_mode` writer - "]
49pub type PWM_STOP_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
50#[doc = "Field `pwm_sw_force_val` reader - "]
51pub type PWM_SW_FORCE_VAL_R = crate::BitReader<bool>;
52#[doc = "Field `pwm_sw_force_val` writer - "]
53pub type PWM_SW_FORCE_VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
54#[doc = "Field `pwm_sw_mode` reader - "]
55pub type PWM_SW_MODE_R = crate::BitReader<bool>;
56#[doc = "Field `pwm_sw_mode` writer - "]
57pub type PWM_SW_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
58#[doc = "Field `pwm_stop_en` reader - "]
59pub type PWM_STOP_EN_R = crate::BitReader<bool>;
60#[doc = "Field `pwm_stop_en` writer - "]
61pub type PWM_STOP_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
62#[doc = "Field `pwm_sts_top` reader - "]
63pub type PWM_STS_TOP_R = crate::BitReader<bool>;
64#[doc = "Field `pwm_sts_top` writer - "]
65pub type PWM_STS_TOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWM1_CONFIG_SPEC, bool, O>;
66impl R {
67 #[doc = "Bits 0:1"]
68 #[inline(always)]
69 pub fn reg_clk_sel(&self) -> REG_CLK_SEL_R {
70 REG_CLK_SEL_R::new((self.bits & 3) as u8)
71 }
72 #[doc = "Bit 2"]
73 #[inline(always)]
74 pub fn pwm_out_inv(&self) -> PWM_OUT_INV_R {
75 PWM_OUT_INV_R::new(((self.bits >> 2) & 1) != 0)
76 }
77 #[doc = "Bit 3"]
78 #[inline(always)]
79 pub fn pwm_stop_mode(&self) -> PWM_STOP_MODE_R {
80 PWM_STOP_MODE_R::new(((self.bits >> 3) & 1) != 0)
81 }
82 #[doc = "Bit 4"]
83 #[inline(always)]
84 pub fn pwm_sw_force_val(&self) -> PWM_SW_FORCE_VAL_R {
85 PWM_SW_FORCE_VAL_R::new(((self.bits >> 4) & 1) != 0)
86 }
87 #[doc = "Bit 5"]
88 #[inline(always)]
89 pub fn pwm_sw_mode(&self) -> PWM_SW_MODE_R {
90 PWM_SW_MODE_R::new(((self.bits >> 5) & 1) != 0)
91 }
92 #[doc = "Bit 6"]
93 #[inline(always)]
94 pub fn pwm_stop_en(&self) -> PWM_STOP_EN_R {
95 PWM_STOP_EN_R::new(((self.bits >> 6) & 1) != 0)
96 }
97 #[doc = "Bit 7"]
98 #[inline(always)]
99 pub fn pwm_sts_top(&self) -> PWM_STS_TOP_R {
100 PWM_STS_TOP_R::new(((self.bits >> 7) & 1) != 0)
101 }
102}
103impl W {
104 #[doc = "Bits 0:1"]
105 #[inline(always)]
106 #[must_use]
107 pub fn reg_clk_sel(&mut self) -> REG_CLK_SEL_W<0> {
108 REG_CLK_SEL_W::new(self)
109 }
110 #[doc = "Bit 2"]
111 #[inline(always)]
112 #[must_use]
113 pub fn pwm_out_inv(&mut self) -> PWM_OUT_INV_W<2> {
114 PWM_OUT_INV_W::new(self)
115 }
116 #[doc = "Bit 3"]
117 #[inline(always)]
118 #[must_use]
119 pub fn pwm_stop_mode(&mut self) -> PWM_STOP_MODE_W<3> {
120 PWM_STOP_MODE_W::new(self)
121 }
122 #[doc = "Bit 4"]
123 #[inline(always)]
124 #[must_use]
125 pub fn pwm_sw_force_val(&mut self) -> PWM_SW_FORCE_VAL_W<4> {
126 PWM_SW_FORCE_VAL_W::new(self)
127 }
128 #[doc = "Bit 5"]
129 #[inline(always)]
130 #[must_use]
131 pub fn pwm_sw_mode(&mut self) -> PWM_SW_MODE_W<5> {
132 PWM_SW_MODE_W::new(self)
133 }
134 #[doc = "Bit 6"]
135 #[inline(always)]
136 #[must_use]
137 pub fn pwm_stop_en(&mut self) -> PWM_STOP_EN_W<6> {
138 PWM_STOP_EN_W::new(self)
139 }
140 #[doc = "Bit 7"]
141 #[inline(always)]
142 #[must_use]
143 pub fn pwm_sts_top(&mut self) -> PWM_STS_TOP_W<7> {
144 PWM_STS_TOP_W::new(self)
145 }
146 #[doc = "Writes raw bits to the register."]
147 #[inline(always)]
148 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
149 self.0.bits(bits);
150 self
151 }
152}
153#[doc = "pwm1_config.\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 [pwm1_config](index.html) module"]
154pub struct PWM1_CONFIG_SPEC;
155impl crate::RegisterSpec for PWM1_CONFIG_SPEC {
156 type Ux = u32;
157}
158#[doc = "`read()` method returns [pwm1_config::R](R) reader structure"]
159impl crate::Readable for PWM1_CONFIG_SPEC {
160 type Reader = R;
161}
162#[doc = "`write(|w| ..)` method takes [pwm1_config::W](W) writer structure"]
163impl crate::Writable for PWM1_CONFIG_SPEC {
164 type Writer = W;
165 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
167}
168#[doc = "`reset()` method sets pwm1_config to value 0"]
169impl crate::Resettable for PWM1_CONFIG_SPEC {
170 const RESET_VALUE: Self::Ux = 0;
171}