SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
FreeRTOS.h
Go to the documentation of this file.
1/*
2 * SuperTinyKernel(TM) RTOS: Lightweight High-Performance Deterministic C++ RTOS for Embedded Systems.
3 *
4 * Source: https://github.com/SuperTinyKernel-RTOS
5 *
6 * Copyright (c) 2022-2026 Neutron Code Limited <stk@neutroncode.com>. All Rights Reserved.
7 * License: MIT License, see LICENSE for a full text.
8 */
9
10#ifndef FREERTOS_STK_H_
11#define FREERTOS_STK_H_
12
13#include <stdint.h>
14#include <stddef.h>
15
16#include "FreeRTOSConfig.h"
17
148
149/* -------------------------------------------------------------------------
150 * Portability macros - mirror what FreeRTOS normally provides via
151 * FreeRTOSConfig.h + portmacro.h so that application code compiles
152 * without changes when those headers are absent.
153 * -------------------------------------------------------------------------*/
154
155#ifndef configMAX_PRIORITIES
156#define configMAX_PRIORITIES 32U
157#endif
158
159#ifndef configMINIMAL_STACK_SIZE
160#define configMINIMAL_STACK_SIZE 128U
161#endif
162
163#ifndef configTICK_RATE_HZ
164#define configTICK_RATE_HZ 1000U
165#endif
166
167#ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
168#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 4U
169#endif
170
171#ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
172#define configTASK_NOTIFICATION_ARRAY_ENTRIES 1U
173#endif
174
175#ifndef configUSE_QUEUE_SETS
176#define configUSE_QUEUE_SETS 1U
177#endif
178
179#ifndef configUSE_MUTEXES
180#define configUSE_MUTEXES 1U
181#endif
182
183#ifndef configUSE_TIMERS
184#define configUSE_TIMERS 1U
185#endif
186
187#ifndef configUSE_EVENT_GROUPS
188#define configUSE_EVENT_GROUPS 1U
189#endif
190
191#ifndef configUSE_STREAM_BUFFERS
192#define configUSE_STREAM_BUFFERS 1U
193#endif
194
195#ifndef configUSE_COUNTING_SEMAPHORES
196#define configUSE_COUNTING_SEMAPHORES 1U
197#endif
198
199#ifndef configUSE_TASK_NOTIFICATIONS
200#define configUSE_TASK_NOTIFICATIONS 1U
201#endif
202
203#ifndef configTOTAL_HEAP_SIZE
204#define configTOTAL_HEAP_SIZE 10240U
205#endif
206
211#ifndef FREERTOS_STK_MAX_TASKS
212#define FREERTOS_STK_MAX_TASKS 16U
213#endif
214
218#ifndef FREERTOS_STK_DEFAULT_STACK_WORDS
219#define FREERTOS_STK_DEFAULT_STACK_WORDS 256U
220#endif
221
241#ifndef FREERTOS_STK_PEND_CALL_QUEUE_SIZE
242#define FREERTOS_STK_PEND_CALL_QUEUE_SIZE 8U
243#endif
244
245/* =========================================================================
246 * Single extern "C" block - matches the cmsis_os2.h pattern.
247 * All typedefs, enums, macros referencing C functions, and all function
248 * declarations are enclosed here so both C and C++ translation units
249 * see consistent C linkage with no per-declaration repetition.
250 * =========================================================================*/
251
252#ifdef __cplusplus
253extern "C" {
254#endif
255
256/* -------------------------------------------------------------------------
257 * FreeRTOS primitive types
258 * -------------------------------------------------------------------------*/
259
260typedef uint32_t TickType_t;
261typedef long BaseType_t;
262typedef unsigned long UBaseType_t;
263typedef long portBASE_TYPE;
264typedef uintptr_t StackType_t;
265
266#ifndef portMAX_DELAY
267 #define portMAX_DELAY ((TickType_t)0xFFFFFFFFUL)
268#endif
269
270#define pdTRUE ((BaseType_t)1)
271#define pdFALSE ((BaseType_t)0)
272#define pdPASS (pdTRUE)
273#define pdFAIL (pdFALSE)
274#define errQUEUE_EMPTY ((BaseType_t)0)
275#define errQUEUE_FULL ((BaseType_t)0)
276
277#ifndef configSTACK_DEPTH_TYPE
278 #define configSTACK_DEPTH_TYPE StackType_t
279#endif
280
281/* -------------------------------------------------------------------------
282 * Task state (eTaskState)
283 * -------------------------------------------------------------------------*/
284
295
296/* -------------------------------------------------------------------------
297 * Task notification actions (xTaskNotify)
298 * -------------------------------------------------------------------------*/
299
309
310/* -------------------------------------------------------------------------
311 * Opaque handle types
312 *
313 * All handles are pointers to internal control block structs defined in
314 * freertos_stk.cpp. Application code treats them as opaque void *.
315 * -------------------------------------------------------------------------*/
316
317typedef void *TaskHandle_t;
318typedef void *QueueHandle_t;
319typedef void *SemaphoreHandle_t;
320typedef void *TimerHandle_t;
321typedef void *EventGroupHandle_t;
322typedef void *StreamBufferHandle_t;
324
325/* QueueSet is not supported; typedefs kept for compilation compatibility. */
326typedef void *QueueSetHandle_t;
328
329/* -------------------------------------------------------------------------
330 * Function pointer types
331 * -------------------------------------------------------------------------*/
332
333typedef void (*TaskFunction_t)(void *pvParameters);
335typedef void (*PendedFunction_t)(void *pvParameter1, uint32_t ulParameter2);
336
344 StreamBufferHandle_t xStreamBuffer,
345 BaseType_t *pxHigherPriorityTaskWoken);
346
347/* -------------------------------------------------------------------------
348 * Task parameters structure
349 * -------------------------------------------------------------------------*/
350
352typedef struct
353{
354 const char *pcName;
355 uint32_t usStackDepth;
359
360/* -------------------------------------------------------------------------
361 * TaskStatus_t — per-task snapshot filled by uxTaskGetSystemState()
362 * -------------------------------------------------------------------------*/
363
382
383/* -------------------------------------------------------------------------
384 * Event group bits type
385 * -------------------------------------------------------------------------*/
386
387typedef uint32_t EventBits_t;
388
389/* -------------------------------------------------------------------------
390 * Critical section and yield - underlying C functions called by the macros
391 * below. Declared here inside the extern "C" block so they are correctly
392 * resolved whether the caller is a C or a C++ translation unit.
393 * -------------------------------------------------------------------------*/
394
398void vPortEnterCritical(void);
399
403void vPortExitCritical(void);
404
408void taskYIELD_impl(void);
409
410#define taskENTER_CRITICAL() vPortEnterCritical()
411#define taskEXIT_CRITICAL() vPortExitCritical()
412#define taskDISABLE_INTERRUPTS() vPortEnterCritical()
413#define taskENABLE_INTERRUPTS() vPortExitCritical()
414#define taskYIELD() taskYIELD_impl()
415#define portYIELD() taskYIELD_impl()
416
417/* -------------------------------------------------------------------------
418 * Kernel control
419 * -------------------------------------------------------------------------*/
420
423void vTaskStartScheduler(void);
424
426void vTaskEndScheduler(void);
427
429void vTaskSuspendAll(void);
430
434
437
440
443
444/* Scheduler state constants returned by xTaskGetSchedulerState(). */
445#define taskSCHEDULER_NOT_STARTED ((BaseType_t)0)
446#define taskSCHEDULER_RUNNING ((BaseType_t)1)
447#define taskSCHEDULER_SUSPENDED ((BaseType_t)2)
448
453
454/* -------------------------------------------------------------------------
455 * Task management
456 * -------------------------------------------------------------------------*/
457
467 const char *pcName,
468 uint32_t usStackDepth,
469 void *pvParameters,
470 UBaseType_t uxPriority,
471 TaskHandle_t *pxCreatedTask);
472
475void vTaskDelete(TaskHandle_t xTaskToDelete);
476
482#define STATIC_TASK_TCB_SIZE_WORDS (21U + configNUM_THREAD_LOCAL_STORAGE_POINTERS \
483 + (3U * (configTASK_NOTIFICATION_ARRAY_ENTRIES - 1U)))
484typedef struct
485{
488
493#define STATIC_QUEUE_TCB_SIZE_WORDS 25U
494typedef struct
495{
498
504#define STATIC_SEMAPHORE_TCB_SIZE_WORDS 8U
509
515#define STATIC_TIMER_TCB_SIZE_WORDS 10U
516typedef struct
517{
518 uint64_t _opaque[STATIC_TIMER_TCB_SIZE_WORDS]; // requires 64-bit alignment for stk::time::TimerHost::Timer
520
525#define STATIC_EVENT_GROUP_TCB_SIZE_WORDS 13U
530
536#define STATIC_STREAM_BUFFER_TCB_SIZE_WORDS 27U
541
547#define STATIC_MESSAGE_BUFFER_TCB_SIZE_WORDS 53U
552
566 const char *pcName,
567 uint32_t ulStackDepth,
568 void *pvParameters,
569 UBaseType_t uxPriority,
570 StackType_t *puxStackBuffer,
571 StaticTask_t *pxTaskBuffer);
572
576#ifndef portNUM_CONFIGURABLE_REGIONS
577# define portNUM_CONFIGURABLE_REGIONS 3U
578#endif
579typedef struct
580{
583 uint32_t ulParameters;
585
601
618 const TaskParameters_restricted_t *pxTaskDefinition,
619 TaskHandle_t *pxCreatedTask);
620
638 const TaskParameters_restricted_t *pxTaskDefinition,
639 TaskHandle_t *pxCreatedTask);
640
653void vTaskList(char *pcWriteBuffer);
654
672void vTaskGetRunTimeStats(char *pcWriteBuffer);
673
676void vTaskSuspend(TaskHandle_t xTaskToSuspend);
677
680void vTaskResume(TaskHandle_t xTaskToResume);
681
686
696
699void vTaskDelay(TickType_t xTicksToDelay);
700
705void vTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement);
706
713BaseType_t xTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement);
714
718void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority);
719
724
729
734
738
742TaskHandle_t xTaskGetHandle(const char *pcNameToQuery);
743
747const char *pcTaskGetName(TaskHandle_t xTaskToQuery);
748
754
761
771 UBaseType_t uxArraySize,
772 uint32_t *pulTotalRunTime);
773
774/* -------------------------------------------------------------------------
775 * Queue API
776 * -------------------------------------------------------------------------*/
777
780QueueHandle_t xQueueCreate(UBaseType_t uxQueueLength, UBaseType_t uxItemSize);
781
793 UBaseType_t uxItemSize,
794 uint8_t *pucQueueStorage,
795 StaticQueue_t *pxStaticQueue);
796
799void vQueueDelete(QueueHandle_t xQueue);
800
807 const void *pvItemToQueue,
808 TickType_t xTicksToWait);
809
816 const void *pvItemToQueue,
817 TickType_t xTicksToWait);
818
826 const void *pvItemToQueue,
827 TickType_t xTicksToWait);
828
835 void *pvBuffer,
836 TickType_t xTicksToWait);
837
853 void *pvBuffer,
854 TickType_t xTicksToWait);
855
867 void *pvBuffer);
868
873
879
884
889
896BaseType_t xQueueOverwrite(QueueHandle_t xQueue, const void *pvItemToQueue);
897
904 const void *pvItemToQueue,
905 BaseType_t *pxHigherPriorityTaskWoken);
906
913 const void *pvItemToQueue,
914 BaseType_t *pxHigherPriorityTaskWoken);
915
922 void *pvBuffer,
923 BaseType_t *pxHigherPriorityTaskWoken);
924
933 const void *pvItemToQueue,
934 BaseType_t *pxHigherPriorityTaskWoken);
935
948 const void *pvItemToQueue,
949 BaseType_t *pxHigherPriorityTaskWoken);
950
957
964
995
1007
1008/* -------------------------------------------------------------------------
1009 * Queue Set API
1010 *
1011 * A queue set allows a single task to block on multiple queues and/or binary
1012 * or counting semaphores simultaneously, waking as soon as any member
1013 * transitions from empty to non-empty.
1014 *
1015 * Usage rules (matching the FreeRTOS API contract):
1016 * 1. Call xQueueCreateSet() with a capacity >= the sum of the capacities
1017 * of all queues and semaphores that will be added to the set.
1018 * 2. Add members with xQueueAddToSet() while they are empty.
1019 * 3. Call xQueueSelectFromSet() or xQueueSelectFromSetFromISR() to wait for
1020 * any member to receive an item. The returned handle identifies which
1021 * member fired; call xQueueReceive() or xSemaphoreTake() on that handle
1022 * to consume the item.
1023 * 4. Remove members with xQueueRemoveFromSet() only while they are empty.
1024 * 5. Mutexes must not be added to queue sets.
1025 *
1026 * \warning xQueueOverwrite / xQueueOverwriteFromISR should not be used on
1027 * queues that are set members, as they generate a set notification
1028 * even when replacing an existing item rather than filling a new
1029 * slot, which can cause spurious wakeups.
1030 * -------------------------------------------------------------------------*/
1031
1039QueueSetHandle_t xQueueCreateSet(UBaseType_t uxEventQueueLength);
1040
1050 QueueSetHandle_t xQueueSet);
1051
1061 QueueSetHandle_t xQueueSet);
1062
1078 TickType_t xTicksToWait);
1079
1089
1090/* -------------------------------------------------------------------------
1091 * Semaphore / Mutex API
1092 * -------------------------------------------------------------------------*/
1093
1097
1103
1109 UBaseType_t uxInitialCount);
1110
1119 UBaseType_t uxInitialCount,
1120 StaticSemaphore_t *pxSemaphoreBuffer);
1121
1126
1132
1135
1141
1144void vSemaphoreDelete(SemaphoreHandle_t xSemaphore);
1145
1150BaseType_t xSemaphoreTake(SemaphoreHandle_t xSemaphore, TickType_t xTicksToWait);
1151
1158 BaseType_t *pxHigherPriorityTaskWoken);
1159
1165
1170
1175
1182 BaseType_t *pxHigherPriorityTaskWoken);
1183
1189
1203
1216
1217/* -------------------------------------------------------------------------
1218 * Software Timer API
1219 * -------------------------------------------------------------------------*/
1220
1228TimerHandle_t xTimerCreate(const char *pcTimerName,
1229 TickType_t xTimerPeriodInTicks,
1230 UBaseType_t uxAutoReload,
1231 void *pvTimerID,
1232 TimerCallbackFunction_t pxCallbackFunction);
1233
1244TimerHandle_t xTimerCreateStatic(const char *pcTimerName,
1245 TickType_t xTimerPeriodInTicks,
1246 UBaseType_t uxAutoReload,
1247 void *pvTimerID,
1248 TimerCallbackFunction_t pxCallbackFunction,
1249 StaticTimer_t *pxTimerBuffer);
1250
1255BaseType_t xTimerDelete(TimerHandle_t xTimer, TickType_t xTicksToWait);
1256
1261BaseType_t xTimerStart(TimerHandle_t xTimer, TickType_t xTicksToWait);
1262
1267BaseType_t xTimerStop(TimerHandle_t xTimer, TickType_t xTicksToWait);
1268
1273BaseType_t xTimerReset(TimerHandle_t xTimer, TickType_t xTicksToWait);
1274
1281 TickType_t xNewPeriod,
1282 TickType_t xTicksToWait);
1283
1288
1292void *pvTimerGetTimerID(TimerHandle_t xTimer);
1293
1297void vTimerSetTimerID(TimerHandle_t xTimer, void *pvNewID);
1298
1302const char *pcTimerGetName(TimerHandle_t xTimer);
1303
1308
1314
1315/* -------------------------------------------------------------------------
1316 * Timer ISR API
1317 *
1318 * These functions are safe to call from an interrupt service routine. They
1319 * post a command to the TimerHost command queue (a stk::sync::PipeT write
1320 * with NO_WAIT) and return immediately without blocking.
1321 *
1322 * The xTicksToWait parameter is accepted for FreeRTOS API compatibility but
1323 * is always ignored: the STK command queue write is non-blocking by design
1324 * (PipeT::TryWrite / NO_WAIT), so there is no meaningful timeout to honour
1325 * from ISR context. If the command queue is full the function returns pdFAIL.
1326 *
1327 * pxHigherPriorityTaskWoken is always set to pdFALSE. STK's tick task wakes
1328 * itself via the command queue CV, which is handled internally by the
1329 * scheduler without requiring the ISR to request a manual context switch.
1330 * -------------------------------------------------------------------------*/
1331
1337 BaseType_t *pxHigherPriorityTaskWoken);
1338
1344 BaseType_t *pxHigherPriorityTaskWoken);
1345
1351 BaseType_t *pxHigherPriorityTaskWoken);
1352
1359 TickType_t xNewPeriod,
1360 BaseType_t *pxHigherPriorityTaskWoken);
1361
1388 void *pvParameter1,
1389 uint32_t ulParameter2,
1390 TickType_t xTicksToWait);
1391
1407 void *pvParameter1,
1408 uint32_t ulParameter2,
1409 BaseType_t *pxHigherPriorityTaskWoken);
1410
1411/* -------------------------------------------------------------------------
1412 * Event Group API
1413 * -------------------------------------------------------------------------*/
1414
1418
1424
1427void vEventGroupDelete(EventGroupHandle_t xEventGroup);
1428
1434 EventBits_t uxBitsToSet);
1435
1441 EventBits_t uxBitsToClear);
1442
1447
1456 EventBits_t uxBitsToWaitFor,
1457 BaseType_t xClearOnExit,
1458 BaseType_t xWaitForAllBits,
1459 TickType_t xTicksToWait);
1460
1467 EventBits_t uxBitsToSet,
1468 BaseType_t *pxHigherPriorityTaskWoken);
1469
1475 EventBits_t uxBitsToClear);
1476
1506 EventBits_t uxBitsToSet,
1507 EventBits_t uxBitsToWaitFor,
1508 TickType_t xTicksToWait);
1509
1510/* -------------------------------------------------------------------------
1511 * Task Notification API
1512 *
1513 * Non-indexed variants always operate on slot 0 and are thin wrappers around
1514 * the indexed variants below. Indexed variants accept a slot index in the
1515 * range [0, configTASK_NOTIFICATION_ARRAY_ENTRIES).
1516 * -------------------------------------------------------------------------*/
1517
1523
1528uint32_t ulTaskNotifyTake(BaseType_t ulClearCountOnExit, TickType_t xTicksToWait);
1529
1535BaseType_t xTaskNotify(TaskHandle_t xTaskToNotify,
1536 uint32_t ulValue,
1537 eNotifyAction eAction);
1538
1545BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry,
1546 uint32_t ulBitsToClearOnExit,
1547 uint32_t *pulNotificationValue,
1548 TickType_t xTicksToWait);
1549
1557 uint32_t ulValue,
1558 eNotifyAction eAction,
1559 BaseType_t *pxHigherPriorityTaskWoken);
1560
1561/* -------------------------------------------------------------------------
1562 * Task Notification — Indexed API
1563 *
1564 * Each task has configTASK_NOTIFICATION_ARRAY_ENTRIES independent notification
1565 * slots, indexed 0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1. Each slot
1566 * is backed by its own stk::sync::Semaphore + value word + pending flag,
1567 * matching the per-slot isolation guarantee of the FreeRTOS reference implementation.
1568 *
1569 * Out-of-range uxIndexToNotify / uxIndexToWait causes an assertion in debug
1570 * builds and is treated as a no-op / failure in release builds.
1571 * -------------------------------------------------------------------------*/
1572
1578 UBaseType_t uxIndexToNotify);
1579
1585uint32_t ulTaskNotifyTakeIndexed(UBaseType_t uxIndexToWait,
1586 BaseType_t ulClearCountOnExit,
1587 TickType_t xTicksToWait);
1588
1596 UBaseType_t uxIndexToNotify,
1597 uint32_t ulValue,
1598 eNotifyAction eAction);
1599
1608 uint32_t ulBitsToClearOnEntry,
1609 uint32_t ulBitsToClearOnExit,
1610 uint32_t *pulNotificationValue,
1611 TickType_t xTicksToWait);
1612
1621 UBaseType_t uxIndexToNotify,
1622 uint32_t ulValue,
1623 eNotifyAction eAction,
1624 BaseType_t *pxHigherPriorityTaskWoken);
1625
1626/* -------------------------------------------------------------------------
1627 * Task Notification — AndQuery / StateClear / ValueClear extensions
1628 *
1629 * These functions extend the notification API with query-on-send and
1630 * targeted clear operations, matching the FreeRTOS 10.4+ additions.
1631 * -------------------------------------------------------------------------*/
1632
1644 uint32_t ulValue,
1645 eNotifyAction eAction,
1646 uint32_t *pulPreviousNotifyValue);
1647
1657 UBaseType_t uxIndexToNotify,
1658 uint32_t ulValue,
1659 eNotifyAction eAction,
1660 uint32_t *pulPreviousNotifyValue);
1661
1671 uint32_t ulValue,
1672 eNotifyAction eAction,
1673 uint32_t *pulPreviousNotifyValue,
1674 BaseType_t *pxHigherPriorityTaskWoken);
1675
1686 UBaseType_t uxIndexToNotify,
1687 uint32_t ulValue,
1688 eNotifyAction eAction,
1689 uint32_t *pulPreviousNotifyValue,
1690 BaseType_t *pxHigherPriorityTaskWoken);
1691
1705
1712 UBaseType_t uxIndexToClear);
1713
1724 uint32_t ulBitsToClear);
1725
1733 UBaseType_t uxIndexToClear,
1734 uint32_t ulBitsToClear);
1735
1736/* -------------------------------------------------------------------------
1737 * Thread-local storage (TLS) API
1738 *
1739 * Each task has a fixed-size array of configNUM_THREAD_LOCAL_STORAGE_POINTERS
1740 * void* slots, indexed 0 .. configNUM_THREAD_LOCAL_STORAGE_POINTERS-1.
1741 * The slots are initialised to NULL at task creation.
1742 * Passing NULL for xTaskToQuery/xTaskToSet selects the calling task.
1743 * -------------------------------------------------------------------------*/
1744
1750 BaseType_t xIndex,
1751 void *pvValue);
1752
1758 BaseType_t xIndex);
1759
1760/* -------------------------------------------------------------------------
1761 * Stream Buffer API
1762 *
1763 * A stream buffer is a lightweight, ISR-safe byte-stream FIFO backed by a
1764 * stk::sync::MessageQueue with msg_size = 1. Producers write arbitrary-length
1765 * byte spans; consumers read arbitrary-length spans. A trigger level can be
1766 * set so that Receive() blocks until at least N bytes are available.
1767 *
1768 * xStreamBufferCreate() - heap-allocated control block + data buffer.
1769 * xStreamBufferCreateStatic() - caller-supplied StaticStreamBuffer_t TCB and
1770 * pucStreamBufferStorageArea data buffer (no heap).
1771 *
1772 * ISR variants (SendFromISR / ReceiveFromISR) are non-blocking (NO_WAIT).
1773 * Passing NULL for pxHigherPriorityTaskWoken is safe; it is always set to
1774 * pdFALSE because STK handles scheduling internally.
1775 * -------------------------------------------------------------------------*/
1776
1782StreamBufferHandle_t xStreamBufferCreate(size_t xBufferSizeBytes,
1783 size_t xTriggerLevelBytes);
1784
1793 size_t xBufferSizeBytes,
1794 size_t xTriggerLevelBytes,
1795 uint8_t *pucStreamBufferStorageArea,
1796 StaticStreamBuffer_t *pxStaticStreamBuffer);
1797
1800void vStreamBufferDelete(StreamBufferHandle_t xStreamBuffer);
1801
1808size_t xStreamBufferSend(StreamBufferHandle_t xStreamBuffer,
1809 const void *pvTxData,
1810 size_t xDataLengthBytes,
1811 TickType_t xTicksToWait);
1812
1820 const void *pvTxData,
1821 size_t xDataLengthBytes,
1822 BaseType_t *pxHigherPriorityTaskWoken);
1823
1830size_t xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer,
1831 void *pvRxData,
1832 size_t xBufferLengthBytes,
1833 TickType_t xTicksToWait);
1834
1842 void *pvRxData,
1843 size_t xBufferLengthBytes,
1844 BaseType_t *pxHigherPriorityTaskWoken);
1845
1850
1855
1860
1865
1870
1882 BaseType_t *pxHigherPriorityTaskWoken);
1883
1889 size_t xTriggerLevelBytes);
1890
1897
1911
1925 size_t xBufferSizeBytes,
1926 size_t xTriggerLevelBytes,
1927 StreamBufferCallbackFunction_t pxSendCompletedCallback,
1928 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
1929
1943 size_t xBufferSizeBytes,
1944 size_t xTriggerLevelBytes,
1945 uint8_t *pucStreamBufferStorageArea,
1946 StaticStreamBuffer_t *pxStaticStreamBuffer,
1947 StreamBufferCallbackFunction_t pxSendCompletedCallback,
1948 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
1949
1950/* -------------------------------------------------------------------------
1951 * Message Buffer API
1952 *
1953 * A message buffer carries discrete, variable-length messages. Each message
1954 * is stored as a pool block (payload) plus an envelope {size, block*} in a
1955 * separate queue. Receive() always returns exactly one complete message.
1956 *
1957 * Backed by:
1958 * - stk::memory::BlockMemoryPool — fixed-size payload blocks
1959 * (block size = AlignBlockSize(xMaxMessageSize)).
1960 * - stk::sync::MessageQueue — envelope FIFO of {len, block*} structs,
1961 * providing correct blocking on both "pool full" and "queue empty".
1962 *
1963 * xMessageBufferCreate() - heap-allocated control block + pool storage.
1964 * xMessageBufferCreateStatic() - caller-supplied TCB and storage buffer.
1965 * xMessageBufferCreateWithCallback() - heap-allocated + send/recv callbacks.
1966 * xMessageBufferCreateStaticWithCallback() - static + send/recv callbacks.
1967 * -------------------------------------------------------------------------*/
1968
1975MessageBufferHandle_t xMessageBufferCreate(size_t xBufferSizeBytes,
1976 size_t xMaxMessageSize);
1977
1986 size_t xMaxMessageSize,
1987 size_t xMessageCount,
1988 uint8_t *pucMessageBufferStorageArea,
1989 StaticMessageBuffer_t *pxStaticMessageBuffer);
1990
2006 size_t xBufferSizeBytes,
2007 size_t xMaxMessageSize,
2008 StreamBufferCallbackFunction_t pxSendCompletedCallback,
2009 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
2010
2024 size_t xMaxMessageSize,
2025 size_t xMessageCount,
2026 uint8_t *pucMessageBufferStorageArea,
2027 StaticMessageBuffer_t *pxStaticMessageBuffer,
2028 StreamBufferCallbackFunction_t pxSendCompletedCallback,
2029 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
2030
2033void vMessageBufferDelete(MessageBufferHandle_t xMessageBuffer);
2034
2043size_t xMessageBufferSend(MessageBufferHandle_t xMessageBuffer,
2044 const void *pvTxData,
2045 size_t xDataLengthBytes,
2046 TickType_t xTicksToWait);
2047
2060 const void *pvTxData,
2061 size_t xDataLengthBytes,
2062 BaseType_t *pxHigherPriorityTaskWoken);
2063
2071size_t xMessageBufferReceive(MessageBufferHandle_t xMessageBuffer,
2072 void *pvRxData,
2073 size_t xBufferLengthBytes,
2074 TickType_t xTicksToWait);
2075
2089 void *pvRxData,
2090 size_t xBufferLengthBytes,
2091 BaseType_t *pxHigherPriorityTaskWoken);
2092
2097
2102
2107
2120
2127
2139 BaseType_t *pxHigherPriorityTaskWoken);
2140
2141/* -------------------------------------------------------------------------
2142 * Heap API
2143 *
2144 * pvPortMalloc / vPortFree are thin wrappers around
2145 * stk::memory::MemoryAllocator::Allocate / Free — the same allocation seam
2146 * used internally by all STK and FreeRTOS-STK objects. Replacing the two
2147 * MemoryAllocator definitions in freertos_stk.cpp (e.g. to point at a static
2148 * pool) automatically redirects both the internal and application-facing heap.
2149 *
2150 * xPortGetFreeHeapSize / xPortGetMinimumEverFreeHeapSize / vPortGetHeapStats
2151 * read from the same s_MemStats accounting structure maintained by
2152 * MemoryAllocator::Allocate() and ::Free().
2153 * -------------------------------------------------------------------------*/
2154
2171
2176void *pvPortMalloc(size_t xWantedSize);
2177
2181void vPortFree(void *pv);
2182
2190size_t xPortGetFreeHeapSize(void);
2191
2200
2208void vPortGetHeapStats(HeapStats_t *pxHeapStats);
2209
2210/* -------------------------------------------------------------------------
2211 * Convenience macros matching standard FreeRTOS naming conventions
2212 * -------------------------------------------------------------------------*/
2213
2214#define pdMS_TO_TICKS(xTimeInMs) ((TickType_t)(xTimeInMs))
2215#define tskIDLE_PRIORITY ((UBaseType_t)0U)
2216#define xTaskHandle TaskHandle_t
2217
2218#ifdef __cplusplus
2219}
2220#endif
2221
2223
2224#endif /* FREERTOS_STK_H_ */
BaseType_t xTaskCreateRestrictedStatic(const TaskParameters_restricted_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask)
void * StreamBufferHandle_t
Definition FreeRTOS.h:322
BaseType_t xSemaphoreTakeFromISR(SemaphoreHandle_t xSemaphore, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xTimerStartFromISR(TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xStreamBufferReset(StreamBufferHandle_t xStreamBuffer)
void vTaskSuspendAll(void)
Suspend the scheduler (disables preemption; interrupts remain enabled).
SemaphoreHandle_t xSemaphoreCreateMutexStatic(StaticSemaphore_t *pxMutexBuffer)
StreamBufferHandle_t xStreamBufferCreate(size_t xBufferSizeBytes, size_t xTriggerLevelBytes)
#define STATIC_TASK_TCB_SIZE_WORDS
Definition FreeRTOS.h:482
size_t xPortGetFreeHeapSize(void)
size_t xMessageBufferSpacesAvailable(MessageBufferHandle_t xMessageBuffer)
BaseType_t xTaskAbortDelay(TaskHandle_t xTask)
BaseType_t xQueuePeek(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait)
eTaskState
Task execution state, returned by eTaskGetState().
Definition FreeRTOS.h:287
BaseType_t xEventGroupSetBitsFromISR(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume)
BaseType_t xQueueSendToFront(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
QueueHandle_t xQueueCreate(UBaseType_t uxQueueLength, UBaseType_t uxItemSize)
BaseType_t xTaskNotifyAndQueryIndexed(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue)
SemaphoreHandle_t xSemaphoreCreateBinary(void)
BaseType_t xTimerChangePeriod(TimerHandle_t xTimer, TickType_t xNewPeriod, TickType_t xTicksToWait)
size_t xMessageBufferNextLengthBytes(MessageBufferHandle_t xMessageBuffer)
void vPortFree(void *pv)
EventBits_t xEventGroupSync(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToSet, EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait)
void vTimerSetTimerID(TimerHandle_t xTimer, void *pvNewID)
QueueSetMemberHandle_t xQueueSelectFromSetFromISR(QueueSetHandle_t xQueueSet)
StreamBufferHandle_t xStreamBufferCreateWithCallback(size_t xBufferSizeBytes, size_t xTriggerLevelBytes, StreamBufferCallbackFunction_t pxSendCompletedCallback, StreamBufferCallbackFunction_t pxReceiveCompletedCallback)
TaskHandle_t xTaskGetCurrentTaskHandle(void)
BaseType_t xTaskNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken)
EventGroupHandle_t xEventGroupCreate(void)
void vPortEnterCritical(void)
BaseType_t xTimerStart(TimerHandle_t xTimer, TickType_t xTicksToWait)
SemaphoreHandle_t xSemaphoreCreateRecursiveMutex(void)
Create a recursive mutex (same implementation as xSemaphoreCreateMutex).
void * QueueSetHandle_t
Definition FreeRTOS.h:326
void * SemaphoreHandle_t
Definition FreeRTOS.h:319
BaseType_t xQueueOverwriteFromISR(QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken)
void vQueueDelete(QueueHandle_t xQueue)
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority)
StreamBufferHandle_t xStreamBufferCreateStaticWithCallback(size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t *pucStreamBufferStorageArea, StaticStreamBuffer_t *pxStaticStreamBuffer, StreamBufferCallbackFunction_t pxSendCompletedCallback, StreamBufferCallbackFunction_t pxReceiveCompletedCallback)
BaseType_t xTimerStopFromISR(TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken)
void(* PendedFunction_t)(void *pvParameter1, uint32_t ulParameter2)
Definition FreeRTOS.h:335
BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxHigherPriorityTaskWoken)
long portBASE_TYPE
Definition FreeRTOS.h:263
BaseType_t xTimerReset(TimerHandle_t xTimer, TickType_t xTicksToWait)
long BaseType_t
Definition FreeRTOS.h:261
BaseType_t xMessageBufferReset(MessageBufferHandle_t xMessageBuffer)
uintptr_t StackType_t
Definition FreeRTOS.h:264
UBaseType_t uxTaskGetNumberOfTasks(void)
Return the number of tasks currently under kernel management.
BaseType_t xTaskNotifyStateClear(TaskHandle_t xTask)
BaseType_t xTaskNotifyIndexed(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction)
BaseType_t xQueueSendToBackFromISR(QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken)
void * EventGroupHandle_t
Definition FreeRTOS.h:321
MessageBufferHandle_t xMessageBufferCreateWithCallback(size_t xBufferSizeBytes, size_t xMaxMessageSize, StreamBufferCallbackFunction_t pxSendCompletedCallback, StreamBufferCallbackFunction_t pxReceiveCompletedCallback)
QueueSetHandle_t xQueueCreateSet(UBaseType_t uxEventQueueLength)
UBaseType_t uxQueueSpacesAvailable(QueueHandle_t xQueue)
void vTaskStartScheduler(void)
TaskHandle_t xSemaphoreGetMutexHolderFromISR(SemaphoreHandle_t xMutex)
SemaphoreHandle_t xSemaphoreCreateCountingStatic(UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer)
#define STATIC_MESSAGE_BUFFER_TCB_SIZE_WORDS
Definition FreeRTOS.h:547
size_t xStreamBufferBytesAvailable(StreamBufferHandle_t xStreamBuffer)
TaskHandle_t xQueueGetMutexHolderFromISR(QueueHandle_t xQueue)
void(* TimerCallbackFunction_t)(TimerHandle_t xTimer)
Definition FreeRTOS.h:334
BaseType_t xTimerPendFunctionCall(PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait)
UBaseType_t uxTaskGetSystemState(TaskStatus_t *pxTaskStatusArray, UBaseType_t uxArraySize, uint32_t *pulTotalRunTime)
BaseType_t xTaskNotifyStateClearIndexed(TaskHandle_t xTask, UBaseType_t uxIndexToClear)
TickType_t xTaskGetTickCount(void)
Return the tick count since the scheduler started.
UBaseType_t uxSemaphoreGetCount(SemaphoreHandle_t xSemaphore)
EventBits_t xEventGroupGetBits(EventGroupHandle_t xEventGroup)
BaseType_t xQueueSendFromISR(QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken)
size_t xMessageBufferReceive(MessageBufferHandle_t xMessageBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
unsigned long UBaseType_t
Definition FreeRTOS.h:262
uint32_t ulTaskNotifyTake(BaseType_t ulClearCountOnExit, TickType_t xTicksToWait)
BaseType_t xTaskNotifyAndQueryFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue, BaseType_t *pxHigherPriorityTaskWoken)
void vEventGroupDelete(EventGroupHandle_t xEventGroup)
const char * pcTimerGetName(TimerHandle_t xTimer)
void * QueueSetMemberHandle_t
Definition FreeRTOS.h:327
void(* TaskFunction_t)(void *pvParameters)
Definition FreeRTOS.h:333
uint32_t EventBits_t
Definition FreeRTOS.h:387
TaskHandle_t xSemaphoreGetMutexHolder(SemaphoreHandle_t xMutex)
BaseType_t xTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement)
BaseType_t xQueueIsQueueFullFromISR(const QueueHandle_t xQueue)
BaseType_t xStreamBufferIsFull(StreamBufferHandle_t xStreamBuffer)
QueueHandle_t xQueueCreateStatic(UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue)
BaseType_t xTimerStop(TimerHandle_t xTimer, TickType_t xTicksToWait)
SemaphoreHandle_t xSemaphoreCreateBinaryStatic(StaticSemaphore_t *pxSemaphoreBuffer)
BaseType_t xTaskNotifyAndQuery(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue)
void * pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery, BaseType_t xIndex)
BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait)
size_t xMessageBufferSendFromISR(MessageBufferHandle_t xMessageBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xQueueIsQueueEmptyFromISR(const QueueHandle_t xQueue)
BaseType_t xTaskNotifyGive(TaskHandle_t xTaskToNotify)
void vTaskDelay(TickType_t xTicksToDelay)
void vStreamBufferDelete(StreamBufferHandle_t xStreamBuffer)
MessageBufferHandle_t xMessageBufferCreateStatic(size_t xMaxMessageSize, size_t xMessageCount, uint8_t *pucMessageBufferStorageArea, StaticMessageBuffer_t *pxStaticMessageBuffer)
TimerHandle_t xTimerCreate(const char *pcTimerName, TickType_t xTimerPeriodInTicks, UBaseType_t uxAutoReload, void *pvTimerID, TimerCallbackFunction_t pxCallbackFunction)
void vTaskSuspend(TaskHandle_t xTaskToSuspend)
uint32_t ulTaskNotifyTakeIndexed(UBaseType_t uxIndexToWait, BaseType_t ulClearCountOnExit, TickType_t xTicksToWait)
BaseType_t xQueueRemoveFromSet(QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet)
SemaphoreHandle_t xSemaphoreCreateMutex(void)
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery)
BaseType_t xStreamBufferResetFromISR(StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xStreamBufferSetTriggerLevel(StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevelBytes)
BaseType_t xMessageBufferResetFromISR(MessageBufferHandle_t xMessageBuffer, BaseType_t *pxHigherPriorityTaskWoken)
SemaphoreHandle_t xSemaphoreCreateCounting(UBaseType_t uxMaxCount, UBaseType_t uxInitialCount)
void vTaskSetThreadLocalStoragePointer(TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue)
SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic(StaticSemaphore_t *pxMutexBuffer)
BaseType_t xQueueAddToSet(QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet)
void taskYIELD_impl(void)
MessageBufferHandle_t xMessageBufferCreateStaticWithCallback(size_t xMaxMessageSize, size_t xMessageCount, uint8_t *pucMessageBufferStorageArea, StaticMessageBuffer_t *pxStaticMessageBuffer, StreamBufferCallbackFunction_t pxSendCompletedCallback, StreamBufferCallbackFunction_t pxReceiveCompletedCallback)
size_t xStreamBufferSpacesAvailable(StreamBufferHandle_t xStreamBuffer)
uint32_t ulTaskNotifyValueClearIndexed(TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear)
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask)
UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask)
BaseType_t xSemaphoreGive(SemaphoreHandle_t xSemaphore)
BaseType_t xQueuePeekFromISR(QueueHandle_t xQueue, void *pvBuffer)
BaseType_t xStreamBufferIsEmpty(StreamBufferHandle_t xStreamBuffer)
BaseType_t xTaskGetSchedulerState(void)
BaseType_t xSemaphoreGiveFromISR(SemaphoreHandle_t xSemaphore, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xTaskNotifyFromISRIndexed(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xSemaphoreTake(SemaphoreHandle_t xSemaphore, TickType_t xTicksToWait)
void vTaskList(char *pcWriteBuffer)
EventGroupHandle_t xEventGroupCreateStatic(StaticEventGroup_t *pxEventGroupBuffer)
UBaseType_t uxQueueMessagesWaiting(QueueHandle_t xQueue)
BaseType_t xMessageBufferIsEmpty(MessageBufferHandle_t xMessageBuffer)
BaseType_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
EventBits_t xEventGroupClearBitsFromISR(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToClear)
void vMessageBufferDelete(MessageBufferHandle_t xMessageBuffer)
uint32_t TickType_t
Definition FreeRTOS.h:260
BaseType_t xQueueReset(QueueHandle_t xQueue)
BaseType_t xMessageBufferIsFull(MessageBufferHandle_t xMessageBuffer)
BaseType_t xTimerDelete(TimerHandle_t xTimer, TickType_t xTicksToWait)
eTaskState eTaskGetState(TaskHandle_t xTask)
void * TimerHandle_t
Definition FreeRTOS.h:320
BaseType_t xTaskNotifyAndQueryFromISRIndexed(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue, BaseType_t *pxHigherPriorityTaskWoken)
void * QueueHandle_t
Definition FreeRTOS.h:318
TickType_t xTimerGetPeriod(TimerHandle_t xTimer)
size_t xMessageBufferReceiveFromISR(MessageBufferHandle_t xMessageBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t *pxHigherPriorityTaskWoken)
QueueSetMemberHandle_t xQueueSelectFromSet(QueueSetHandle_t xQueueSet, TickType_t xTicksToWait)
TickType_t xTimerGetExpiryTime(TimerHandle_t xTimer)
size_t xPortGetMinimumEverFreeHeapSize(void)
void(* StreamBufferCallbackFunction_t)(StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken)
Definition FreeRTOS.h:343
void vTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement)
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToClear)
void vSemaphoreDelete(SemaphoreHandle_t xSemaphore)
void vPortGetHeapStats(HeapStats_t *pxHeapStats)
MessageBufferHandle_t xMessageBufferCreate(size_t xBufferSizeBytes, size_t xMaxMessageSize)
#define STATIC_QUEUE_TCB_SIZE_WORDS
Definition FreeRTOS.h:493
BaseType_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
#define STATIC_SEMAPHORE_TCB_SIZE_WORDS
Definition FreeRTOS.h:504
BaseType_t xTimerIsTimerActive(TimerHandle_t xTimer)
void * pvPortMalloc(size_t xWantedSize)
BaseType_t xTaskCreateRestricted(const TaskParameters_restricted_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask)
const char * pcTaskGetName(TaskHandle_t xTaskToQuery)
BaseType_t xTaskNotifyGiveIndexed(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify)
#define portNUM_CONFIGURABLE_REGIONS
Definition FreeRTOS.h:577
size_t xStreamBufferSendFromISR(StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t *pxHigherPriorityTaskWoken)
TimerHandle_t xTimerCreateStatic(const char *pcTimerName, TickType_t xTimerPeriodInTicks, UBaseType_t uxAutoReload, void *pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer)
BaseType_t xSemaphoreGiveRecursive(SemaphoreHandle_t xMutex)
#define STATIC_TIMER_TCB_SIZE_WORDS
Definition FreeRTOS.h:515
TickType_t xTaskGetTickCountFromISR(void)
Return the tick count from ISR context (ISR-safe).
BaseType_t xTaskNotifyWaitIndexed(UBaseType_t uxIndexToWait, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait)
TaskHandle_t xQueueGetMutexHolder(QueueHandle_t xQueue)
void vTaskResume(TaskHandle_t xTaskToResume)
UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask)
BaseType_t xTimerChangePeriodFromISR(TimerHandle_t xTimer, TickType_t xNewPeriod, BaseType_t *pxHigherPriorityTaskWoken)
UBaseType_t uxQueueMessagesWaitingFromISR(QueueHandle_t xQueue)
BaseType_t xTimerResetFromISR(TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken)
#define STATIC_STREAM_BUFFER_TCB_SIZE_WORDS
Definition FreeRTOS.h:536
uint32_t ulTaskNotifyValueClear(TaskHandle_t xTask, uint32_t ulBitsToClear)
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToWaitFor, BaseType_t xClearOnExit, BaseType_t xWaitForAllBits, TickType_t xTicksToWait)
void * pvTimerGetTimerID(TimerHandle_t xTimer)
size_t xStreamBufferSend(StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
BaseType_t xTaskResumeAll(void)
BaseType_t xTaskCreate(TaskFunction_t pvTaskCode, const char *pcName, uint32_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask)
StreamBufferHandle_t xStreamBufferCreateStatic(size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t *pucStreamBufferStorageArea, StaticStreamBuffer_t *pxStaticStreamBuffer)
size_t xStreamBufferGetTriggerLevel(StreamBufferHandle_t xStreamBuffer)
StackType_t uxTaskGetStackHighWaterMark2(TaskHandle_t xTask)
size_t xMessageBufferSend(MessageBufferHandle_t xMessageBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
#define configSTACK_DEPTH_TYPE
Definition FreeRTOS.h:278
BaseType_t xSemaphoreTakeRecursive(SemaphoreHandle_t xMutex, TickType_t xTicksToWait)
void * MessageBufferHandle_t
Definition FreeRTOS.h:323
eNotifyAction
Action applied to a task's notification value by xTaskNotify().
Definition FreeRTOS.h:302
void vTaskGetRunTimeStats(char *pcWriteBuffer)
void * TaskHandle_t
Definition FreeRTOS.h:317
#define STATIC_EVENT_GROUP_TCB_SIZE_WORDS
Definition FreeRTOS.h:525
void vTaskEndScheduler(void)
End scheduling (KERNEL_DYNAMIC only). Included for API completeness.
void vPortExitCritical(void)
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup, EventBits_t uxBitsToSet)
BaseType_t xTimerPendFunctionCallFromISR(PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xQueueSendToFrontFromISR(QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken)
BaseType_t xTaskNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction)
BaseType_t xQueueReceive(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait)
size_t xStreamBufferReceiveFromISR(StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t *pxHigherPriorityTaskWoken)
void vTaskDelete(TaskHandle_t xTaskToDelete)
size_t xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
BaseType_t xQueueOverwrite(QueueHandle_t xQueue, const void *pvItemToQueue)
size_t xStreamBufferNextMessageLengthBytes(StreamBufferHandle_t xStreamBuffer)
TaskHandle_t xTaskCreateStatic(TaskFunction_t pvTaskCode, const char *pcName, uint32_t ulStackDepth, void *pvParameters, UBaseType_t uxPriority, StackType_t *puxStackBuffer, StaticTask_t *pxTaskBuffer)
@ eRunning
Definition FreeRTOS.h:288
@ eReady
Definition FreeRTOS.h:289
@ eInvalid
Definition FreeRTOS.h:293
@ eDeleted
Definition FreeRTOS.h:292
@ eBlocked
Definition FreeRTOS.h:290
@ eSuspended
Definition FreeRTOS.h:291
@ eIncrement
Definition FreeRTOS.h:305
@ eSetValueWithOverwrite
Definition FreeRTOS.h:306
@ eSetBits
Definition FreeRTOS.h:304
@ eNoAction
Definition FreeRTOS.h:303
@ eSetValueWithoutOverwrite
Definition FreeRTOS.h:307
Parameters passed to xTaskCreate().
Definition FreeRTOS.h:353
UBaseType_t uxPriority
Definition FreeRTOS.h:357
const char * pcName
Definition FreeRTOS.h:354
void * pvParameters
Definition FreeRTOS.h:356
uint32_t usStackDepth
Definition FreeRTOS.h:355
StackType_t * pxStackBase
Definition FreeRTOS.h:378
uint32_t xTaskNumber
Definition FreeRTOS.h:380
eTaskState eCurrentState
Definition FreeRTOS.h:374
TaskHandle_t xHandle
Definition FreeRTOS.h:372
StackType_t usStackHighWaterMark
Definition FreeRTOS.h:379
UBaseType_t uxBasePriority
Definition FreeRTOS.h:376
UBaseType_t uxCurrentPriority
Definition FreeRTOS.h:375
uint32_t ulRunTimeCounter
Definition FreeRTOS.h:377
const char * pcTaskName
Definition FreeRTOS.h:373
uintptr_t _opaque[(21U+4U+(3U *(1U - 1U)))]
Definition FreeRTOS.h:486
uintptr_t _opaque[25U]
Definition FreeRTOS.h:496
uintptr_t _opaque[8U]
Definition FreeRTOS.h:507
uint64_t _opaque[10U]
Definition FreeRTOS.h:518
uintptr_t _opaque[13U]
Definition FreeRTOS.h:528
uintptr_t _opaque[27U]
Definition FreeRTOS.h:539
uintptr_t _opaque[53U]
Definition FreeRTOS.h:550
uint32_t ulLengthInBytes
Definition FreeRTOS.h:582
uint32_t ulParameters
Definition FreeRTOS.h:583
void * pvBaseAddress
Definition FreeRTOS.h:581
StackType_t * puxStackBuffer
Definition FreeRTOS.h:597
TaskFunction_t pvTaskCode
Definition FreeRTOS.h:592
MemoryRegion_t xRegions[3U]
Definition FreeRTOS.h:599
StaticTask_t * pxTaskBuffer
Definition FreeRTOS.h:598
size_t xSizeOfSmallestFreeBlockInBytes
Definition FreeRTOS.h:2165
size_t xMinimumEverFreeBytesRemaining
Definition FreeRTOS.h:2167
size_t xNumberOfSuccessfulAllocations
Definition FreeRTOS.h:2168
size_t xSizeOfLargestFreeBlockInBytes
Definition FreeRTOS.h:2164
size_t xNumberOfFreeBlocks
Definition FreeRTOS.h:2166
size_t xNumberOfSuccessfulFrees
Definition FreeRTOS.h:2169
size_t xAvailableHeapSpaceInBytes
Definition FreeRTOS.h:2163