|  | MCUXpresso SDK API Reference Manual
    Rev. 0
    NXP Semiconductors | 
| Data Structures | |
| struct | semaphore_t | 
| Type for an semaphore.  More... | |
| struct | mutex_t | 
| Type for a mutex.  More... | |
| struct | task_control_block_t | 
| Task control block for bare metal.  More... | |
| struct | event_t | 
| Type for an event object.  More... | |
| struct | msg_queue_t | 
| Type for a message queue.  More... | |
| Macros | |
| #define | FSL_OSA_BM_TASK_ENABLE 1U | 
| Definition to determine whether enable TASK module.  More... | |
| #define | FSL_OSA_BM_TIMER_NONE 0U | 
| Bare Metal does not use timer.  More... | |
| #define | FSL_OSA_BM_TIMER_SYSTICK 1U | 
| Bare Metal uses SYSTICK as timer.  More... | |
| #define | FSL_OSA_BM_TIMER_CONFIG FSL_OSA_BM_TIMER_SYSTICK | 
| Configure what timer is used in Bare Metal.  More... | |
| #define | OSA_WAIT_FOREVER 0xFFFFFFFFU | 
| Constant to pass as timeout value in order to wait indefinitely.  More... | |
| #define | TASK_MAX_NUM 7 | 
| How many tasks can the bare metal support.  More... | |
| #define | FSL_OSA_TIME_RANGE 0xFFFFFFFFU | 
| OSA's time range in millisecond, OSA time wraps if exceeds this value.  More... | |
| #define | OSA_DEFAULT_INT_HANDLER ((osa_int_handler_t)(&DefaultISR)) | 
| The default interrupt handler installed in vector table.  More... | |
| Typedefs | |
| typedef void * | task_param_t | 
| Type for task parameter. | |
| typedef void(* | task_t )(task_param_t param) | 
| Type for a task handler, returned by the OSA_TaskCreate function. | |
| typedef task_control_block_t * | task_handler_t | 
| Type for a task pointer. | |
| typedef uint32_t | task_stack_t | 
| Type for a task stack. | |
| typedef uint32_t | event_flags_t | 
| Type for an event flags group, bit 32 is reserved. | |
| typedef msg_queue_t * | msg_queue_handler_t | 
| Type for a message queue handler. | |
| Functions | |
| void | DefaultISR (void) | 
| The default interrupt handler installed in vector table.  More... | |
| Thread management | |
| #define | PRIORITY_OSA_TO_RTOS(osa_prio) (osa_prio) | 
| Defines a task.  More... | |
| #define | PRIORITY_RTOS_TO_OSA(rtos_prio) (rtos_prio) | 
| struct semaphore_t | 
| Data Fields | |
| uint32_t | time_start | 
| The time to start timeout. | |
| uint32_t | timeout | 
| Timeout to wait in milliseconds. | |
| volatile bool | isWaiting | 
| Is any task waiting for a timeout on this object. | |
| volatile uint8_t | semCount | 
| The count value of the object. | |
| struct mutex_t | 
| Data Fields | |
| uint32_t | time_start | 
| The time to start timeout. | |
| uint32_t | timeout | 
| Timeout to wait in milliseconds. | |
| volatile bool | isWaiting | 
| Is any task waiting for a timeout on this mutex. | |
| volatile bool | isLocked | 
| Is the object locked or not. | |
| struct task_control_block_t | 
| Data Fields | |
| osa_task_ptr_t | p_func | 
| Task's entry. | |
| osa_task_priority_t | priority | 
| Task's priority. | |
| osa_task_param_t | param | 
| Task's parameter. | |
| bool | haveToRun | 
| Task was signaled. | |
| struct event_t | 
| Data Fields | |
| uint32_t | time_start | 
| The time to start timeout. | |
| uint32_t | timeout | 
| Timeout to wait in milliseconds. | |
| volatile event_flags_t | flags | 
| The flags status. | |
| task_handler_t | waitingTask | 
| Handler to the waiting task. | |
| bool | autoClear | 
| Auto clear or manual clear. | |
| volatile bool | isWaiting | 
| Is any task waiting for a timeout on this event. | |
| struct msg_queue_t | 
| Data Fields | |
| volatile bool | isWaiting | 
| Is any task waiting for a timeout. | |
| uint32_t | time_start | 
| The time to start timeout. | |
| uint32_t | timeout | 
| Timeout to wait in milliseconds. | |
| uint32_t | size | 
| The size(byte) of a single message. | |
| task_handler_t | waitingTask | 
| Handler to the waiting task. | |
| uint8_t * | queueMem | 
| Points to the queue memory. | |
| uint16_t | number | 
| The number of messages in the queue. | |
| uint16_t | max | 
| The max number of queue messages. | |
| uint16_t | head | 
| Index of the next message to be read. | |
| uint16_t | tail | 
| Index of the next place to write to. | |
| #define FSL_OSA_BM_TASK_ENABLE 1U | 
| #define FSL_OSA_BM_TIMER_NONE 0U | 
| #define FSL_OSA_BM_TIMER_SYSTICK 1U | 
| #define FSL_OSA_BM_TIMER_CONFIG FSL_OSA_BM_TIMER_SYSTICK | 
| #define OSA_WAIT_FOREVER 0xFFFFFFFFU | 
| #define TASK_MAX_NUM 7 | 
| #define FSL_OSA_TIME_RANGE 0xFFFFFFFFU | 
| #define OSA_DEFAULT_INT_HANDLER ((osa_int_handler_t)(&DefaultISR)) | 
| #define PRIORITY_OSA_TO_RTOS | ( | osa_prio | ) | (osa_prio) | 
This macro defines resources for a task statically. Then, the OSA_TaskCreate creates the task based-on these resources.
| task | The task function. | 
| stackSize | The stack size this task needs in bytes. | 
| void DefaultISR | ( | void | ) |