MotorWare f2806x Module API Documentation
Module overview

Queue (QUEUE) Module

Description

The queue manager (QUEUE) implements an array of multiple queues of events or tasks. These events are user functions that are posted on the queue for execution. Usually the way the queue works is by posting events in the main interrupt service routine (ISR), and then all the posted events are executed in the main subroutine, out of the ISR.
Note: If queue manager is deemed too much overhead for a given application, can easily revert to a single ISR with inline functions by replacing event posting functions with event execution functions.

The following figure shows how a typical interrupt service routine (ISR) pushes Events or tasks to the queue to be executed outside of the ISR.


mainISRQueue.jpg




The following state machine represents a typical user's code, where the queue manager listens to events posted, and executed all events in a First In First Out fashion (FIFO) unless the user posts something on top of the queue by executing the QUEUE_postEventFirst() function.


mainQueue.jpg




Configuration Information

Before using the QUEUE manager, an initialization subroutins is needed to set all events to zero, and get everything initialized. Please see the QUEUE_init() functions define in queue.h for more details.

Integration Information

There is only one module in this package, the APIs can be referenced at QUEUE. The API headers can be located at queue.h. The test procedures are described at test_queue.h.