22#ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_
23#define CMSIS_PLUS_RTOS_OS_C_DECLS_H_
29#if defined(OS_USE_OS_APP_CONFIG_H)
30#include <cmsis-plus/os-app-config.h>
33#include <cmsis-plus/rtos/port/os-decls.h>
41#pragma GCC diagnostic push
43#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
138#define os_flags_any 0
143#define os_flags_all 0xFFFFFFFF
256#define OS_THREAD_PRIO_SHIFT (4)
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
737#pragma GCC diagnostic push
738#if defined(__clang__)
739#pragma clang diagnostic ignored "-Wpadded"
740#elif defined(__GNUC__)
741#pragma GCC diagnostic ignored "-Wpadded"
793#if !defined(OS_USE_RTOS_PORT_TIMER)
798#if defined(OS_USE_RTOS_PORT_TIMER)
799 os_timer_port_data_t port_;
810#pragma GCC diagnostic pop
906#pragma GCC diagnostic push
907#if defined(__clang__)
908#pragma clang diagnostic ignored "-Wpadded"
909#elif defined(__GNUC__)
910#pragma GCC diagnostic ignored "-Wpadded"
981#if !defined(OS_USE_RTOS_PORT_MUTEX)
986#if defined(OS_USE_RTOS_PORT_MUTEX)
987 os_mutex_port_data_t port;
1007#pragma GCC diagnostic pop
1062#if !defined(OS_USE_RTOS_PORT_CONDITION_VARIABLE)
1090#pragma GCC diagnostic push
1091#if defined(__clang__)
1092#pragma clang diagnostic ignored "-Wpadded"
1093#elif defined(__GNUC__)
1094#pragma GCC diagnostic ignored "-Wpadded"
1149#if !defined(OS_USE_RTOS_PORT_SEMAPHORE)
1153#if defined(OS_USE_RTOS_PORT_SEMAPHORE)
1154 os_semaphore_port_data_t port;
1166#pragma GCC diagnostic pop
1180#pragma GCC diagnostic push
1181#if defined(__clang__)
1182#pragma clang diagnostic ignored "-Wpadded"
1183#elif defined(__GNUC__)
1184#pragma GCC diagnostic ignored "-Wpadded"
1240#if !defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1245 void* allocated_pool_addr;
1247#if defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1248 os_mempool_port_data_t port;
1250 size_t pool_size_bytes;
1251 size_t allocated_pool_size_elements_;
1263#pragma GCC diagnostic pop
1270#if defined(OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS)
1291#pragma GCC diagnostic push
1292#if defined(__clang__)
1293#pragma clang diagnostic ignored "-Wpadded"
1294#elif defined(__GNUC__)
1295#pragma GCC diagnostic ignored "-Wpadded"
1351#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1362 void* allocated_queue_addr;
1365#if defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1366 os_mqueue_port_data_t port;
1369 size_t queue_size_bytes;
1370 size_t allocated_queue_size_elements;
1376#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1386#pragma GCC diagnostic pop
1398#pragma GCC diagnostic push
1399#if defined(__clang__)
1400#pragma clang diagnostic ignored "-Wpadded"
1401#elif defined(__GNUC__)
1402#pragma GCC diagnostic ignored "-Wpadded"
1447#if !defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1452#if defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1453 os_evflags_port_data_t port_;
1464#pragma GCC diagnostic pop
1537#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.