pub trait TransmitClient {
    fn transmitted_buffer(
        &self,
        tx_buffer: &'static mut [u8],
        tx_len: usize,
        rval: Result<(), ErrorCode>
    ); fn transmitted_word(&self, _rval: Result<(), ErrorCode>) { ... } }
Expand description

Trait implemented by a UART transmitter to receive callbacks when operations complete.

Required Methods

A call to Transmit::transmit_buffer completed. The Result<(), ErrorCode> indicates whether the buffer was successfully transmitted. A call to transmit_word or transmit_buffer made within this callback SHOULD NOT return BUSY: when this callback is made the UART should be ready to receive another call.

The tx_len argument specifies how many words were transmitted. An rval of Ok(()) indicates that every requested word was transmitted: tx_len in the callback should be the same as tx_len in the initiating call.

rval is Ok(()) if the full buffer was successfully transmitted, or

  • CANCEL if the call to transmit_buffer was cancelled and the buffer was not fully transmitted. tx_len contains how many words were transmitted.
  • SIZE if the buffer could only be partially transmitted. tx_len contains how many words were transmitted.
  • FAIL if the transmission failed in some way.

Provided Methods

A call to Transmit::transmit_word completed. The Result<(), ErrorCode> indicates whether the word was successfully transmitted. A call to transmit_word or transmit_buffer made within this callback SHOULD NOT return BUSY: when this callback is made the UART should be ready to receive another call.

rval is Ok(()) if the word was successfully transmitted, or

  • CANCEL if the call to transmit_word was cancelled and the word was not transmitted.
  • FAIL if the transmission failed in some way.

Implementors