| Kinetis SDK API Reference Manual 1.0.0-beta Freescale Semiconductor, Inc.

- Introduction
- Related Pages
- API Usage

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Typedefs
µC/OS-III Abstraction Layer
OS Abstraction Layer (OSA)

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

## Data Structures
struct | EVENT_UCOSIII
| Type for an event group object in uCOS-III. More...

## Macros
#define | kSyncWaitForever 0xFFFFFFFFU
| Constant to pass as timeout value in order to wait indefinitely. More...
#define | FSL_RTOS_CURRENT_TASK ((task_handler_t)OSTCBCurPtr)
| Macro passed to the task_destroy function to destroy the current task.

## Typedefs
typedef OS_TCB * | task_handler_t
| Type for a task handler, returned by the task_create function. More...
typedef CPU_STK | task_stack_t
| Type for a task stack. More...
typedef void(* | task_t )(void *start)
| Type for a task pointer. More...
typedef OS_SEM | sync_object_t
| Type for an synchronization object. More...
typedef OS_MUTEX | lock_object_t
| Type for a resource locking object. More...
typedef OS_FLAGS | event_group_t
| Type for an event flags group, bit 32 is reserved. More...
typedef EVENT_UCOSIII | event_object_t
| Type for an event group object.
typedef OS_Q | msg_queue_t
| Type for a message queue declaration and creation. More...
typedef msg_queue_t * | msg_queue_handler_t
| Type for a message queue handler.
typedef void * | msg_queue_item_t
| Type for a message queue item. More...

## Thread management
#define | FSL_RTOS_TASK_DEFINE(task, stackSize, name, usesFloat)
| Creates a task descriptor that is used to create the task with task_create. More...
#define | task_create(task, priority, param, handler)
| Creates and sets the task to active. More...

## Synchronization
#define | sync_object_declare(obj) sync_object_t obj
| Create the synchronization object. More...

## Resource locking
#define | lock_object_declare(obj) lock_object_t obj
| Create the locking object. More...

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

## Critical Sections
#define | rtos_enter_critical OS_CRITICAL_ENTER
| Ensures the following code will not be preempted.
#define | rtos_exit_critical OS_CRITICAL_EXIT
| Allows preemption.

## Data Structure Documentation

struct EVENT_UCOSIII

### Data Fields
OS_FLAG_GRP | group
| uCOS-III's event entity
event_clear_type | clearType
| Auto clear or manual clear.

## Macro Definition Documentation

#define kSyncWaitForever 0xFFFFFFFFU

#define FSL_RTOS_TASK_DEFINE | ( |  | task,
|  |  | stackSize,
|  |  | name,
|  |  | usesFloat
| ) |  |

Value:
OS_TCB TCB_##task; \
task_stack_t fslTaskStack_##task[(stackSize)/sizeof(task_stack_t)]; \
uint8_t fslTaskName_##task[] = name; \
bool fslTaskFloatUse_##task = usesFloat
task_stack_t
uint32_t task_stack_t
Type for a task stack.
Definition: fsl_os_abstraction_bm.h:79

Parameters

  task | The task function.
  stackSize | Number of elements in the stack for this task.
  name | String to assign to the task.
  usesFloat | Boolean that indicates whether the task uses the floating point unit.

#define task_create | ( |  | task,
|  |  | priority,
|  |  | param,
|  |  | handler
| ) |  |

Value:
(*(handler) = &(TCB_##task), \
__task_create(task, \
fslTaskName_##task, \
sizeof(fslTaskStack_##task), \
fslTaskStack_##task, \
priority, \
param, \
fslTaskFloatUse_##task, \
handler))
__task_create
fsl_rtos_status __task_create(task_t task, uint8_t *name, uint16_t stackSize, task_stack_t *stackMem, uint16_t priority, void *param, bool usesFloat, task_handler_t *handler)
Create a task.

Parameters

  task | The task function.
  priority | Initial priority of the task.
  param | Pointer to be passed to the task when it is created.
  handler | Returns the identifier to be used afterwards to destroy the task.

Return values

  kSuccess | The task was successfully created.
  kError | Creation of task failed.

#define sync_object_declare | ( |  | obj | ) | sync_object_t obj

To be used instead of a standard declaration.

Parameters

  obj | The sync object to create.

#define lock_object_declare | ( |  | obj | ) | lock_object_t obj

To be used instead of a standard declaration.

Parameters

  obj | The lock object to create.

#define MSG_QUEUE_DECLARE | ( |  | name,
|  |  | number,
|  |  | size
| ) |  | msg_queue_t name

Parameters

  name | Identifier for the memory region.
  number | Number of elements in the queue.
  size | Size of every elements in words.

## Typedef Documentation

typedef OS_TCB* task_handler_t

typedef CPU_STK task_stack_t

typedef void(* task_t)(void *start)

typedef OS_SEM sync_object_t

typedef OS_MUTEX lock_object_t

typedef OS_FLAGS event_group_t

typedef OS_Q msg_queue_t

typedef void* msg_queue_item_t