aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/src/gpiote.rs8
-rw-r--r--embassy-nrf/src/ppi/mod.rs4
-rw-r--r--embassy-nrf/src/pwm.rs22
-rw-r--r--embassy-nrf/src/timer.rs12
4 files changed, 23 insertions, 23 deletions
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs
index 21d0d9564..6550f2abd 100644
--- a/embassy-nrf/src/gpiote.rs
+++ b/embassy-nrf/src/gpiote.rs
@@ -221,7 +221,7 @@ impl<'d, C: Channel, T: GpioPin> InputChannel<'d, C, T> {
221 } 221 }
222 222
223 /// Returns the IN event, for use with PPI. 223 /// Returns the IN event, for use with PPI.
224 pub fn event_in(&self) -> Event { 224 pub fn event_in(&self) -> Event<'d> {
225 let g = regs(); 225 let g = regs();
226 Event::from_reg(&g.events_in[self.ch.number()]) 226 Event::from_reg(&g.events_in[self.ch.number()])
227 } 227 }
@@ -292,21 +292,21 @@ impl<'d, C: Channel, T: GpioPin> OutputChannel<'d, C, T> {
292 } 292 }
293 293
294 /// Returns the OUT task, for use with PPI. 294 /// Returns the OUT task, for use with PPI.
295 pub fn task_out(&self) -> Task { 295 pub fn task_out(&self) -> Task<'d> {
296 let g = regs(); 296 let g = regs();
297 Task::from_reg(&g.tasks_out[self.ch.number()]) 297 Task::from_reg(&g.tasks_out[self.ch.number()])
298 } 298 }
299 299
300 /// Returns the CLR task, for use with PPI. 300 /// Returns the CLR task, for use with PPI.
301 #[cfg(not(feature = "nrf51"))] 301 #[cfg(not(feature = "nrf51"))]
302 pub fn task_clr(&self) -> Task { 302 pub fn task_clr(&self) -> Task<'d> {
303 let g = regs(); 303 let g = regs();
304 Task::from_reg(&g.tasks_clr[self.ch.number()]) 304 Task::from_reg(&g.tasks_clr[self.ch.number()])
305 } 305 }
306 306
307 /// Returns the SET task, for use with PPI. 307 /// Returns the SET task, for use with PPI.
308 #[cfg(not(feature = "nrf51"))] 308 #[cfg(not(feature = "nrf51"))]
309 pub fn task_set(&self) -> Task { 309 pub fn task_set(&self) -> Task<'d> {
310 let g = regs(); 310 let g = regs();
311 Task::from_reg(&g.tasks_set[self.ch.number()]) 311 Task::from_reg(&g.tasks_set[self.ch.number()])
312 } 312 }
diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs
index c2bc0f580..3be965abe 100644
--- a/embassy-nrf/src/ppi/mod.rs
+++ b/embassy-nrf/src/ppi/mod.rs
@@ -96,7 +96,7 @@ impl<'d, G: Group> PpiGroup<'d, G> {
96 /// Get a reference to the "enable all" task. 96 /// Get a reference to the "enable all" task.
97 /// 97 ///
98 /// When triggered, it will enable all the channels in this group. 98 /// When triggered, it will enable all the channels in this group.
99 pub fn task_enable_all<'s: 'd>(&'d self) -> Task<'s> { 99 pub fn task_enable_all(&self) -> Task<'d> {
100 let n = self.g.number(); 100 let n = self.g.number();
101 Task::from_reg(&regs().tasks_chg[n].en) 101 Task::from_reg(&regs().tasks_chg[n].en)
102 } 102 }
@@ -104,7 +104,7 @@ impl<'d, G: Group> PpiGroup<'d, G> {
104 /// Get a reference to the "disable all" task. 104 /// Get a reference to the "disable all" task.
105 /// 105 ///
106 /// When triggered, it will disable all the channels in this group. 106 /// When triggered, it will disable all the channels in this group.
107 pub fn task_disable_all<'s: 'd>(&self) -> Task<'s> { 107 pub fn task_disable_all(&self) -> Task<'d> {
108 let n = self.g.number(); 108 let n = self.g.number();
109 Task::from_reg(&regs().tasks_chg[n].dis) 109 Task::from_reg(&regs().tasks_chg[n].dis)
110 } 110 }
diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs
index 363a255d5..c8c81fa01 100644
--- a/embassy-nrf/src/pwm.rs
+++ b/embassy-nrf/src/pwm.rs
@@ -181,7 +181,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
181 181
182 /// Returns reference to `Stopped` event endpoint for PPI. 182 /// Returns reference to `Stopped` event endpoint for PPI.
183 #[inline(always)] 183 #[inline(always)]
184 pub fn event_stopped(&self) -> Event { 184 pub fn event_stopped(&self) -> Event<'d> {
185 let r = T::regs(); 185 let r = T::regs();
186 186
187 Event::from_reg(&r.events_stopped) 187 Event::from_reg(&r.events_stopped)
@@ -189,7 +189,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
189 189
190 /// Returns reference to `LoopsDone` event endpoint for PPI. 190 /// Returns reference to `LoopsDone` event endpoint for PPI.
191 #[inline(always)] 191 #[inline(always)]
192 pub fn event_loops_done(&self) -> Event { 192 pub fn event_loops_done(&self) -> Event<'d> {
193 let r = T::regs(); 193 let r = T::regs();
194 194
195 Event::from_reg(&r.events_loopsdone) 195 Event::from_reg(&r.events_loopsdone)
@@ -197,7 +197,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
197 197
198 /// Returns reference to `PwmPeriodEnd` event endpoint for PPI. 198 /// Returns reference to `PwmPeriodEnd` event endpoint for PPI.
199 #[inline(always)] 199 #[inline(always)]
200 pub fn event_pwm_period_end(&self) -> Event { 200 pub fn event_pwm_period_end(&self) -> Event<'d> {
201 let r = T::regs(); 201 let r = T::regs();
202 202
203 Event::from_reg(&r.events_pwmperiodend) 203 Event::from_reg(&r.events_pwmperiodend)
@@ -205,7 +205,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
205 205
206 /// Returns reference to `Seq0 End` event endpoint for PPI. 206 /// Returns reference to `Seq0 End` event endpoint for PPI.
207 #[inline(always)] 207 #[inline(always)]
208 pub fn event_seq_end(&self) -> Event { 208 pub fn event_seq_end(&self) -> Event<'d> {
209 let r = T::regs(); 209 let r = T::regs();
210 210
211 Event::from_reg(&r.events_seqend[0]) 211 Event::from_reg(&r.events_seqend[0])
@@ -213,7 +213,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
213 213
214 /// Returns reference to `Seq1 End` event endpoint for PPI. 214 /// Returns reference to `Seq1 End` event endpoint for PPI.
215 #[inline(always)] 215 #[inline(always)]
216 pub fn event_seq1_end(&self) -> Event { 216 pub fn event_seq1_end(&self) -> Event<'d> {
217 let r = T::regs(); 217 let r = T::regs();
218 218
219 Event::from_reg(&r.events_seqend[1]) 219 Event::from_reg(&r.events_seqend[1])
@@ -221,7 +221,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
221 221
222 /// Returns reference to `Seq0 Started` event endpoint for PPI. 222 /// Returns reference to `Seq0 Started` event endpoint for PPI.
223 #[inline(always)] 223 #[inline(always)]
224 pub fn event_seq0_started(&self) -> Event { 224 pub fn event_seq0_started(&self) -> Event<'d> {
225 let r = T::regs(); 225 let r = T::regs();
226 226
227 Event::from_reg(&r.events_seqstarted[0]) 227 Event::from_reg(&r.events_seqstarted[0])
@@ -229,7 +229,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
229 229
230 /// Returns reference to `Seq1 Started` event endpoint for PPI. 230 /// Returns reference to `Seq1 Started` event endpoint for PPI.
231 #[inline(always)] 231 #[inline(always)]
232 pub fn event_seq1_started(&self) -> Event { 232 pub fn event_seq1_started(&self) -> Event<'d> {
233 let r = T::regs(); 233 let r = T::regs();
234 234
235 Event::from_reg(&r.events_seqstarted[1]) 235 Event::from_reg(&r.events_seqstarted[1])
@@ -240,7 +240,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
240 /// 240 ///
241 /// Interacting with the sequence while it runs puts it in an unknown state 241 /// Interacting with the sequence while it runs puts it in an unknown state
242 #[inline(always)] 242 #[inline(always)]
243 pub unsafe fn task_start_seq0(&self) -> Task { 243 pub unsafe fn task_start_seq0(&self) -> Task<'d> {
244 let r = T::regs(); 244 let r = T::regs();
245 245
246 Task::from_reg(&r.tasks_seqstart[0]) 246 Task::from_reg(&r.tasks_seqstart[0])
@@ -251,7 +251,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
251 /// 251 ///
252 /// Interacting with the sequence while it runs puts it in an unknown state 252 /// Interacting with the sequence while it runs puts it in an unknown state
253 #[inline(always)] 253 #[inline(always)]
254 pub unsafe fn task_start_seq1(&self) -> Task { 254 pub unsafe fn task_start_seq1(&self) -> Task<'d> {
255 let r = T::regs(); 255 let r = T::regs();
256 256
257 Task::from_reg(&r.tasks_seqstart[1]) 257 Task::from_reg(&r.tasks_seqstart[1])
@@ -262,7 +262,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
262 /// 262 ///
263 /// Interacting with the sequence while it runs puts it in an unknown state 263 /// Interacting with the sequence while it runs puts it in an unknown state
264 #[inline(always)] 264 #[inline(always)]
265 pub unsafe fn task_next_step(&self) -> Task { 265 pub unsafe fn task_next_step(&self) -> Task<'d> {
266 let r = T::regs(); 266 let r = T::regs();
267 267
268 Task::from_reg(&r.tasks_nextstep) 268 Task::from_reg(&r.tasks_nextstep)
@@ -273,7 +273,7 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
273 /// 273 ///
274 /// Interacting with the sequence while it runs puts it in an unknown state 274 /// Interacting with the sequence while it runs puts it in an unknown state
275 #[inline(always)] 275 #[inline(always)]
276 pub unsafe fn task_stop(&self) -> Task { 276 pub unsafe fn task_stop(&self) -> Task<'d> {
277 let r = T::regs(); 277 let r = T::regs();
278 278
279 Task::from_reg(&r.tasks_stop) 279 Task::from_reg(&r.tasks_stop)
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs
index fed576c35..04748238d 100644
--- a/embassy-nrf/src/timer.rs
+++ b/embassy-nrf/src/timer.rs
@@ -168,21 +168,21 @@ impl<'d, T: Instance> Timer<'d, T> {
168 /// Returns the START task, for use with PPI. 168 /// Returns the START task, for use with PPI.
169 /// 169 ///
170 /// When triggered, this task starts the timer. 170 /// When triggered, this task starts the timer.
171 pub fn task_start<'s: 'd>(&self) -> Task<'s> { 171 pub fn task_start(&self) -> Task<'d> {
172 Task::from_reg(&T::regs().tasks_start) 172 Task::from_reg(&T::regs().tasks_start)
173 } 173 }
174 174
175 /// Returns the STOP task, for use with PPI. 175 /// Returns the STOP task, for use with PPI.
176 /// 176 ///
177 /// When triggered, this task stops the timer. 177 /// When triggered, this task stops the timer.
178 pub fn task_stop<'s: 'd>(&self) -> Task<'s> { 178 pub fn task_stop(&self) -> Task<'d> {
179 Task::from_reg(&T::regs().tasks_stop) 179 Task::from_reg(&T::regs().tasks_stop)
180 } 180 }
181 181
182 /// Returns the CLEAR task, for use with PPI. 182 /// Returns the CLEAR task, for use with PPI.
183 /// 183 ///
184 /// When triggered, this task resets the timer's counter to 0. 184 /// When triggered, this task resets the timer's counter to 0.
185 pub fn task_clear<'s: 'd>(&self) -> Task<'s> { 185 pub fn task_clear(&self) -> Task<'d> {
186 Task::from_reg(&T::regs().tasks_clear) 186 Task::from_reg(&T::regs().tasks_clear)
187 } 187 }
188 188
@@ -190,7 +190,7 @@ impl<'d, T: Instance> Timer<'d, T> {
190 /// 190 ///
191 /// When triggered, this task increments the timer's counter by 1. 191 /// When triggered, this task increments the timer's counter by 1.
192 /// Only works in counter mode. 192 /// Only works in counter mode.
193 pub fn task_count<'s: 'd>(&self) -> Task<'s> { 193 pub fn task_count(&self) -> Task<'d> {
194 Task::from_reg(&T::regs().tasks_count) 194 Task::from_reg(&T::regs().tasks_count)
195 } 195 }
196 196
@@ -258,14 +258,14 @@ impl<'d, T: Instance> Cc<'d, T> {
258 /// Returns this CC register's CAPTURE task, for use with PPI. 258 /// Returns this CC register's CAPTURE task, for use with PPI.
259 /// 259 ///
260 /// When triggered, this task will capture the current value of the timer's counter in this register. 260 /// When triggered, this task will capture the current value of the timer's counter in this register.
261 pub fn task_capture<'s: 'd>(&self) -> Task<'s> { 261 pub fn task_capture(&self) -> Task<'d> {
262 Task::from_reg(&T::regs().tasks_capture) 262 Task::from_reg(&T::regs().tasks_capture)
263 } 263 }
264 264
265 /// Returns this CC register's COMPARE event, for use with PPI. 265 /// Returns this CC register's COMPARE event, for use with PPI.
266 /// 266 ///
267 /// This event will fire when the timer's counter reaches the value in this CC register. 267 /// This event will fire when the timer's counter reaches the value in this CC register.
268 pub fn event_compare<'s: 'd>(&self) -> Event<'s> { 268 pub fn event_compare(&self) -> Event<'d> {
269 Event::from_reg(&T::regs().events_compare[self.n]) 269 Event::from_reg(&T::regs().events_compare[self.n])
270 } 270 }
271 271