内容
内容 .............................................................................................................................................................. 2
数字清单 ...................................................................................................................................................... 7
代码清单 ...................................................................................................................................................... 8
表格列表 .................................................................................................................................................... 16
符号列表 .................................................................................................................................................... 17
第 1 章关于本手册 .................................................................................................................................... 18
1.1 范围 .............................................................................................................................................. 18
第 2 章任务和调度程序 API ................................................................................................................... 19
2.1portSWITCH_TO_USER_MODE() ..................................................................................... 19
2.2vTaskAllocateMPURegions() ............................................................................................... 19
2.3xTaskAbortDelay() ................................................................................................................. 21
2.4xTaskCallApplicationTaskHook() ........................................................................................ 22
2.5xTaskCheckForTimeOut() .................................................................................................... 23
2.6xTaskCreate() ........................................................................................................................ 25
2.7xTaskCreateStatic () ............................................................................................................ 28
2.8xTaskCreateRestricted() ...................................................................................................... 30
2.9vTaskDelay() .......................................................................................................................... 33
2.10vTaskDelayUntil() ................................................................................................................ 34
2.11vTaskDelete() ....................................................................................................................... 35
2.12taskDISABLE_INT ERRUPTS() ........................................................................................ 36
2.13taskENABLE_INT ERRUPTS() ......................................................................................... 37
2.14taskENTER_CRITICAL() .................................................................................................... 37
2.15taskENTER_CRITICAL_FROM_ISR() ............................................................................. 39
2.16taskEXIT_CRITICAL() ........................................................................................................ 40
2.1taskEXIT_CRITICAL_FROM_ISR() .................................................................................... 41
2.2xTaskGetApplicationTaskTag() ........................................................................................... 42
2.3xTaskGetCurrentTaskHandle() ........................................................................................... 43
2.4xTaskGetIdleTaskHandle() .................................................................................................. 44
2.1xTaskGetHandle() ................................................................................................................. 44
2.2uxTaskGetNumberOfTasks() ............................................................................................... 45
2.3vTaskGetRunTimeStats() ..................................................................................................... 46
2.4xTaskGetSchedulerState() ................................................................................................... 48
2.5uxTaskGetStackHighWaterMark() ...................................................................................... 49
2.6eTaskGetState() .................................................................................................................... 50
2.7uxTaskGetSystemState() ..................................................................................................... 50
2.8vTaskGetTaskInfo() ............................................................................................................... 53
2.9pvTaskGetThreadLocalStoragePoint er() .......................................................................... 54
2.10pcTaskGetName() ............................................................................................................... 55
2.11xTaskGetTickCount() .......................................................................................................... 55
2.12xTaskGetTickCountFromISR() .......................................................................................... 56
2.13vTaskList() ............................................................................................................................ 57
2.14xTaskNotify() ........................................................................................................................ 59
2.15xTaskNotifyAndQuery() ...................................................................................................... 60
2.16xTaskNotifyAndQueryFromISR() ...................................................................................... 62
2.17xTaskNotifyFromISR() ........................................................................................................ 64
2.18xTaskNotifyGive() ................................................................................................................ 67
2.19vTaskNotifyGiveFromISR() ................................................................................................ 69
2.20xTaskNotifyStateClear() ..................................................................................................... 71
2.21ulTaskNotifyTake() .............................................................................................................. 72
2.22xTaskNotifyWait() ................................................................................................................ 74
2.23uxTaskPriorityGet() ............................................................................................................. 76
2.24vTaskPrioritySet() ................................................................................................................ 77
2.25vTaskResume() ................................................................................................................... 78
2.26xTaskResumeAll() ............................................................................................................... 80
2.27xTaskResumeFromISR() ................................................................................................... 81
2.28vTaskSetApplicationTaskTag() ......................................................................................... 83
2.29vTaskSetThreadLocalStoragePoint er() .......................................................................... 84
2.30vTaskSetTimeOutState().................................................................................................... 85
2.31vTaskStartScheduler() ........................................................................................................ 86
2.32vTaskStepTick() ................................................................................................................... 88
2.33vTaskSuspend() .................................................................................................................. 89
2.34vTaskSuspendAll() .............................................................................................................. 90
2.35taskYIELD() .......................................................................................................................... 92
第 3 章队列 API ....................................................................................................................................... 93
3.1vQueueAddToRegistry() ....................................................................................................... 93
3.2xQueueAddToSet() ............................................................................................................... 94
3.3xQueueCreate() ..................................................................................................................... 95
3.4xQueueCreateSet() ............................................................................................................... 96
3.5xQueueCreateStatic () ......................................................................................................... 98
3.6vQueueDelete() ................................................................................................................... 100
3.7pcQueueGetName() ............................................................................................................ 101
3.8xQueueIsQueueEmptyFromISR() ..................................................................................... 101
3.9xQueueIsQueueFullFromISR() .......................................................................................... 102
3.10uxQueueMessagesWaiting() ........................................................................................... 103
3.11uxQueueMessagesWaitingFromISR() ........................................................................... 103
3.12xQueueOverwrite() ............................................................................................................ 104
3.13xQueueOverwriteFromISR() ............................................................................................ 105
3.14xQueuePeek() .................................................................................................................... 107
3.15xQueuePeekFromISR() .................................................................................................... 109
3.16xQueueReceive() .............................................................................................................. 110
3.17xQueueReceiveFromISR() .............................................................................................. 112
3.18xQueueRemoveFromSet() ............................................................................................... 114
3.19xQueueReset() .................................................................................................................. 115
3.20xQueueSelectFromSet() .................................................................................................. 115
3.21xQueueSelectFromSetFromISR() .................................................................................. 116
3.22xQueueSend() ,xQueueSendToFront() ,xQueueSendToBack() .............. 117
3.23xQueueSendFromISR(),xQueueSendToBackFromISR(),
xQueueSendToFrontFromISR() ............................................................................................. 119
3.24uxQueueSpacesAvailable() ............................................................................................. 122
第 4 章信号量 API ................................................................................................................................. 123
4.1vSemaphoreCreateBinary() ............................................................................................... 123
4.2xSemaphoreCreateBinary() ............................................................................................... 124
4.3xSemaphoreCreateBinaryStatic () ................................................................................... 126
4.4xSemaphoreCreateCounting() .......................................................................................... 128
4.5xSemaphoreCreateCountingStatic () .............................................................................. 129
4.6xSemaphoreCreateMutex()................................................................................................ 131
4.7xSemaphoreCreateMutexStatic () .................................................................................... 132
4.8xSemaphoreCreateRecursiveMutex() .............................................................................. 134
4.9xSemaphoreCreateRecursiveMutexStatic () .................................................................. 135
4.10vSemaphoreDelete() ......................................................................................................... 137
4.11uxSemaphoreGetCount() ................................................................................................. 137
4.12xSemaphoreGetMutexHolder() ....................................................................................... 138
4.13xSemaphoreGive() ............................................................................................................ 138
4.14xSemaphoreGiveFromISR() ............................................................................................ 140
4.15xSemaphoreGiveRecursive() .......................................................................................... 141
4.16xSemaphoreTake() ........................................................................................................... 143
4.17xSemaphoreTakeFromISR() ........................................................................................... 145
4.18xSemaphoreTakeRecursive() .......................................................................................... 146
第 5 章软件定时器 API ......................................................................................................................... 148
5.1xTimerChangePeriod() ........................................................................................................... 148
5.2xTimerChangePeriodFromISR() ....................................................................................... 150
5.3xTimerCreate() ..................................................................................................................... 152
5.4xTimerCreateStatic () ......................................................................................................... 154
5.5xTimerDelete() ..................................................................................................................... 157
5.1xTimerGetExpiryTime() ...................................................................................................... 158
5.1pcTimerGetName().............................................................................................................. 159
5.2xTimerGetPeriod() ............................................................................................................... 160
5.3xTimerGetTimerDaemonTaskHandle() ............................................................................ 161
5.4pvTimerGetTimerID() .......................................................................................................... 161
5.5xTimerIsTimerActive() ......................................................................................................... 162
5.6xTimerPendFunctionCall() ................................................................................................. 163
5.7xTimerPendFunctionCallFromISR() ................................................................................. 164
5.8xTimerReset() ................................................................................................................................. 166
5.9xTimerResetFromISR() ...................................................................................................... 169
5.10vTimerSetTimerID() .......................................................................................................... 170
5.11xTimerStart() ...................................................................................................................... 171
5.12xTimerStartFromISR() ...................................................................................................... 172
5.13xTimerStop() ...................................................................................................................... 174
5.14xTimerStopFromISR() ...................................................................................................... 175
第 6 章事件组 API ................................................................................................................................... 176
6.1xEventGroupClearBits()...................................................................................................... 176
6.2xEventGroupClearBitsFromISR() ...................................................................................... 178
6.3xEventGroupCreate() .......................................................................................................... 179
6.4xEventGroupCreateStatic () .............................................................................................. 180
6.1vEventGroupDelete() .......................................................................................................... 181
6.2xEventGroupGetBits() ......................................................................................................... 182
6.1xEventGroupGetBitsFromISR() ......................................................................................... 182
6.2xEventGroupSetBits() ......................................................................................................... 183
6.3xEventGroupSetBitsFromISR() ......................................................................................... 184
6.1xEventGroupSync() ............................................................................................................. 186
6.2xEventGroupWaitBits() ....................................................................................................... 188
第七章内核配置....................................................................................................................................... 190
7.1FreeRTOSConfig.h ................................................................................................................... 190
7.2 启动“INCLUDE_”的常量 .......................................................................................................... 191