41 #define Event_Handle void* 44 #include <ti/sysbios/knl/Queue.h> 45 #include <ti/sysbios/knl/Clock.h> 46 #include <ti/sysbios/knl/Event.h> 65 #define UTIL_EVENT_ID_NONE (0) // Event_Id_NONE 66 #define UTIL_EVENT_ID_00 (0x1) // Event_Id_00 67 #define UTIL_EVENT_ID_01 (0x2) // Event_Id_01 68 #define UTIL_EVENT_ID_02 (0x4) // Event_Id_02 69 #define UTIL_EVENT_ID_03 (0x8) // Event_Id_03 70 #define UTIL_EVENT_ID_04 (0x10)// Event_Id_04 71 #define UTIL_EVENT_ID_05 (0x20)// Event_Id_05 72 #define UTIL_EVENT_ID_06 (0x40)// Event_Id_06 73 #define UTIL_QUEUE_EVENT_ID (0x00100000)//Event_Id_30 74 #define UTIL_TL_CB_EVENT UTIL_EVENT_ID_00 // Event_Id_00 76 #define UTIL_QUEUE_EVENT_ID Event_Id_30 83 typedef void (*UtilTimerCback)(uint32_t arg);
85 typedef struct Clock_Struct
91 pthread_attr_t timerThrdAttr;
92 struct itimerspec timeVal;
126 uint32_t clockDuration, uint32_t clockPeriod,
127 uint8_t startFlag, uint32_t arg);
129 void Clock_destruct(Clock_Struct *structP);
132 Clock_FuncPtr clockCB,
133 uint32_t clockDuration,
134 uint32_t clockPeriod,
254 extern uint8_t
Util_isBufSet(uint8_t *pBuf, uint8_t pattern, uint16_t len);
268 extern void Event_post(mqd_t eventQueue, uint32_t msg);
uint8_t * Util_dequeueMsg(Queue_Handle msgQueue)
Dequeues the message from the RTOS queue.
uint8_t Util_isBufSet(uint8_t *pBuf, uint8_t pattern, uint16_t len)
Check if contents of buffer matches byte pattern.
uint8_t Util_enqueueMsg(Queue_Handle msgQueue, Event_Handle event, uint8_t *pMsg)
Creates a queue node and puts the node in RTOS queue.
void Util_rescheduleClock(Clock_Struct *pClock, uint32_t clockPeriod)
Reschedule a clock by changing the timeout and period values.
void Util_startClock(Clock_Struct *pClock)
Start a clock.
char * Util_convertBdAddr2Str(uint8_t *pAddr)
Convert Bluetooth address to string. Only needed when LCD display is used.
void Util_stopClock(Clock_Struct *pClock)
Stop a clock.
void Util_restartClock(Clock_Struct *pClock, uint32_t clockTimeout)
Restart a clock by changing the timeout.
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.
Queue_Handle Util_constructQueue(Queue_Struct *pQueue)
Initialize an RTOS queue to hold messages from profile to be processed.
bool Util_isActive(Clock_Struct *pClock)
Determine if a clock is currently active.