Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Reference Manual
API Functions and Configuration Options
Contents
Contents ................................................................................................................................... 5
List of Figures ........................................................................................................................... 8
List of Code Listings ................................................................................................................. 9
List of Tables .......................................................................................................................... 13
List of Notation ........................................................................................................................ 14
Chapter 1 About This Manual............................................................................................... 16
1.1 Scope........................................................................................................................ 17
Chapter 2 Task and Scheduler API ...................................................................................... 20
2.1 portSWITCH_TO_USER_MODE() ............................................................................ 21
2.2 vTaskAllocateMPURegions() .................................................................................... 22
2.3 xTaskCallApplicationHook() ...................................................................................... 25
2.4 xTaskCreate() ........................................................................................................... 27
2.5 xTaskCreateRestricted() ........................................................................................... 31
2.6 vTaskDelay() ............................................................................................................. 36
2.7 vTaskDelayUntil() ...................................................................................................... 38
2.8 vTaskDelete()............................................................................................................ 41
2.9 taskDISABLE_INTERRUPTS() ................................................................................. 43
2.10 taskENABLE_INTERRUPTS() .................................................................................. 45
2.11 taskENTER_CRITICAL() ........................................................................................... 46
2.12 taskEXIT_CRITICAL() ............................................................................................... 49
2.13 xTaskGetApplicationTaskTag() ................................................................................. 51
2.14 xTaskGetCurrentTaskHandle().................................................................................. 53
2.15 xTaskGetIdleTaskHandle()........................................................................................ 54
2.16 uxTaskGetNumberOfTasks() .................................................................................... 55
2.17 vTaskGetRunTimeStats() .......................................................................................... 56
2.18 xTaskGetSchedulerState() ........................................................................................ 60
2.19 uxTaskGetStackHighWaterMark() ............................................................................. 61
2.20 eTaskGetState() ........................................................................................................ 63
2.21 uxTaskGetSystemState() .......................................................................................... 65
2.22 pcTaskGetTaskName() ............................................................................................. 69
2.23 xTaskGetTickCount() ................................................................................................ 70
2.24 xTaskGetTickCountFromISR() .................................................................................. 72
2.25 vTaskList() ................................................................................................................ 74
2.26 xTaskNotify() ............................................................................................................. 77
2.27 xTaskNotifyFromISR() ............................................................................................... 80
2.28 xTaskNotifyGive()...................................................................................................... 84
2.29 xTaskNotifyGiveFromISR() ....................................................................................... 86
v
2.30
2.31
2.32
2.33
2.34
2.35
2.36
2.37
2.38
2.39
2.40
2.41
2.42
ulTaskNotifyTake() .................................................................................................... 89
xTaskNotifyWait() ...................................................................................................... 92
uxTaskPriorityGet() ................................................................................................... 95
vTaskPrioritySet() ...................................................................................................... 97
vTaskResume() ......................................................................................................... 99
xTaskResumeAll() ................................................................................................... 101
xTaskResumeFromISR() ......................................................................................... 103
vTaskSetApplicationTaskTag() ................................................................................ 106
vTaskStartScheduler() ............................................................................................. 108
vTaskStepTick() ...................................................................................................... 110
vTaskSuspend() ...................................................................................................... 112
vTaskSuspendAll() .................................................................................................. 114
taskYIELD() ............................................................................................................. 116
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12
4.13
APPENDIX 1:
APPENDIX 2:
List of Figures
Figure 1 An example of the table produced by calling vTaskGetRunTimeStats() .................... 56
Figure 2 An example of the table produced by calling vTaskList() ........................................... 74
Figure 3 Time line showing the execution of 4 tasks, all of which run at the idle priority ........ 264
Figure 4 An example interrupt priority configuration .............................................................. 266
viii
List of Tables
Table 1. eTaskGetState() return values ................................................................................. 63
Table 2. Additional macros that are required if ...................................................................... 262
Table 3. Special data types used by FreeRTOS .................................................................. 278
Table 4. Macro prefixes ....................................................................................................... 280
Table 5. Common macro definitions..................................................................................... 280
Table 6. Comparing the open source license with the commercial license ........................... 282
xiii
List of Notation
xiv
API
ISR
MPU
RTOS