IPC@CHIP® RTOS-LNX – API Documentation
RTOS RTX API overview
The internal IPC@CHIP® Event Manager provides a convenient mechanism for coordinating tasks waiting for events. The events can be signalled by other tasks or timer procedures. The Event Manager allows more than one task to simultaneously wait for a particular event. Tasks can also wait for a particular combination of events or for any one in a set of events.
The Event Manager provides a set of event flags which can be associated with specific events in your system. These event flags are provided in groups with 32 event flags per group. The number of Event Groups which can be created is limited by the total number of kernel objects available, which is 1000. One kernel object is expended to create a semaphore, Event Group or timer procedure. Two kernel objects are required per Message Exchange.
The Event Manager is useful when two or more tasks will wait for the same event, e.g. waiting for the start of a motor. An event flag is defined to represent the state of the motor (off or on). When tasks must wait for the motor, they do so by calling the Event Manager requesting a wait until the motor control event flag indicates that the motor is on. When the motor control task or timer procedure detects that the motor is on, it signals the event with a call to the Event Manager. The Event Manager then wakes up all tasks which are waiting for the motor to be on.
The RTX_Strobe_Events() API allows events to be operated in an edge triggered mode, with an automatic return to zero after the event. This feature avoids a second API call that would otherwise be required to create a falling edge back to zero after an event has been set to one. Any task that was awaiting a one for the single event which is strobed will be released from the wait.