canqueue Struct Reference
[CAN Module]

#include <can.h>


Data Fields

int in
int out
int size
int messages
canmsgqueue


Detailed Description

can queue structure This structure must be initialized and hooked to a canmsg buffer before initializing the CAN hardware. Users are responsible for allocating enough memory to hold the required number of CAN messages. A number of queue functions are provided below. The simplist method for using the queue is using standard push/pull functions but this requires memory copying since the queues are represented by arrays and not true dynamic linked lists. A more efficient but mroe complicated method is the use the data directly from the array, the remove it with CAN_RX_REMOVE. A similar approach can be taken with pushing data by retrieving the tx pointer, to write to with CAN_WRITE_BUFFER, copying data into it and calling CAN_ENQEUE

Definition at line 119 of file can.h.


Field Documentation

int canqueue::messages
 

total queue size

Definition at line 123 of file can.h.

int canqueue::out
 

index to next available in push slot

Definition at line 121 of file can.h.

canmsg* canqueue::queue
 

number of messages in the queue

Definition at line 124 of file can.h.

int canqueue::size
 

index to next available in pull slot

Definition at line 122 of file can.h.


The documentation for this struct was generated from the following file:
Generated on Fri Mar 3 17:25:46 2006 for EMAC-HCS12-SDK by  doxygen 1.4.6