-
xTaskCreate()
:- usage:
xTaskCreate(taskFunction, taskName, stackSize, parameters, priority, taskHandle)
- parameter:
taskFunction
: Task function, that is, the entry function of the task.taskName
: The name of the task.stackSize
: The size of the task stack.parameters
: The parameter passed to the task function.priority
: The priority of the task.taskHandle
: Task handle, used to refer to the created task.
- Return value: Return if the task is created successfully,
pdPASS
otherwise returnerrCOULD_NOT_ALLOCATE_REQUIRED_MEMORY
.
-
vTaskDelay()
:- usage:
vTaskDelay(delay)
- parameter:
delay
: Delay time, in ticks of the system clock.
- Return value: None.
-
xQueueCreate():
- Usage: xQueueCreate(queueLength, itemSize)
- parameter:
- queueLength: The length of the queue, that is, the number of elements that can be stored.
- itemSize: The size of each queue element.
- Return value: If the queue is successfully created, a handle to the queue is returned, otherwise NULL is returned.
-
xQueueSend()
:- usage:
xQueueSend(queueHandle, item, waitTime)
- parameter:
queueHandle
: The handle to the queue.item
: The data to send.waitTime
: The time to wait for the queue to be available, in ticks of the system clock.
- Return value: Return if the data was successfully sent to the queue,
pdPASS
otherwise returnerrQUEUE_FULL
.
xQueueReceive()
:- usage:
xQueueReceive(queueHandle, buffer, waitTime)
- parameter:
queueHandle
: The handle to the queue.buffer
: Buffer for receiving data.waitTime
: The time to wait for the queue to be available, in ticks of the system clock.
- Return value: Return if the data is successfully received,
pdPASS
otherwise returnerrQUEUE_EMPTY
.
xSemaphoreCreateBinary()
:- usage:
xSemaphoreCreateBinary()
- Parameters: none
- Return value: If the binary semaphore is created successfully, it returns a handle pointing to the semaphore, otherwise it returns
NULL
.
xSemaphoreTake()
:- usage:
xSemaphoreTake(semaphoreHandle, waitTime)
- parameter:
semaphoreHandle
: Handle to the semaphore.waitTime
: The time to wait for the semaphore to be available, in ticks of the system clock.
- Return value: Return if the semaphore is successfully obtained, otherwise
pdPASS
returnerrQUEUE_EMPTY
.
xSemaphoreGive()
:- usage:
xSemaphoreGive(semaphoreHandle)
- parameter:
semaphoreHandle
: Handle to the semaphore.
- Return value: Return if the semaphore is successfully released,
pdPASS
otherwise returnerrQUEUE_FULL
.
xEventGroupCreate()
:- usage:
xEventGroupCreate()
- Parameters: none
- Return value: If the event group is created successfully, it returns a handle pointing to the event group, otherwise it returns
NULL
.
xEventGroupSetBits()
:- usage:
xEventGroupSetBits(eventGroupHandle, eventBits)
- parameter:
eventGroupHandle
: Handle to the event group.eventBits
: The event bit to set.
- Return value: The event bit that was set.
xEventGroupWaitBits()
:- usage:
xEventGroupWaitBits(eventGroupHandle, bitsToWaitFor, clearOnExit, waitForAllBits, waitTime)
- parameter:
eventGroupHandle
: Handle to the event group.bitsToWaitFor
: Waiting event bit.clearOnExit
: Whether to clear the event bit when exiting the wait.waitForAllBits
: Whether to wait for all event bits to be set.waitTime
: The time to wait for the event bit to be set, in ticks of the system clock.
- Return value: The event bit that was set.