Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
µC/OS-III Abstraction Layer

The Kinetis SDK provides the µC/OS-III Abstraction Layer for synchronization, mutual exclusion, message queue, etc. More...

Overview

Data Structures

struct  event_ucosiii
 Type for an event group object in µCOS-III. More...
 
struct  msgq_struct_ucosiii
 Type for message queue in µCOS-III. More...
 

Macros

#define OSA_WAIT_FOREVER   0xFFFFFFFFU
 Constant to pass as timeout value in order to wait indefinitely. 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 OS_TCB * task_handler_t
 Type for a task handler, returned by the OSA_TaskCreate function. More...
 
typedef CPU_STK task_stack_t
 Type for a task stack. More...
 
typedef void * task_param_t
 Type for task parameter.
 
typedef void(* task_t )(task_param_t param)
 Type for a task pointer.
 
typedef OS_SEM semaphore_t
 Type for a semaphore. More...
 
typedef OS_MUTEX mutex_t
 Type for a mutex. More...
 
typedef OS_FLAGS event_flags_t
 Type for an event flags group. More...
 
typedef event_ucosiii event_t
 Type for an event object. More...
 
typedef msgq_struct_ucosiii msg_queue_t
 Type for a message queue. More...
 
typedef msg_queue_tmsg_queue_handler_t
 Type for a message queue handler. More...
 

Thread management

#define OSA_TASK_DEFINE(task, stackSize)
 Defines a task. More...
 
#define PRIORITY_OSA_TO_RTOS(osa_prio)   ((osa_prio)+1U)
 To provide unified task piority for upper layer, OSA layer makes conversion. More...
 
#define PRIORITY_RTOS_TO_OSA(rtos_prio)   ((rtos_prio)-1U)
 

Message queues

#define MSG_QUEUE_DECLARE(name, number, size)
 This macro statically reserves the memory required for the queue. More...
 

Data Structure Documentation

struct event_ucosiii

Data Fields

OS_FLAG_GRP group
 µCOS-III's event entity.
 
osa_event_clear_mode_t clearMode
 Auto clear or manual clear.
 
struct msgq_struct_ucosiii

Data Fields

OS_Q queue
 the message queue's control block
 
OS_MEM mem
 control block for the memory where save the messages
 
void * msgs
 pointer to the memory where save the messages
 
uint16_t size
 size of the message in words
 

Macro Definition Documentation

#define OSA_WAIT_FOREVER   0xFFFFFFFFU
#define FSL_OSA_TIME_RANGE   0xFFFFFFFFU
#define OSA_DEFAULT_INT_HANDLER   ((osa_int_handler_t)(&DefaultISR))
#define OSA_TASK_DEFINE (   task,
  stackSize 
)
Value:
OS_TCB TCB_##task; \
task_stack_t task##_stack[(stackSize)/sizeof(task_stack_t)]; \
task_handler_t task##_task_handler = &(TCB_##task)
uint32_t task_stack_t
Type for a task stack.
Definition: fsl_os_abstraction_bm.h:104
CPU_STK task_stack_t
Type for a task stack.
Definition: fsl_os_abstraction_ucosiii.h:72
OS_TCB * task_handler_t
Type for a task handler, returned by the OSA_TaskCreate function.
Definition: fsl_os_abstraction_ucosiii.h:69

This macro defines resources for a task statically. Then, the OSA_TaskCreate creates the task based on these resources.

Parameters
taskThe task function.
stackSizeThe stack size this task needs in bytes.
#define PRIORITY_OSA_TO_RTOS (   osa_prio)    ((osa_prio)+1U)

uC/OS-III's tick task should have a high piority, so we set tick task to piority 0, applications use other priorities.

#define MSG_QUEUE_DECLARE (   name,
  number,
  size 
)
Value:
uint32_t msgs_##name[number*size]; \
msg_queue_t memory_##name = { \
.msgs = msgs_##name \
}; \
msg_queue_t *name = &(memory_##name)
msgq_struct_ucosiii msg_queue_t
Type for a message queue.
Definition: fsl_os_abstraction_ucosiii.h:93
void * msgs
pointer to the memory where save the messages
Definition: fsl_os_abstraction_ucosiii.h:64
Parameters
nameIdentifier for the memory region.
numberNumber of elements in the queue.
sizeSize of every elements in words.

Typedef Documentation

typedef OS_TCB* task_handler_t
typedef CPU_STK task_stack_t
typedef OS_SEM semaphore_t
typedef OS_MUTEX mutex_t
typedef OS_FLAGS event_flags_t