Read timeouts with ISR pipe

ISR -> userspace pipe with timeout. More...

Detailed Description

ISR -> userspace pipe with timeout.

Files

file  read_timeout.h
 isrpipe read timeout Interface
 

Functions

int isrpipe_read_timeout (isrpipe_t *isrpipe, uint8_t *buf, size_t count, uint32_t timeout)
 Read data from isrpipe (with timeout, blocking) More...
 
int isrpipe_read_all_timeout (isrpipe_t *isrpipe, uint8_t *buf, size_t count, uint32_t timeout)
 Read data from isrpipe (with timeout, blocking, wait until all read) More...
 

Function Documentation

◆ isrpipe_read_all_timeout()

int isrpipe_read_all_timeout ( isrpipe_t isrpipe,
uint8_t *  buf,
size_t  count,
uint32_t  timeout 
)

Read data from isrpipe (with timeout, blocking, wait until all read)

This function is like isrpipe_read_timeout, but will only return on timeout or when count bytes have been received.

Parameters
[in]isrpipeisrpipe object to operate on
[in]bufbuffer to write to
[in]countnumber of bytes to read
[in]timeouttimeout in microseconds
Returns
number of bytes read
-ETIMEDOUT on timeout

◆ isrpipe_read_timeout()

int isrpipe_read_timeout ( isrpipe_t isrpipe,
uint8_t *  buf,
size_t  count,
uint32_t  timeout 
)

Read data from isrpipe (with timeout, blocking)

Currently, the timeout parameter is applied on every underlying read, which might be per single byte.

Note
This function might return less than count bytes
Parameters
[in]isrpipeisrpipe object to operate on
[in]bufbuffer to write to
[in]countnumber of bytes to read
[in]timeouttimeout in microseconds
Returns
number of bytes read
-ETIMEDOUT on timeout