int rtf_create (unsigned int fifo, int size);
The RT-FIFO is a mechanism, implemented as a character device, to communicate between real-time tasks and ordinary Linux processes. The rtf_* functions are used by the real-time tasks; Linux processes use standard character device access functions such as read, write, and select.
int rtf_destroy (unsigned int fifo);
int rtf_reset (unsigned int fifo);
int rtf_resize (unsigned int fifo, int size);
int rtf_put (unsigned int fifo, void *buf, int count);
write
to the corresponding /dev/fifo<n>
device to enqueue
data to a fifo. Similarly, Linux processes use read
or similar functions
to read the data previously written via rtf_put
by a real-time task.
int rtf_get (unsigned int fifo, void *buf, int count);
read
from the corresponding fifo device to dequeue data from a fifo.
Similarly, Linux processes use write
or similar functions to
write the data to be read via rtf_put by a real-time task.
rtf_get is often used in conjunction with rtf_create_handler to process data received asynchronously from a Linux process. A handler is installed via rtf_create_handler; this handler calls rtf_get to receive any data present in the RT-FIFO as it becomes available. In this way, polling is not necessary; the handler is called only when data is present in the fifo.
int rtf_create_handler (unsigned int fifo, int (*handler)(unsigned int fifo));
rtf_create_handler is often used in conjunction with rtf_get to process data acquired asynchronously from a Linux process. The installed handler calls rtf_get when data is present. Because the handler is only executed when there is activity on the fifo, polling is not necessary.