This module implements Utility function.
More...
|
| file | util.h |
| | Util layer interface.
|
| |
|
| Clock_Handle | Util_constructClock (Clock_Struct *pClock, Clock_FuncPtr clockCB, uint32_t clockDuration, uint32_t clockPeriod, uint8_t startFlag, UArg arg) |
| | Initialize a TIRTOS Clock instance. More...
|
| |
| Queue_Handle | Util_constructQueue (Queue_Struct *pQueue) |
| | Initialize an RTOS queue to hold messages from profile to be processed. More...
|
| |
| uint8_t * | Util_dequeueMsg (Queue_Handle msgQueue) |
| | Dequeue the message from the RTOS queue. More...
|
| |
| uint8_t | Util_enqueueMsg (Queue_Handle msgQueue, Event_Handle event, uint8_t *pMsg) |
| | Creates a queue node and puts the node in RTOS queue. More...
|
| |
| bool | Util_isActive (Clock_Struct *pClock) |
| | Determine if a clock is currently active. More...
|
| |
| void | Util_rescheduleClock (Clock_Struct *pClock, uint32_t clockPeriod) |
| | Reschedule a clock by changing the timeout and period values. More...
|
| |
| void | Util_restartClock (Clock_Struct *pClock, uint32_t clockTimeout) |
| | Restart a clock by changing the timeout. More...
|
| |
| void | Util_startClock (Clock_Struct *pClock) |
| | Start a clock. More...
|
| |
| void | Util_stopClock (Clock_Struct *pClock) |
| | Stop a clock. More...
|
| |
This module implements Utility function.
| #define UTIL_QUEUE_EVENT_ID Event_Id_30 |
Util Queue Event ID.
In order to wake an application when a message is inserted into its queue, an event must be posted. Util reserved Event Id 30 for a generic queue event.
| Clock_Handle Util_constructClock |
( |
Clock_Struct * |
pClock, |
|
|
Clock_FuncPtr |
clockCB, |
|
|
uint32_t |
clockDuration, |
|
|
uint32_t |
clockPeriod, |
|
|
uint8_t |
startFlag, |
|
|
UArg |
arg |
|
) |
| |
Initialize a TIRTOS Clock instance.
- Parameters
-
| pClock | - pointer to clock instance structure. |
| clockCB | - callback function upon clock expiration. |
| clockDuration | - longevity of clock timer in milliseconds |
| clockPeriod | - duration of a periodic clock, used continuously after clockDuration expires. |
| startFlag | - TRUE to start immediately, FALSE to wait. |
| arg | - argument passed to callback function. |
- Returns
- Clock_Handle - a handle to the clock instance.
| Queue_Handle Util_constructQueue |
( |
Queue_Struct * |
pQueue | ) |
|
Initialize an RTOS queue to hold messages from profile to be processed.
- Parameters
-
| pQueue | - pointer to queue instance structure. |
- Returns
- A queue handle.
| uint8_t* Util_dequeueMsg |
( |
Queue_Handle |
msgQueue | ) |
|
Dequeue the message from the RTOS queue.
- Parameters
-
- Returns
- pointer to dequeued message
-
NULL otherwise.
| uint8_t Util_enqueueMsg |
( |
Queue_Handle |
msgQueue, |
|
|
Event_Handle |
event, |
|
|
uint8_t * |
pMsg |
|
) |
| |
Creates a queue node and puts the node in RTOS queue.
- Parameters
-
| msgQueue | - queue handle. |
| event | - the thread's event processing event that this queue is associated with. |
| pMsg | - pointer to message to be queued |
- Returns
- TRUE if message was queued
-
FALSE otherwise.
| bool Util_isActive |
( |
Clock_Struct * |
pClock | ) |
|
Determine if a clock is currently active.
- Parameters
-
| pClock | - pointer to clock struct |
- Returns
- TRUE
-
FALSE
| void Util_rescheduleClock |
( |
Clock_Struct * |
pClock, |
|
|
uint32_t |
clockPeriod |
|
) |
| |
Reschedule a clock by changing the timeout and period values.
- Parameters
-
| pClock | - pointer to clock struct |
| clockPeriod | - longevity of clock timer in milliseconds |
| void Util_restartClock |
( |
Clock_Struct * |
pClock, |
|
|
uint32_t |
clockTimeout |
|
) |
| |
Restart a clock by changing the timeout.
- Parameters
-
| pClock | - pointer to clock struct |
| clockTimeout | - longevity of clock timer in milliseconds |
| void Util_startClock |
( |
Clock_Struct * |
pClock | ) |
|
Start a clock.
- Parameters
-
| pClock | - pointer to clock struct |
| void Util_stopClock |
( |
Clock_Struct * |
pClock | ) |
|
Stop a clock.
- Parameters
-
| pClock | - pointer to clock struct |