aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/timer.rs
diff options
context:
space:
mode:
authorCameron <[email protected]>2023-07-05 09:20:56 +0200
committerCameron <[email protected]>2023-07-05 09:20:56 +0200
commit2c5146f19fad4344222dee916687b750896a7487 (patch)
treeaee363ba745a7b605e3c79292d07aa5d7bd09324 /embassy-nrf/src/timer.rs
parent93caf97a04d1383ddeb11cff51b3ca34107a45c8 (diff)
Fixed Lifetimes in Events & Tasks
Diffstat (limited to 'embassy-nrf/src/timer.rs')
-rw-r--r--embassy-nrf/src/timer.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs
index dc3757856..fed576c35 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(&self) -> Task { 171 pub fn task_start<'s: 'd>(&self) -> Task<'s> {
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(&self) -> Task { 178 pub fn task_stop<'s: 'd>(&self) -> Task<'s> {
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(&self) -> Task { 185 pub fn task_clear<'s: 'd>(&self) -> Task<'s> {
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(&self) -> Task { 193 pub fn task_count<'s: 'd>(&self) -> Task<'s> {
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(&self) -> Task { 261 pub fn task_capture<'s: 'd>(&self) -> Task<'s> {
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(&self) -> Event { 268 pub fn event_compare<'s: 'd>(&self) -> Event<'s> {
269 Event::from_reg(&T::regs().events_compare[self.n]) 269 Event::from_reg(&T::regs().events_compare[self.n])
270 } 270 }
271 271