CONTENTS

CONTENTS

I

LIST OF FIGURES ........................................................................................................................ III
LIST OF CODE LISTINGS............................................................................................................. III
LIST OF NOTATION......................................................................................................................VI
CHAPTER 1
ABOUT THIS MANUAL ....................................................................................... 1
1.1
SCOPE .................................................................................................................................. 2
1.2
FUNCTION ORDERING ............................................................................................................. 2
1.3
API USAGE RESTRICTIONS ..................................................................................................... 2
1.4
DATA TYPES AND CODING STYLE ............................................................................................ 3
CHAPTER 2
TASK API ............................................................................................................ 4
2.1
XTASKCALLAPPLICATIONHOOK()............................................................................................. 5
2.2
XTASKCREATE()..................................................................................................................... 8
2.3
VTASKDELAY()..................................................................................................................... 11
2.4
VTASKDELAYUNTIL() ............................................................................................................ 13
2.5
VTASKDELETE() ................................................................................................................... 16
2.6
TASKDISABLE_INTERRUPTS().......................................................................................... 18
2.7
TASKENABLE_INTERRUPTS()........................................................................................... 19
2.8
VTASKENDSCHEDULER() ...................................................................................................... 20
2.9
ULTASKENDTRACE() ............................................................................................................ 21
2.10 TASKENTER_CRITICAL() ................................................................................................... 22
2.11 TASKEXIT_CRITICAL() ....................................................................................................... 24
2.12 XTASKGETCURRENTTASKHANDLE()...................................................................................... 25
2.13 UXTASKGETNUMBEROFTASKS() ........................................................................................... 26
2.14 XTASKGETSCHEDULERSTATE() ............................................................................................ 27
2.15 UXTASKGETHIGHW ATERMARK()........................................................................................... 28
2.16 XTASKGETTICKCOUNT()....................................................................................................... 30
2.17 VTASKLIST() ........................................................................................................................ 32
2.18 UXTASKPRIORITYGET() ........................................................................................................ 35
2.19 VTASKPRIORITYSET()........................................................................................................... 37
2.20 VTASKRESUME() .................................................................................................................. 39
2.21 XTASKRESUMEALL() ............................................................................................................ 41
2.22 XTASKRESUMEFROMISR() ................................................................................................... 43
2.23 VTASKSETAPPLICATIONTAG() ............................................................................................... 45
2.24 VTASKSTARTSCHEDULER()................................................................................................... 47
2.25 VTASKSUSPEND() ................................................................................................................ 49

..................................................27 VTASKSUSPENDALL()........................................ 56 3...................... 67 3....................................7 XQUEUERECEIVE()............................. 106 APPENDIX 2: LICENSING INFORMATION ............ 72 3........................................................................................................................... 93 4...................................................................................................................................................... 99 APPENDIX 1: DATA TYPES AND CODING STYLE GUIDE ................................................................. 81 4........................................3 VQUEUEDELETE() ............ 78 4...........................................................8 XQUEUERECEIVEFROMISR() ..... 51 TASKYIELD() .........................................................................................5 XSEMAPHOREGIVE() ......6 XSEMAPHOREGIVEFROMISR () .................................................................................................................................................................................................2 XSEMAPHORECREATECOUNTING() ......................................................................................................26 2. 62 3....... 91 4.....3 XSEMAPHORECREATEMUTEX() ................................................................................................................ 63 3.....................................2 CONFIGURATION CONSTANTS ................. XQUEUESENDTOFRONT()..............................1 VQUEUEADDTOREGISTRY ..............................................................................................................................6 XQUEUEPEEK()............................................................................................................................................................................... 58 3..................................................................10 XQUEUESENDFROMISR()........ 64 3....................................................................................................... 60 3........2... 79 4.........................4 XSEMAPHORECREATERECURSIVEMUTEX()................................. 97 5..... 87 4................................2 XQUEUECREATE()................................................ 109 ......... XQUEUESENDTOFRONTFROMISR()...............................4 UXQUEUEMESSAGESW AITING() .....9 XSEMAPHORETAKERECURSIVE()................................. 70 3.......8 XSEMAPHORETAKE() ... 83 4.................................9 XQUEUESEND()................................ 89 4..................................................................................... XQUEUESENDTOBACKFROMISR().................. 85 4............................. XQUEUESENDTOBACK()...........................H ....7 XSEMAPHOREGIVERECURSIVE() .............................................................................................................. 75 CHAPTER 4 SEMAPHORE API ............................................................................................................................................................................ 55 3.1 FREERTOSCONFIG........................1 VSEMAPHORECREATEBINARY()............................................................. 53 CHAPTER 3 QUEUE API ......................................5 UXQUEUEMESSAGESW AITINGFROMISR() ................. 95 CHAPTER 5 KERNEL CONFIGURATION ....................... 98 5...........

................................................................................ 30 Listing 24 Example use of xTaskGetTickCount()...................................................................................................... 32 Listing 26 Example use of vTaskList()................................................................................................................................................................................................................................................................... 15 Listing 10 vTaskDelete() function prototype ............... 24 Listing 19 xTaskGetCurrentTaskHandle() function prototype ........ 19 Listing 14 vTaskEndScheduler() function prototype ........................................................................... 100 Figure 3 An example interrupt priority configuration ....................................................................................................... 31 Listing 25 vTaskList() function prototype ...........................................LIST OF FIGURES Figure 1 An example of the table produced by calling vTaskList()................................. 18 Listing 13 taskENABLE_INTERRUPTS() macro prototype............................. 102 LIST OF CODE LISTINGS Listing 1 xTaskCallApplicationTaskHook() function prototype ............... 13 Listing 9 Example use of vTaskDelayUntil() ..................................... 5 Listing 3 Example use of xTaskCallApplicationTaskHook() ........................................................................................................... 34 Listing 27 uxTaskPriorityGet() function prototype ................... 12 Listing 8 vTaskDelayUntil() function prototype ..................... 35 Listing 28 Example use of uxTaskPriorityGet().................................................. 5 Listing 2 The prototype to which all task hook functions must conform.................................................................................. 11 Listing 7 Example use of vTaskDelay() .............................................................................................................................................................................................. 29 Listing 23 xTaskGetTickCount() function prototype ........................ 17 Listing 12 taskDISABLE_INTERRUPTS() macro prototype........................................... 25 Listing 20 uxTaskGetNumberOfTasks() function prototype .................................................. 10 Listing 6 vTaskDelay() function prototype ........................................................................................................................................... 37 Listing 30 Example use of vTaskPrioritySet() ......................................................................................................................... 36 Listing 29 vTaskPrioritySet() function prototype .................................................................................................. 8 Listing 5 Example use of xTaskCreate()...................................................................................................................................... 16 Listing 11 Example use of the vTaskDelete() ......................................................................................................................................................... 7 Listing 4 xTaskCreate() function prototype.. 26 Listing 21 xTaskGetSchedulerState() function prototype............................... 22 Listing 17 Example use of taskENTER_CRITICAL() and taskEXIT_CRITICAL()........................................................ 23 Listing 18 taskEXIT_CRITICAL() macro prototype .................................................................. 21 Listing 16 taskENTER_CRITICAL macro prototype .................. 38 ........................................ 20 Listing 15 ulTaskEndTrace() function prototype .................................................................................................................................... 27 Listing 22 Example use of uxTaskGetStackHighWaterMark() ......................... 32 Figure 2 Time line showing the execution of 4 idle priority tasks ...............................................................

....................................... 43 Listing 36 Example use of vTaskResumeFromISR() ........... 75 Listing 66 Example use of xQueueSendToBackFromISR() ....... 51 Listing 44 Example use of vTaskSuspendAll() ....................................................... 54 Listing 47 vQueueAddToRegistry() API function ............................................................................. 82 ..................................................................................................... 60 Listing 52 Example use of vQueueDelete() ... 46 Listing 39 vTaskStartScheduler() function prototype ... 52 Listing 45 taskYIELD() macro prototype............................................................................................................................................................... 47 Listing 40 Example use of vTaskStartScheduler() ......... 79 Listing 68 Example use of vSemaphoreCreateBinary() ................................................................................................................................................. 81 Listing 70 Example use of xSemaphoreCreateCounting() .............................................. 74 Listing 65 xQueueSendFromISR()............... 58 Listing 50 Example use of xQueueCreate().............................................................................................................................................................................. 59 Listing 51 vQueueDelete() API function .................................. 39 Listing 32 Example use of vTaskResume() ........................................................................................................................... 62 Listing 55 uxQueueMessagesWaitingFromISR() function prototype....................................................................................................................................................................................................... 61 Listing 53 uxQueueMessagesWaiting() function prototype................................................................... 53 Listing 46 Example us of taskYIELD() ...........................................................................Listing 31 vTaskResume() function prototype ................................................................... 62 Listing 54 Example us of uxQueueMessagesWaiting() .......................... xQueueSendToBackFromISR() and xQueueSendToFrontFromISR() function prototypes ........................... 80 Listing 69 xSemaphoreCreateCounting() macro prototype................................................................................................................ 50 Listing 43 vTaskSuspendAll() function prototype............................................................................................................................................. xQueueSendToFront() and xQueueSendToBack() function prototypes................ 71 Listing 63 xQueueSend()............... 77 Listing 67 vSemaphoreCreateBinary() macro prototype .................................................... 56 Listing 48 Example use of vQueueAddToRegistry() ............................................................................................................ 67 Listing 60 Example us of xQueueReceive()......................................................................................................................................................... 48 Listing 41 vTaskSuspend() function prototype............................. 44 Listing 37 vTaskSetApplicationTaskTag() function prototype ............................................................. 72 Listing 64 Example use of xQueueSendToBack() .............................................................................................. 42 Listing 35 xTaskResumeFromISR() function prototype ...................................... 57 Listing 49 xQueueCreate() API function ...................................... 64 Listing 58 Example us of xQueuePeek() ............................................................ 70 Listing 62 Example use of xQueueReceiveFromISR() ................................................................................................................................................... 41 Listing 34 Example use of xTaskResumeAll() ................................................ 49 Listing 42 Example use of vTaskSuspend() ............................................................................................................... 69 Listing 61 xQueueReceiveFromISR() function prototype..................................................................................................................................... 63 Listing 57 xQueuePeek() function prototype............... 63 Listing 56 Example use of uxQueueMessagesWaitingFromISR() ........................................................ 45 Listing 38 Example use of vTaskSetApplicationTaskTag() ....................................................................... 40 Listing 33 xTaskResumeAll() function prototype .................................................... 66 Listing 59 xQueueReceive() function prototype.

.......................................... 83 Listing 72 Example use of xSemaphoreCreateMutex()...................................................................................................... 95 Listing 84 Example use of xSemaphoreTakeRecursive() ...................................................................................................................................................................................................................................................... 96 Listing 85 The stack overflow hook function prototype ..... 87 Listing 76 Example use of xSemaphoreGive() ........................ 88 Listing 77 xSemaphoreGiveFromISR() macro prototype ..................................... 91 Listing 80 Example use of xSemaphoreGiveRecursive().................................................................................................. 90 Listing 79 xSemaphoreGiveRecursive() macro prototype........................................................... 93 Listing 82 Example use of xSemaphoreTake().................................................................................................. 99 ................................................... 89 Listing 78 Example use of xSemaphoreGiveFromISR() .... 94 Listing 83 xSemaphoreTakeRecursive() macro prototype ...........................................................................................................Listing 71 xSemaphoreCreateMutex() macro prototype ......................................................................... 84 Listing 73 xSemaphoreCreateRecursiveMutex() macro prototype.................................... 86 Listing 75 xSemaphoreGive() macro prototype ............................ 85 Listing 74 Example use of xSemaphoreCreateRecursiveMutex(). 92 Listing 81 xSemaphoreTake() macro prototype.............................................

Sign up to vote on this title
UsefulNot useful