i2c_read_timeout_us() function
Attempt to read specified number of bytes from address, with timeout
Arguments
addr
7-bit address of device to read from
dst
Pointer to buffer to receive data
len
Length of data in bytes to receive
nostop
If true, master retains control of the bus at the end of the transfer (no Stop is issued), and the next transfer will begin with a Restart rather than a Start.
timeout_us
The time that the function will wait for the entire transaction to complete
Return value
Number of bytes read, or PICO_ERROR_GENERIC if address not acknowledged, no device present, or PICO_ERROR_TIMEOUT if a timeout occurred.