37#ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_
38#define CMSIS_PLUS_RTOS_OS_C_DECLS_H_
44#include <cmsis-plus/os-app-config.h>
45#include <cmsis-plus/rtos/port/os-decls.h>
53#pragma GCC diagnostic push
56#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
151#define os_flags_any 0
156#define os_flags_all 0xFFFFFFFF
269#define OS_THREAD_PRIO_SHIFT (4)
401#pragma GCC diagnostic push
402#pragma GCC diagnostic ignored "-Wpadded"
421 size_t stack_size_bytes;
446#if !defined(OS_USE_RTOS_PORT_SCHEDULER)
447 os_port_thread_context_t port;
456#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \
457 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
475#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES)
479#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
593 void* allocted_stack_address;
594 size_t acquired_mutexes;
595 size_t allocated_stack_size_elements;
601#if defined(OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE)
602 os_thread_user_storage_t user_storage;
605#if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) \
606 || defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES)
610#if defined(OS_USE_RTOS_PORT_SCHEDULER)
611 os_thread_port_data_t port;
621#pragma GCC diagnostic pop
633#pragma GCC diagnostic push
634#pragma GCC diagnostic ignored "-Wpadded"
666#pragma GCC diagnostic pop
673#pragma GCC diagnostic push
674#pragma GCC diagnostic ignored "-Wpadded"
685#pragma GCC diagnostic pop
738#pragma GCC diagnostic push
739#pragma GCC diagnostic ignored "-Wpadded"
790#if !defined(OS_USE_RTOS_PORT_TIMER)
795#if defined(OS_USE_RTOS_PORT_TIMER)
796 os_timer_port_data_t port_;
807#pragma GCC diagnostic pop
903#pragma GCC diagnostic push
904#pragma GCC diagnostic ignored "-Wpadded"
974#if !defined(OS_USE_RTOS_PORT_MUTEX)
979#if defined(OS_USE_RTOS_PORT_MUTEX)
980 os_mutex_port_data_t port;
1000#pragma GCC diagnostic pop
1055#if !defined(OS_USE_RTOS_PORT_CONDITION_VARIABLE)
1083#pragma GCC diagnostic push
1084#pragma GCC diagnostic ignored "-Wpadded"
1138#if !defined(OS_USE_RTOS_PORT_SEMAPHORE)
1142#if defined(OS_USE_RTOS_PORT_SEMAPHORE)
1143 os_semaphore_port_data_t port;
1155#pragma GCC diagnostic pop
1169#pragma GCC diagnostic push
1170#pragma GCC diagnostic ignored "-Wpadded"
1225#if !defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1230 void* allocated_pool_addr;
1232#if defined(OS_USE_RTOS_PORT_MEMORY_POOL)
1233 os_mempool_port_data_t port;
1235 size_t pool_size_bytes;
1236 size_t allocated_pool_size_elements_;
1248#pragma GCC diagnostic pop
1255#if defined(OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS)
1276#pragma GCC diagnostic push
1277#pragma GCC diagnostic ignored "-Wpadded"
1332#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1343 void* allocated_queue_addr;
1346#if defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1347 os_mqueue_port_data_t port;
1350 size_t queue_size_bytes;
1351 size_t allocated_queue_size_elements;
1357#if !defined(OS_USE_RTOS_PORT_MESSAGE_QUEUE)
1367#pragma GCC diagnostic pop
1379#pragma GCC diagnostic push
1380#pragma GCC diagnostic ignored "-Wpadded"
1424#if !defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1429#if defined(OS_USE_RTOS_PORT_EVENT_FLAGS)
1430 os_evflags_port_data_t port_;
1441#pragma GCC diagnostic pop
1514#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.