Advanced: Creating Customized OSIs : Customizing API Definitions : General API Definitions : OS Data Type APIs

OS Data Type APIs
 
Sample Definition
Defines the (OS Object) Type name of the Task .
The definition of this API is used when a Task type name is needed.
For example, with the tracing function (controlled by a Code Generator option), the type of the parameter that identifies the Task being traced uses this API definition.
Generated Code (type_def.h):
#ifdef TRACE_TASK
void traceTask(TASK_H t, char indx);
typedef struct TASK_H {HANDLE hndl; DWORD tid; int indx; int evCount; HANDLE eventArray[16];} TASK_H;
Defines the (OS Object) Data Type of the Task .
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Event Descriptor Name
Defines the (OS Object) Type name. of the Event.
The definition of this API is used when a Task-Event type name is needed.
For example, when using Task-Events in OSEK, a data that holds the Task-Event is allocated with the type name defined by this API.
API Definition: EventMaskType
Generated code (type_def.h):
EventMaskType eventsBuff;
Event Descriptor Data Type
Defines the (OS Object) Data Type of the Event.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Software Counter Descriptor Name
Defines the (OS Object) Type name. of the Software Counter.
The definition of this API is used when a Software-Counter type name is needed.
For example, when using OSEK OS and Timeouts then this API's definition is used in the Counter Overflow Task to install a timer to invoke this Task again.
Generated Code (glob_func.c):
Software Counter Descriptor Data Type
typedef uint16 SW_COUNTER_H
Defines the (OS Object) Data Type of the Software Counter.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Timer Descriptor Name
Defines the (OS Object) Type name of the Timer.
Timer Descriptor Data Type
Defines the (OS Object) Data Type of the Timer.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Semaphore Descriptor Name
Defines the Semaphore (OS Object) Type name.
Semaphore Descriptor Data Type
Defines the Semaphore (OS Object) Data Type.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Message Descriptor Name
Defines the Message (OS Object) Type name.
Message Descriptor Data Type
Defines the Message (OS Object) Data Type.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Defines the ISR (OS Object) Type name.
typedef @interrupt void (* ISR_H)(void)
Defines the ISR (OS Object) Data Type.
The definition of this API is generated in the file type_def.h
The generated code is the API's definition suffixed with an end-line.
Queue Descriptor Data Type(nameid, qType)
typedef struct $<nameid>_qtype{
q[DEFAULT_QUEUE_SIZE];
} $<nameid>_qtype;
Defines the data type of a queue.
This API is used when there is data of type Queue in the model.
The type is generated in the file type_def.h
Formal Parameter: q_type = unsigned long int
typedef struct $<nameid>_qtype{
$<qType> q[DEFAULT_QUEUE_SIZE];
} $<nameid>_qtype;
typedef struct DI_QUEUE_qtype{
unsigned long int q[DEFAULT_QUEUE_SIZE];
} DI_QUEUE_qtype;
Queue Data Type Static Init(nameid, qType)
Defines the code for the static initialization of the Queue type.
This API is used when statically initializing a Queue typed data.
The initialization can be in a generic's data allocation, or in a User's data initialization (controlled by a Code Generator option)
Formal Parameter: q_type = unsigned long int

Generated code:
struct DI_QUEUE_qtype DI_QUEUE = {