Advanced: Creating Customized OSIs : Customizing API Definitions : General API Definitions : Internal Data Types APIs

Internal Data Types APIs
 
Sample Definition
Code Generated
Condition Buffer User-Type Type
Defines the type of User-Define-Type used when generating the conditions in 'Buffer per Condition' mode.
Conditions that are generated in a separate buffer each, use the type which is defined by this API.
The definition of this API is generated in the file type_def.h - for Conditions related to a Task/ISR or a Generic Activity generated as function.
The definition of this API is generated in the files glob_dat (forward declaration) and glob_dat.c (declaration) - for Condition in the "global" scope.
For Condition named COND1, using a separate buffer:
uint8 COND1;
Defines the type of buffer used when generating the events in 'Buffer per Event' mode.
Events that are generated in a separate buffer each, use the type which is defined by this API.
The definition of this API is used in the file type_def.h
For Event named EV1, using a separate buffer:
Default Signed Integer Type()
Defines the default integer signed type.
This overrides the definition in the Code-Generator property-sheet.
Element defined to be of type Integer or Bit array will have a definition of its 'signed type' in the generated code. The definition may be a macro in the file macro_def.h, or a typedef in the file type_def.h (depending on a profile setting).
This type is used with the Arithmetical bitwise operations (ASHL, ASHR), to cast the value of the element to the Element's "signed type".
The definition of this API is used for an Element only if there are no specific definitions of the Integer signed type already defined in its Design-Attributes.
For a Data-Item named DI, of type Integer
Design-Attribute "Integer Signed Type": signed long int
#define STYPE_DI signed long int (in macro_def.h)
typedef signed long int STYPE_DI (in type_def.h)
Default Unsigned Integer Type()
Defines the default integer unsigned type.
This overrides the definition in the Code-Generator property-sheet.
Element defined to be of type Integer or Bit array will have a definition of its 'unsigned type' in the generated code. The definition may be a macro in the file macro_def.h, or a typedef in the file type_def.h (depending on a profile setting).
This type is used with the Arithmetical bitwise operations (LSHL, LSHR), to cast the value of the element to the Element's "unsigned type".
The definition of this API is used for an Element only if there are no specific definitions of the Integer unsigned type already defined in its Design-Attributes.
For a Data-Item named DI, of type Integer
Design-Attribute "Integer Unsigned Type": unsigned long int
#define STYPE_DI unsigned long int (in macro_def.h)
typedef unsigned long int STYPE_DI (in type_def.h)
Default Floating Point Type()
Defines the default floating point type.
This overrides the definition in the Code-Generator property-sheet.
"Element defined to be of type Real, and which is not defining a specific data type in its Design-Attributes will use the default floating data type.
The default floating data type defined by this API overrides the default floating point data type defined in the Code Generator's profile.
The definition of this API is used when declaring the Elements data, in glob_dat.c (declaration) and glob_dat.h (extern declaration)."
"For a Data-Item named DI_REAL, of type Real:
double DI_REAL; (in glob_dat.c)
extern double DI_REAL; (in glob_dat.h)"
Defines the data-type used for conditions and bit data-items, when generating conditions/bits without macros.
This overrides the definition in the Code-Generator property-sheet.
Conditions and Data-Items of type Bit are combined into buffers.
When using the Code Generator's option for generating Conditions in expressions without using macros ("Use Macros for > Conditions" - unchecked), the type definition of the Conditions/Bits buffers uses a bit field data type.
Each of the fields in the bit fields is of type which can be defined by this API.
The data type is defined in the file type_def.h for Bits/Conditions that relate to a TASK/ISR or a User-Defined-Type, and in the file glob_dat.c and glob_dat.h for Bits/Conditions that relate to the global scope.
For Conditions COND1 and COND2:
unsigned int cond1_:1; /* GENERAL_CONTROL:cond1 */
unsigned int cond2_:1; /* GENERAL_CONTROL:cond2 */
} cg_BitsConditions;
Defines the default ""char"" type.
The tool will generate the following data allocation for Data-Item DI_STR defined as string with length=23: <Default char Type() Definition> di_str_[23];
Defines the default data type for elements of type char or char* (strings).
For example a Data-Item defined to be a string will use this API to allocate its data.
For Data-Item named DI_STR or type string, with length of 10:
char DI_STR[10];