Module rustkey::io

source ·
Expand description

io module contains basic input/output operations.

Constants§

Functions§

  • available reports the number of bytes available in buffer ready to be read.
  • configuration returns the current I/O configuration as triple (bitrate, data_bits, stop_bits).
  • Configure UART I/O communication.
  • read reads N bytes.
  • read_available reads data that is currently available in receive-buffer into buffer, up until receive-buffer is empty or buffer is filled. Returns number of bytes read, possibly 0 if no bytes are available in the buffer.
  • read_checked reads N bytes after checking for availability in the current reception buffer.
  • read_into reads bytes with length of the slice into the provided slice.
  • read_into_checked reads to fill provided buffer iff sufficient data is available in receive-buffer.
  • read_into_restricted will attempt to read data from receive-buffer. The read amount is either a full buffer, or whatever was available at that time. The maximum amount of time spent on receiving data is limited by cycles number of iterations.
  • read_into_timed receives data into buffer until buffer is filled or timeout is reached. timeout is a timeout in milliseconds.
  • read_timed reads N bytes or until timeout (milliseconds) is reached.
  • read_u8 reads a single byte.
  • wait blocks (actively checking status) until new bytes arrive to be read.
  • write writes provided data.
  • write_u8 writes a single byte.