Several customers have asked why we developed our own object oriented
programming language rather than provide a product with Linux or an
operating system supporting compiled 'C'. If we look back at the original
requirements we can see some of the reasons.
Prime: A combined operating and communication software offering unique capabilities for slave / host applications.
1/ The customer’s end user or
distributor could write code and insert images to add in their own functionality with a text editor.
2/ The program code could be updated or expanded by the host system using ASCII text over a serial link.
3/ The product should be license free and use simple development tools.
4/ The customer can create his own large images and control them like fonts.
5/ The SD card should be able to stream video and audio with the minimum of user programming.
6/ An existing host software requires only limited changes to upgrade a display from 4X20 LCD to a full colour TFT.
7/ The module has the intelligence to operate as a host and the compact command language to act as a high speed slave.
8/ The number of commands should be minimized by using 'overloading' and provide a higher level of functionality than C functions.
9/ The parameters for interfaces and screen entities should be held in styles similar to HTML.
10/ The application development time should take days or weeks rather than months.
11/ If the software engineer leaves the company, it is relatively easy for the engineering manager to amend the program.
These reasons may not be key to your application, but we believe it does
offer new product opportunities.

High Level Object
Oriented Commands
The module has an integrated
compiler and debugger so that users can write the high level object oriented
language commands in a text file or send via an interface to develop their
application. Although pictures and fonts can be loaded via an interface, it
is best to store these on an SD card or transfer via USB from on a PC. The
multi faceted commands are divided into 4 groups as shown below.
You may be thinking how can 25 commands operate a host system, so lets take
a look at the LOAD command. It can perform the equivalent language
functions of strcpy, strcat, format, inp, outp and a page collation
function. Please study our application example code for an understanding of
this compact language.
library
& system |
page & visibility |
draw on page |
functions |
FPROG:Load Menu/Img to Flash |
PAGE: Create a page of entities |
POSN: Position cursor on page |
FUNC: Create a function |
LIB: Load Image/Font to RAM |
STYLE: Set parameters |
TEXT: draw text on page |
VAR: Create a variable |
INC:Include a sub file |
SHOW: Show a page or entity |
DRAW: draw box circle line graph |
IF ? : Conditional test-true/false |
RUN:Call function or user code |
HIDE: Hide a page or entity |
IMG: draw image on page |
LOOP: Repeat commands |
RESET:Reset system, NAND |
DEL: Delete entity from Library |
KEY:create touch or external key |
CALC: Calculation and string edit |
;; Refresh current page |
LOAD: Copy and format pages,
strings, interface and data |
|
WAIT: Set delay period |
; Terminate command |
|
|
INT: Set an interrupt |
Styles make your Application
Consistent
All entities and buffers use
parameters stored in a Style similar to HTML web pages. These are extensive
and define colours, entity types, buffer size and interface parameters like
baud rate, clock edges and data format. Styles can be embedded in parent
styles to reduce repetition and simplify changes.
Screen Page Creation
and Control
Pages can be smaller than the screen for
pop up help menus, status information and lists. Buttons can be varying
size, with radio, rectangle or check box style with special types for
navigation actions. The cursor position command allows relative or absolute
positioning for reduced instructions during page layout. Entities can be
updated by incoming host commands and their associated functions can run all
the time or only when the entity or it’s page is visible. When a text is
numeric, it can be compared, incremented or decremented or form part of an
equation using the CALC command. Buffers or variables can be created for
interfaces, on-board memory, the SD Card, timers, counters and text. Hex
code can be included in text variables when prefixed by \\.
When creating your page structures and functions in a file, // prefixes user
comments.
Uploading your Menu Structure, Functions and Images
Data received from
interfaces or flash memory is processed and stored in RAM libraries for high
speed access to create or refresh pages and entities. Every entity has a
text name for easy reference by future update commands.
In a similar way to a PC, your software could be permanently retained on an
SD card and auto loaded at Power On or saved in internal flash by
transferring it from an SD card or uploading it via an interface port. SD
cards of 1G size and SDHC cards of 4G, 8G, 16G and 32G size are supported.
2G SD cards are not supported.
If an SD Card is used, the module will look for a file called ‘TU480A.MNU’
which will reference all other menu or image files. This may be your only
menu file with all functions included. It would have a header similar to the
example below to copy other files on the SD card to the internal flash
memory. See the 'example projects' section
RESET(LIBRARY); FPROG;
LIB(BACKIMAGE,”SDHC/backmain.bmp”); //load background picture
into the onboard flash library
LIB(STARTIMAGE,”SDHC/startbut.bmp”); //load start button into
the onboard flash library
…….. FEND;
Entities can be changed via the user interfaces by direct reference to there
name or style with version v44 firmware.
Examples:
LOAD(homestyle.back,BLUE”); change the background
colour of the page called homepage to blue
LOAD(rs2.set,“96e”); change the rs232
baud rate to 9600 baud with even parity
LOAD(GenText.font,“40X56Kata”); change font size of all
text using style GenText
|
Command Overview
This page identifies the current and expected operating status of commands
and styles
|
|
Command Format, with Parameters
/ Description |
INT |
INT(Name,Buffer,Function) If interrupt triggered do function |
RESET |
RESET(Name) Clear eeprom, delete list, library, or
reset system |
System |
SETUP(System) { startup-bled-wdog-rotate-test-angles-encode-calibrate-clkfreq-ignore
tch_loc_tlx-tch_loc_tly-tch_val_tlx-tch_val_tly-tch_loc_trx-tch_loc_try-tch_val_trx-tch_val_try
tch_loc_brx-tch_loc_bry-tch_val_brx-tch_val_bry-tch_loc_blx-tch_loc_bly-tch_val_blx-tch_val_bly
touchSave } |
Touch - Res |
SETUP(Touch)
{ type-enable-samples-debounce-accuracy-inactive-width-height-xnum-ynum-gain-threshold-address-filterlevel-filterlimit-filterenable-switch-invertx-inverty
} |
Touch - PCT |
SETUP(Touch)
{ type-debounce-enable-inactive-width-height-xnum-ynum-gain-threshold-address-filterlevel-filterlimit-filterenable-switch-invertx-inverty
} |
Touch - ICT |
SETUP(Touch)
{ type-enable-inactive } |
RS2 |
SETUP(RS2)
{ baud-data-stop-parity-rxi-proc-procdel-procnum-rxb-txi-txb-encode-flow } |
RS4 |
SETUP(RS4) { baud-data-stop-parity-rxi-proc-procdel-procnum-rxb-txi-txb-encode-flow-duplex
} |
ASYNC |
SETUP(Async)
{ baud-data-stop-parity-rxi-proc-procdel-procnum-rxb-txi-txb-encode-flow
} |
SPI |
SETUP(SPI)
{ active-mode-speed-rxi-proc-procdel-procnum-encode-rxb-rxo-rxf-txi-end-dummy-txb-txo-irq
} |
I2C |
SETUP(I2C)
{ addr-end-active-speed-rxi-proc-procdel-procnum-encode-rxb-txi-txb
} |
USB |
SETUP(USB)
{ rxi-txi-rxb } |
KEYIO |
SETUP(KEYIO)
{ active-inp-trig-edge-keyb-pullup } |
ENC |
SETUP(ENC)
{ active-a1-b1-a2-b2-debounce1-debounce2-timeout1-timeout2-mode1-mode2
} |
ADC |
SETUP(ADC)
{ active-calib1-calib2-avg1-avg2 } |
PWM |
SETUP(PWM)
{ active-pol1-pol2-pol3-cycle1-cycle2-cycle3-duty1-duty2-duty3-delay
} |
AC97 |
SETUP(AC97)
{ active-line_gain_L-line_gain_R-mic_gain_L-mic_gain_R-rec_sel-rec_rate-treble-bass-threeD-
master_volume-speaker_volume-headphone_volume-balance-stereo_speaker-pbdonefnc-pbprogfnc-pbmode
} |
LIB |
LIB(Name,Source) Load picture,audio or font into library.
BMP/JPG/WAV/FNT |
FPROG...FEND |
FPROG.....FEND Store menu and image files in onboard flash |
INC |
INC(FileName) Include the contents of another menu, style or
setup file |
Page Style |
STYLE(Name,Page)
{ update-sizeX-sizeY-posX-posY-back-image-type
} |
Text Style |
STYLE(Name,Text)
{ font-size-col-back-opacity-maxLen-maxRows-rotate-justify-yAlign-xtrim-curRel-width-bcol-padding-xSpace-ySpace} |
Draw style |
STYLE(Name,Draw)
{ type-maxX-maxY-col-back-opacity-width-rotate-curRel-xOrigin-yOrigin-xScale-yScale-xScroll
} |
Img Style |
STYLE(Name,IMG)
{ scale-maxX-maxY-rotate-action-step-opacity-curRel } |
Key Style |
STYLE(Name,Key)
{ type-debounce-delay-repeat-action-curRel-repeatnum-repeatdec-repeatend } |
Del |
DEL(Name) Delete a page, entity |
Page |
PAGE(NAME,STYLE){...}
|
POSN |
POSN(X,Y,Page/Name,Style) Position cursor or re-position named entity |
TEXT |
TEXT(Name,Value,Style)
|
|
TEXT(Name,Value,Style,PosX,PosY) |
DRAW |
DRAW(Name,SizeX,SizeY,Style) |
|
DRAW(Name,SizeX,SizeY,Style,PosX,PosY) |
IMG |
IMG(Name,Src,Style) |
|
IMG(Name,Src,Style,PosX,PosY) |
KEY |
KEY(Name,Func,SizeX,SizeY,Style); |
|
KEY(Name,downFunc,upFunc,repFunc,SizeX,SizeY,Style); |
|
KEY(Name,Func,SizeX,SizeY,Style,PosX,PosY); |
LOOP |
LOOP(Name,Var){...} Loop for a specified number of times |
SHOW |
SHOW(Name) Show a page, entity |
HIDE |
HIDE(Name) Hide a page, entity |
REFRESH |
;; Refresh current page |
LOAD |
LOAD(Name,N2,N3,N..) Multi function copy pages, variable N2--N.. to Name. |
VAR |
VAR(Name,Value,Style) Create a variable of a specified type with a
default value |
Array |
VAR(Name,Value,Style,Num) Create an array of variables with size num |
File |
FILE( |
CALC |
CALC(Result, Var1, Var2, Act) Quick calculation and text manipulation |
RUN |
RUN(Func) Run a function or user code |
FUNC |
FUNC(Name) {...} Declare a set of commands |
IF |
IF(Var~Var?Func1:Func2) Evaluate condition and do func1 if true, func2
if false |
SELECT |
SELECT(var) { CASE(n,func);} Evaluate a variable and undertake function |
EXIT |
EXIT(Name) Use to exit current loop or function |
RTC |
RTC/D
RTCSECS-RTCMINS-RTCHOURS-RTCDAYS-RTCMONTHS-RTCYEARS |
RTA |
RTA
RTASECS-RTAMINS-RTAHOURS-RTADAYS-RTAMONTHS |
Runtime Counter |
Run Counters
CNTMILLI-CNTSECS-CNTMINS-CNTHOURS-CNTDAYS-CNTRUN |
IO Counter |
IO Counters
CNTK00 -- CNTK30 |
WAIT |
WAIT(Time) Wait specified milliseconds before next |
LOOP |
LOOP(Name,Var){...} Loop for a specified number of times |
STRUCTURE |
STRUCT(Name,Num) { } Create a multi-dimensional structure of arrays
or variables |
TERMINATION |
; Terminate command |
INLINE |
[ cmd();cmd();....cmd; ] Enclose commands as inline
function in IF, INT, KEY, RUN |
|
|