Makes the uarte endtx event available
This commit allows event_endtx to be used outside of the Uarte itself. As a consequence, PPI can be used to drive tasks given the end of transmission on the Uarte. This is particularly useful for situations like RS485 where a GPIO must be set to high when transmitting then cleared when done. A non-ppi approach can cause a delay in the clearing of this GPIO as other Embassy tasks might become scheduled.
This commit is contained in:
parent
82e5edb940
commit
c54303be75
1 changed files with 6 additions and 0 deletions
|
@ -151,6 +151,12 @@ impl<'d, T: Instance> Uarte<'d, T> {
|
|||
(self.tx, self.rx)
|
||||
}
|
||||
|
||||
/// Return the endtx event for use with PPI
|
||||
pub fn event_endtx(&self) -> Event {
|
||||
let r = T::regs();
|
||||
Event::from_reg(&r.events_endtx)
|
||||
}
|
||||
|
||||
fn on_interrupt(_: *mut ()) {
|
||||
let r = T::regs();
|
||||
let s = T::state();
|
||||
|
|
Loading…
Reference in a new issue