Update preset.
[bertos.git] / bertos / struct / kfile_fifo.h
index 5d9ba5c2de5a099c693c6ca268c95797e4d77039..fbc5d097f2265af3d0f097d023b2b51511d98118 100644 (file)
  *
  * \brief KFile interface over a FIFO buffer.
  *
- * \version $Id: cfg_adc.h 2348 2009-02-16 13:43:44Z duplo $
+ * 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:
+ * \code
+ * // 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
+ * }
+ * \endcode
+ *
+ *
  * \author Francesco Sacchi <asterix@develer.com>
  *
  * $WIZ$ module_name = "kfilefifo"
@@ -43,7 +63,7 @@
 #define STRUCT_KFILE_FIFO
 
 #include "fifobuf.h"
-#include <kern/kfile.h>
+#include <io/kfile.h>
 
 typedef struct KFileFifo
 {
@@ -65,6 +85,15 @@ INLINE KFileFifo * KFILEFIFO_CAST(KFile *fd)
        return (KFileFifo *)fd;
 }
 
+/**
+ * Initialize KFileFifo struct.
+ *
+ * \param kf Interface to initialize.
+ * \param fifo Fifo buffer to operate on.
+ */
 void kfilefifo_init(KFileFifo *kf, FIFOBuffer *fifo);
 
+int kfilefifo_testSetup(void);
+int kfilefifo_testRun(void);
+int kfilefifo_testTearDown(void);
 #endif /* STRUCT_KFILE_FIFO */