What is a gel file? What can a gel file do?
GEL stands for General Extended Language, which is a general extended language file. The GEL file is composed of codes similar to C language. GEL language is an interpreted language. The extension of GEL file is .gel.
GEL files are used to (1) extend CCS functionality, such as menu options, and (2) provide access to the target board's memory.
1. Basic syntax of gel - Class C
Gel functions and gel parameters do not need to be defined in the DSP program. Gel has many similarities to C language: functions, return statements, if-else statements, while statements, the same comment method as C, #define, and the usage of these functions or statements is also very similar to that in C.
GEL Function
funcName(param1 "discription" [,param2 "discription", param3 "discription",...])
{
statements;
}
There is no need to declare the return type and parameter type in the gel function, but the return statement can be used in the function;
Parameters are composed of "parameter + string type description". Parameters do not need to be defined and can be any of the following: symbolic value of the actual/simulated DSP target board; digital constant (expression or constant); string constant.
GEL function call: You can usually call a GEL function anywhere you enter a C expression, or you can call a GEL function from within another GEL function. GEL functions cannot be called recursively.
GEL Statements
Return statement:
return [expression];
Conditional Statements:
-
if (exp)
-
statements 1;
-
else
-
statements 2;
Loop statement:
-
while (exp) {
-
statements;
-
}
GEL Pretreatment
#define identifier(arguments list) token-expression
GEL Notes
// Comments
/* Comments */
2. Gel-specific keywords
menuitem/hotmenu
Tested in CCS v4.2, menuitem adds submenu items under the Scripts menu, and hotmenu adds submenu items of the menu item defined by menuitem. Refer to the examples later in this article.
Functions declared with these two keywords do not require parameters, such as
-
menuitem "Addressing Modes";
-
hotmenu C27x_Mode()
-
{
-
AMODE = 0;
-
OBJMODE = 0;
-
}
-
hotmenu C28x_Mode()
-
{
-
AMODE = 0;
-
OBJMODE = 1;
-
}
-
hotmenu C2xLP_Mode()
-
{
-
AMODE = 1;
-
OBJMODE = 1;
-
}
The above code will generate the following menu structure,
Scripts
-Addressing Modes
-C27x_Mode
- C28x_Mode
- C2xLP_MODE
dialog
Add an entry submenu to the menu defined by menuitem and pop up a dialog box when the submenu is clicked.
menuitem "MyFunc"
dialog InitTarget(StartAddr "Starting Address", EndAddr "Ending Address")
{
statements;
}
dialog RefreshTarget()
{
statements;
}
slider
Add a slider. Each time you move the slider, call the GEL file again with the new value on the slider. The definition format is as follows:
slider param_def(minVal, maxVal, increment, pageIncrement, paramName)
{
statements;
}
|