Loading...
Searching...
No Matches
ISR Pipe

ISR -> userspace pipe. More...

Detailed Description

ISR -> userspace pipe.

Modules

 Read timeouts with ISR pipe
 ISR -> userspace pipe with timeout.
 

Files

file  isrpipe.h
 isrpipe Interface
 

Data Structures

struct  isrpipe_t
 Context structure for isrpipe. More...
 

Macros

#define ISRPIPE_INIT(tsrb_buf)
 Static initializer for irspipe.
 

Functions

void isrpipe_init (isrpipe_t *isrpipe, uint8_t *buf, size_t bufsize)
 Initialisation function for isrpipe.
 
int isrpipe_write_one (isrpipe_t *isrpipe, uint8_t c)
 Put one byte into the isrpipe's buffer.
 
int isrpipe_write (isrpipe_t *isrpipe, const uint8_t *buf, size_t n)
 Put number of bytes into the isrpipe's buffer.
 
int isrpipe_read (isrpipe_t *isrpipe, uint8_t *buf, size_t count)
 Read data from isrpipe (blocking)
 

Macro Definition Documentation

◆ ISRPIPE_INIT

#define ISRPIPE_INIT (   tsrb_buf)
Value:
{ .mutex = MUTEX_INIT, \
.tsrb = TSRB_INIT(tsrb_buf) }
#define MUTEX_INIT
Static initializer for mutex_t.
Definition mutex.h:224
#define TSRB_INIT(BUF)
Static initializer.
Definition tsrb.h:49

Static initializer for irspipe.

Definition at line 45 of file isrpipe.h.

Function Documentation

◆ isrpipe_init()

void isrpipe_init ( isrpipe_t isrpipe,
uint8_t *  buf,
size_t  bufsize 
)

Initialisation function for isrpipe.

Parameters
[in]isrpipeisrpipe object to initialize
[in]bufbuffer to use as ringbuffer (must be power of two sized!)
[in]bufsizesize of buf

◆ isrpipe_read()

int isrpipe_read ( isrpipe_t isrpipe,
uint8_t *  buf,
size_t  count 
)

Read data from isrpipe (blocking)

Parameters
[in]isrpipeisrpipe object to operate on
[in]bufbuffer to write to
[in]countnumber of bytes to read
Returns
number of bytes read

◆ isrpipe_write()

int isrpipe_write ( isrpipe_t isrpipe,
const uint8_t *  buf,
size_t  n 
)

Put number of bytes into the isrpipe's buffer.

Parameters
[in]isrpipeisrpipe object to operate on
[in]bufbytes to add to isrpipe buffer
[in]nnumber of bytes to add from buf to isrpipe's buffer
Returns
number of bytes that could be added
-1 if buffer was full

◆ isrpipe_write_one()

int isrpipe_write_one ( isrpipe_t isrpipe,
uint8_t  c 
)

Put one byte into the isrpipe's buffer.

Parameters
[in]isrpipeisrpipe object to operate on
[in]cbyte to add to isrpipe buffer
Returns
0 if byte could be added
-1 if buffer was full