|
Argon RTOS
1.3.0
Tiny embedded real-time kernel
|
Header for the Argon RTOS C API. More...
Include dependency graph for ar_kernel.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | ar_channel_t |
| Channel. More... | |
| struct | ar_list_node_t |
| Linked list node. More... | |
| struct | ar_queue_t |
| Queue. More... | |
| struct | ar_runloop_t |
| Run loop. More... | |
| struct | ar_runloop_t::_ar_runloop_function_info |
| struct | ar_thread_t |
| Thread. More... | |
| struct | ar_timer_t |
| Timer. More... | |
| struct | ar_list_t |
| Linked list. More... | |
| struct | ar_mutex_t |
| Mutex. More... | |
| union | ar_runloop_result_t |
| Run loop result. More... | |
| struct | ar_semaphore_t |
| Counting semaphore. More... | |
| struct | ar_thread_status_t |
| Current status of a thread. More... | |
Macros | |
| #define | AR_VERSION |
| Current version of Argon (v1.3.0). | |
Typedefs | |
Function types | |
| typedef bool(* | ar_sort_predicate_t) (ar_list_node_t *a, ar_list_node_t *b) |
| Function type used for sorting object lists. | |
| typedef void(* | ar_thread_entry_t) (void *param) |
| Prototype for the thread entry point. More... | |
| typedef void(* | ar_timer_entry_t) (ar_timer_t *timer, void *param) |
| Callback routine for timer expiration. More... | |
| typedef void(* | ar_runloop_function_t) (void *param) |
| typedef void(* | ar_runloop_queue_handler_t) (ar_queue_t *queue, void *param) |
| typedef void(* | ar_runloop_channel_handler_t) (ar_channel_t *channel, void *param) |
Functions | |
Kernel | |
| void | ar_kernel_run (void) |
| Start the kernel running. More... | |
| bool | ar_kernel_is_running (void) |
| Returns whether the kernel is running or not. | |
| uint32_t | ar_get_system_load (void) |
| Returns the current system load. More... | |
Threads | |
| ar_status_t | ar_thread_create (ar_thread_t *thread, const char *name, ar_thread_entry_t entry, void *param, void *stack, unsigned stackSize, uint8_t priority, bool startImmediately) |
| Create a new thread. More... | |
| ar_status_t | ar_thread_delete (ar_thread_t *thread) |
| Delete a thread. More... | |
| ar_status_t | ar_thread_suspend (ar_thread_t *thread) |
| Put thread in suspended state. More... | |
| ar_status_t | ar_thread_resume (ar_thread_t *thread) |
| Make the thread eligible for execution. More... | |
| ar_thread_state_t | ar_thread_get_state (ar_thread_t *thread) |
| Return the current state of the thread. More... | |
| uint8_t | ar_thread_get_priority (ar_thread_t *thread) |
| Return the thread's current priority. More... | |
| ar_status_t | ar_thread_set_priority (ar_thread_t *thread, uint8_t newPriority) |
| Change a thread's priority. More... | |
| ar_thread_t * | ar_thread_get_current (void) |
| Returns the currently running thread object. More... | |
| ar_runloop_t * | ar_thread_get_runloop (ar_thread_t *thread) |
| Get the runloop currently associated with the given thread. More... | |
| void | ar_thread_sleep (uint32_t milliseconds) |
| Put the current thread to sleep for a certain amount of time. More... | |
| void | ar_thread_sleep_until (uint32_t wakeup) |
| Put the current thread to sleep until a specific time. More... | |
| const char * | ar_thread_get_name (ar_thread_t *thread) |
| Get the thread's name. More... | |
| uint32_t | ar_thread_get_load (ar_thread_t *thread) |
| Get the amount of CPU time the thread is using. More... | |
| uint32_t | ar_thread_get_stack_used (ar_thread_t *thread) |
| Get the maximum stack usage of the specified thread. More... | |
| uint32_t | ar_thread_get_report (ar_thread_status_t report[], uint32_t maxEntries) |
| Get a report of all thread's status. More... | |
Semaphores | |
| ar_status_t | ar_semaphore_create (ar_semaphore_t *sem, const char *name, unsigned count) |
| Create a new semaphore. More... | |
| ar_status_t | ar_semaphore_delete (ar_semaphore_t *sem) |
| Delete a semaphore. More... | |
| ar_status_t | ar_semaphore_get (ar_semaphore_t *sem, uint32_t timeout) |
| Acquire the semaphore. More... | |
| ar_status_t | ar_semaphore_put (ar_semaphore_t *sem) |
| Release the semaphore. More... | |
| uint32_t | ar_semaphore_get_count (ar_semaphore_t *sem) |
| Returns the current semaphore count. More... | |
| const char * | ar_semaphore_get_name (ar_semaphore_t *sem) |
| Get the semaphore's name. More... | |
Mutexes | |
| ar_status_t | ar_mutex_create (ar_mutex_t *mutex, const char *name) |
| Create a new mutex object. More... | |
| ar_status_t | ar_mutex_delete (ar_mutex_t *mutex) |
| Delete a mutex. More... | |
| ar_status_t | ar_mutex_get (ar_mutex_t *mutex, uint32_t timeout) |
| Lock the mutex. More... | |
| ar_status_t | ar_mutex_put (ar_mutex_t *mutex) |
| Unlock the mutex. More... | |
| bool | ar_mutex_is_locked (ar_mutex_t *mutex) |
| Returns whether the mutex is currently locked. More... | |
| ar_thread_t * | ar_mutex_get_owner (ar_mutex_t *mutex) |
| Returns the current owning thread, if there is one. More... | |
| const char * | ar_mutex_get_name (ar_mutex_t *mutex) |
| Get the mutex's name. More... | |
Channels | |
| ar_status_t | ar_channel_create (ar_channel_t *channel, const char *name, uint32_t width) |
| Create a new channel. More... | |
| ar_status_t | ar_channel_delete (ar_channel_t *channel) |
| Delete an existing channel. More... | |
| ar_status_t | ar_channel_send (ar_channel_t *channel, const void *value, uint32_t timeout) |
| Send to a channel. More... | |
| ar_status_t | ar_channel_receive (ar_channel_t *channel, void *value, uint32_t timeout) |
| Receive from a channel. More... | |
| const char * | ar_channel_get_name (ar_channel_t *channel) |
| Get a channel's name. More... | |
Queues | |
| ar_status_t | ar_queue_create (ar_queue_t *queue, const char *name, void *storage, unsigned elementSize, unsigned capacity) |
| Create a new queue. More... | |
| ar_status_t | ar_queue_delete (ar_queue_t *queue) |
| Delete an existing queue. More... | |
| ar_status_t | ar_queue_send (ar_queue_t *queue, const void *element, uint32_t timeout) |
| Add an item to the queue. More... | |
| ar_status_t | ar_queue_receive (ar_queue_t *queue, void *element, uint32_t timeout) |
| Remove an item from the queue. More... | |
| bool | ar_queue_is_empty (ar_queue_t *queue) |
| Returns whether the queue is currently empty. More... | |
| uint32_t | ar_queue_get_count (ar_queue_t *queue) |
| Returns the current number of elements in the queue. More... | |
| const char * | ar_queue_get_name (ar_queue_t *queue) |
| Get the queue's name. More... | |
Timers | |
| ar_status_t | ar_timer_create (ar_timer_t *timer, const char *name, ar_timer_entry_t callback, void *param, ar_timer_mode_t timerMode, uint32_t delay) |
| Create a new timer. More... | |
| ar_status_t | ar_timer_delete (ar_timer_t *timer) |
| Delete a timer. More... | |
| ar_status_t | ar_timer_start (ar_timer_t *timer) |
| Start the timer running. More... | |
| ar_status_t | ar_timer_stop (ar_timer_t *timer) |
| Stop the timer. More... | |
| bool | ar_timer_is_active (ar_timer_t *timer) |
| Returns whether the timer is currently running. More... | |
| ar_status_t | ar_timer_set_delay (ar_timer_t *timer, uint32_t newDelay) |
| Adjust the timer's delay. More... | |
| uint32_t | ar_timer_get_delay (ar_timer_t *timer) |
| Get the current delay for the timer. More... | |
| const char * | ar_timer_get_name (ar_timer_t *timer) |
| Get the timer's name. More... | |
Runloop | |
| ar_status_t | ar_runloop_create (ar_runloop_t *runloop, const char *name) |
| Create a new runloop. More... | |
| ar_status_t | ar_runloop_delete (ar_runloop_t *runloop) |
| Destroy a runloop. More... | |
| ar_status_t | ar_runloop_run (ar_runloop_t *runloop, uint32_t timeout, ar_runloop_result_t *object) |
| Run a runloop for a period of time. More... | |
| ar_status_t | ar_runloop_stop (ar_runloop_t *runloop) |
| Stop a runloop. More... | |
| ar_status_t | ar_runloop_perform (ar_runloop_t *runloop, ar_runloop_function_t function, void *param) |
| Invoke a function on a runloop. More... | |
| ar_status_t | ar_runloop_signal (ar_runloop_t *runloop, uint32_t signal) |
| Send a signal to a runloop. More... | |
| ar_status_t | ar_runloop_add_timer (ar_runloop_t *runloop, ar_timer_t *timer) |
| Associate a timer with a runloop. More... | |
| ar_status_t | ar_runloop_add_queue (ar_runloop_t *runloop, ar_queue_t *queue, ar_runloop_queue_handler_t callback, void *param) |
| Add a queue to a runloop. More... | |
| ar_runloop_t * | ar_runloop_get_current (void) |
| Return the current runloop. More... | |
| const char * | ar_runloop_get_name (ar_runloop_t *runloop) |
| Return the runloop's name. More... | |
Time | |
| uint32_t | ar_get_tick_count (void) |
| Return the current time in ticks. | |
| uint32_t | ar_get_millisecond_count (void) |
| Return the current time in milliseconds. More... | |
| uint64_t | ar_get_microseconds () |
| Get a microsecond timestamp. More... | |
| uint32_t | ar_get_milliseconds_per_tick (void) |
| Get the number of milliseconds per tick. | |
| static uint32_t | ar_ticks_to_milliseconds (uint32_t ticks) |
| Convert ticks to milliseconds. | |
| static uint32_t | ar_milliseconds_to_ticks (uint32_t milliseconds) |
| Convert milliseconds to ticks. | |
Atomic operations | |
| int8_t | ar_atomic_add8 (volatile int8_t *value, int8_t delta) |
| Atomic 8-bit add operation. More... | |
| int16_t | ar_atomic_add16 (volatile int16_t *value, int16_t delta) |
| Atomic 16-bit add operation. More... | |
| int32_t | ar_atomic_add32 (volatile int32_t *value, int32_t delta) |
| Atomic 32-bit add operation. More... | |
| bool | ar_atomic_cas8 (volatile int8_t *value, int8_t expectedValue, int8_t newValue) |
| Atomic 8-bit compare and swap operation. More... | |
| bool | ar_atomic_cas16 (volatile int16_t *value, int16_t expectedValue, int16_t newValue) |
| Atomic 16-bit compare and swap operation. More... | |
| bool | ar_atomic_cas32 (volatile int32_t *value, int32_t expectedValue, int32_t newValue) |
| Atomic 32-bit compare and swap operation. More... | |
Header for the Argon RTOS C API.
| struct _ar_runloop::_ar_runloop_function_info |
| enum _ar_thread_start |