|
Data Structures |
| struct | semaphore_t |
| | Structure describing a semaphore. More...
|
| struct | mailbox_t |
| | Structure describing mailboxes. More...
|
| struct | task_t |
| | Structure describing a task. More...
|
| struct | mutex_t |
| | A structure describing a mutex. More...
|
| struct | yavrtos_system_struct |
| | For internal use only.
Structure used by the system to hold the system stack, and a flag indicating whether an ISR is currently being executed.
More...
|
Defines |
| #define | YAVRTOS_OK 0 |
| | OK.
|
| #define | YAVRTOS_INVALID_TASK 1 |
| | Invalid task state.
|
| #define | YAVRTOS_IDLE_TASK 2 |
| | Invalid function for idle task.
|
| #define | YAVRTOS_ISR 3 |
| | Invalid function for an ISR.
|
| #define | YAVRTOS_TIMEOUT 4 |
| | Timeout.
|
| #define | YAVRTOS_NOT_OWNER 5 |
| | Not the mutex owner.
|
| #define | YAVRTOS_RTOS_NOT_STARTED 6 |
| | RTOS not started.
|
| #define | YAVRTOS_MBOX_NOT_EMPTY 7 |
| | Mailbox not empty.
|
| #define | YAVRTOS_ALREADY_STOPPED 8 |
| | The task was already stopped.
|
| #define | interrupt_store_t uint8_t |
| | A flag indicating whether interrupts were enabled - used by disable_interrupts() and restore_interrupts().
|
| #define | save_cpu_context() |
| | For internal use only.
Save the CPU context to the stack, and disable interrupts
|
| #define | restore_cpu_context() |
| | For internal use only.
Restore the CPU context from the stack, possibly re-enabling interrupts
|
| #define | TASK_ISR(vector, do_task_switch) |
| | The macro for ISRs.
|
Typedefs |
| typedef uint8_t | yavrtos_result_t |
| | Function return value.
|
Functions |
| task_t * | reserve_task (uint16_t stacklen, uint8_t pri, mutex_t *memory_mutex) |
| | Tasks are kept in a linked list in memory - this function reserves an "empty" task on that list, ready to be subsequently utilised by a call to create_task().
|
| task_t * | create_task (void(*proc)(void *), void(*cleanup)(), void *init_data, uint16_t stacklen, uint8_t pri, mutex_t *memory_mutex) |
| | Create a task, ready to be run.
|
| yavrtos_result_t | stop_task (task_t *t, uint8_t wait_for_mutexes) |
| | Stop a task.
|
| void | yield () __attribute__((naked)) |
| | Stop executing the current task and try and execute a higher-priority task or another task of the same priority.
|
| yavrtos_result_t | lock_on (mutex_t *m, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Lock on a mutex.
|
| yavrtos_result_t | lock_off (mutex_t *m) |
| | Unlock a mutex.
|
| int16_t | get_current_mbox_version (mailbox_t *mbox) |
| | Get the current version of a mailbox.
|
| void * | read_mbox_min_version (mailbox_t *mbox, int16_t *version, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Wait for a mailbox to reach at least a certain version, and then start reading from it.
|
| void * | read_mbox (mailbox_t *mbox, int16_t *version) |
| | Read a mailbox.
|
| mailbox_t * | release_mbox_read () |
| | Function to call when finished reading from a mailbox.
|
| void | initialise_mbox (mailbox_t *mbox, void *data, const int16_t version) |
| | Initialise a mailbox - this must be called on every mailbox before it is used.
|
| yavrtos_result_t | write_mbox (mailbox_t *mbox, void *data, uint8_t wait_for_receivers, uint8_t wait_for_empty_nullify, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Write to a mailbox.
|
| yavrtos_result_t | write_mbox_now (mailbox_t *mbox, void *data) |
| | Attempt to write to a mailbox.
|
| yavrtos_result_t | wait_for_receiver (mailbox_t *mbox, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Wait for a task to be suspended while trying to read from a mailbox.
|
| yavrtos_result_t | wait_for_min_value (semaphore_t *s, int16_t value, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Wait for a semaphore to reach at least a particular value.
|
| yavrtos_result_t | wait_for_min_value_timeout (semaphore_t *p, int16_t value, semaphore_t *timeout_semaphore, int16_t timeout_value) |
| | Wait for a semaphore to reach at least a particular value, but with a set value for the timeout, as opposed to an increment to the timeout semaphore value.
|
| yavrtos_result_t | wait_for_increment_of (semaphore_t *p, uint16_t amount, semaphore_t *timeout_semaphore, int16_t timeout) |
| | Wait for a semaphore to increment its value by a certain amount.
|
| yavrtos_result_t | wait_for_increment_of_timeout (semaphore_t *p, uint16_t amount, semaphore_t *timeout_semaphore, int16_t timeout_value) |
| | Wait for a semaphore to increment its value by a certain amount, but with a set value for the timeout, as opposed to an increment to the timeout semaphore value.
|
| int16_t | get_semaphore_value (semaphore_t *s) |
| | Get the current value of a semaphore.
|
| void | increment_semaphore_by (semaphore_t *s, uint16_t amount) |
| | Increment the value of a semaphore by the given amount.
|
| void | task_switcher_start (void(*idle)(void *), void *idle_data, uint16_t idle_stacklen, uint16_t system_stacklen) __attribute__((naked)) |
| | Start the whole process running.
|
| interrupt_store_t | disable_interrupts () |
| | Disable interrupts system-wide.
|
| void | restore_interrupts (interrupt_store_t interrupts) |
| | Restore the state of the system-wide interrupts.
|
| void | switch_task () __attribute__((naked)) |
| | For internal use only.
Perform a task switch.
|
Variables |
| task_t * | current_task |
| | The current task.
|
| struct yavrtos_system_struct | yavrtos_system |
| | For internal use only.
The system_struct used to hold the system stack and a flag indicating whether an ISR is currently being executed
|