[][src]Trait kernel::hil::uart::TransmitClient

pub trait TransmitClient {
    fn transmitted_buffer(
        &self,
        tx_buffer: &'static mut [u8],
        tx_len: usize,
        rval: ReturnCode
    ); fn transmitted_word(&self, _rval: ReturnCode) { ... } }

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

Required methods

fn transmitted_buffer(
    &self,
    tx_buffer: &'static mut [u8],
    tx_len: usize,
    rval: ReturnCode
)

A call to Transmit::transmit_buffer completed. The ReturnCode indicates whether the buffer was successfully transmitted. A call to transmit_word or transmit_buffer made within this callback SHOULD NOT return EBUSY: 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 SUCCESS 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 SUCCESS if the full buffer was successfully transmitted, or

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

Provided methods

fn transmitted_word(&self, _rval: ReturnCode)

A call to Transmit::transmit_word completed. The ReturnCode indicates whether the word was successfully transmitted. A call to transmit_word or transmit_buffer made within this callback SHOULD NOT return EBUSY: when this callback is made the UART should be ready to receive another call.

rval is SUCCESS if the word was successfully transmitted, or

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

Implementors

impl TransmitClient for DebugWriter[src]

Loading content...