pub struct RxReception<'c> { /* private fields */ }unstable only.Expand description
A reception in progress, see RxChannel::start_receive.
Dropping it stops the reception.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl RxReception<'_>
impl RxReception<'_>
Sourcepub fn poll(&mut self, buf: &mut [PulseCode]) -> Result<RxProgress, RxError>
pub fn poll(&mut self, buf: &mut [PulseCode]) -> Result<RxProgress, RxError>
Copies the codes received since the previous call into buf.
Codes that do not fit into buf stay in the channel RAM, and the next call copies them.
Returns RxProgress::Done once the reception has ended and every code has been copied.
The hardware makes a PulseCode available only when both of its pulses are complete.
Thus, the last pulse can be missing until the next edge on the input. The last code of a
frame contains the end marker.
§Errors
RxError::BufferTooSmallifbufis empty while codes are waiting. The codes stay in the channel RAM, and a call with space inbufcopies them.RxError::Overrunif the reception failed. Every further call returns it.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn stop(self)
pub fn stop(self)
Stops the reception, the same as dropping it.
The reception stops immediately, before the idle threshold. Codes that were not copied by
Self::poll are lost.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.