50 #include "sw/drivers/cpu/src/32b/f28x/f2803x/cpu.h"
73 #define EVENT_MAX_NUM_ARGS 4
78 #define QUEUE_MAX_NUM_EVENTS 8
162 return(!(obj->
firstEvent == (EVENT_Handle)obj));
180 extern QUEUE_Handle
QUEUE_init(
void *pMemory,
const size_t numBytes);
197 const uint_least8_t numArgs)
218 pEvent->
taken =
true;
250 const uint_least8_t numArgs)
271 pEvent->
taken =
true;
319 pFirstEvent->
taken =
false;
350 pLastEvent->
taken =
false;
352 obj->
lastEvent = (EVENT_Handle)pPrevEvent;
368 uint_least8_t numArgs = pEvent->
numArgs;
376 else if(numArgs == 3)
380 else if(numArgs == 2)
384 else if(numArgs == 1)
388 else if(numArgs == 0)
406 #endif // end of _QUEUE_H_ definition
struct _EVENT_Obj_ * EVENT_Handle
Defines the EVENT handle.
Contains the public interface to the types definitions.
struct _EVENT_Obj_ EVENT_Obj
Defines the event queue object.
QUEUE_Handle QUEUE_init(void *pMemory, const size_t numBytes)
Initializes the queue.
struct _EVENT_Obj_ * nextEvent
the next event in the queue
static status QUEUE_postEventFirst(QUEUE_Handle handle, const EVENT_Fxn eventFxn, const EVENT_ArgList *pArgList, const uint_least8_t numArgs)
Posts an event to the beginning of the specified queue.
EVENT_Handle lastEvent
the last event in the queue
struct _QUEUE_Obj_ QUEUE_Obj
Defines the queue object structure.
struct _EVENT_ArgList_ EVENT_ArgList
Defines the event argument list.
QUEUE_Status_e
Defines the queue status messages.
void * arg[EVENT_MAX_NUM_ARGS]
an array of the pointers to the event arguments
uint_least8_t queueNumber
the queue number
#define QUEUE_MAX_NUM_EVENTS
Defines the maximum number of events per queue Note: must be a power of 2.
EVENT_ArgList argList
the event function argument list
static status QUEUE_postEventLast(QUEUE_Handle handle, const EVENT_Fxn eventFxn, const EVENT_ArgList *pArgList, const uint_least8_t numArgs)
Posts an event to the end of the specified queue.
uint_least8_t numArgs
the number of event arguments
EVENT_Fxn eventFxn
the event function that will be called
bool taken
a flag to indicate if event is taken
unsigned int status
Defines the portable data type for a status result.
struct _EVENT_Obj_ * prevEvent
the previous event in the queue
Defines the event queue object.
uint32_t gEventIndex
The event index.
EVENT_Obj gEvents[QUEUE_MAX_NUM_EVENTS]
The array of events.
the first event taken message
struct _QUEUE_Obj_ * QUEUE_Handle
Defines the queue handle.
#define EVENT_MAX_NUM_ARGS
Defines the maximum number of event arguments.
EVENT_Handle firstEvent
the first event in the queue
#define ERROR
Defines generic error.
the last event taken message
void(* EVENT_Fxn)()
Defines the event function prototype.
Defines the event argument list.
static void QUEUE_removeFirstEvent(QUEUE_Handle handle)
Removed the first event from the specified queue.
void QUEUE_listen(QUEUE_Handle handle)
Puts the calling process in a listen state. It loops until.
static void QUEUE_executeEvent(QUEUE_Handle handle)
Checks the specified event queue for an event. If there is an event,.
static bool QUEUE_isIdle(QUEUE_Handle handle)
Checks if the specified queue is idle.
static bool QUEUE_isEvent(QUEUE_Handle handle)
Checks if there is an event available in the queue.
Defines the queue object structure.
static void QUEUE_removeLastEvent(QUEUE_Handle handle)
Removed the last event from the specified queue.