Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
_CIRBUF Struct Reference

#include <nz_circularBuffer.h>

Data Fields

WORD put
 
WORD get
 
BYTE * buf
 
WORD maxOffset
 
union {
   struct {
      unsigned int   bPacket: 1
 Buffer Type: If 0 is streaming(CIRBUF_TYPE_STREAMING), else packet(CIRBUF_TYPE_PACKET or CIRBUF_TYPE_LARGE_PACKET)
 
      unsigned int   bPacketLarge: 1
 Buffer Type: Only valid for Packet Buffer Type, if 0 is CIRBUF_TYPE_PACKET, else CIRBUF_TYPE_LARGE_PACKET.
 
      unsigned int   format: 3
 Buffer Format: Formatting, is a BUFFORMAT_XXX Define.
 
      unsigned int   bSizePower2: 1
 Buffer size must be a power of 2. This makes buffer more efficient.
 
      unsigned int   fill6_7: 2
 Fill.
 
      unsigned int   fill8_15: 8
 
   }   flagBits
 
   struct {
      unsigned int   type: 2
 Buffer Type, is a CIRBUF_TYPE_XXX define. Can only be streaming or packet types.
 
      unsigned int   format: 3
 Formatting, is a BUFFORMAT_XXX Define.
 
      unsigned int   fill: 11
 
   }   flagTF
 
   struct {
      unsigned int   val: 5
 Buffer Type and Format, OR'ed combination of CIRBUF_TYPE_XXX and CIRBUF_FORMAT_XXX.
 
      unsigned int   fill5_7: 3
 Reserved, might add to format.
 
      unsigned int   fill: 8
 
   }   typeFormat
 
   struct {
      BYTE   LB
 Lower Byte, contains Buffer Type and Format.
 
      BYTE   HB
 Upper Byte.
 
   }   flagBytes
 
   WORD   flagVal
 
}; 
 

Detailed Description

Circular Buffer Structure, for buffers with maximum size of 65279. Exactly the same as CIRBUF structure, but flagBits.bSizePower2 flag must be clear. Use bufXxx functions with this structure. bufXxx functions always work, and buffXxx are optimzed functions for when buffer size is a power of 2.

Examples:
cirbuf_demo1/main.c, cirbuf_packet_demo/main.c, and usb/device_MIDI_LCD/main.c.

Field Documentation

unsigned int format

Buffer Format: Formatting, is a BUFFORMAT_XXX Define.

Formatting, is a BUFFORMAT_XXX Define.


The documentation for this struct was generated from the following file: