Вы находитесь на странице: 1из 5

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
2.26 VTASKSUSPENDALL()........................................................................................................... 51
2.27 TASKYIELD() ....................................................................................................................... 53

CHAPTER 3 QUEUE API ....................................................................................................... 55


3.1 VQUEUEADDTOREGISTRY .................................................................................................... 56
3.2 XQUEUECREATE()................................................................................................................ 58
3.3 VQUEUEDELETE() ................................................................................................................ 60
3.4 UXQUEUEMESSAGESW AITING() ............................................................................................ 62
3.5 UXQUEUEMESSAGESW AITINGFROMISR() ............................................................................. 63
3.6 XQUEUEPEEK().................................................................................................................... 64
3.7 XQUEUERECEIVE()............................................................................................................... 67
3.8 XQUEUERECEIVEFROMISR() ................................................................................................ 70
3.9 XQUEUESEND(), XQUEUESENDTOFRONT(), XQUEUESENDTOBACK()...................................... 72
3.10 XQUEUESENDFROMISR(), XQUEUESENDTOBACKFROMISR(),
XQUEUESENDTOFRONTFROMISR().................................................................................................. 75

CHAPTER 4 SEMAPHORE API ............................................................................................. 78


4.1 VSEMAPHORECREATEBINARY()............................................................................................. 79
4.2 XSEMAPHORECREATECOUNTING() ........................................................................................ 81
4.3 XSEMAPHORECREATEMUTEX() ............................................................................................. 83
4.4 XSEMAPHORECREATERECURSIVEMUTEX()............................................................................ 85
4.5 XSEMAPHOREGIVE() ............................................................................................................ 87
4.6 XSEMAPHOREGIVEFROMISR () ............................................................................................. 89
4.7 XSEMAPHOREGIVERECURSIVE() ........................................................................................... 91
4.8 XSEMAPHORETAKE() ............................................................................................................ 93
4.9 XSEMAPHORETAKERECURSIVE()........................................................................................... 95

CHAPTER 5 KERNEL CONFIGURATION ............................................................................. 97


5.1 FREERTOSCONFIG.H .......................................................................................................... 98
5.2 CONFIGURATION CONSTANTS ............................................................................................... 99

APPENDIX 1: DATA TYPES AND CODING STYLE GUIDE .................................................. 106

APPENDIX 2: LICENSING INFORMATION ........................................................................... 109


LIST OF FIGURES

Figure 1 An example of the table produced by calling vTaskList()...................................................... 32


Figure 2 Time line showing the execution of 4 idle priority tasks ...................................................... 100
Figure 3 An example interrupt priority configuration ......................................................................... 102

LIST OF CODE LISTINGS

Listing 1 xTaskCallApplicationTaskHook() function prototype .............................................................. 5


Listing 2 The prototype to which all task hook functions must conform................................................. 5
Listing 3 Example use of xTaskCallApplicationTaskHook() .................................................................. 7
Listing 4 xTaskCreate() function prototype........................................................................................... 8
Listing 5 Example use of xTaskCreate()............................................................................................. 10
Listing 6 vTaskDelay() function prototype .......................................................................................... 11
Listing 7 Example use of vTaskDelay() .............................................................................................. 12
Listing 8 vTaskDelayUntil() function prototype ................................................................................... 13
Listing 9 Example use of vTaskDelayUntil() ....................................................................................... 15
Listing 10 vTaskDelete() function prototype ....................................................................................... 16
Listing 11 Example use of the vTaskDelete() ..................................................................................... 17
Listing 12 taskDISABLE_INTERRUPTS() macro prototype................................................................ 18
Listing 13 taskENABLE_INTERRUPTS() macro prototype................................................................. 19
Listing 14 vTaskEndScheduler() function prototype ........................................................................... 20
Listing 15 ulTaskEndTrace() function prototype ................................................................................. 21
Listing 16 taskENTER_CRITICAL macro prototype ........................................................................... 22
Listing 17 Example use of taskENTER_CRITICAL() and taskEXIT_CRITICAL()................................ 23
Listing 18 taskEXIT_CRITICAL() macro prototype ............................................................................. 24
Listing 19 xTaskGetCurrentTaskHandle() function prototype ............................................................. 25
Listing 20 uxTaskGetNumberOfTasks() function prototype ................................................................ 26
Listing 21 xTaskGetSchedulerState() function prototype.................................................................... 27
Listing 22 Example use of uxTaskGetStackHighWaterMark() ............................................................ 29
Listing 23 xTaskGetTickCount() function prototype ............................................................................ 30
Listing 24 Example use of xTaskGetTickCount()................................................................................ 31
Listing 25 vTaskList() function prototype ............................................................................................ 32
Listing 26 Example use of vTaskList()................................................................................................ 34
Listing 27 uxTaskPriorityGet() function prototype ............................................................................... 35
Listing 28 Example use of uxTaskPriorityGet()................................................................................... 36
Listing 29 vTaskPrioritySet() function prototype ................................................................................. 37
Listing 30 Example use of vTaskPrioritySet() ..................................................................................... 38
Listing 31 vTaskResume() function prototype .................................................................................... 39
Listing 32 Example use of vTaskResume() ........................................................................................ 40
Listing 33 xTaskResumeAll() function prototype ................................................................................ 41
Listing 34 Example use of xTaskResumeAll() .................................................................................... 42
Listing 35 xTaskResumeFromISR() function prototype ...................................................................... 43
Listing 36 Example use of vTaskResumeFromISR() .......................................................................... 44
Listing 37 vTaskSetApplicationTaskTag() function prototype ............................................................. 45
Listing 38 Example use of vTaskSetApplicationTaskTag() ................................................................. 46
Listing 39 vTaskStartScheduler() function prototype .......................................................................... 47
Listing 40 Example use of vTaskStartScheduler() .............................................................................. 48
Listing 41 vTaskSuspend() function prototype.................................................................................... 49
Listing 42 Example use of vTaskSuspend() ....................................................................................... 50
Listing 43 vTaskSuspendAll() function prototype................................................................................ 51
Listing 44 Example use of vTaskSuspendAll() ................................................................................... 52
Listing 45 taskYIELD() macro prototype............................................................................................. 53
Listing 46 Example us of taskYIELD() ................................................................................................ 54
Listing 47 vQueueAddToRegistry() API function ................................................................................ 56
Listing 48 Example use of vQueueAddToRegistry() ........................................................................... 57
Listing 49 xQueueCreate() API function ............................................................................................. 58
Listing 50 Example use of xQueueCreate()........................................................................................ 59
Listing 51 vQueueDelete() API function ............................................................................................. 60
Listing 52 Example use of vQueueDelete() ........................................................................................ 61
Listing 53 uxQueueMessagesWaiting() function prototype................................................................. 62
Listing 54 Example us of uxQueueMessagesWaiting() ...................................................................... 62
Listing 55 uxQueueMessagesWaitingFromISR() function prototype................................................... 63
Listing 56 Example use of uxQueueMessagesWaitingFromISR() ...................................................... 63
Listing 57 xQueuePeek() function prototype....................................................................................... 64
Listing 58 Example us of xQueuePeek() ............................................................................................ 66
Listing 59 xQueueReceive() function prototype.................................................................................. 67
Listing 60 Example us of xQueueReceive()........................................................................................ 69
Listing 61 xQueueReceiveFromISR() function prototype.................................................................... 70
Listing 62 Example use of xQueueReceiveFromISR() ....................................................................... 71
Listing 63 xQueueSend(), xQueueSendToFront() and xQueueSendToBack() function prototypes..... 72
Listing 64 Example use of xQueueSendToBack() .............................................................................. 74
Listing 65 xQueueSendFromISR(), xQueueSendToBackFromISR() and
xQueueSendToFrontFromISR() function prototypes ................................................................... 75
Listing 66 Example use of xQueueSendToBackFromISR() ................................................................ 77
Listing 67 vSemaphoreCreateBinary() macro prototype ..................................................................... 79
Listing 68 Example use of vSemaphoreCreateBinary() ...................................................................... 80
Listing 69 xSemaphoreCreateCounting() macro prototype................................................................. 81
Listing 70 Example use of xSemaphoreCreateCounting() .................................................................. 82
Listing 71 xSemaphoreCreateMutex() macro prototype ..................................................................... 83
Listing 72 Example use of xSemaphoreCreateMutex()....................................................................... 84
Listing 73 xSemaphoreCreateRecursiveMutex() macro prototype...................................................... 85
Listing 74 Example use of xSemaphoreCreateRecursiveMutex()....................................................... 86
Listing 75 xSemaphoreGive() macro prototype .................................................................................. 87
Listing 76 Example use of xSemaphoreGive() ................................................................................... 88
Listing 77 xSemaphoreGiveFromISR() macro prototype .................................................................... 89
Listing 78 Example use of xSemaphoreGiveFromISR() ..................................................................... 90
Listing 79 xSemaphoreGiveRecursive() macro prototype................................................................... 91
Listing 80 Example use of xSemaphoreGiveRecursive().................................................................... 92
Listing 81 xSemaphoreTake() macro prototype.................................................................................. 93
Listing 82 Example use of xSemaphoreTake()................................................................................... 94
Listing 83 xSemaphoreTakeRecursive() macro prototype .................................................................. 95
Listing 84 Example use of xSemaphoreTakeRecursive() ................................................................... 96
Listing 85 The stack overflow hook function prototype ....................................................................... 99

Вам также может понравиться