SuperTinyKernel™ RTOS 1.06.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
144
145/* -------------------------------------------------------------------------
146 * Portability macros - mirror what FreeRTOS normally provides via
147 * FreeRTOSConfig.h + portmacro.h so that application code compiles
148 * without changes when those headers are absent.
149 * -------------------------------------------------------------------------*/
150
151#ifndef configMAX_PRIORITIES
152#define configMAX_PRIORITIES 32U
153#endif
154
155#ifndef configMINIMAL_STACK_SIZE
156#define configMINIMAL_STACK_SIZE 128U
157#endif
158
159#ifndef configTICK_RATE_HZ
160#define configTICK_RATE_HZ 1000U
161#endif
162
163#ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
164#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 4U
165#endif
166
167#ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
168#define configTASK_NOTIFICATION_ARRAY_ENTRIES 1U
169#endif
170
171#ifndef configUSE_QUEUE_SETS
172#define configUSE_QUEUE_SETS 1U
173#endif
174
175#ifndef configUSE_MUTEXES
176#define configUSE_MUTEXES 1U
177#endif
178
179#ifndef configUSE_TIMERS
180#define configUSE_TIMERS 1U
181#endif
182
183#ifndef configUSE_EVENT_GROUPS
184#define configUSE_EVENT_GROUPS 1U
185#endif
186
187#ifndef configUSE_STREAM_BUFFERS
188#define configUSE_STREAM_BUFFERS 1U
189#endif
190
191#ifndef configUSE_COUNTING_SEMAPHORES
192#define configUSE_COUNTING_SEMAPHORES 1U
193#endif
194
195#ifndef configUSE_TASK_NOTIFICATIONS
196#define configUSE_TASK_NOTIFICATIONS 1U
197#endif
198
199#ifndef configTOTAL_HEAP_SIZE
200#define configTOTAL_HEAP_SIZE 10240U
201#endif
202
207#ifndef FREERTOS_STK_MAX_TASKS
208#define FREERTOS_STK_MAX_TASKS 16U
209#endif
210
214#ifndef FREERTOS_STK_DEFAULT_STACK_WORDS
215#define FREERTOS_STK_DEFAULT_STACK_WORDS 256U
216#endif
217
237#ifndef FREERTOS_STK_PEND_CALL_QUEUE_SIZE
238#define FREERTOS_STK_PEND_CALL_QUEUE_SIZE 8U
239#endif
240
241/* =========================================================================
242 * Single extern "C" block - matches the cmsis_os2.h pattern.
243 * All typedefs, enums, macros referencing C functions, and all function
244 * declarations are enclosed here so both C and C++ translation units
245 * see consistent C linkage with no per-declaration repetition.
246 * =========================================================================*/
247
248#ifdef __cplusplus
249extern "C" {
250#endif
251
252/* -------------------------------------------------------------------------
253 * FreeRTOS primitive types
254 * -------------------------------------------------------------------------*/
255
256typedef uint32_t TickType_t;
257typedef long BaseType_t;
258typedef unsigned long UBaseType_t;
259typedef long portBASE_TYPE;
260typedef uintptr_t StackType_t;
261
262#define portMAX_DELAY ((TickType_t)0xFFFFFFFFUL)
263#define pdTRUE ((BaseType_t)1)
264#define pdFALSE ((BaseType_t)0)
265#define pdPASS (pdTRUE)
266#define pdFAIL (pdFALSE)
267#define errQUEUE_EMPTY ((BaseType_t)0)
268#define errQUEUE_FULL ((BaseType_t)0)
269
270#ifndef configSTACK_DEPTH_TYPE
271 #define configSTACK_DEPTH_TYPE StackType_t
272#endif
273
274/* -------------------------------------------------------------------------
275 * Task state (eTaskState)
276 * -------------------------------------------------------------------------*/
277
288
289/* -------------------------------------------------------------------------
290 * Task notification actions (xTaskNotify)
291 * -------------------------------------------------------------------------*/
292
302
303/* -------------------------------------------------------------------------
304 * Opaque handle types
305 *
306 * All handles are pointers to internal control block structs defined in
307 * freertos_stk.cpp. Application code treats them as opaque void *.
308 * -------------------------------------------------------------------------*/
309
310typedef void *TaskHandle_t;
311typedef void *QueueHandle_t;
312typedef void *SemaphoreHandle_t;
313typedef void *TimerHandle_t;
314typedef void *EventGroupHandle_t;
315typedef void *StreamBufferHandle_t;
317
318/* QueueSet is not supported; typedefs kept for compilation compatibility. */
319typedef void *QueueSetHandle_t;
321
322/* -------------------------------------------------------------------------
323 * Function pointer types
324 * -------------------------------------------------------------------------*/
325
326typedef void (*TaskFunction_t)(void *pvParameters);
328typedef void (*PendedFunction_t)(void *pvParameter1, uint32_t ulParameter2);
329
337 StreamBufferHandle_t xStreamBuffer,
338 BaseType_t *pxHigherPriorityTaskWoken);
339
340/* -------------------------------------------------------------------------
341 * Task parameters structure
342 * -------------------------------------------------------------------------*/
343
345typedef struct
346{
347 const char *pcName;
348 uint32_t usStackDepth;
352
353/* -------------------------------------------------------------------------
354 * TaskStatus_t — per-task snapshot filled by uxTaskGetSystemState()
355 * -------------------------------------------------------------------------*/
356
375
376/* -------------------------------------------------------------------------
377 * Event group bits type
378 * -------------------------------------------------------------------------*/
379
380typedef uint32_t EventBits_t;
381
382/* -------------------------------------------------------------------------
383 * Critical section and yield - underlying C functions called by the macros
384 * below. Declared here inside the extern "C" block so they are correctly
385 * resolved whether the caller is a C or a C++ translation unit.
386 * -------------------------------------------------------------------------*/
387
391void vPortEnterCritical(void);
392
396void vPortExitCritical(void);
397
401void taskYIELD_impl(void);
402
403#define taskENTER_CRITICAL() vPortEnterCritical()
404#define taskEXIT_CRITICAL() vPortExitCritical()
405#define taskDISABLE_INTERRUPTS() vPortEnterCritical()
406#define taskENABLE_INTERRUPTS() vPortExitCritical()
407#define taskYIELD() taskYIELD_impl()
408#define portYIELD() taskYIELD_impl()
409
410/* -------------------------------------------------------------------------
411 * Kernel control
412 * -------------------------------------------------------------------------*/
413
416void vTaskStartScheduler(void);
417
419void vTaskEndScheduler(void);
420
422void vTaskSuspendAll(void);
423
427
430
433
436
437/* Scheduler state constants returned by xTaskGetSchedulerState(). */
438#define taskSCHEDULER_NOT_STARTED ((BaseType_t)0)
439#define taskSCHEDULER_RUNNING ((BaseType_t)1)
440#define taskSCHEDULER_SUSPENDED ((BaseType_t)2)
441
446
447/* -------------------------------------------------------------------------
448 * Task management
449 * -------------------------------------------------------------------------*/
450
460 const char *pcName,
461 uint32_t usStackDepth,
462 void *pvParameters,
463 UBaseType_t uxPriority,
464 TaskHandle_t *pxCreatedTask);
465
468void vTaskDelete(TaskHandle_t xTaskToDelete);
469
475#define STATIC_TASK_TCB_SIZE_WORDS (19U + configNUM_THREAD_LOCAL_STORAGE_POINTERS \
476 + (3U * (configTASK_NOTIFICATION_ARRAY_ENTRIES - 1U)))
477typedef struct
478{
481
486#define STATIC_QUEUE_TCB_SIZE_WORDS 24U
487typedef struct
488{
491
497#define STATIC_SEMAPHORE_TCB_SIZE_WORDS 8U
502
508#define STATIC_TIMER_TCB_SIZE_WORDS 16U
509typedef struct
510{
513
518#define STATIC_EVENT_GROUP_TCB_SIZE_WORDS 10U
523
529#define STATIC_STREAM_BUFFER_TCB_SIZE_WORDS 26U
534
540#define STATIC_MESSAGE_BUFFER_TCB_SIZE_WORDS 38U
545
559 const char *pcName,
560 uint32_t ulStackDepth,
561 void *pvParameters,
562 UBaseType_t uxPriority,
563 StackType_t *puxStackBuffer,
564 StaticTask_t *pxTaskBuffer);
565
569#ifndef portNUM_CONFIGURABLE_REGIONS
570# define portNUM_CONFIGURABLE_REGIONS 3U
571#endif
572typedef struct
573{
576 uint32_t ulParameters;
578
594
611 const TaskParameters_restricted_t *pxTaskDefinition,
612 TaskHandle_t *pxCreatedTask);
613
631 const TaskParameters_restricted_t *pxTaskDefinition,
632 TaskHandle_t *pxCreatedTask);
633
646void vTaskList(char *pcWriteBuffer);
647
665void vTaskGetRunTimeStats(char *pcWriteBuffer);
666
669void vTaskSuspend(TaskHandle_t xTaskToSuspend);
670
673void vTaskResume(TaskHandle_t xTaskToResume);
674
679
689
692void vTaskDelay(TickType_t xTicksToDelay);
693
698void vTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement);
699
706BaseType_t xTaskDelayUntil(TickType_t *pxPreviousWakeTime, TickType_t xTimeIncrement);
707
711void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority);
712
717
722
727
731
735TaskHandle_t xTaskGetHandle(const char *pcNameToQuery);
736
740const char *pcTaskGetName(TaskHandle_t xTaskToQuery);
741
747
754
764 UBaseType_t uxArraySize,
765 uint32_t *pulTotalRunTime);
766
767/* -------------------------------------------------------------------------
768 * Queue API
769 * -------------------------------------------------------------------------*/
770
773QueueHandle_t xQueueCreate(UBaseType_t uxQueueLength, UBaseType_t uxItemSize);
774
786 UBaseType_t uxItemSize,
787 uint8_t *pucQueueStorage,
788 StaticQueue_t *pxStaticQueue);
789
792void vQueueDelete(QueueHandle_t xQueue);
793
800 const void *pvItemToQueue,
801 TickType_t xTicksToWait);
802
809 const void *pvItemToQueue,
810 TickType_t xTicksToWait);
811
819 const void *pvItemToQueue,
820 TickType_t xTicksToWait);
821
828 void *pvBuffer,
829 TickType_t xTicksToWait);
830
846 void *pvBuffer,
847 TickType_t xTicksToWait);
848
860 void *pvBuffer);
861
866
872
877
882
889BaseType_t xQueueOverwrite(QueueHandle_t xQueue, const void *pvItemToQueue);
890
897 const void *pvItemToQueue,
898 BaseType_t *pxHigherPriorityTaskWoken);
899
906 const void *pvItemToQueue,
907 BaseType_t *pxHigherPriorityTaskWoken);
908
915 void *pvBuffer,
916 BaseType_t *pxHigherPriorityTaskWoken);
917
926 const void *pvItemToQueue,
927 BaseType_t *pxHigherPriorityTaskWoken);
928
941 const void *pvItemToQueue,
942 BaseType_t *pxHigherPriorityTaskWoken);
943
950
957
988
1000
1001/* -------------------------------------------------------------------------
1002 * Queue Set API
1003 *
1004 * A queue set allows a single task to block on multiple queues and/or binary
1005 * or counting semaphores simultaneously, waking as soon as any member
1006 * transitions from empty to non-empty.
1007 *
1008 * Usage rules (matching the FreeRTOS API contract):
1009 * 1. Call xQueueCreateSet() with a capacity >= the sum of the capacities
1010 * of all queues and semaphores that will be added to the set.
1011 * 2. Add members with xQueueAddToSet() while they are empty.
1012 * 3. Call xQueueSelectFromSet() or xQueueSelectFromSetFromISR() to wait for
1013 * any member to receive an item. The returned handle identifies which
1014 * member fired; call xQueueReceive() or xSemaphoreTake() on that handle
1015 * to consume the item.
1016 * 4. Remove members with xQueueRemoveFromSet() only while they are empty.
1017 * 5. Mutexes must not be added to queue sets.
1018 *
1019 * \warning xQueueOverwrite / xQueueOverwriteFromISR should not be used on
1020 * queues that are set members, as they generate a set notification
1021 * even when replacing an existing item rather than filling a new
1022 * slot, which can cause spurious wakeups.
1023 * -------------------------------------------------------------------------*/
1024
1032QueueSetHandle_t xQueueCreateSet(UBaseType_t uxEventQueueLength);
1033
1043 QueueSetHandle_t xQueueSet);
1044
1054 QueueSetHandle_t xQueueSet);
1055
1071 TickType_t xTicksToWait);
1072
1082
1083/* -------------------------------------------------------------------------
1084 * Semaphore / Mutex API
1085 * -------------------------------------------------------------------------*/
1086
1090
1096
1102 UBaseType_t uxInitialCount);
1103
1112 UBaseType_t uxInitialCount,
1113 StaticSemaphore_t *pxSemaphoreBuffer);
1114
1119
1125
1128
1134
1137void vSemaphoreDelete(SemaphoreHandle_t xSemaphore);
1138
1143BaseType_t xSemaphoreTake(SemaphoreHandle_t xSemaphore, TickType_t xTicksToWait);
1144
1151 BaseType_t *pxHigherPriorityTaskWoken);
1152
1158
1163
1168
1175 BaseType_t *pxHigherPriorityTaskWoken);
1176
1182
1196
1209
1210/* -------------------------------------------------------------------------
1211 * Software Timer API
1212 * -------------------------------------------------------------------------*/
1213
1221TimerHandle_t xTimerCreate(const char *pcTimerName,
1222 TickType_t xTimerPeriodInTicks,
1223 UBaseType_t uxAutoReload,
1224 void *pvTimerID,
1225 TimerCallbackFunction_t pxCallbackFunction);
1226
1237TimerHandle_t xTimerCreateStatic(const char *pcTimerName,
1238 TickType_t xTimerPeriodInTicks,
1239 UBaseType_t uxAutoReload,
1240 void *pvTimerID,
1241 TimerCallbackFunction_t pxCallbackFunction,
1242 StaticTimer_t *pxTimerBuffer);
1243
1248BaseType_t xTimerDelete(TimerHandle_t xTimer, TickType_t xTicksToWait);
1249
1254BaseType_t xTimerStart(TimerHandle_t xTimer, TickType_t xTicksToWait);
1255
1260BaseType_t xTimerStop(TimerHandle_t xTimer, TickType_t xTicksToWait);
1261
1266BaseType_t xTimerReset(TimerHandle_t xTimer, TickType_t xTicksToWait);
1267
1274 TickType_t xNewPeriod,
1275 TickType_t xTicksToWait);
1276
1281
1285void *pvTimerGetTimerID(TimerHandle_t xTimer);
1286
1290void vTimerSetTimerID(TimerHandle_t xTimer, void *pvNewID);
1291
1295const char *pcTimerGetName(TimerHandle_t xTimer);
1296
1301
1307
1308/* -------------------------------------------------------------------------
1309 * Timer ISR API
1310 *
1311 * These functions are safe to call from an interrupt service routine. They
1312 * post a command to the TimerHost command queue (a stk::sync::PipeT write
1313 * with NO_WAIT) and return immediately without blocking.
1314 *
1315 * The xTicksToWait parameter is accepted for FreeRTOS API compatibility but
1316 * is always ignored: the STK command queue write is non-blocking by design
1317 * (PipeT::TryWrite / NO_WAIT), so there is no meaningful timeout to honour
1318 * from ISR context. If the command queue is full the function returns pdFAIL.
1319 *
1320 * pxHigherPriorityTaskWoken is always set to pdFALSE. STK's tick task wakes
1321 * itself via the command queue CV, which is handled internally by the
1322 * scheduler without requiring the ISR to request a manual context switch.
1323 * -------------------------------------------------------------------------*/
1324
1330 BaseType_t *pxHigherPriorityTaskWoken);
1331
1337 BaseType_t *pxHigherPriorityTaskWoken);
1338
1344 BaseType_t *pxHigherPriorityTaskWoken);
1345
1352 TickType_t xNewPeriod,
1353 BaseType_t *pxHigherPriorityTaskWoken);
1354
1381 void *pvParameter1,
1382 uint32_t ulParameter2,
1383 TickType_t xTicksToWait);
1384
1400 void *pvParameter1,
1401 uint32_t ulParameter2,
1402 BaseType_t *pxHigherPriorityTaskWoken);
1403
1404/* -------------------------------------------------------------------------
1405 * Event Group API
1406 * -------------------------------------------------------------------------*/
1407
1411
1417
1420void vEventGroupDelete(EventGroupHandle_t xEventGroup);
1421
1427 EventBits_t uxBitsToSet);
1428
1434 EventBits_t uxBitsToClear);
1435
1440
1449 EventBits_t uxBitsToWaitFor,
1450 BaseType_t xClearOnExit,
1451 BaseType_t xWaitForAllBits,
1452 TickType_t xTicksToWait);
1453
1460 EventBits_t uxBitsToSet,
1461 BaseType_t *pxHigherPriorityTaskWoken);
1462
1468 EventBits_t uxBitsToClear);
1469
1499 EventBits_t uxBitsToSet,
1500 EventBits_t uxBitsToWaitFor,
1501 TickType_t xTicksToWait);
1502
1503/* -------------------------------------------------------------------------
1504 * Task Notification API
1505 *
1506 * Non-indexed variants always operate on slot 0 and are thin wrappers around
1507 * the indexed variants below. Indexed variants accept a slot index in the
1508 * range [0, configTASK_NOTIFICATION_ARRAY_ENTRIES).
1509 * -------------------------------------------------------------------------*/
1510
1516
1521uint32_t ulTaskNotifyTake(BaseType_t ulClearCountOnExit, TickType_t xTicksToWait);
1522
1528BaseType_t xTaskNotify(TaskHandle_t xTaskToNotify,
1529 uint32_t ulValue,
1530 eNotifyAction eAction);
1531
1538BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry,
1539 uint32_t ulBitsToClearOnExit,
1540 uint32_t *pulNotificationValue,
1541 TickType_t xTicksToWait);
1542
1550 uint32_t ulValue,
1551 eNotifyAction eAction,
1552 BaseType_t *pxHigherPriorityTaskWoken);
1553
1554/* -------------------------------------------------------------------------
1555 * Task Notification — Indexed API
1556 *
1557 * Each task has configTASK_NOTIFICATION_ARRAY_ENTRIES independent notification
1558 * slots, indexed 0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1. Each slot
1559 * is backed by its own stk::sync::Semaphore + value word + pending flag,
1560 * matching the per-slot isolation guarantee of the FreeRTOS reference implementation.
1561 *
1562 * Out-of-range uxIndexToNotify / uxIndexToWait causes an assertion in debug
1563 * builds and is treated as a no-op / failure in release builds.
1564 * -------------------------------------------------------------------------*/
1565
1571 UBaseType_t uxIndexToNotify);
1572
1578uint32_t ulTaskNotifyTakeIndexed(UBaseType_t uxIndexToWait,
1579 BaseType_t ulClearCountOnExit,
1580 TickType_t xTicksToWait);
1581
1589 UBaseType_t uxIndexToNotify,
1590 uint32_t ulValue,
1591 eNotifyAction eAction);
1592
1601 uint32_t ulBitsToClearOnEntry,
1602 uint32_t ulBitsToClearOnExit,
1603 uint32_t *pulNotificationValue,
1604 TickType_t xTicksToWait);
1605
1614 UBaseType_t uxIndexToNotify,
1615 uint32_t ulValue,
1616 eNotifyAction eAction,
1617 BaseType_t *pxHigherPriorityTaskWoken);
1618
1619/* -------------------------------------------------------------------------
1620 * Task Notification — AndQuery / StateClear / ValueClear extensions
1621 *
1622 * These functions extend the notification API with query-on-send and
1623 * targeted clear operations, matching the FreeRTOS 10.4+ additions.
1624 * -------------------------------------------------------------------------*/
1625
1637 uint32_t ulValue,
1638 eNotifyAction eAction,
1639 uint32_t *pulPreviousNotifyValue);
1640
1650 UBaseType_t uxIndexToNotify,
1651 uint32_t ulValue,
1652 eNotifyAction eAction,
1653 uint32_t *pulPreviousNotifyValue);
1654
1664 uint32_t ulValue,
1665 eNotifyAction eAction,
1666 uint32_t *pulPreviousNotifyValue,
1667 BaseType_t *pxHigherPriorityTaskWoken);
1668
1679 UBaseType_t uxIndexToNotify,
1680 uint32_t ulValue,
1681 eNotifyAction eAction,
1682 uint32_t *pulPreviousNotifyValue,
1683 BaseType_t *pxHigherPriorityTaskWoken);
1684
1698
1705 UBaseType_t uxIndexToClear);
1706
1717 uint32_t ulBitsToClear);
1718
1726 UBaseType_t uxIndexToClear,
1727 uint32_t ulBitsToClear);
1728
1729/* -------------------------------------------------------------------------
1730 * Thread-local storage (TLS) API
1731 *
1732 * Each task has a fixed-size array of configNUM_THREAD_LOCAL_STORAGE_POINTERS
1733 * void* slots, indexed 0 .. configNUM_THREAD_LOCAL_STORAGE_POINTERS-1.
1734 * The slots are initialised to NULL at task creation.
1735 * Passing NULL for xTaskToQuery/xTaskToSet selects the calling task.
1736 * -------------------------------------------------------------------------*/
1737
1743 BaseType_t xIndex,
1744 void *pvValue);
1745
1751 BaseType_t xIndex);
1752
1753/* -------------------------------------------------------------------------
1754 * Stream Buffer API
1755 *
1756 * A stream buffer is a lightweight, ISR-safe byte-stream FIFO backed by a
1757 * stk::sync::MessageQueue with msg_size = 1. Producers write arbitrary-length
1758 * byte spans; consumers read arbitrary-length spans. A trigger level can be
1759 * set so that Receive() blocks until at least N bytes are available.
1760 *
1761 * xStreamBufferCreate() - heap-allocated control block + data buffer.
1762 * xStreamBufferCreateStatic() - caller-supplied StaticStreamBuffer_t TCB and
1763 * pucStreamBufferStorageArea data buffer (no heap).
1764 *
1765 * ISR variants (SendFromISR / ReceiveFromISR) are non-blocking (NO_WAIT).
1766 * Passing NULL for pxHigherPriorityTaskWoken is safe; it is always set to
1767 * pdFALSE because STK handles scheduling internally.
1768 * -------------------------------------------------------------------------*/
1769
1775StreamBufferHandle_t xStreamBufferCreate(size_t xBufferSizeBytes,
1776 size_t xTriggerLevelBytes);
1777
1786 size_t xBufferSizeBytes,
1787 size_t xTriggerLevelBytes,
1788 uint8_t *pucStreamBufferStorageArea,
1789 StaticStreamBuffer_t *pxStaticStreamBuffer);
1790
1793void vStreamBufferDelete(StreamBufferHandle_t xStreamBuffer);
1794
1801size_t xStreamBufferSend(StreamBufferHandle_t xStreamBuffer,
1802 const void *pvTxData,
1803 size_t xDataLengthBytes,
1804 TickType_t xTicksToWait);
1805
1813 const void *pvTxData,
1814 size_t xDataLengthBytes,
1815 BaseType_t *pxHigherPriorityTaskWoken);
1816
1823size_t xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer,
1824 void *pvRxData,
1825 size_t xBufferLengthBytes,
1826 TickType_t xTicksToWait);
1827
1835 void *pvRxData,
1836 size_t xBufferLengthBytes,
1837 BaseType_t *pxHigherPriorityTaskWoken);
1838
1843
1848
1853
1858
1863
1875 BaseType_t *pxHigherPriorityTaskWoken);
1876
1882 size_t xTriggerLevelBytes);
1883
1890
1904
1918 size_t xBufferSizeBytes,
1919 size_t xTriggerLevelBytes,
1920 StreamBufferCallbackFunction_t pxSendCompletedCallback,
1921 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
1922
1936 size_t xBufferSizeBytes,
1937 size_t xTriggerLevelBytes,
1938 uint8_t *pucStreamBufferStorageArea,
1939 StaticStreamBuffer_t *pxStaticStreamBuffer,
1940 StreamBufferCallbackFunction_t pxSendCompletedCallback,
1941 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
1942
1943/* -------------------------------------------------------------------------
1944 * Message Buffer API
1945 *
1946 * A message buffer carries discrete, variable-length messages. Each message
1947 * is stored as a pool block (payload) plus an envelope {size, block*} in a
1948 * separate queue. Receive() always returns exactly one complete message.
1949 *
1950 * Backed by:
1951 * - stk::memory::BlockMemoryPool — fixed-size payload blocks
1952 * (block size = AlignBlockSize(xMaxMessageSize)).
1953 * - stk::sync::MessageQueue — envelope FIFO of {len, block*} structs,
1954 * providing correct blocking on both "pool full" and "queue empty".
1955 *
1956 * xMessageBufferCreate() - heap-allocated control block + pool storage.
1957 * xMessageBufferCreateStatic() - caller-supplied TCB and storage buffer.
1958 * xMessageBufferCreateWithCallback() - heap-allocated + send/recv callbacks.
1959 * xMessageBufferCreateStaticWithCallback() - static + send/recv callbacks.
1960 * -------------------------------------------------------------------------*/
1961
1968MessageBufferHandle_t xMessageBufferCreate(size_t xBufferSizeBytes,
1969 size_t xMaxMessageSize);
1970
1979 size_t xMaxMessageSize,
1980 size_t xMessageCount,
1981 uint8_t *pucMessageBufferStorageArea,
1982 StaticMessageBuffer_t *pxStaticMessageBuffer);
1983
1999 size_t xBufferSizeBytes,
2000 size_t xMaxMessageSize,
2001 StreamBufferCallbackFunction_t pxSendCompletedCallback,
2002 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
2003
2017 size_t xMaxMessageSize,
2018 size_t xMessageCount,
2019 uint8_t *pucMessageBufferStorageArea,
2020 StaticMessageBuffer_t *pxStaticMessageBuffer,
2021 StreamBufferCallbackFunction_t pxSendCompletedCallback,
2022 StreamBufferCallbackFunction_t pxReceiveCompletedCallback);
2023
2026void vMessageBufferDelete(MessageBufferHandle_t xMessageBuffer);
2027
2036size_t xMessageBufferSend(MessageBufferHandle_t xMessageBuffer,
2037 const void *pvTxData,
2038 size_t xDataLengthBytes,
2039 TickType_t xTicksToWait);
2040
2053 const void *pvTxData,
2054 size_t xDataLengthBytes,
2055 BaseType_t *pxHigherPriorityTaskWoken);
2056
2064size_t xMessageBufferReceive(MessageBufferHandle_t xMessageBuffer,
2065 void *pvRxData,
2066 size_t xBufferLengthBytes,
2067 TickType_t xTicksToWait);
2068
2082 void *pvRxData,
2083 size_t xBufferLengthBytes,
2084 BaseType_t *pxHigherPriorityTaskWoken);
2085
2090
2095
2100
2113
2120
2132 BaseType_t *pxHigherPriorityTaskWoken);
2133
2134/* -------------------------------------------------------------------------
2135 * Heap API
2136 *
2137 * pvPortMalloc / vPortFree are thin wrappers around
2138 * stk::memory::MemoryAllocator::Allocate / Free — the same allocation seam
2139 * used internally by all STK and FreeRTOS-STK objects. Replacing the two
2140 * MemoryAllocator definitions in freertos_stk.cpp (e.g. to point at a static
2141 * pool) automatically redirects both the internal and application-facing heap.
2142 *
2143 * xPortGetFreeHeapSize / xPortGetMinimumEverFreeHeapSize / vPortGetHeapStats
2144 * read from the same s_MemStats accounting structure maintained by
2145 * MemoryAllocator::Allocate() and ::Free().
2146 * -------------------------------------------------------------------------*/
2147
2164
2169void *pvPortMalloc(size_t xWantedSize);
2170
2174void vPortFree(void *pv);
2175
2183size_t xPortGetFreeHeapSize(void);
2184
2193
2201void vPortGetHeapStats(HeapStats_t *pxHeapStats);
2202
2203/* -------------------------------------------------------------------------
2204 * Convenience macros matching standard FreeRTOS naming conventions
2205 * -------------------------------------------------------------------------*/
2206
2207#define pdMS_TO_TICKS(xTimeInMs) ((TickType_t)(xTimeInMs))
2208#define tskIDLE_PRIORITY ((UBaseType_t)0U)
2209#define xTaskHandle TaskHandle_t
2210
2211#ifdef __cplusplus
2212}
2213#endif
2214
2216
2217#endif /* FREERTOS_STK_H_ */
BaseType_t xTaskCreateRestrictedStatic(const TaskParameters_restricted_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask)
void * StreamBufferHandle_t
Definition FreeRTOS.h:315
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:475
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:280
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:319
void * SemaphoreHandle_t
Definition FreeRTOS.h:312
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:328
BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxHigherPriorityTaskWoken)
long portBASE_TYPE
Definition FreeRTOS.h:259
BaseType_t xTimerReset(TimerHandle_t xTimer, TickType_t xTicksToWait)
long BaseType_t
Definition FreeRTOS.h:257
BaseType_t xMessageBufferReset(MessageBufferHandle_t xMessageBuffer)
uintptr_t StackType_t
Definition FreeRTOS.h:260
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:314
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:540
size_t xStreamBufferBytesAvailable(StreamBufferHandle_t xStreamBuffer)
TaskHandle_t xQueueGetMutexHolderFromISR(QueueHandle_t xQueue)
void(* TimerCallbackFunction_t)(TimerHandle_t xTimer)
Definition FreeRTOS.h:327
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:258
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:320
void(* TaskFunction_t)(void *pvParameters)
Definition FreeRTOS.h:326
uint32_t EventBits_t
Definition FreeRTOS.h:380
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:256
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:313
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:311
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:336
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:486
BaseType_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
#define STATIC_SEMAPHORE_TCB_SIZE_WORDS
Definition FreeRTOS.h:497
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:570
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:508
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:529
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:271
BaseType_t xSemaphoreTakeRecursive(SemaphoreHandle_t xMutex, TickType_t xTicksToWait)
void * MessageBufferHandle_t
Definition FreeRTOS.h:316
eNotifyAction
Action applied to a task's notification value by xTaskNotify().
Definition FreeRTOS.h:295
void vTaskGetRunTimeStats(char *pcWriteBuffer)
void * TaskHandle_t
Definition FreeRTOS.h:310
#define STATIC_EVENT_GROUP_TCB_SIZE_WORDS
Definition FreeRTOS.h:518
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:281
@ eReady
Definition FreeRTOS.h:282
@ eInvalid
Definition FreeRTOS.h:286
@ eDeleted
Definition FreeRTOS.h:285
@ eBlocked
Definition FreeRTOS.h:283
@ eSuspended
Definition FreeRTOS.h:284
@ eIncrement
Definition FreeRTOS.h:298
@ eSetValueWithOverwrite
Definition FreeRTOS.h:299
@ eSetBits
Definition FreeRTOS.h:297
@ eNoAction
Definition FreeRTOS.h:296
@ eSetValueWithoutOverwrite
Definition FreeRTOS.h:300
Parameters passed to xTaskCreate().
Definition FreeRTOS.h:346
UBaseType_t uxPriority
Definition FreeRTOS.h:350
const char * pcName
Definition FreeRTOS.h:347
void * pvParameters
Definition FreeRTOS.h:349
uint32_t usStackDepth
Definition FreeRTOS.h:348
StackType_t * pxStackBase
Definition FreeRTOS.h:371
uint32_t xTaskNumber
Definition FreeRTOS.h:373
eTaskState eCurrentState
Definition FreeRTOS.h:367
TaskHandle_t xHandle
Definition FreeRTOS.h:365
StackType_t usStackHighWaterMark
Definition FreeRTOS.h:372
UBaseType_t uxBasePriority
Definition FreeRTOS.h:369
UBaseType_t uxCurrentPriority
Definition FreeRTOS.h:368
uint32_t ulRunTimeCounter
Definition FreeRTOS.h:370
const char * pcTaskName
Definition FreeRTOS.h:366
uintptr_t _opaque[(19U+4U+(3U *(1U - 1U)))]
Definition FreeRTOS.h:479
uintptr_t _opaque[24U]
Definition FreeRTOS.h:489
uintptr_t _opaque[8U]
Definition FreeRTOS.h:500
uintptr_t _opaque[16U]
Definition FreeRTOS.h:511
uintptr_t _opaque[10U]
Definition FreeRTOS.h:521
uintptr_t _opaque[26U]
Definition FreeRTOS.h:532
uintptr_t _opaque[38U]
Definition FreeRTOS.h:543
uint32_t ulLengthInBytes
Definition FreeRTOS.h:575
uint32_t ulParameters
Definition FreeRTOS.h:576
void * pvBaseAddress
Definition FreeRTOS.h:574
StackType_t * puxStackBuffer
Definition FreeRTOS.h:590
TaskFunction_t pvTaskCode
Definition FreeRTOS.h:585
MemoryRegion_t xRegions[3U]
Definition FreeRTOS.h:592
StaticTask_t * pxTaskBuffer
Definition FreeRTOS.h:591
size_t xSizeOfSmallestFreeBlockInBytes
Definition FreeRTOS.h:2158
size_t xMinimumEverFreeBytesRemaining
Definition FreeRTOS.h:2160
size_t xNumberOfSuccessfulAllocations
Definition FreeRTOS.h:2161
size_t xSizeOfLargestFreeBlockInBytes
Definition FreeRTOS.h:2157
size_t xNumberOfFreeBlocks
Definition FreeRTOS.h:2159
size_t xNumberOfSuccessfulFrees
Definition FreeRTOS.h:2162
size_t xAvailableHeapSpaceInBytes
Definition FreeRTOS.h:2156