Closed azerupi closed 2 years ago
There is currently already a method pending_event that allows to get events when the interrupts are enabled. But the idle flag and the txe and rxne flags can also be used when interrupts are disabled (idleie=0, txeie=0 and rxneie=0 respectively).
pending_event
idle
txe
rxne
idleie=0
txeie=0
rxneie=0
This PR adds methods on Rx and Tx to read the state of those flags and reset the idle flag. This is inspired by https://github.com/stm32-rs/stm32f1xx-hal/blob/master/src/serial.rs#L303-L324
Rx
Tx
These methods are also more intuitive IMHO than the pending_event method.
We tested is_idle and clear_idle_interrupt and confirmed that it worked. What do you guys think?
is_idle
clear_idle_interrupt
There is currently already a method
pending_event
that allows to get events when the interrupts are enabled. But theidle
flag and thetxe
andrxne
flags can also be used when interrupts are disabled (idleie=0
,txeie=0
andrxneie=0
respectively).This PR adds methods on
Rx
andTx
to read the state of those flags and reset theidle
flag. This is inspired by https://github.com/stm32-rs/stm32f1xx-hal/blob/master/src/serial.rs#L303-L324These methods are also more intuitive IMHO than the
pending_event
method.We tested
is_idle
andclear_idle_interrupt
and confirmed that it worked. What do you guys think?