kfile_fifo.h File Reference
KFile interface over a FIFO buffer. More...
#include "fifobuf.h"#include <kern/kfile.h>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. | |
Detailed Description
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 }
- Version:
- Id
- cfg_adc.h 2348 2009-02-16 13:43:44Z duplo
Definition in file kfile_fifo.h.
Function Documentation
| void kfilefifo_init | ( | KFileFifo * | kf, | |
| FIFOBuffer * | fifo | |||
| ) |
Initialize KFileFifo struct.
- Parameters:
-
kf Interface to initialize. fifo Fifo buffer to operate on.
Definition at line 68 of file kfile_fifo.c.
