Function tmc2209::await_read_response [−][src]
pub fn await_read_response<U>(uart_rx: &mut U) -> ReadResponse where
U: Read<u8>,
Expand description
Blocks and attempts to read a response from the given UART receiver.
The response might be from any register, so the reg_addr
on the returned response should be
checked.
NOTE: Currently, this function will block until a response can be successfully read. This
means the function may block forever in the case some communication error occurs. Once a
generic timer API lands in the embedded-hal
crate, this should be changed to take a timeout
duration and return with a timeout error in the case that the duration is exceeded before a
response can be read. In the meantime, consider using the Reader
and its read_response
method directly to avoid blocking or apply your own timeout logic.