MCPcopy Create free account
hub / github.com/SharpCoder/teensycore / serial_read

Function serial_read

src/serio.rs:410–413  ·  view source on GitHub ↗

Retuns the current buffer of data the serial interface has accumulated. You can interact with this buffer, modify it, etc. It is recommended to call `.clear()` on the buffer as soon as you are done with the data, otherwise the buffer will eventually overflow.

(device: SerioDevice)

Source from the content-addressed store, hash-verified

408/// done with the data, otherwise the buffer will eventually
409/// overflow.
410pub fn serial_read<'a>(device: SerioDevice) -> &'a mut Str {
411 let uart = get_uart_interface(device);
412 return uart.get_rx_buffer();
413}
414
415/// Returns the amount of data in the currenet read buffer.
416pub fn serial_available(device: SerioDevice) -> usize {

Callers

nothing calls this directly

Calls 2

get_uart_interfaceFunction · 0.85
get_rx_bufferMethod · 0.80

Tested by

no test coverage detected