Home

AN411 - Color Touchscreen Application Kit

image

Contents

1. lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal coordinate lcd UNKNOWN ERR packet too long lcd _TIMEOUT_ERR timeout error lcd PenWidth int lcd PenWidth int width DESCRIPTION Sets the width in pixels for lines rectangles and triangles but not circles The value is saved in global variable 1cd_penwidth PARAMETERS width width in pixels 1 200 RETURN VALUE lcd SUCCESS full message received lcd CMD ERR parameter number illegal pen width lcd UNKNOWN ERR packet too long lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 25 lcd Rectangle int lcd Rectangle int x0 int y0 int x1 int yl int style DESCRIPTION Draws a rectangle using the current foreground color and pen width PARAMETERS x0 top left x coordinate in pixels yo top left y coordinate in pixels x1 bottom right x coordinate in pixels yl bottom right y coordinate in pixels style 0 regular line 1 filled rectangle with current foreground color 2 dotted rectangle one pixel dots overrides pen width RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error lcd SetState int led SetState int button int state DESCRIPTION Sets the state of a latching button PARAMETERS button The button number 1 127 state State value for the button 0 button is off 1 button is on RETURN VALUE lcd SUCCESS full message received 1lcd_CMD_ERR parame
2. notification on button release r lt n gt lt return gt lt n gt ButtonID PARAMETERS ButtonID Identifies a button Must be in the range of 1 to 127 The remaining parameters are optional if they are not passed to the function default values will be used The parameters may be used in any order unless otherwise specified With the excep tion of the operating mode parameters the parameter name and value must be entered as fol lows lt parameter name gt lt parameter value gt lt parameter valueN gt BIN END must be the final parameter when not using BAR_ VALUE The following two parameters define the button s operating mode They are mutually exclusive The operating mode should immediately follow But tonID BTN MOM This defines the button operation as momentary and is the default Any time this value is specified it becomes the default BTN LAT This defines the button operation as latched Any time this value is spec ified it becomes the default The coordinates can be forced using the following three parameters Note that the 0 0 location is the top left corner of the LCD BIN TLXY int two values top left x and y coordinates This is the coordinate clos est to 0 0 If no values are entered the button will be placed at an x offset BTN_SEP from the previous x value If this is greater than BTN MARGINS second value the x will be reset to BTN_ MARGINS first value and the y value will be
3. PARAMETER brightness The backlight brightness 0 5 where 5 is the brightest RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal brightness value 1lcd_UNKNOWN_ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C lcd Bar int lcd Bar int bar _nbr BAR_END DESCRIPTION This function is used in two ways it can be used to define a bar graph with default values for each of the optional parameters and it can be used to update the defined bar graph with speci fied values using the BAR_ VALUE parameter PARAMETERS bar nbr the number of the bar graph 0 9 The remaining parameters are optional and may be used in any order unless otherwise speci fied The parameter name and value must be entered as follows lt parameter name gt lt parameter value gt lt parameter value2 gt BAR END BAR VALUE NOTE Defining any of the following parameters will cause several of the parameters not being must be the final parameter 1loat This macro is a special case if it is the first optional parameter no other parameters are evaluated and the value is displayed on the bar chart The execution of this option must be preceded by a call to this func tion without BAR_ VALUE since the first parameter BAR_END is optional for this special case After normalization using BAR_MAX VALUE top right and BAR_MIN_ VALUE bottom left the float val
4. lcd BLACK lcd WHITE lcd BLUE lcd_CYAN lcd _RED lcd MAGENTA lcd_DGREY lcd _ GREY lcd _LGREY lcd_LGREEN lcd_LCYAN lcd_LRED lcd YELLOW PARAMETERS ForeColor foreground color BackColor background color RETURN VALUE lcd SUCCESS full message received 1lcd_CMD_ERR parameter number illegal color lcd UNKNOWN ERR packet too long lcd_TIMEOUT_ERR timeout error lcd GREEN lcd BROWN lcd LBLUE lcd _LMAGENTA 022 0108 Rev C 11 led BFcolorsD int lcd BFcolorsD int ForeColor int Backcolor DESCRIPTION Sets the detailed background and foreground colors as explained in the section titled Set Color Detailed in the SLCD Graphics Touch Terminal Technical Manual Some of the available colors have been predefined lcd RED D lcd_DKRED D lcd GREEN D lcd DKGREEN D lcd _BLUE_D lcd DKBLUE_ D lcd YELLOW D lcd GRAY D lcd_LTGREY D lcd MDGRAY D lcd VLTGRAY D PARAMETERS ForeColor foreground color BackColor background color RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C lcd ButtonDef int lcd ButtonDef int ButtonID BTN_END DESCRIPTION Defines a button The size of the button is determined by its associated bit map The GIT sends a notification when a screen touch is detected the notification is the string referred to in the function description for lcd_GetTouch notification on button press x lt n gt lt return gt
5. Any time this parameter is specified its value becomes the default See the section titled Set Color Detailed in the SLCD Graphics Touch Terminal Technical Manual sgtt pdf for more information 022 0108 Rev C led Bar continued RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal parameter lcd _UNKNOWN_ ERR packet too long 1lcd_TIMEOUT_ERR timeout error EXAMPLE lcd Bar 0 BAR TLXY 50 50 BAR_SIZE 50 100 BAR_BKG lcd_LTGRAY D BAR SEGCOLOR lcd RED D force top segment to red BAR SEG 70 middle segment ends at 70 BAR SEGCOLOR lcd YELLOW D middle segment to yellow BAR SEG 30 bottom segment ends at 30 BAR SEGCOLOR lcd GREEN D bottom segment to green BAR_END lcd Bar 0 BAR VALUE 50 5 display a value on bar chart lcd BeepVolume int lcd BeepVolume int Volume DESCRIPTION Sets the beep volume and saves the setting in global variable 1cd_beepvolume PARAMETER Volume The beep volume Valid values are in the range 0 255 with 255 being the maximum volume RETURN VALUE lcd SUCCESS full message received lcd_CMD ERR parameter number illegal volume lcd UNKNOWN _ ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 10 led BFcolorsB int lcd BFcolorsB int ForeColor int Backcolor DESCRIPTION Sets the default basic background and foreground colors The colors have been predefined
6. TOUCH HIDDEN display does not invert on press TOUCH INVERT display inverts on press default mode TOUCH _TYPEMATIC will use the current typematic setup Any time this parameter is specified its value becomes the default The value is initialized to TOUCH_INVERT RETURN VALUE lcd SUCCESS full message received 1lcd_CMD_ERR parameter number illegal coordinate lcd UNKNOWN _ ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 20 lcd DispBitmap int lcd DispBitmap int BmpID int xCoord int yCoord DESCRIPTION Displays a bitmap on the Reach GIT The bitmaps included with the Color Touchscreen Appli cation Kit were drawn with the Windows Paint program See the Reach manual SLCD Graphics Touch Terminal Technical Manual for details on downloading bitmaps PARAMETERS BmpID bitmap number xCoord starting x coordinate 0 left side yCoord starting y coordinate 0 top RETURN VALUE lcd SUCCESS full message received lcd _UNKNOWN_ ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 21 led DispText int lcd DispText char Text int xCoord int yCoord int mode DESCRIPTION Diaplay text on the Reach GIT There are several display modes To see their differences run the sample program Samples ColorTouchscreen lcd_text c substituting other display modes for MODE NORMAL PARAMETERS Text Pointer to the text to display The maximum number of characters is 126 xC
7. increased by BTN_ SEP Both values are initialized to 10 BTN SEP int two values allows you to specify the x and y separation values for placing multiple buttons without having to specify BTN TLXyY for each The separation is defined as the distance between the top left corners of the bitmaps Any time this parameter is specified its value becomes the de fault Both values are initialized to 80 Note that the buttons will draw in the x direction first then the y direction 022 0108 Rev C 13 led ButtonDef continued BTN MARGINS int two values the left and right margins for automatic positioning of multiple buttons See BTN TLXY Any time this parameter is spec ified its value becomes the default The values are initialized to 10 310 MIN value 0 MAX value 339 BIN TYPE int one value button type its default value is BUTTON _RELEASE Any time BTN_ TYPE is specified its value becomes the default The parameter value can be one of the macros listed under Momentary or Latched Momentary e BUTTON PRESS notify on press e BUTTON TYPEMATIC notify on press typematic function e BUTTON RELEASE notify on release default e BUTTON PR notify on press and release Latched e BUTTON LAT latching display appropriate bitmap see BTN BMP for off and on states e BUTTON LAT _0 initialize to state 0 e BUTTON LAT _ 13 initialize to state 1 BIN TEXT BTN_MOM char address of the button tex
8. low to enable rs232 device endif The BL2600 series of single board computers has its configureable DIOO DIO3 set as inputs and DIO4 DIO7 set as outputs for use with the Demonstration Board if BOARD FAMILY BL26 digOutConfig 0x00F0 DIO0 3 Input DIO4 7 Output endif The main loop of the program is straight forward main int pressed button variable to store which button has been pressed brdInit initialize board for this demo setup lcd Connect with LCD setup colors and clear screen 022 0108 Rev C 4 while 1 lcd _ClearScreen Clear screen drawButtons wait for button press amp release while pressed button lcd GetTouch 100 1 if pressed button BUTTON1 lcd _ClearScreen lcd DispText You got me 100 100 MODE NORMAL fnMsDelay 1000 delay long enough to read displayed text pressed button 0 reset pressed button value The function brdInit is familiar to most Dynamic C users It is a board specific function that initial izes I O and system ports The next function call setup _1cd is a local function that was defined prior to main A call to lcd_Connect is made by setup_1cd in order to establish a serial communication channel between the RCM3720 and the GIT Once the communication channel is opera tional details like font choice and screen colors are requested With the initialization procedures completed the
9. sample program enters an endless while loop The GIT screen is cleared lcd_ClearScreen and a call is made to the local function drawButtons void drawButtons define and draw a button led_ButtonDef BUTTON1 BUTTON NUMBER 1 BTN MOM momentary button BIN TLXY 120 80 top left x y coordinates BTN TYPE BUTTON PRESS notify on press BTN _ TEXT Hit me text in button BIN TXTOFFSET 5 20 text x y coordinates BTN BMP BMP_big button BMP_big button_dn BTN END The API function lcd_ButtonDef allows you to associate graphic images BMP_big button and BMP_big _button_dn with a button number BUTTON1 You can locate the button anywhere on the screen by specifying the top left x and y coordinates You can also superimpose text on the button See the function description for 1cd_ButtonDef for other button parameters that you can customize After the button is displayed on the Reach GIT the program waits for it to be pressed while pressed button lcd GetTouch 100 1 The program will stay in the while loop until it receives notification from the GIT that a screen press has taken place It then checks to make sure the expected button was pressed before responding to it The response is to remove the button graphic before displaying some text lcd_DispText A delay is added fnMsDelay to give the user time to read the text Then the screen is cleared the button is re
10. 4 40x80 60x120 See the Reach Technology manual on the Reach Technology CD for addi tional details RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN ERR packet too long lcd _TIMEOUT_ERR timeout error 022 0108 Rev C 23 lcd GetTouch int lcd GetTouch int tdly DESCRIPTION Recognizes a touchscreen press by examining the first character of the string sent by the Reach GIT The first character will be x r or s This function returns a 16 bit integer with the touchscreen area number in the low byte For latched buttons the high byte is 1 if the button was pressed and a 0 if not PARAMETER tdly maximum number of milliseconds to wait RETURN VALUE gt 0 button number 0 127 or touchscreen area number 128 255 1 no touchscreen press detected led Line int lcd Line int x0 int yO int x1 int yl DESCRIPTION Draws a line using the current foreground color and pen width PARAMETERS x0 starting pixel number of the x coordinate yo starting pixel number of the y coordinate x1 ending pixel number of the x coordinate yl ending pixel number of the y coordinate RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 24 led Origin int lcd Origin int xval int yval DESCRIPTION Sets the origin for subsequent commands PARAMETERS xval x value 0 319 yval y value 0 2390 RETURN VALUE
11. Ea 2 AN411 Color Touchscreen Application Kit The Color Touchscreen Application Kit contains the hardware and software for creating an easy to use graphical interface for device monitoring and control A graphics library some predefined bitmaps and a variety of sample programs provide the tools you ll need to program the Rabbit based controller to display stationary and animated graphics on the Reach Technology SLCD Graphics Touch Terminal GIT Hardware Components The Color Touchscreen Application Kit has the following hardware e RCM3720 RabbitCore module e RCM3720 Prototyping Board with RS 232 circuits installed e Reach Technology GIT The hardware connection between the RCM3720 and the GIT are shown in Figure 1 and are explained in detail in the Color Touchscreen Application Kit Getting Started instructions located on the supplemental Dynamic C CD Figure 1 Color Touchscreen Hardware Interface RS 232 Serial Cable Interface RCM3720 on Prototyping Board Reach Graphics Touch Terminal od WOO Od OL Programming Cable Any applications developed using the Color Touchscreen Application Kit can be easily ported to any Rab bit based single board computer or RabbitCore module with an RS 232 interface For a complete descrip tion of the RCM3720 and the prototyping board included in this kit refer to the RCM3700 User s Manual located on the Dynamic C CD 022 0108 R
12. NKNOWN ERR packet too long lcd_TIMEOUT_ERR timeout error 022 0108 Rev C lcd Connect int lcd Connect void DESCRIPTION Opens the serial port and initializes communication with the display The default baud rate is 115200 bps Before executing this function you must first define which serial port to use by defining the macroLCD USE PORT lt serial port designator A F gt forexample define LCD USE PORTB There is a fixed 200 ms delay to allow the GIT to initialize RETURN VALUE lcd SUCCESS full message received lcd _UNKNOWN_ ERR packet too long 1lcd_TIMEOUT_ERR timeout error led Cursor int led Cursor int xval int yval DESCRIPTION Sets the cursor location for subsequent text commands coordinates are relative to origin PARAMETERS xval x coordinate 0 319 yval y coordinate 0 239 RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal coordinate lcd UNKNOWN _ ERR packet too long lcd _TIMEOUT_ERR timeout error 022 0108 Rev C 19 lcd DefTouchArea int lcd DefTouchArea int IDnum TA_END DESCRIPTION Sets a touch area on the GTT or defines the touchmatic area When the touch area is pressed the GTT will send an x response followed by the touch area ITDnum PARAMETERS IDnum Touch area ID number to set must be between 128 and 255 The remaining parameters are optional and may be used in any order unless otherwise speci fied T
13. OR LIB provides the function calls to demonstrate a virtual calculator on a Reach GTT led calculator Display int lcd calculator Display int Keypad BitMap number int X int Y DESCRIPTION Sets up and displays the specified keypad PARAMETERS Keypad BitMap number the bitmap number for the keypad X horizontal offset in pixels from the top left corner of the GTT Y vertical offset in pixels from the top left corner of the GIT RETURN VALUE lcd _ SUCCESS Calculator float Calculator void DESCRIPTION Allows the operator to use the calculator displayed by lcd_calculator Display This is a blocking function and will not return a value to the calling program until the operator presses the return key RET RETURN VALUE The result of the calculation Rabbit Semiconductor Inc www rabbit com 022 0108 Rev C 29
14. drawn and the program again waits for a button press notification 022 0108 Rev C 5 Dynamic C Functions The functions described in this section are for use with the Color Touchscreen Application Kit The source code is in LIB DISPLAYS ColorTouchscreen REACH LIB All the function calls are nonreentrant and blocking Each function call is associated with a command for the Reach GTT These commands are documented in the Graphics Touch Terminal Technical Manual Several of the API functions in REACH LIB take a variable number of parameters These optional parameters come in groups with the first parameter in the group being one of a documented set of identifiers and subsequent parameters in the group being the value specific to that identifier The list of parameter groups must be terminated using a parameter that signifies the end of the parameter list Here is an example lcd Chart 0 chart id number CHART TLXY 50 50 eft top corner CHART BRXY 70 200 right bottom corner CHART BKG lcd LTGRAY_D background color CHART PEN 2 lcd DKRED D pen width and color CHART END end of parameter list fnMsDelay void fnMsDelay unsigned int tdly DESCRIPTION Creates a delay of the specified number of milliseconds PARAMETER tdly Number of milliseconds to wait RETURN VALUE None 022 0108 Rev C 6 led Backlight int lcd Backlight int brightness DESCRIPTION Modifies the backlight brightness
15. ents at the beginning of the sample program Note that the RCM3720 must be installed on the Prototyping Board when using these sample programs and it must be connected to the GIT as shown in Figure after the bitmaps and macros have been loaded To run a sample program open it with the File menu then compile and run it by pressing F9 The following sample programs are available LCD BAR CHART1 C LCD BAR CHART2 C LCD BAR CHART3 C Various demos of bar charts LCD BUTTON1 C LCD BUTTON2 C LCD BUTTON3 C Various demos of input to the GTT using buttons LCD _PONG1 C LCD PONG2 C Colorful take on the familiar pong demo LCD _TEXT1 C Demo of text moving across the screen SLCD_DEMO C A comprehensive demo that exercises many of the kit s API functions 022 0108 Rev C 3 Source Code Walk Through In this section the sample program LCD _BUTTON1 C is used to show how easy it is to create and display a button that will notify your application when it has been pressed We will only examine some of the code to view the source code for the entire program you must open it in Dynamic C or a text editor One of the first things that must be done in any application written for the Color Touchscreen Application Kit is initializing the serial port communication channel between the Rabbit based controller and the Reach GIT The graphics library provides some macros that make the serial port initialization very easy All you have to d
16. ev C 1 Software and Documentation The Color Touchscreen Application Kit comes with three CD ROMs 1 Dynamic C CD contains e Dynamic C installation e Dynamic C documentation and RCM3720 documentation 2 Supplemental Dynamic C CD contains e Application Kit sample programs Color Touchscreen Application Kit Getting Started instructions 3 Reach Technology CD contains BMPload exe a Windows program for downloading images and macros to the GIT e SGTT pdf SLCD Graphics Touch Terminal Technical Manual the user s manual for the Reach GIT e AN100 pdf Reach Technology document describing a full featured application that uses the low level Reach commands instead of the API functions provided with the Color Touchscreen Application Kit Definitions This section clarifies some terms bitmap A graphical image created using a program such as Windows Paint The bitmaps are downloaded to the Reach GIT via the Windows program BMPload exe This makes them available for display or for use as a button object button A defined area of the screen that is touch sensitive see touch area and has two bitmaps associated with it one for when the button is not pressed and the other for when it is pressed latched button Type of button that operates in a push on push off mode momentary button Type of button that is activated for as long as the operator is pressing it typematic Operation associated with a momentary butt
17. he parameter name and value must be entered as follows lt parameter name gt lt parameter value gt TA_END must be the final parameter The coordinates can be forced using the following two parameters Keep in mind that the 0 0 location is the top left corner of the LCD If both values are 0 the area will be placed at the lo cation specified by the last lcd_Origin statement TA TLXY int two values top left x and y coordinates This is the coordinate clos est to 0 0 Note that if both values are 0 the area will be placed at the lo cation specified by the last lcd_Origin statement If no values are entered the area will be placed at an x offset TA_ SEP from the previous x value If this is gt 300 x will be reset to 0 and the y value will be increased by TA_SEP Both values are initialized to 10 TA SIZE int two values the x and y size of the area Any time this parameter is specified its value becomes the default Both values are initialized to 20 TA SEP int two values Allows you to specify x and y separation values between top left corners of the bit maps for placing multiple areas without having to specify the x and y values for each The separation is measured relative to the top left corner of the bitmaps Any time this parameter is specified its value becomes the default Both values are initialized to 20 Note that the areas will proceed in the x direction first then y TA TYPE int mode for the touch area
18. ified by the order it appears in the parameter list in the exam ple below pen 1 and pen 2 are defined If none are specified there will be one pen If more than one pen is desired you must define values for pen 1 CHART DATA WIDTH int number of horizontal pixels per data point default 4 CHART BKG int background color default is dark blue See the section ti tled Set Color Detailed in the SLCD Graphics Touch Ter minal Technical Manual for more information RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal parameter lcd _UNKNOWN_ ERR packet too long 1lcd_TIMEOUT_ERR timeout error EXAMPLE led Chart 0 CHART TLXY 50 50 CHART BRXY 70 200 CHART BKG lcd _LTGRAY_D CHART PEN 2 lcd_DKRED D CHART PEN 2 lcd _DKBLUE D CHART END 022 0108 Rev C led Circle int led Circle int x int y int radius int filled DESCRIPTION Draws a circle using the current foreground color PARAMETERS x center x coordinate in pixels y center y coordinate in pixels radius radius in pixels filled lt 0 not filled line width is 1 pixel 1 filled with current foreground color RETURN VALUE lcd SUCCESS full message received lcd _UNKNOWN_ ERR packet too long 1lcd_TIMEOUT_ERR timeout error lcd ClearScreen int lcd ClearScreen void DESCRIPTION Clears the screen to the current background color RETURN VALUE lcd SUCCESS full message received lcd U
19. ne green segment from 0 to 100 The bar graph may have as many as three segments If no segments are specified there will be one segment One BAR_SEG parameter Top right segment Green from specified value to 100 Bottom left segment Yellow from 0 to specified value Two BAR_SEG parameters Top right segment Green from first specified value to 100 Middle segment Yellow from 2nd specified value to first specified value Bottom left segment Red from 0 to second specified value For proper operation the higher percentage value must be listed first BAR SEG must not be specified for the top segment int the color associated with the last defined BAR_SEG See BAR_SEG for the default colors Any time this parameter is specified its value be comes the default See the Reach Technology manual for Set Color Detailed for more infor mation int width in pixels of the border default 1 Any time this parameter is specified its value becomes the default Bar Orientation Use only one of the following two macros with no parameter BAR VERT BAR HORIZ BAR BKG vertical orientation default the minimum value is at the bottom horizontal orientation the minimum value is on the left If no orientation is specified the function will determine the orientation au tomatically based on the following formula if BRx TLx BRy Thy lt 1 0 orientation BAR_VERT int background color default gray 0x888
20. o is define one of the serial port macros For example if Serial Port D is used to connect the Reach GIT to the Rabbit the application must include the statement define LCD USE PORTD tells library which serial port to use Every button must be identified by an integer in the range of 1 to 127 define BUTTONI1 1 Create a button ID for button function Buttons have two states on pressed and off unpressed therefore each button must have two associated images The images are identified by their position in demo 1st a file that defines which BMPs are copied to the Reach GTT If you open samples ColorTouchscreen BMP Macro demo 1st you will see that the bmp files we want to display are the 30th and 31st files in the list define BMP big button 30 define BMP _big button_dn 31 All sample programs or user defined applications that call API functions from this kit s graphics library must include the statement use REACH LIB The sample program includes some board setup calls to allow the sample program to be used with all Rabbit based single board computers and RabbitCore modules When an RCM3600 or RCM3700 series RabbitCore module is used with the RCM3700 Prototyping Board PES must be toggled low to enable the RS 232 chip since the RCM3700 Prototyping Board Serial Ports C and D are also used with the IrDA transceiver on the RCM3700 Prototyping Board if BOARD FAMILY RCM36 BitWrPortI PEDR amp PEDRShadow 0 5 set
21. on It is a feature that causes the button notification to be repeated for as long as the button is pressed touch area An area of the screen defined by x and y coordinates that has a user assigned number associated with it When the area is touched a message is sent from the Reach controller to the Rabbit A total of 128 touch areas are allowed 022 0108 Rev C 2 Sample Programs The software included with the supplemental Dynamic C CD contains the bitmaps and macros that need to be loaded to the Reach Technology display before the sample programs listed below can be run A summary of the loading process is described in the Color Touchscreen Application Kit Getting Started instructions For complete details on the loading process refer to Appendix A of the SLCD Graphics Touch Terminal Technical Manual When you installed the supplemental Dynamic C CD you also installed some sample programs that illustrate the use of the RCM3720 with the Reach Technology GIT These sample programs can be found in the Dynamic C Samples ColorTouchscreen folder TIP Use the bitmaps macros and sample programs from the Dynamic C supplemental CD While these are based on the bitmaps and the sample program included with the Reach Technol ogy CD the sample programs on the Dynamic C supplemental CD contain all the latest enhancements Each sample program has comments that describe the purpose and function of the program Follow the instructions in the comm
22. oord horizontal starting point If both horizontal and vertical coordinates are 0 no coordinates are sent and the text will be displayed at a previously de fined location yCoord vertical starting point If both horizontal and vertical coordinates are 0 no coordinates are sent and the text will be displayed at a previously defined location mode One of these display modes e MODE NORMAL MODE_ TRANS transparent text is written on top of current dis play MODE_XOR exclusive OR e MODE_ REV foreground background colors are reversed e MODE TRANS _ REV transparent reversed RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number string too long lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C lcd DrawMode int lcd DrawMode int mode DESCRIPTION Sets the drawing mode PARAMETERS mode 0 normal 1 XOR RETURN VALUE lcd SUCCESS full message received lcd _CMD_ERR parameter number illegal mode lcd UNKNOWN ERR packet too long lcd _TIMEOUT_ERR timeout error lcd Font int led Font char Font DESCRIPTION Sets the default font PARAMETER Font Pointer to the font descriptor Current proportional fonts are 8 10 10S 13 13B 16 16B I8BC 24 24B 24BC 32 32B Current mono spaced fonts are 4x6 6x8 6x9 8x8 8x9 8x10 8x12 8x13 8x15B 8x16 8x16L 14x24 16x32 16x321 24x48 32x6
23. rans mission to the display NOTE Defining any of the following parameters will cause all the parameters not being defined in the statement to take on their default values Default coordinates are calculated based on the chart_nbr assuming one column of five evenly spaced stripcharts The coordinates can be forced using the following two parameters Keep in mind that the 0 0 location is the top left corner of the LCD CHART TLXY int two values top left x and y coordinates this is the coordinate closest to 0 0 The default values will place up to five stripcharts The starting x y for a stripchart can be calculated as follows x 20 y stripchart number 45 10 CHART BRXY int two values bottom right x and y coordinates The default values will create a stripchart 180 pixels wide and 40 pixels high CHART MAX VALUE float value at top of bar default 100 0 CHART MIN VALUE float value at bottom of bar default 0 0 022 0108 Rev C 16 led Chart continued CHART PEN two values int pen width in pixels 1 or 2 default is 1 int the color for the pen default is dark red Several of the available colors have been defined in this library see lcd BFcolorsD See the section titled Set Color Detailed in the SLCD Graphics Touch Terminal Technical Manual for those colors that are not defined in reach lib The stripchart may have as many as three pens The pen number is ident
24. t BTN_ LAT char two values for the addresses of the button text The first value is button off the second value is button on The current limit for the button text string is 19 characters total BIN _TXTOFFSET BTN_MOM int two values x and y offset values within the button for text BTN_ LAT int four values x and y offset values within the button for the text The first two values are for button off text the second two values are for button on text Any time this parameter is specified its values become the default The values are initialized to 5 BTN BMP int two values bit map numbers the first one is for the off state and the second one is for the on state Any time this parameter is specified its values becomes the default The values are initialized to 22 and 23 RETURN VALUE lcd SUCCESS full message received 1lcd_CMD_ERR parameter number illegal button lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 14 lcd Calibrate int lcd Calibrate void DESCRIPTION Runs a calibration procedure whereby the user is asked to touch points on the screen to calibrate it The calibration values are stored in non volatile memory and restored on power on This command will not cause the program to block during calibration It is the responsibility of the programmer or user to ensure that the calibration is complete before using the LCD touch screen The following code is one
25. ter number illegal button lcd UNKNOWN _ ERR packet too long lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 26 led Triangle int led Triangle int x0 int yO int x1 int yl int x2 int y2 int color DESCRIPTION Draws a triangle using the current foreground color and pen width unless a fill color is speci fied PARAMETERS x0 top left vertex x coordinate in pixels yo top left vertex y coordinate in pixels x1 top right vertex x coordinate in pixels yl top right vertex y coordinate in pixels x2 bottom vertex x coordinate in pixels y2 bottom vertex y coordinate in pixels color fill color in RGB format see the section titled Set Color Detailed in the SLCD Graphics Touch Terminal Technical Manual 1 no fill color RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN _ ERR packet too long lcd _TIMEOUT_ERR timeout error 022 0108 Rev C 27 lcd Typematic int lcd Typematic int delay int repeatdelay DESCRIPTION Sets typematic parameters for momentary buttons PARAMETERS delay The delay in milliseconds before the button starts to repeat Must be a mul tiple of 10 ms repeatdelay The delay in milliseconds between repeats Must be a multiple of 10 ms RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN _ ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C 28 Calculator Keypad Function Calls The library SAMPLES LIB ColorTouchscreen REACH CALCULAT
26. ue is converted to an integer for transmission to the display The chart will not be displayed on the screen until a BAR_ VALUE is spec ified defined in the statement to take on their default values unless otherwise indicated BAR TLXY BAR BRXY BAR SIZE BAR SEP int two values top left x and y coordinates in pixels this is the coordi nate closest to 0 0 the top left corner of the GTT The default values start at 9 10 and will be updated based on BAR_ SEP This parameter must precede BAR_BRXY or BAR_ SIZE whichever is used int two values bottom right x and y coordinates in pixels If these values are specified they will be used to calculate the BAR_SIZE values int two values x and y pixel sizes The default values are 50 100 Any time this parameter is specified its value becomes the default int two values x and y separation in pixels relative to BAR_TLXY This is only used if you want multiple bars evenly spaced and do not want to specify the BAR_TLXY for each The default values are 64 110 Any time this parameter is specified its values become the default 022 0108 Rev C BAR MAX VALUE BAR MIN VALUE BAR SEG BAR SEGCOLOR BAR BORDER led Bar continued float value at top of bar default 100 0 float value at bottom of bar default 0 0 int percentage of full scale for the start of upper segment and or the middle segment maximum value 100 default is o
27. way to do this while lcd_Origin 0 0 lcd SUCCESS fnMsDelay 1000 wait for done calibrate RETURN VALUE lcd SUCCESS full message received lcd UNKNOWN ERR packet too long 1lcd_TIMEOUT_ERR timeout error 022 0108 Rev C led Chart int led Chart int chart nbr CHART END DESCRIPTION This function is used in two ways it can be used to define a stripchart that will then be dis played on the GIT and it can be used to update the defined stripchart with specified values us ing the CHART_ VALUE parameter There are default values for each of the optional parameters PARAMETERS chart _nbr number of the stripchart 0 4 The remaining parameters are optional and may be used in any order unless otherwise speci fied The parameter name and value must be entered as follows lt parameter name gt lt parameter value gt lt parameter value2 gt CHART END must be the final parameter when not using CHART_ VALUE CHART VALUE loat displays chart values This is a special case if it is the first op tional parameter no other parameters are evaluated and the values are dis played on the stripchart There must be a value for each of the defined pens Any parameters following the values will be ignored The execution of this option must be preceded by a call to this function without CHART_ VALUE After normalization using CHART_MAX VALUE and CHART _MIN_ VALUE the float value is converted to an integer for t

Download Pdf Manuals

image

Related Search

Related Contents

Samsung S19A10 Hướng dẫn sử dụng  HP ENVY x360 15-u200ng    CM442 manual eng  Sub-Zero Freezer ID-30F User's Manual  MSP430-JTAG-ISO-MK2 USER'S MANUAL  Impianto a ciclo continuo Ultromat® AF0, AT0 e ATF  HTC Touch 3G Brown    : MENTE MARINE - Vollautomatische, at www.SVB.de  

Copyright © All rights reserved.
Failed to retrieve file