21#ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_
22#define CMSIS_PLUS_RTOS_OS_C_DECLS_H_
28#if defined(OS_USE_OS_APP_CONFIG_H)
29#include <cmsis-plus/os-app-config.h>
32#include <cmsis-plus/rtos/port/os-decls.h>
40#pragma GCC diagnostic push
42#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
137#define os_flags_any 0
142#define os_flags_all 0xFFFFFFFF
255#define OS_THREAD_PRIO_SHIFT (4)
385 typedef os_port_thread_stack_allocation_element_t
388#pragma GCC diagnostic push
389#if defined(__clang__)
390#pragma clang diagnostic ignored "-Wpadded"
391#elif defined(__GNUC__)
392#pragma GCC diagnostic ignored "-Wpadded"
412 size_t stack_size_bytes;
437#if !defined(OS_USE_RTOS_PORT_SCHEDULER)
438 os_port_thread_context_t port;
447#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \
448 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
466#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES)
470#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
584 void* allocted_stack_address;
585 size_t acquired_mutexes;
586 size_t allocated_stack_size_elements;
592#if defined(OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE)
593 os_thread_user_storage_t user_storage;
596#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \
597 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
601#if defined(OS_USE_RTOS_PORT_SCHEDULER)
602 os_thread_port_data_t port;
612#pragma GCC diagnostic pop
624#pragma GCC diagnostic push
625#if defined(__clang__)
626#pragma clang diagnostic ignored "-Wpadded"
627#elif defined(__GNUC__)
628#pragma GCC diagnostic ignored "-Wpadded"
661#pragma GCC diagnostic pop
668#pragma GCC diagnostic push
669#if defined(__clang__)
670#pragma clang diagnostic ignored "-Wpadded"
671#elif defined(__GNUC__)
672#pragma GCC diagnostic ignored "-Wpadded"
684#pragma GCC diagnostic pop
736#pragma GCC diagnostic push
737#if defined(__clang__)
738#pragma clang diagnostic ignored "-Wpadded"
739#elif defined(__GNUC__)
740#pragma GCC diagnostic ignored "-Wpadded"
792#if !defined(OS_USE_RTOS_PORT_TIMER)
797#if defined(OS_USE_RTOS_PORT_TIMER)
798 os_timer_port_data_t port_;
809#pragma GCC diagnostic pop
905#pragma GCC diagnostic push
906#if defined(__clang__)
907#pragma clang diagnostic ignored "-Wpadded"
908#elif defined(__GNUC__)
909#pragma GCC diagnostic ignored "-Wpadded"
980#if !defined(OS_USE_RTOS_PORT_MUTEX)
985#if defined(OS_USE_RTOS_PORT_MUTEX)
986 os_mutex_port_data_t port;
1006#pragma GCC diagnostic pop
1061#if !defined(OS_USE_RTOS_PORT_CONDITION_VARIABLE)
1089#pragma GCC diagnostic push
1090#if defined(__clang__)
1091#pragma clang diagnostic ignored "-Wpadded"
1092#elif defined(__GNUC__)
1093#pragma GCC diagnostic ignored "-Wpadded"
1148#if !defined(OS_USE_RTOS_PORT_SEMAPHORE)
1152#if defined(OS_USE_RTOS_PORT_SEMAPHORE)
1153 os_semaphore_port_data_t port;
1165#pragma GCC diagnostic pop
1179#pragma GCC diagnostic push
1180#if defined(__clang__)
1181#pragma clang diagnostic ignored "-Wpadded"
1182#elif defined(__GNUC__)
1183#pragma GCC diagnostic ignored "-Wpadded"
1239#if !defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1244 void* allocated_pool_addr;
1246#if defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1247 os_mempool_port_data_t port;
1249 size_t pool_size_bytes;
1250 size_t allocated_pool_size_elements_;
1262#pragma GCC diagnostic pop
1269#if defined(OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS)
1290#pragma GCC diagnostic push
1291#if defined(__clang__)
1292#pragma clang diagnostic ignored "-Wpadded"
1293#elif defined(__GNUC__)
1294#pragma GCC diagnostic ignored "-Wpadded"
1350#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1361 void* allocated_queue_addr;
1364#if defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1365 os_mqueue_port_data_t port;
1368 size_t queue_size_bytes;
1369 size_t allocated_queue_size_elements;
1375#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1385#pragma GCC diagnostic pop
1397#pragma GCC diagnostic push
1398#if defined(__clang__)
1399#pragma clang diagnostic ignored "-Wpadded"
1400#elif defined(__GNUC__)
1401#pragma GCC diagnostic ignored "-Wpadded"
1446#if !defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1451#if defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1452 os_evflags_port_data_t port_;
1463#pragma GCC diagnostic pop
1536#pragma GCC diagnostic push
struct os_clock_s os_clock_t
Clock object storage.
void os_systick_handler(void)
SysTick interrupt handler.
void os_rtc_handler(void)
RTC interrupt handler.
struct os_condvar_attr_s os_condvar_attr_t
Condition variable attributes.
struct os_condvar_s os_condvar_t
Condition variable object storage.
uint32_t os_flags_mask_t
Type of variables holding flags masks.
uint64_t os_statistics_counter_t
Type of variables holding context switches counters.
os_port_irq_state_t os_irq_state_t
Type of variables holding interrupts priority values.
uint32_t os_flags_mode_t
Type of variables holding flags modes.
os_port_scheduler_state_t os_sched_state_t
Type of variables holding scheduler state codes.
os_port_clock_offset_t os_clock_offset_t
Type of variables holding clock offsets.
void * os_iterator_t
Generic iterator, implemented as a pointer.
uint64_t os_statistics_duration_t
Type of variables holding durations in CPU cycles.
os_port_clock_duration_t os_clock_duration_t
Type of variables holding clock durations.
os_port_clock_timestamp_t os_clock_timestamp_t
Type of variables holding clock time stamps.
uint32_t os_result_t
Type of values returned by RTOS functions.
struct os_evflags_s os_evflags_t
Event flags object storage.
struct os_evflags_attr_s os_evflags_attr_t
Event flags attributes.
struct os_mempool_s os_mempool_t
Memory pool object storage.
struct os_mempool_attr_s os_mempool_attr_t
Memory pool attributes.
struct os_memory_s os_memory_t
Memory resource object storage.
struct os_mqueue_attr_s os_mqueue_attr_t
Message queue attributes.
struct os_mqueue_s os_mqueue_t
Message queue object storage.
uint8_t os_mqueue_prio_t
Type of variables holding message queue priorities.
struct os_mutex_attr_s os_mutex_attr_t
Mutex attributes.
struct os_mutex_s os_mutex_t
Mutex object storage.
@ os_mutex_protocol_inherit
Inherit priority from highest priority thread.
@ os_mutex_protocol_protect
Execute at the highest priority.
@ os_mutex_protocol_none
Priority and scheduling not affected by mutex ownership.
@ os_mutex_protocol_default
Default mutex protocol.
@ os_mutex_type_recursive
Recursive mutex behaviour.
@ os_mutex_type_errorcheck
Check mutex behaviour.
@ os_mutex_type_default
Default mutex type.
@ os_mutex_type_normal
Normal mutex behaviour.
@ os_mutex_robustness_default
Default mutex robustness.
@ os_mutex_robustness_robust
Enhanced robustness at thread termination.
@ os_mutex_robustness_stalled
Normal robustness.
struct os_semaphore_attr_s os_semaphore_attr_t
Semaphore attributes.
struct os_semaphore_s os_semaphore_t
Semaphore object storage.
int16_t os_semaphore_count_t
Type of variables holding semaphore counts.
struct os_thread_context_s os_thread_context_t
Thread context.
struct os_thread_attr_s os_thread_attr_t
Thread attributes.
os_port_thread_stack_allocation_element_t os_thread_stack_allocation_element_t
Type of variables holding aligned stack elements.
void *(* os_thread_func_t)(os_thread_func_args_t args)
Type of thread function.
uint8_t os_thread_prio_t
Type of variables holding thread priorities.
struct os_thread_statistics_s os_thread_statistics_t
Thread statistics.
struct os_thread_stack_s os_thread_stack_t
Thread stack.
struct os_thread_s os_thread_t
Thread object storage.
os_port_thread_stack_element_t os_thread_stack_element_t
Type of variables holding stack words.
void * os_thread_func_args_t
Type of thread function arguments.
uint8_t os_thread_state_t
Type of variables holding thread states.
@ os_thread_state_terminated
No longer usable, but resources not yet released.
@ os_thread_state_suspended
Not present in the READY list, waiting for an event.
@ os_thread_state_undefined
Used to catch uninitialised threads.
@ os_thread_state_ready
Present in the READY list and competing for CPU.
@ os_thread_state_initialising
Used to check reused threads.
@ os_thread_state_destroyed
Terminated and resources (like stack) released.
@ os_thread_state_running
Has the CPU and runs.
@ os_thread_priority_highest
@ os_thread_priority_lowest
@ os_thread_priority_error
@ os_thread_priority_below_normal
@ os_thread_priority_high
@ os_thread_priority_none
@ os_thread_priority_realtime
@ os_thread_priority_idle
@ os_thread_priority_normal
@ os_thread_priority_above_normal
uint8_t os_timer_type_t
Type of variables holding timer types.
void(* os_timer_func_t)(os_timer_func_args_t args)
Type of timer function.
void * os_timer_func_args_t
Type of timer function arguments.
struct os_timer_attr_s os_timer_attr_t
Timer attributes.
struct os_timer_s os_timer_t
Timer object storage.
uint8_t os_timer_state_t
Type of variables holding timer states.
os_mqueue_size_t os_mqueue_index_t
uint8_t os_mutex_protocol_t
os_internal_double_list_links_t os_internal_threads_waiting_list_t
struct os_internal_waiting_thread_node_s os_internal_waiting_thread_node_t
struct os_internal_evflags_s os_internal_evflags_t
Internal event flags.
struct os_internal_clock_timestamps_list_s os_internal_clock_timestamps_list_t
#define OS_THREAD_PRIO_SHIFT
uint8_t os_mutex_robustness_t
struct os_internal_thread_children_list_s os_internal_thread_children_list_t
uint16_t os_mempool_size_t
struct os_clock_node_s os_internal_clock_timer_node_t
struct os_internal_double_list_links_s os_internal_double_list_links_t
uint16_t os_mqueue_msg_size_t
os_clock_timestamp_t timestamp
Condition variable attributes.
void * clock
Pointer to clock object instance.
Condition variable object storage.
void * clock
Pointer to clock object instance.
Event flags object storage.
os_internal_double_list_links_t links
os_flags_mask_t flags_mask
os_internal_double_list_links_t links
os_internal_double_list_links_t links
Memory resource object storage.
size_t mp_pool_size_bytes
Size of user provided memory pool area, in bytes.
void * mp_pool_address
Pointer to user provided memory pool area.
void * clock
Pointer to clock object instance.
Memory pool object storage.
Message queue attributes.
void * mq_queue_addr
Pointer to user provided message queue area.
void * clock
Pointer to clock object instance.
size_t mq_queue_size_bytes
Size of user provided message queue area, in bytes.
Message queue object storage.
os_mutex_type_t mx_type
Mutex type.
os_mutex_protocol_t mx_protocol
Mutex protocol.
os_mutex_count_t mx_max_count
Recursive mutex max count.
os_mutex_robustness_t mx_robustness
Mutex robustness.
os_thread_prio_t mx_priority_ceiling
Mutex priority ceiling.
void * clock
Pointer to clock object instance.
void * clock
Pointer to clock object instance.
os_semaphore_count_t sm_max_value
Semaphore max count value.
os_semaphore_count_t sm_initial_value
Semaphore initial count value.
Semaphore object storage.
os_thread_prio_t th_priority
Thread initial priority.
void * th_stack_address
Address of the user defined storage for the thread stack.
bool th_enable_assert_reuse
void * clock
Address of the clock to use for timeouts.
size_t th_stack_size_bytes
Size of the user defined storage for the thread stack, in bytes.
void * clock
Pointer to clock object instance.
os_timer_type_t tm_type
Timer type.