SYS_FIFO

This device is a FIFO RAM buffer. A write to the buffer adds data to the FIFO. A read from the buffer reads from the FIFO. If the FIFO fills up, additional writes will block until data arrives. Similarly, if the FIFO is empty, a read will block until data arrives.

Details

define CFIFO_VERSION

define CFIFO_IOC_CHAR

define I_CFIFO_GETVERSION

define I_CFIFO_GETINFO

define I_CFIFO_SETATTR

define I_CFIFO_GETOWNER

define I_CFIFO_SETOWNER

define I_CFIFO_FIFOINIT

define I_CFIFO_FIFOFLUSH

define I_CFIFO_FIFOEXIT

define I_CFIFO_FIFOSETATTR

define I_CFIFO_FIFOGETINFO

define FFIFO_VERSION

define FFIFO_IOC_CHAR

define I_FFIFO_GETVERSION

define I_FFIFO_GETINFO

define I_FFIFO_SETATTR

define I_FFIFO_FLUSH

define I_FFIFO_INIT

define I_FFIFO_EXIT

define FIFO_VERSION

define FIFO_IOC_CHAR

define I_FIFO_GETVERSION

define I_FIFO_GETINFO

This request gets the size of the FIFO in bytes. Example:

fifo_attr_t attr;
ioctl(fifo_fd, I_FIFO_ATTR, &attr);

define I_FIFO_SETATTR

define I_FIFO_FLUSH

define I_FIFO_INIT

define I_FIFO_EXIT

define I_FIFO_PEEK

This request allows a process to peek at the data in the FIFO without reading it.

char buffer[16];
fifo_peek_t peek_req;
peek_req.buf = buffer; //Destination buffer
peek_req.loc = 0; //first available bytes in FIFO
peek_req.nbyte = 16; //peek up to 16 bytes
ioctl(fifo_fd, I_FIFO_PEEK, &peek);

define I_FIFO_TOTAL

enum @5
  • CFIFO_FLAG_NONE

enum @14
  • FFIFO_FLAG_SET_WRITEBLOCK
  • FFIFO_FLAG_IS_OVERFLOW
  • FFIFO_FLAG_NOTIFY_WRITE
  • FFIFO_FLAG_NOTIFY_READ

enum @15
  • FIFO_FLAG_NONE
  • FIFO_FLAG_SET_WRITEBLOCK Write block flag
  • FIFO_FLAG_IS_OVERFLOW Overflow flag
  • FIFO_FLAG_NOTIFY_WRITE Notify on write
  • FIFO_FLAG_NOTIFY_READ Notify on read
  • FIFO_FLAG_INIT Initialize the FIFO
  • FIFO_FLAG_EXIT Shutdown the FIFO
  • FIFO_FLAG_FLUSH Flush the FIFO
  • FIFO_FLAG_IS_READ_BUSY Set internally when FIFO is reading
  • FIFO_FLAG_IS_WRITE_WHILE_READ_BUSY Set internally when FIFO is written while reading
  • FIFO_FLAG_IS_WRITE_BUSY Set internally when FIFO is being written
  • FIFO_FLAG_IS_WRITE_WHILE_WRITE_BUSY Set internally when FIFO is written while being written

struct::cfifo_info_t

u32 o_flags

Fifo flags

u16 count

Total number of channels in the fifo

u16 size

The size of each channel

u32 o_ready

Bitmask of channels with at least one byte

u32 resd

struct::cfifo_attr_t

This structure defines the attributes of a FIFO.

u32 o_flags

Fifo flags

u32 resd

struct::cfifo_fiforequest_t

u32 channel

struct::cfifo_fifoattr_t

u32 channel

fifo_attr_t attr

struct::cfifo_fifoinfo_t

u32 channel

fifo_info_t info

struct::ffifo_info_t

u32 o_flags

Fifo flags

u16 frame_count

Total number of frames in the fifo

u16 frame_size

Frame size of the fifo

u16 frame_count_ready

Number of frames being used

u16 resd_align

u32 resd

struct::ffifo_attr_t

This structure defines the attributes of a FIFO.

u32 o_flags

Fifo flags

u32 resd

struct::fifo_info_t

u32 o_flags

Bitmask to indicate supported features

u32 size

The total number of bytes in the FIFO

u32 size_ready

The number of bytes ready to be read from the FIFO

u32 overflow

If non-zero, indicates data received in the buffer was discarded

u32 resd

struct::fifo_attr_t

This structure defines the attributes of a FIFO.

u32 o_flags

Use to set the write block

u32 resd

struct::fifo_peek_t

This is used when peeking at data in the FIFO

u32 loc

The location to peek

char * buf

A pointer to the buffer to receive peek bytes

int nbyte

The number of bytes to peek


X

Thanks for Coming!

Subscribe to news and updates