BeRTOS
|
KFile interface over a FIFO buffer. More...
Go to the source code of this file.
Defines | |
#define | KFT_KFILEFIFO MAKE_ID('F', 'I', 'F', '0') |
ID for KFile FIFO. | |
Functions | |
KFileFifo * | KFILEFIFO_CAST (KFile *fd) |
Convert + ASSERT from generic KFile to KFileFifo. | |
void | kfilefifo_init (KFileFifo *kf, FIFOBuffer *fifo) |
Initialize KFileFifo struct. |
KFile interface over a FIFO buffer.
Convenient way to push data into a FIFO using the KFile interface. For example, it's possible to read from a serial port and put the characters into a fifo:
// serial reader process { // other stuff here... kfile_read(&ser_port.fd, buffer, sizeof(buffer)); kfile_write(&kfifo.fd, buffer, sizeof(buffer)); // ... } // controller process { //... kfile_read(&kfifo.fd, buffer2, sizeof(buffer2)); // use read data }
Definition in file kfile_fifo.h.
void kfilefifo_init | ( | KFileFifo * | kf, |
FIFOBuffer * | fifo | ||
) |
Initialize KFileFifo struct.
kf | Interface to initialize. |
fifo | Fifo buffer to operate on. |
Definition at line 67 of file kfile_fifo.c.