Home

GEMstudio User`s Guide

image

Contents

1. void getString void putchar serverResp putchar hiNib putchar loNib if loNib 0x30 putstring stringl if loNib 0x31 putstring strino2 This routine is only looking to respond with one of is only looking at the least significant nibble of 51 Uses putchar from ICC C library to put individual CKCKCkCKCk Kk kk k k k K K k k K K K KOK K KOK KOK KOK KOK KOK K K KOK K KOK K KC KOK CK KOK KOK KOK KOK KOK KOK KOK KOK kk ko kk ke I R RO I two strings tring variable index Therefore it characters onto serial line RK RK k k k k K K k k K K k k K K K KOK K K KOK K KOK KOK KOK K K KOK K K KOK kk KOK KKK KKK KOK KOK KOK KOK KOK KOK K KOK R R k k K Handler for a setByte function request Format of request string is five bytes gt 0xD5 vH vL NH NL byte variable and vL is 5 wher v index of low nibble of v vH is ASC version of high nibble o N value of variable v NH is ASC version of high nibble of N and NL is ASC low nibble of Returns five bytes gt OxE5 vH vL NH NL where P vH vL NH NL are all duplicates of the bytes that were in the request string FA CKCKCKCK kk k k k k K k k K K K KOK K KOK KOK KOK KOK KOK K K KOK CK KOK CK Ck KOK KC Ck kk KOK KOK KOK K
2. 52 sua 54 aire 57 Vedi 59 61 nuu E E 63 RadiOBULtOTi usce coc a oda tuer DR exa OTA QR ERR ik en RCM ge URS Md ee ci dE V 64 St bp TII TII C LE LIE uM 66 IIIa M 68 Mem m EP 71 View WA SCS la equ up bd Mu ra MR 76 77 Dynamic Image ete Ehe Ea S Suma Uere Era pi 79 Image Ba Uem 80 222206 82 bine GAIT luu unpas DIL DILE 84 u CDI aqya satanas 86 88 90 Strine issen a
3. static char caseType newByte byteFromBuf amp buffer if newByte gt OxDO amp amp newByte serverResp respMake newByte caseType serverResp else if state 0 caseType 0x00 if state 0 amp amp caseType gt 0xD0 amp amp caseType else if state 1 hiNib newByte tateT n else if state 2 loNib newByte if caseType 0xD5 statet t state 0 switch caseType case 0 0 getByte break case OxDl1 getString break case 0 2 getWord break case OxD8 invokeRPC break else if state 3 amp amp caseType 0 5 setValHi newByte state else if state 4 setVallo newByte tate 0 n setByte OR KKK k 1k 1k k k k k K Kk K K KOK KOK KOK KOK I K k k K K K Hex to ascii conversion routine amp lt lt lt k kc kCkckck kck ck kckck KOK KOK KOK KOK KOK KOK f char hex2ascii char hex return hex lt Ox0A hex 0 hex A 0x0A OK KKK I kk kk kk kk kk kk KKKA KK koe ke koe kk Ascii to hex conversion routine OKCKCKCkCkCkCkck ck k ck k kk k k ck Kk k k kck ck k KOK KOK KOK KOK char ascii2hex char ascii return ascii OK k k k k k 1k k K k k K K K k K K K K KOK KOK K K KOK K K KOK K KOK K KOK K Kk KOK KOK KOK KOK KOK KOK K K KOK KOK KK Kk ck koe K KKK K Handler for a
4. 93 Inter Widget Communication 96 Refresh Objects niei 105 Amulet COMMUNICATION S LLL u tie ree nea to eua a Dando aee 110 111 Graphic Primitives ASCII u uu u u aiian aE XR IR Gag ERR di 133 CRC Protocol tre xa siasat qa 136 Graphic Primitives CRG ir tret ERES TC IRURE E 154 CRE PrOtOCOl EM 158 Protocol ANALY ZEN seite ta 159 Amulet Bitmap FOnmat as 160 isa ME MR MINUM IM 161 Macro 55 M 163 Appendix UART Code examples 40 2200 44 4 0 166 Appendix B 5222 0 ra ER SEE cL ag 178 Appendix C Inter Widget 190 Restore O
5. valMSBhinib hex2ascii char wordValue gt gt 12 amp 0 0 valMSBlonib hex2ascii char wordValue gt gt 8 amp 0Ox0f valLSBhinib hex2ascii char wordValue gt gt 4 Ox0f valLSBlonib hex2ascii char wordValue amp 0 0 putchar serverResp putchar hiNib putchar l1oNib putchar valMSBhinib putchar valMSBlonib putchar valLSBhinib putchar valLSBlonib RR RK KK k k k K k k K K K KOK K K K KOK KOK KOK KOK K K KOK K K KOK K K KOK KC Kk CK KC Ck KOK KC kk kk KOK kk K K KC kk koe R OR K K Handler for invokeRPC function Format of request string is three bytes gt 0xD8 rH where r index of RPC rH is ASC version of high nibble of r and rL is ASC of low nibble of r Returns three bytes gt 0xD8 rH rL where rH rL are duplicates of the bytes that were in the request string KCKCK KCKCKCK kk k k k k K AA K KOK OK K K KOK KOK KOK KOK KOK KOK KOK KOK K KOK K KO I AA KOK KOK KOK A A KOK A OOO K R ke e x kx void invokeRPC void char rpc valMSBhinib valMSBlonib valLSBhinib valLSBlonib unsigned int wordValue rpc ascii2hex hiNib lt lt 4 rpc ascii2hex loNib performRPC rpc this code could do any number of things based upon which Remote Procedure Call is requested putchar serverResp putchar hiNib putchar loNib BOR
6. 0 The flags are defined as follows e specifies that the numeric field is left justified The default is right justified e specifies that positive numbers are preceded with a plus sign e 0 specifies that a right justified numeric field lead with zeroes The default is right justified with leading spaces e specifies that displayed hexadecimal numbers are preceded with Ox a blank space specifies that a left justified numeric field lead with a single space when displaying positive number and lead with a negative sign when displaying a negative number Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the value in updateFreq Parameterz verticalAlign valuez TOP or MIDDLE or BOTTOM Specifies the vertical alignment of the string associated with the printf attribute within the Numeric Field dimensions Only one value is allowed you cannot mix vertical alignments Default is TOP Parameter waitForlnit valuez CHECKE
7. color line weight b 0x00 g 0x00 r 0x00 0x04 Drawing a Filled Rectangle To draw a filled rectangle that is 0 140 pixels wide OxFO pixels tall has a topleft point at 0 00 0 00 and using fill color blue 0x25 green 0x46 red 0x73 the following would be sent to the Amulet OxDB 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x31 0x34 0x30 0x30 0x30 0x46 0x30 pnt 1 x pnt 1 delta x delta y draw 0x00 0x00 0x140 OxFO fill rectangle opcode 0 32 0 35 0 34 0 36 0 37 0 33 0 32 color line weight 0 25 0 46 r 0x73 N A CRC Protocol Amulet CRC Communication Protocol Amulet can use either an ASCII based or a CRC based communication protocol between the Amulet LCD module and your embedded device external processor New GEMstudio projects default to using the CRC protocol which is very similar in structure to Modbus RTU The external processor must be capable of RS 232 serial communications Amulet master messages are initiated either by timer events or by user input from the touch panel Amulet master messages are derived from compiled GEMstudio code stored in the data flash on the Amulet module See Widgets Document for more information For more detail on the Amulet CRC communication protocol click on the following topics Serial Port Pinouts Communication Format CRC Calculation Communication Modifications Amulet Protocol Overview
8. A Get word variable array request Amulet UART words x value An Invoke Remote Procedure Call RPC command Amulet UART invokeRPC A Set byte variable command Amulet UART byte x setValue y A Set word variable command Amulet UART word x setValue y A Set string variable command Amulet UART string x setValue y A Set color variable command Amulet UART color x setValue y If the message is valid the slave should either return the requested data if a Get request or confirm the message if an Invoke or Set command If the message is not valid the slave should respond with an acknowledge to have the Amulet move to the next request or the slave can respond with a negative acknowledgement NAK OxF1 to have the Amulet resend the last message Table 1 defines thirteen messages that can be sent between the master and the slave not counting the graphic primitive messages The valid range of variables and Remote Procedure Calls is O OxFF The valid range for byte variable values returned from the slave in response to the Get Byte variable request is also O OxFF The valid range for word variable values returned from the slave in response to the Get Word variable request is O OxFFFF String and label variable values returned from the slave in response to the Get String variable request can have a maximum of 252 ASCII 0x20 Ox7E characters plus a null termination character 0x00 Si
9. Amulet Technologies User guide Table of Contents W CO u EE uu mma MER LIA u EI MEI EE 4 GEMst dio Topical Guide icc 200 Sante dea da ba 5 Amulet GEM Font Converter n a n 6 Create LCD Canina PEE 11 LCD Board Chooser E 13 Board Profile Editor rooted er e RESET ee vin e n VET Y ae e eU e E E Y Vet 15 Page Functions EO OM rad nd dU itu 17 Href Editor RE T 24 Amulet Funcion Cala u uuu AA 29 Page FUNCOMS ha eiim au pana SD EAS ap ua Saku S 32 Amulet Internal RAM treinta Rubros 33 Am let Widgets un ukan un uh a asss 44 oM M d 47 22 48 Animated mu uu luu ien ee 49 Sco 50 Control Widgets aac uru uu utc oup ea ul ki tienes ayaq 51 CHECK BOX ca n
10. Amulet back Amulet calendar timePeriod setValue x Amulet calendar timePeriod value Amulet calibrate Amulet clearLCD Amulet fileNumber x Amulet internal setCalPOC Returns to calling page Returns the year month day of the month day of the week hour military hour am or pm minute second Where timePeriod is either year month day of the month day of the week hour militaryHour am_pm minute second and X is an integer with the following limits year min 0000 max 65535 month min 1 January max 12 December e dayOfMonth min 1 max 31 dayOfWeek min 1 Sunday max 7 Saturday hour 0 max 23 militaryHour min 0 max 23 am_pm min 0 am max 1 pm minute 0 max 59 second min 0 max 59 All time periods return an integer with the same limits as timePeriod setValue x EXCEPT for the hour the hour will return min 1 max 12 and you must read am_pm to determine the actual time OR you can just read military hour and the min 0 max 23 Runs touchscreen calibration returns to calling page when calibration completed Calibration constants are then saved to serial data flash There is a 100 000 max write limit on the life of the serial data flash After 10 000 writes the Amulet OS and the user s project should be reprogrammed to maintain data integrity Clears the entire LCD Hyperlink to the file whose internal index is x See Amulet link map file documentation
11. NAMEsstring Specifies the internal name of this meta refresh object Used for Inter Widget Communication only Examples To send out an invoke RPC 5 message every 500ms use the following META REFRESH object META HTTP EQUIV REFRESH CONTENT 0 5 URL Amulet UART invokeRPC 5 gt To send out an invoke RPC 5 message once immediately upon loading the page but never again use the following META HTTP EQUIV REFRESH CONTENT 0 0 01 URL Amulet UART invokeRPC 5 gt Note 0 of 0 0 01 means that the URL function will not have an update rate The 0 01 of 0 0 01 means that the URL function will be called 10ms after loading the page To launch to a page called parrot after 5 seconds use the following lt META HTTP EQUIV REFRESH CONTENT 5 URL parrot open gt 2 Call a function s when a timer based function returns a specific value if then else function or switch statement lt META HTTP EQUIV REFRESH CONTENT updateRate delayRate IF function EQ GT LT NEQ value THEN function s ELSE function s NAME string gt This meta tag acts like an anchor that calls its THEN or ELSE function s when the timer based IF function returns a specific value instead of a user hit Notice the strange syntax with all of the semi colon delimited fields enclosed within one set of quotes There can only be a single IF statement per meta but there can be multiple THEN statements with their corresponding
12. Software handshaking using a modified XON XOFF protocol In a system where the Amulet is the slave it is possible to send number of master messages a row without waiting for a response from the Amulet This becomes an important point when there are a large number of messages that need to be sent to the Amulet in a short period of time If the Amulet is set to respond to every master message like it will by default or if you have setup the Amulet to respond with an ACK by using the Meta attribute SlaveAckRsp only the last sent message will be responded to So if you send over 30 master messages packed together as a single stream of bytes only one response message or ACK will be returned from the Amulet One of the problems of this technique is that the Amulet has a 256 byte receive buffer which can be filled to capacity if too many bytes are sent to the Amulet The receive buffer is not circular so when the Amulet is done parsing an incoming message as long as there are no more bytes left in the receive buffer the buffer counter is reset and the next message can be up to 256 bytes in length Using the example above if the master sends another 30 master messages before the Amulet is finished parsing the first batch of 30 master messages the buffer counter will not get a chance to reset thus filling up the buffer since 60 master messages which on average are 5 bytes each will not fit in a 256 byte receive buffer If the buffer ever ge
13. Specifies the strings and its associated value that can be displayed when using Amulet UART byte x value The string whose value equals the value returned from the byte x value function is displayed Options List Cancel Save Parameter colorlnvert value REGION or STRING NONE Specifies if the string is shown with alternate colors If REGION selected the fillColorAlt and fontColorAlt will be used instead of fillColor and fontColor If STRING selected only fontColorAlt will be used instead of fontColor If NONE selected String Field will use fillColor and fontColor Only one value is allowed you cannot mix color inversion properties Default is NONE Parameter fillColorAlt value See color entry conventions Specifies the desired String Field fill color if colorinvert set to REGION See section on colors for more information If no alternate fill color is specified the default alternate fill color is the logical inverse of the current fillColor If the alpha is FF then the fill color alt is fully opaque Parameter fontColorAlt value See color entry conventions Specifies the desired font color if set to either REGION or STRING See section on colors for more information If fontColorAlt is not specified the default alternate font color is the logical inverse of the current fontColor Inter Widget Communication All widgets use the href parameter to specify a function
14. saveCanvas setLinePattern setLineWeight Bar Check Custom Dyn graph box x x x x 4a x x button Func Image button Bar x x x x x x x x x x x Image Image Line List Num Widgets Seq Plot x x x x x x x Field Radio Scribble Slider Button x x x x 5 X x x x x x x x x x setMethod m 8 1 setTrigger x setUpdateRate f 1 setValue x setVariableNumber x 19 19 startUpdating stopUpdating toggleUpdating uploadImage value fastSpeed oneFrame pause play playBackwards playForward regularSpeed slowSpeed superFastSpeed superSlowSpeed 1 Regarding x For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out META REFRESH tags and Function Custom Buttons should use x The range for x is 0 255 Ox00 Oxff for a BYTE 0 65535 Ox00 Oxffff for a WORD and 250 character strings in double quotes for STRINGs 2 Regarding m When setMethod setOnVarMethod setOnVarUARTMethod or setUARTMethod is the IWC method the argument should be the name of the method you want to set 3 Regarding f For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out META REFRESH tags and Function Custom Buttons
15. 0 04 OxFB Data CRC gt PACKET OK lt ACK 0 05 OxFA Data gt UART Overrun Error on Any Byte lt 0x05 OxFA Data CRC gt Packet OK lt ACK EOT gt Packet OK lt ACK ETB gt Finished Finished lt JACK Sample crc calculation code int calcrc char ptr int count int crc char i cre 0 while count gt 0 cre int ptrtt lt lt 8 1 8 if cre 0 8000 ene Grego occ d 0 1021 else crc lt lt 1 while i return crc Embedded GUI Video Tutorials Ifyou haven t already done so please take the time to look at the Online Video Tutorials The tutorials will provide you with an overview of how to create compile and simulate your GUI To get to the tutorials pull down the menu for Help when you open a GEMstudio window and select Online Video Tutorials For additional examples please go to your GEMstudio directory and click on the gemp files What will learn in the tutorials e Creating and Compiling a GUI Simulate the GUI Click here for the videos GEMstudio Change Log Change Log for GEMstudio Pro version 2 0 0 0 Change Log for GEMstudio version 1 4 0 3 Change Log for GEMstudio version 1 4 0 2 Change Log for GEMstudio version 1 4 0 1 Change Log for GEMstudio version 1 4 0 0 Change Log for GEMstudio version 1 3 0 1 Change Log for GEMstudio v
16. Notice the semi colon For the META REFRESH only all attributes must be separated by semi colons There are essentially 3 different kinds of methods 1 methods that do not require parameters 2 methods that require parameters 3 methods that return a value Methods that do not require arguments parameters See example below where function button widget when pressed causes a line plot widget Plot1 to remove itself from the LCD Amulet document Plot1 disappear The href line invokes the disappear method on Plot1 That is it calls disappear relative to the Plot1 object Thus the call to Plot1 disappear causes the widget named Plot1 to remove itself from the LCD The method disappear does not require any arguments parameters that are passed to the method that the method uses as its input Other methods do require arguments though Methods that require arguments parameters Some methods require a parameter to be passed to it When dealing with methods a parameter that is passed to it is referred to as the argument of the method The argument passed to any method is the intrinsic value of the calling widget object Only Control Widgets Objects have an intrinsic value See example below where a list widget sends its intrinsic value to an image sequence widget Tour to use as its input when a list entry is selected Href line Amulet document Tour setValue Options America Australia China France San Francisco
17. the array returns the array of word variables from x to x y Only valid when used in a META Refresh tag to load InternalRAM variables Valid StringField widget href functions Table 7 StringField Widget href functions Amulet document widgetName value Returns the intrinsic value byte word or string of the named Control Widget Amulet internal lostCommByte value Receives the count of consecutive communication time outs Only valid if option field populated Amulet internal OSVersionString value Returns the string of the current Amulet OS version number Amulet internalRAM byte x value Returns the value of internalRAM byte variable x Amulet internalRAM byte x maskedValue y Returns the value of internalRAM byte variable x ANDed with the mask y Amulet internalRAM string x value Returns the string of internalRAM string variable x Amulet math randomByte value Receives a pseudo random byte Amulet math randomByte maskedValue y Receives a pseudo random byte ANDed with the mask y Amulet UART byte x value Sends a getByte request over the UART where x is the byte variable number returns the value of the byte variable x Only valid if option field populated Amulet UART byte x maskedValue y Sends a getByte request over the UART where x is the byte variable number returns the value of the byte variable x ANDed with the mask y Only valid if option field populated Amulet UART string x v
18. Amulet specifies an Amulet specific command object can be UART or InternalRAM variable variable can be byte word or string variable can be a number from 0 255 for byte and word variables and 0 200 for string variables method can be any number of methods described in Appendix B See example href command below where a function button when pressed causes a Remote Procedure Call 5 to be sent out the UART to the external server Amulet UART invokeRPC 5 The href line above invokes the invokeRPC method UART That is it calls invokeRPC relative to the UART object Thus the call to UART invokeRPC causes the UART in the Amulet controller to send out an invokeRPC command The method invokeRPC requires an argument a parameter that is passed to the method that the method uses as its input As a rule of thumb the argument passed to any method is the intrinsic value of the calling widget object Only Control Widgets Objects have an intrinsic value Function buttons can specify an intrinsic value by specifying the buttonValue or by including a number between the s Widgets that can have multiple intrinsic values like lists and sliders must not include a number between the s since their intrinsic value is dependent upon the state of the widget For a list of all available functions see Appendix B Amulet Page Functions GEMstudio uses Page Functions in order to enter logic that goes beyond the simple href functi
19. Amulet document MyScribble disappear Amulet document MyScribble reappear 4 this is a very very very very very very very very very very very very 10 gt For more information on the usage of href editor functions please go to Inter Widget Communications and Appendix C NOTE If at any time you need further explanation on widget or parameter in your project select the widget or parameter and click on the button on the lower left hand corner of the project window or press 1 help window will pop up and explain the selected widget or parameter Amulet Function Calls Amulet widgets use the href parameter to specify a function call See Widgets Color for a detailed description of widgets A function call be a hyperlink to another page a request for the value of an external variable a command to invoke a Remote Procedure Call and much more A function call can also send a command to other widgets known as Inter Widget Communication IWC See Appendix B for a comprehensive list of all available functions The Amulet operating system uses two general types of widgets Control Widgets and View Widgets Control Widgets are user input widgets such as list widgets slider widgets radio buttons checkboxes and function buttons Anchors META REFRESH objects and area maps can also call functions like Control Widgets but because they are not created using the tag they are referred to as
20. KR KK IK kk k k K K k k K K K K K K KOK KOK KOK KOK KOK KOK kk KOK KOK KOK KOK KC KOK kk KC K KOR KOK kk kk koc kk ko kk K ke ke K K kk Checks to see if anything is waiting on the serial line to be handled if so it puts it at the end of the Ringbuffer otherwise it does nothing returns KCKCKCKCKCKCK k k k K k k K K k Kk K K KOK KOK KOK KOK KOK KOK KOK KOK KOK KOK KOK K KOK K K K KOK KOK KOK KOK KOK KOR KOR KOR ko ko KOR ORO ke R KKK void serIn RingBuf buf if SCSR amp RDRF 0 tail buf gt tail buf gt serData tail SCDR buf gt tail tail amp RB SIZE MASK parseSerial KR KK k k k K K k k K K k k K K K K KOK KOK KOK KOK K K KOK K K KOK K KOK K KOK KK KK KOK KOK KOK KOK k kkk kk AA KOK koe ke ke This function acts as the byte handler to the bytes that serIn puts in the Ringbuffer Checks to see if valid request type has been received and then sets server response value Using a standard state machine the program proceeds to set variables to hold the values of the next byte received on the serial lines and when the correct number of bytes have been received 3 bytes for all request types except setByte which needs 5 bytes later calls functions that put the variables back out on the serial line for output void parseSerial void
21. Makes the entire Numeric Field both the background and the text display in normal video Counteracts the inverseRegionColor method normalStringColor Makes the Numeric Field s text string display in normal video Counteracts the normalStringColor method reappear Makes the Numeric Field visible on the LCD Counteracts the disappear method setMethod m Changes the method originally specified by the Numeric Field s href parameter setUARTMethod m Changes the UART method originally specified by the Numeric Field s href parameter setUpdateRate f Changes the update rate originally specified by the Numeric Field the argument being a floating point number specifying time in seconds setValue x Numeric Field uses x as its input This allows a Control Widget to provide the input to a Numeric Field setVariableNumber x Changes the variable number originally specified by an Numeric Field Can be used only if the Numeric Field href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber x setX x Sets the x coordinate of the topleft corner of the Numeric Field to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Numeric Field to the coordinate specified by the word x startUpdating Numeric Field starts updating based upon its input data Counteracts the stopUpdating method stopUpdating Numeric
22. None Detected After sending the initial FSN character the receiver waits for either a 2 second time out or until a buffer full flag is set If the receiver is timed out then another FSN character or an ACK is sent to the sender and the 2 second time out starts again This process continues until the receiver receives a complete 133 byte packet Receiver Considerations This protocol NAKs the following conditions 1 Framing error on any byte 2 Overrun error on any byte 3 Duplicate packet 4 CRC error 5 Receiver timed out didn t receive packet within 1 second On any NAK the sender will re transmit the last packet Items 1 and 2 should be considered serious hardware failures Verify that sender and receiver are using the samebaud rate start bits and stop bits Item 3 is usually the sender getting an ACK garbled and re transmitting the packet Item 4 is found in noisy environments And the last issue should be self correcting after the receiver NAKs the sender Sender Receiver SOH SOH SOH SOH SOH SOH SOH SOH lt FSN Character Times out after 2 seconds lt FSN Character 0 01 OxFE Data CRC gt Packet OK lt ACK 0 02 OxFD Data gt Line hit during transmission lt 0 02 OxFD Data CRC gt Packet OK lt ACK 0x03 OxFC Data CRC gt Packet OK ACK gets garbled lt ACK lt ACK 0x04 OxFB Data gt UART Framing Error on Any Byte lt
23. Amulet As Master Amulet As Slave InternalRAM RPC Buffer Dual Master Collisions Error responses Note About Sending Master Messages During Amulet Page Changes Graphic Primitives Sending Jump To Specific Page Command Sending A Soft Reset Command Sending Get Current Page Index Command Sending Strings The Amulet Which Contain ASCII Characters Between 0 80 Sending Strings To The Amulet Which Contain The Font Style Escape Byte Flow Diagram Example Summary Of Amulet Protocol Command Opcodes Serial Port Pinouts Physical interface Serial cable connections standard RS 232 SIGNAL DB9 DB9 DESCRIPTION FEMALE MALE DOUT Pin 2 Pin 2 Amulet output your processor s input DIN Pin 3 Pin 3 Amulet input your processor s output GND Pin 5 5 Signal Ground Jumpered Pin4 Pin 6 Jumpered Pin 7 Pin8 Communication Format Communications between the Amulet LCD module and an external processor are asynchronous serial transmissions with the following format Baud Rate 9600 14400 19200 28800 38400 56000 57600 or 115200bps Parity None Data Bits 8 Stop Bits 1 The default baud rate is 115 200 bps Other baud rates set in the Project Options gt Communication tab Communication Modifications The default communication time out period is 200ms Other time out periods are set in the Project Options gt Communication tab The default slave ID for the Amulet is 1 and for the Host it
24. Changes the UART method originally specified by the String Field s href parameter setUpdateRate f Changes the update rate originally specified by the String Field the argument being a floating point number specifying time in seconds setVariableNumber x Changes the variable number originally specified by a String Field Can be used only if the String Field href is byte y value or string y value In both cases the y gets changed to the argument specified in setVariableNumber x setX x Sets the x coordinate of the topleft corner of the String Field to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the String Field to the coordinate specified by the word x startUpdating String Field starts updating based upon its input data Counteracts the stopUpdating method stopUpdating String Field stops updating toggleRegionColor Toggles the polarity of the entire String Field both the background and the text toggleStringColor Toggles the String Field s text string polarity Does not affect the background color toggleUpdating Changes current state of String Field either starts or stops updating Animated Image disappear Makes the image not visible on the LCD fastSpeed Increases animation speed oneFrame Advances animation one frame pause Stops animation play Starts animation in current direction playBackwards Starts animating ba
25. OxFFFF Parameter min value number Minimum value returned from the href function must be less than max If the function returns byte the range is O 254 0 00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Parameter minAt value LEFT or RIGHT or TOP or BOTTOM Determines where the minimum value of the linear gauge is located When the minimum value is returned the pointer is located at the minAt location As the value increases the pointer travels the length of the linear background image until the maximum value is reached and the pointer is then located at the opposite extreme of the minAt location Default values are LEFT for horizontal linear gauges and BOTTOM for vertical linear gauges The options are LEFT The pointer value increases from left to right horizontal linear gauge only RIGHT The pointer value increases from right to left horizontal linear gauge only TOP The pointer value increases from top to bottom vertical linear gauge only BOTTOM The pointer value increases from bottom to top vertical linear gauge only Parameter pointerlmage value image Image used as the pointer which travels across the linear background image Image file must be of type GIF JPG or PNG Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 3
26. Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the number in updateFreq Parameter waitForlnit valuez CHECKED or UNCHECKED Specifies if the Image Sequence will wait for valid data before any image will be displayed on the LCD If CHECKED the Image Sequence will not display any image until the first packet of data is received If UNCHECKED or the attribute is not present the Image Sequence starts out displaying the first image until the first packet of data is received Optional Image Sequence Parameter Attributes Parameter noSdram value CHECKED or UNCHECKED Specifies if the images are in sdram or not If noSdramzCHECKED then by default the images are located in the serial data flash If the parameter is false the images are located in sdram Parameter loadImmediately valuez CHECKED or UNCHECKED Specifies if the images are loaded immediatly into the sdram for page loads or not This parameter is only applicable if the noSdram parameter is UNCHECKED If loadimmediately is CHECKED then all the images in the Image S
27. The onTouch function s are called once immediately upon touching the Touch Area See Appendix B for all available functions for the onTouch event Parameterz onZoom value function s the function or multiple sequenced functions invoked after the Touch Area senses the Zoom gesture The Zoom gesture is sensed when the Touch Area is touched by two fingers that are slightly apart and then separated further apart from each other As long as the two fingers are moving away from each other the Zoom gesture will be sensed See Appendix B for all available functions for the onZoom event Zoom Gesture only available on select capacitive touch panels Parameter repeatDelay value number Time to delay from when Touch Area is initially pressed until it starts to auto repeat the onAutoRepeat function s Specified in seconds with a single floating point number A repeatDelay of 0 00 results in the onAutoRepeat never firing The range is 0 00 655 35 Parameterz repeatRate value number The onAutoRepeat function s call frequency while Touch Area is being pressed after the initial delay determined by repeatDelay Specified in seconds with a single floating point number A repeatRate of 0 00 results in the onAutoRepeat function s being launched only once after the given repeatDelay time and then not repeated The range is 0 00 655 35 View Widgets View Widgets enable the user to show values or text in the GUI Amulet has nine types o
28. add the two bytes together and they should always equal 0xff Please note that the packet number starts out at 1 and rolls over to 0 if there are more than 255 packets to be received Bytes 4 131 form the data packet and can be anything Bytes 132 and 133 form the 16 bit CRC The high byte of the CRC is located byte 132 The CRC is calculated only on the data packet bytes 4 131 Xmodem has a CRC but there is an optional secondary CRC that checks the data that was actually written to the flash After sending the EOT byte 0x04 after the last packet in each file you can send what we have dubbed the EOTCRC 0 16 This will cause the Amulet color chip to calculate a new CRC based off of the data in the flash match is indicated by an ACK and a non match by a NACK The FSN will begin transmission after the ACK or NACK A NACK d file should be reprogrammed Synchronization In the standard Xmodem Protocol the receiver starts by sending an ASCII C 0x43 character to the sender indicating it wishes to use the CRC method of block validating In Amulet s color chip we will instead output a character that indicates the size of the serial dataflash connected to first chip select CS0 of the SPI bus This character is reffered to as the Flash Size Notifier or FSN The flash size to character mapping is as follows a 1Mbit b 2Mbit 4Mbit d 8Mbit e 16Mbit 32Mbit standard starter kit size g 64Mbit GCC 2 size Z
29. dio di dir di dio dir dio dir dio dir dio dir di div di di di dio dir dir do di dir dir dio dio di die dio dio die di dio div dio dio di di di di di dio dio dir d di dir di di di di dir dio dio dir di dio dir getWord ServerRespl 5 1 IF VarType2 1 THEN YWORDvariable Pulse X port pin read and save out x acceleration values PULSIN 4 1 xWord ServerResp2 xWord HIGHBYTE ServerResp3 xWord LOWBYTE server data sent out over RS232 to client SEROUT 16 84 ServerRespl VarTypel VarType2 HEX2 ServerResp2 HEX2 ServerResp3 GOTO serial in YWORDvariable PULSIN 2 1 yWord ServerResp2 yWord HIGHBYTE ServerResp3 yWord LOWBYTE SEROUT 16 84 ServerRespl VarTypel VarType2 HEX2 ServerResp2 HEX2 ServerResp3 GOTO serial in Assembly Source Code The following assembly code snippets were taken from an actual server implementation based on Atmel s AVR 8 bit RISC microcontroller Partt AT90LS4433 k ko kk ck ck k k K k k k TK ke KOK K K KOK K KOK K KOK K K kc kc kc kc kc ke ke K KOK ke ke ke ke ke x Main loop of program Waits for valid Client Start Of Message CSOM characters then vectors to the appropriate service routine pORCKCkCkC kk k k k k k k k k k k K k K K K K KOK K K KOK K K KOK KOK KOK K K KOK K
30. from serial data flash page project and notThisPage The dot modifier page will reload the InternalRAM only on the page that the meta is included By using the dot modifier project every page in the project will reload the InternalRAM from the serial data flash unless a page has the meta using ReloadInternalRAM notThisPage If the InternalRAM is to be reloaded it happens immediately upon the loading of the page Any time that page is navigated to the InternalRAM will be reloaded Example usage META name Amulet content ReloadinternalRAM page gt Internal RAM specific methods There are a number of methods that are specific to the Internal RAM variables All three variable types have their own specific methods See the tables below for a description of all available methods Table 1 InternalRAM byte method descriptions InternalRAM Byte Methods Descriptions Amulet InternalRAM byte z add x Add the byte value x to the Internal RAM byte variable z Result is stored in Internal RAM byte variable z Amulet InternalRAM byte z and x Logically AND the Internal RAM byte variable z with the byte value x Result is stored in Internal RAM byte variable z Amulet InternalRAM byte z copyToRamByte x Copy value of Internal RAM byte variable z into Internal RAM byte variable x Amulet InternalRAM byte z dec Decrement the value of Internal RAM byte variable z Amulet lnternalRAM byte z div x Divide the Internal RAM byte va
31. is used Images can be either GIF JPG or PNG Parameter borderColor value See color entry conventions Specifies the color of the list box border See section on colors for more information If no selection color is specified the default color is black If the alpha is FF then the border is fully opaque PWM Pulse Width Modulation Widget 55 A Pulse Width Modulation PWM widget is an invisible object that can send out a waveform out one of three PWM pins the Amulet Color Chip The waveform period and pulse width in ms can be specified as well as which PWM pin the waveform will come out on The waveform ee peak is 3 3v and the trough is at Ov The peak and trough levels cannot be modified k Pulse Width dL Period PWM Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the PWM is to start out invisible or not If the attribute is not CHECKED then by default the PWM is visible If the PWM starts out invisible the only way to make it visible again is via the IWC method reappear Parameter channel value 0 or 1 or 2 Specifies which PWM pin on the Amulet Color Chip the waveform will be output The default value is 0 Parameter initialCondition value ON or OFF or NO CHANGE Specifies if the waveform is to be active immediately upon loading the page No Change means the PWM object will be created for the pa
32. or end with value Using InternalRAM byte variables as variable indices Another powerful feature of Internal RAM variables is that they can be used as variable indices for the base variable type Since variable indeces only range from 0 00 only Internal RAM byte variables can be used as variable indices For example to have a button set an external byte variable that is defined by InternalRAM byte 1 to a value of 0x20 you would use the following Amulet UART byte InternalRAM byte 1 setValue 0x20 The value contained within Internal RAM byte variable 1 would be used as the external byte variable number to set to 0x20 Another example which reads the Internal RAM word variable defined by InternalRAM byte variable would use the following Amulet InternalRAM word InternalRAM byte 0 value The value contained within Internal RAM byte variable 0 would be used as the Internal RAM word variable number to read from When using Internal RAM variables as variable indices use the following naming convention InternalRAM byte x Do not precede with Amulet or end with value Note Internal RAM byte variables only used as variable index of the base variable type of an href function It cannot be used as an index to an Internal RAM variable being used as a method argument That means the following CANNOT be used Amulet UART invokeRPC InternalRAM byte InternalRAM byte 5 It is acceptable to have an href
33. page the Amulet OS will respond with a soft reset This will act exactly as if the reset button was pressed Message Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Jump To Page 0x01 0x50 Page Index Page Index CRC CRC Command MSByte LSByte LSByte MSByte Amulet 0 01 0 50 CRC CRC None None Response ACK LSByte MSByte Examples To jump to page 0x25 send the following sequence 0x01 0x50 0x00 0x25 OxCO 0x12 To jump to page 0x103 send the following sequence 0x01 0x50 0x01 0x03 0x40 0x58 Sending a Soft Reset Command It is possible to send a Master Message to the Amulet which will force it to perform a soft reset It will react exactly as if the reset button was pressed The message structure is essentially the Jump To Page command but the page index is OxFFFF Example To cause a soft reset send the following sequence 0x01 0x50 OxFF OxFF 0x00 0x79 Sending a Get Current Page Index Command To make the Amulet respond with the flash index of the current page send the Get Current Page Index command It will respond with a 16 bit value See the Amulet Link Map for more information Example To read the flash index of the current page send the following sequence 0x01 0x51 OxC1 OxDC The Amulet will respond with the following if the current page is index 0x20 0x01 0x51 0x00 0x20 0x51 OxD1 Sending strings to the Amulet which contain characters between 0x80 0xFFFF When sending strings to the Amulet all characters from 0x20 0x
34. the Amulet logo is used Images can be either GIF JPG or PNG Parameter downArrowaAlt value image Specifies the page down arrow image to use when the down arrow is selected If this attribute is not present then a default image the Amulet logo is used Images can be either GIF JPG or PNG Parameter initHref value function Specifies the function called when the page is loaded Use this attribute whenever FromlnitHref is used as the initialCondition The value returned from this function call will determine which option string starts out highlighted The value should match the intrinsic value of one of the options strings See Appendix B for all available functions Parameter scrollRate value seconds Specifies the rate at which the list scrolls when selecting the area directly below or above the list box The default scroll rate is 45 seconds The range is 0 01 655 35 Parameter upArrow value image Specifies the page up arrow image to use when the list has more items than can be viewed If this attribute is not present then a default image upArrow gif located in Amulet Color Configuration Widgets List is used Images can be either GIF JPG or PNG Parameter upArrowAIt value image Specifies the page up arrow image to use when the up arrow is selected If this attribute is not present then a default image upArrowAlt gif located in Amulet Color Configuration Widgets List
35. the default alternate font color is the logical inverse of the current fontColor String Field String Field Widget StringField class String Class String Field Widget calls a function that returns either a null terminated string of ASCII characters or a one byte index into a list of pre built strings The string field can display a mixture of static text and a dynamic string The static text is input using the standard C printf format Like printf the conversion specification begins with a and ends with the conversion character s Ifan ASCII string is received then the acquired string is inserted where the conversion specification resides in the printf string By default the dynamic string can be a maximum of 25 characters in length To increase the maximum number of characters see precision below If a byte is received the pre built string that has the same value as the acquired byte is inserted where the conversion specification resides in the printf string The values associated with each pre built string are specified similar to C s enum specifier where the first string will have a value of 00 the second item 01 etc unless an explicit value is given If not all values are specified unspecified values continue the progression from the last specified value If the width of the String Field widget is less than required and the height of the string field widget is tall enough the string will wrap automatically If there i
36. you just need to add support for the Amulet specific function opcodes For those not familiar with Modbus RTU there is one oddity when it comes to numbers greater than 8 bit When dealing with data within the payload data is transmitted big endian meaning Most Significant Byte first But when dealing with the 16 bit CRC the CRC is transmitted little endian meaning Least Significant Byte first When using the UART the Amulet CRC protocol is full duplex meaning both the Amulet and the host processor can transmit at the same time All master messages do require a response message though The Amulet LCD module master can send 13 different types of messages to the external processor slave A Get byte variable request Amulet UART byte x value A Get word variable request word 2 bytes Amulet UART word x value A Get string variable request Amulet UART string x value A Get color variable request color 4 bytes Amulet UART color x value A Get byte variable array request Amulet UART bytes x array y A Get word variable array request Amulet UART words x array y A Get color variable array request Amulet UART colors x array y A Get label variable request Amulet UART label x value A Set byte variable command Amulet UART byte x setValue y A Set word variable command Amulet UART word x setValue y A Set string variable command Amulet UART string x setValue y A
37. 0 01 0x41 CRC CRC Response ACK LSByte 5 Message Set InternalRAM Color Index for Primitive Amulet Response Message Set Line Weight for Primitive Amulet Response Message Draw Pixel Primitive Amulet Response Message Draw Line Primitive Amulet Response Message Byte 1 0x01 0x01 Byte 1 0x01 0x01 Byte 1 0x01 0x01 Byte 1 0x01 0x01 Byte 1 Byte 0x42 0x42 ACK Byte 0x43 0x43 ACK Byte 0x44 0x44 ACK Byte 0x45 0x45 ACK Byte 2 Byte IR color index CRC LSByte Byte Line Weight CRC LSByte Byte Pnt X MSByte CRC LSByte Byte 3 Pnt1X MSByte CRC LSByte Byte 3 Byte CRC LSByte CRC MSByte Byte CRC LSByte CRC MSByte Byte Pnt X LSByte CRC MSByte Byte 4 Pnt1X LSByte CRC MSByte Byte 4 Byte 5 CRC MSByte Byte 5 CRC MSByte Byte 5 Pnt Y MSByte Byte 5 Pnt 1 Y MSByte Byte 5 Byte 6 Byte 6 Byte 6 Pnt Y LSByte Byte 6 Pnt1Y LSByte Byte 6 Byte Byte Byte 7 CRC LSByte Byte 7 Pnt2X MSByte Byte 7 Byte Byte Byte 8 CRC MSByte Byte 8 Pnt2 X LSByte Byte 8 Byte Byte Byte Byte 9 Pnt 2 Y MSByte Byte 9 Byte 10 Byte 10 Byte 10 Byte 10 Pnt2 Y LSByte Byte 10 Byte 11 Byte 11 Byte Byte 11 CRC LSBy
38. 0x33 use the following Amulet UART streamOut 0x01 0x11 0x22 0x33 Amulet USB streamOut 0x01 0x11 0x22 0x33 As is the case with the byteOut function call the GEM Graphical OS Chip is not expecting nor accepting any responses to the streamOut function call Sending A String Of Bytes Without A Response To send a stream of raw bytes out the UART can be accomplished by calling multiple Amulet UART byteOut or Amulet USB byteOut functions separated by commas but that is not the most efficient way The href command Amulet UART stringOut string or Amulet USB stringOut string will send out the string of bytes without any formatting and it will not send out the null termination character You can also use InternalRAM string variables as strings to be sent out For instance to send out the value of InternalRAM string O use the following Amulet UART stringOut InternalRAM string 0 Amulet USB stringOut InternalRAM string 0 If it is desired to send out ASCII string that can be accomplished by entering a string that is enclosed by either single or double quotes Please see the section on entering strings for more information For example to send a string that says 123 ABC use the following Amulet UART stringOut 123 ABC Amulet USB stringOut 123 ABC One thing to note is that the ASCII string that is sent out is not null terminated If a null termination character is required then you can enter an Amulet UART byteOut
39. Clears the internalRAM RPC buffer Adds the RPC x to the internalRAM RPC buffer Saves the current state of all the Internal RAM variables byte word and string in the serial data flash There is a 100 000 max write limit on the life of the serial data flash Objects Image Animated Image Static Text Control Widgets Checkbox Custom Button Custom Slider Function Button List Pulse Width Modulation Radio Button Scribble Slider Touch Area View Widgets Bargraph Dynamic Image Image Bar Image Sequence Line Graph Line Plot Linear Gauge Field Amulet Widgets String Field Numbers and GEMstudio Integers can be entered in hexadecimal or decimal Decimal examples are used in this document If hexadecimal is desired precede the number with 0x For example Amulet UART invokeRPC 10 is equivalent to Amulet UART invokeRPC 0x0A Colors and GEMstudio The color depth used in a project is determined by the Color Depth tab in the Project Properties menu option The different color bit depth options are 8 and 32 If using 8 bit color a palette must be designated If not designated the AmuletDefault pal color palette found in the Configuration Palettes directory will be used The AmuletDefault pal color palette is the Web Safe palette with nine extra colors added These nine extra colors correspond with the HTML standard color names that aren t normally found in the Web Sa
40. Field stops updating toggleRegionColor Toggles the polarity of the entire Numeric Field both the background and the text toggleStringColor Toggles the Numeric Field s text string polarity Does not affect the background color toggleUpdating Changes current state of Numeric Field either starts or stops updating Pulse Width Modulation setPeriod x Sets the period of the PWM object in ms Range is 0 01 104 setPulseWidth x Sets the pulse width of the PWM object in ms Range is 0 01 103 99 start Starts the PWM object using the current period and pulse width settings stop Stops the PWM object Radio Button disappear Makes the Radio Button not visible or touchable on the LCD forceHit Radio Button performs its hit method without user input The hit method will invoke all href functions of that object Unlike the CheckBox a forceHit can only be imparted to an individual Radio Button not a Radio Button group forceUpdate Forces the Radio Button group to call its initHref function immediately Only valid if initialCondition is FromlnitHref Updates the Radio Button group and performs a hit To forceUpdate a Radio Button group use the groupName as the widgetName rather than the individual Radio Button name maskedValue y Sends the intrinsic value of the Radio Button to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only valid
41. Field widget Static Text object does not invoke any function s Static Text Parameter Attributes Parameter text value string Specifies the string text to be displayed Parameter fontColor value See color entry conventions Specifies the desired font color See section on colors for more information If no font color is specified the default color is black Parameter font value font font size Specifies the font and font size used for the checkbox label See Amulet GEM Font Converter for more information regarding the creation of auf font files Default font is Bitstream Vera Sans Default font size is 12pt Parameter fontStyle valuez Plain or Bold or Italic Specifies the style associated with the drop down menu The available font styles are e Plain The option text is standard font i e text Bold The option text is bold i e text e The option text is italicized i e text Control Widgets Control Widgets enable te user to set controls in the GUI Amulet has nine different Control Widgets Check Box Custom Button Custom Slider Function Button List Pulse Width Modulation Radio Button Scribble Slider Touch Area CheckBox Checkbox Widget CheckBox class check Box A checkbox is a labeled square box used to invoke a function or set of functions whose argument Check Box is the value of the checkbox To toggle check or uncheck a checkbo
42. GIF images within GEMstudio The resized image was lacking colors and displayed mostly black Changes for GEMstudio version 1 4 0 2 Fixed bug in Tools gt Options menu if no COMM port selected for the and COM1 was not available on the PC Caused GEMstudio to close upon exiting the menu Fixed bug when exiting Project gt LCD Board Chooser if opened prior to opening a project Caused GEMstudio to close upon hitting OK The Height and Width input boxes used to only allow changes of 3 pixels or greater Now fine 1 or 2 pixel changes are allowed GEMstudio layout of Slider Widget fixed to better match WYSIWYG Slider widget handles must odd number of pixels and the layout tool used to allow a positive number GEMplayer now correctly updates if frame buffer was set to Double on Page Change Enhancements Updated the Meta Refresh documentation to better explain the switch statement like capabilities setX and setY for all objects can now handle negative numbers Changes for GEMstudio version 1 4 0 1 Bug Fixes Fixed bug in saving Production Files in a directory other than the root directory where the gemp was located Fixed bug in String Field widgets where if value changed while String Field was invisible it wasn t updated when the String Field was made visible again Fixed bug with the setX function on Numeric Fields Improved clipping on objects that are located only partially
43. InternalRAM string 5 setValue To use a use the escape character same for the semi colon View Widget Function Calls View Widgets are used for displaying data View Widgets include lineplots and bargraphs View Widget function calls are initiated by either a timer event or the IWC method forceUpdate The frequency of the timer event is specified by the updateRate parameter They can only call a single function and that function must return either a byte word 2 bytes or ASCII string The returned value is used as the input to the View Widget Function Call Conventions Amulet function calls borrow some of it syntax from Java Script a scripting language used within HTML Except for hyperlinks to other pages all Amulet function calls start with Amulet The Amulet signifies that what follows is an Amulet specific command If it is desired to hyperlink to another page then just use the name of the file to link to in the href parameter i e YourFileName open Amulet function calls also borrow concepts from Java an Object Oriented Programming OOP language When it is required to interface to an external server use Amulet UART The UART can be thought of as a UART object As in OOP each object has its own set of data and a set of well defined interfaces to that data As in Java these interfaces known as methods Methods just functions that specific to particular object Each object has its own s
44. KOK K KOK KOK KOK KOK KUK K K KOK KR ke KOR R K EKER equ GetCommand 0xDO equ GetResponse OxEO equ StringCommand OxD2 wait it get command get command so check others check for set it a string command string command so it set command set command so check for Is it an invoke command StringResponse OxE2 equ SetCommand 0 5 SetResponse 0 5 equ InvokeCommand 0xD8 equ InvokeResponse 0 8 try again rcall getch Go buffer cpi buffer GetCommand Is brne is it S Not rjmp handleG is it String cpi buffer StringCommand Is brne is rt S Not rjmp handleString is it 5 cpi buffer SetCommand 18 brne is it I Not rjmp handles is it I cpi buffer InvokeCommand brne try again next character rjmp handlel until a character is present in the Not a valid request so start over and wait for k k k k k k k k k k k Kk k k KUK UK KOK UK K K KK KEK KEK K OK KOK CK K K KOK kc kk kk ke ke he hk kk Handle Get Byte command to get variable data start character character Format of request string 0xD0xx where xx variable
45. LEFT or CENTER or RIGHT Specifies the horizontal alignment of the string associated with the printf attribute within the String Field dimensions Only one value is allowed you cannot mix horizontal alignments Default is LEFT Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the String Field Widget The function is called at an update rate specified by the updateFreq attribute Parameter printf value text format text Specifies the text and the formatted string field to be displayed similar to the standard C program printf command The string is input using the standard C printf format Like printf the conversion specification begins with a and ends with the conversion character s By default the dynamic string can be a maximum of 25 characters in length To increase the maximum number of characters see precision below Between the and the conversion character there may be in order e A minus sign which specifies left adjustment of the dynamic string e Anumber that specifies the minimum field width The dynamic string will be printed in a field at least this wide If necessary it will be padded on the left or right if left adjustment is called for to make up the field width e A period which separates the field width from the precision Anumber the precision that specifies the maximum number of characters to be printed from a
46. Last Character to 0x39 you could save just the numbers 0 9 which would obviously result in a much smaller auf file thus using much less flash space These values are not persistant after closing down the Amulet GEM Font Converter Each time you start the Amulet GEM Font Converter the First Character defaults to 0x20 and the Last Character defaults to Ox7F File Menu Load Font Save AmuletFont Options Exit Disclaimer Loads font for viewing Brings up a font dialog box for choosing the font Saves font AmuletFont auf format Brings up save file dialog for choosing the name and save location of the auf file Opens a separate pop up window which allows for specifying the first and last characters to convert Exits the program Converting copyrighted TrueType and bitmap fonts for the purposes of resale copyright infringement or licensing avoidance is strictly prohibited Refer to the original font s licensing agreement for additional restrictions that may apply Amulet Technologies will not be held liable for infringements made to font s licensing agreement nor will it take responsibility for the user s actions involving the use of the Amulet GEM Font Converter Create LCD Configuration If there is no matching LCD selection available the user can customize their own LCD setttings and save as a specific LCD profile On the main window of GEMstudio click on Launch LCD Profile Editor button as highlighted
47. Latin letters with diacritics and characters from Greek Cyrillic Coptic Armenian Hebrew Arabic Syriac and Tana alphabets Three bytes are needed for the rest of the Basic Multilingual Plane which contains virtually all characters in common use Four bytes are needed for characters in the other planes of Unicode which include less common CJK characters and various historic scripts binary hex decimal notes 00000000 01111100 7 0 127 US ASCII single byte 10000000 101111180 128 191 Second third or fourth byte of a multi byte sequence BF 11000000 110000000 192 193 Overlong encoding start of a 2 byte sequence but C1 code point lt 127 11000010 110111102 194 223 Start of 2 byte sequence DF 11100000 1110111HO 224 239 Start of 3 byte sequence EF 11110000 1111010R0 240 244 Start of 4 byte sequence F4 11110101 1111011H5 245 247 Restricted by RFC 3629 start of 4 byte sequence for F7 codepoint above 10FFFF 11111000 11111 01 8 248 251 Restricted by RFC 3629 start of 5 byte sequence FB 11111100 1111110HC 252 253 Restricted RFC 3629 start of 6 byte sequence FD 11111110 111111 IHE 254 255 Invalid not defined by original UTF 8 specification FF Sending strings to the Amulet which contain the font style escape byte Amulet StringField Widgets can statically set the font style
48. NOTE For more information please see Amulet Communication Protocol Amulet Format All images stored within the Amulet serial data flash are saved in an Amulet proprietary format Most images are compressed when saved but when dealing with Dynamic Image Widgets the GEMcompiler leaves the canvas image uncompressed When an external processor sends a new image serially to the Amulet the Amulet replaces the existing image stored in the serial data flash with the incoming image To keep from overwriting other files within the serial data flash the image to be sent to the Amulet must be the exact same dimensions as the canvas image The first 24 bytes of the new image to be sent to the Amulet must be identical to the first 24 bytes of the original canvas image of the Dynamic Image Widget The first 24 bytes can be found in the map file generated by the Amulet GEM Compiler for your specific project The first 12 bytes of an Amulet file are the flash header bytes The next 12 bytes are all image file specific byte 1 12 Amulet flash header bytes byte 13 of rows in pixels LSByte byte 14 of rows in pixels MSByte byte 15 of columns in pixels LSByte byte 16 of columns in pixels MSByte byte 17 image format byte 18 valid image key 5 byte 19 20 transparency flag and bytes per row byte 21 24 transparency bytes The final two byte of the image file must a CRC of the entire file using a seed of 0
49. RK KK kk kk kCk kk CkCk AA A I A k koe kk kk Function to take a byte out of the buffer RCKCKCKCkCkCkck k k K k k K K k KOK K KOK kck ck kckck kck ck ckckck KOK ck ckckck ckck ORO R char byteFromBuf RingBuf buf char byte head buf gt head byte buf gt serData head buf gt head head 1 amp RB SIZE MASK return byte k k k amp k k k amp k k ck ck k k ck k ck ck k ckck k k amp k k k kk k k ck ck k k ck ck ck k ck ck k ck ck ck ck Function to assign a serverResp value based on the byte taken out of the buffer FAR kk Ck KK Ck k KOK K K KOK K KOK KOK KOK OK K KOK K KOK K A A RA I AA KOK KOK KOK KOK R KOK OK KOR KOK A OR KOR KOR KOR char respMake char byte Response always 0 10 greater than the command return byte 0x10 amp k k k k k k k k k k K K k k K K K KOK K KOK KOK KOK KOK KOK K K KOK kk KOK kk kk K K Function to put a string onto the serial line KCKCKCKCKCkCkckck k k ck k Kk K k k K K K KOK K ck kckck kck KOK KOK K K ck ckckckckok OOO K KO void putstring char str char iloop char index 0 char value for iloop 0 iloop value str index putchar value index Basic Source Code The following BASIC source code was taken from actual server implementation based on a Basic Stamp interfaced to an Analog Devices ADXL202EB accelerometer
50. The hit method will invoke all href functions of that object forceUpdate Forces the Slider to call its initHref function immediately Only valid if initialCondition is FromlnitHref Updates the Slider and performs a hit maskedValue y Sends the intrinsic value of the Slider to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Control object to provide the input to a View Widget This method is called from a View Widget href reappear Makes the Slider visible and touchable on the LCD Counteracts the disappear method setValue x The Slider intrinsic value is changed to x setMethod m Changes the method originally specified by the Slider s href parameter only valid when the originally specified method is a single function setUARTMethod m Changes the UART method originally specified by the Slider s href parameter only valid when the originally specified method is a single function setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Slider href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function setX x Sets the x coordinate of the topleft corner of the Slider
51. Widget unspecified values continue the progression from the last specified value By specifying an initial condition that option is highlighted when the page is loaded the href function s are invoked and the value associated with that list object is used as the argument Important note The HEIGHT and WIDTH attributes for List class DO NOT specify the actual size of the List Box drawn on the screen Instead these attributes specify the size of the cell that contains the list box and the relative position of other objects on the screen The Gem code draws the box starting from the top left corner of the cell The code optimizes the width of the drawn box based on the width of the option titles and the specified font The maximum number ol visible list items that can fit in a box based on the HEIGHT attribute determines the actual height of the drawn box Any remaining list items will be hidden from view but are reachable via an arrow that allows for page scrolling through a list You can also scroll through the list an item at a time by keeping the pen down and moving above or below the drawn list box List Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the List is to start out invisible or not If the attribute is not present then by default the List is visible If the List starts out invisible the only way to make it visible again is via the IWC method reappear Parameter fillColor value See c
52. Yo k amp koko ko k k sk kk k ke KI CI koko sk k k k sk CIC ko k ko CIC ke sk k ko ke CIC CIC CIC k k k k sk k kok ko k kek sk k ko k ke k k ko ko kekok k k k ke ke x ko k ko k The main loop of this code waits for valid Client Start of Message CSOM characters then jumps to the appropriate service routine Yo k amp amp k k k k k kk k ko I k k sk k k k ke sk CIC CIC ke ke ke C CIC CIC CI CIC CIC k CK k sk sk k kok ko k k sk sk k k C CIC CI CK ko CK k CK k k kk sk kok k k X M incoming VAR byte 6 Incoming buffer e sk ck ke ke kek k kk kk I sk ko ke CI ke k k kk CIC CIC CI C CI CI k k k CIC CIC CIC CIC k k ko ke sk ke ke sk ko ke ke kek k CIC CIC CI CK ko k CIC CI C ko kk k M serin Rpin Baudmode STR incoming L E serin receive asynchronous serial data Rpin Rx instruct BASIC Stamp to use dedicated serial input pin Baudmode N9600 9600 baud 8 bit data no parity true polarity STR amuletMsg L E receive string of length 1 or until end character received into amuletMsg array is tz The command serin Rx N9600 will poll the serial line looking for serial STR incoming L E character E is encountered data up to length L or until end Incoming data will be stored in the amuletMsg array Li d d di dir dir dir dir di dir di dio di di dir dio dir di dio di dio
53. a pdb file in GEMstudio by selecting File gt Open Production File Once the gem or pdb file has been loaded into GEMstudio you can either Run the project in GEMplayer or you can Program the project into an Amulet module InField Programming This feature enables the user to program a pre compiled Amulet project file generated by GEMstudio through an external processor Please see PDB format for more information on the file format and passThru programming for programming information Palm Database Format Explaining the entire Palm database format in detail is beyond the scope of this document so only the key components will be discussed A PDB file is made up of the following key components 1 A header which describes the database 2 Alist of record entries each describing a chunk of raw data 3 And the raw data itself which is stored linearly Since a PDB can conisist of many files depending on the user interface one must know how to get to all the files in the PDB in order to remotely program the whole user interface Each file of a user interface has its own record entry in the PDB as well as the raw data that pertains to it Parsing the PDB This section will use a hex editor such as CodeWright in order to show the steps invovled in parsing through a PDB file for remote programming The following image is a snapshot of an example PDB opened in CodeWright in hex format C Program Files Amulet projects Examples Calibr
54. amp amp k k k k I k k k k amp amp k amp k k amp amp k k k k lt lt x X lt getByte ServerRespl SEO IF VarType2 5 THEN RateReturn IF VarType2 6 TimeReturn IF VarType2 7 THEN VariableReturn Variable 5 is being requested so return value stored for rate in register B20 RateReturn SEROUT 16 84 ServerRespl VarTypel VarType2 HEX2 B20 GOTO serial Variable 6 is being requested so return value stored for time in register B22 TimeReturn SEROUT 16 84 ServerRespl VarTypel VarType2 HEX2 B22 GOTO serial in Variable 7 register B21 VariableReturn SEROUT 16 84 ServerRespl VarTypel is being requested so return value stored for variable in VarType2 HEX2 B21 GOTO serial in 1 lt x x x x lt k x lt x lt k x k k K lt lt lt k k lt lt lt k k k lt lt k k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp lt amp k k lt lt x x lt Handler for getString function request Format of request string 0xD2xx wher Returns OxE2xxString Null to client Returns requested data back to the screen index of string variable 1 lt x x x x lt x x lt k lt k x k k lt lt I CK k lt lt x k k lt lt k k k k amp amp k
55. and the Amulet will become the slave for that message If the Amulet has any further master messages it will once again become the master until the external processor chooses to be the master When the Amulet is the slave the external processor can read and write to virtual dual port RAM which resides on the Amulet side The Amulet has 256 byte variables 256 word variables 199 19 character string variables and a 6 byte deep RPC buffer Amulet Widgets can have href commands that start with Amulet InternalRAM to access these virtual dual port RAM variables The command characters are the same regardless of who is the master or who is the slave This means that a Get byte variable command sent to the Amulet looks exactly like a Get byte variable command sent to the external processor Amulet as Master The Amulet communication protocol is half duplex The Amulet LCD module master can send ten different types of messages to the external processor slave You can substitute Amulet UART port with Amulet USB if you are using USB A Get byte variable request Amulet UART byte x value A Get word variable request word 2 bytes Amulet UART word x value A Get string variable request Amulet UART string x value A Get color variable request color 4 bytes Amulet UART color x value A Get label variable request Amulet UART label x value A Get byte variable array request Amulet UART bytes x value
56. and the response from the Amulet processor will also start with the Amulet ID Amulet can use either an ASCII based or CRC based communication protocol between the Amulet LCD module and your embedded device external processor New GEMstudio projects default to using the CRC protocol which is very similar in structure to Modbus RTU The external processor must be capable of RS 232 serial communications Amulet master messages are initiated either by timer events or by user input from the touch panel Amulet master messages are derived from compiled GEMstudio code stored in the data flash on the Amulet module See Appendix A for a sample implementation of the Amulet protocol on an external processor Note Amulet now defaults to using a much more secure CRC based communication protocol The ASCII protocol has been in use since 2000 and is still supported but new projects are encouraged to use the newer CRC protocol ASCII Protocol For more information on ASCII Protocol click here CRC Protocol For more information on CRC Protocol click here ASCII Protocol Amulet ASCII Communication Protocol Amulet uses an ASCII communication protocol between the Amulet LCD module and your embedded device external processor The external processor must be capable of RS 232 serial communications Amulet master messages are initiated either by timer events or by user input from the touch panel Amulet master messages are derived from compiled Amule
57. byte Return in buffer brcc try again carry cleared then invalid value so start over mov what buffer This is where we would use the value of xx now stored in which to determine where to store the value of NN now stored in what For the sake of brevity this example only handles xx 00 while all other xx are ignored cpi which 0 If offset is zero then VARO is the variable to set brne try again sts VARO what Set VARO ldi buffer SetResponse rcal putch mov buffer which swap buffer rcal nib2ascii rcal putch mov buffer which rcal nib2ascii rcal putch mov buffer what swap buffer rcal nib2ascii rcal putch mov buffer what rcal nib2ascii rcal putch rjmp try again Acknowledge valid command Convert Convert Convert Echo back MSNibb e of variab of buffer to Convert LSNibble Echo back LSNibb e of variab Done with Set comn k k k k k k k k k k k k k k k K K K Kk K K K KOK K KOK K kO KOR KK Handle I command to Invoke a function nand so start tate MSNibble into LSNibble position LSNibble of buffer to an ASC Echo back MSNibble of variable LSNibble of buffer to an ASC Echo back LSNibble of variable tate MSNibble into LSNibble position LSNibble of buffer to an ASC e NN an ASC e N
58. byte CRC Dual Master Collisions In a dual master system it is possible that both masters will choose to send a message out at the same time If the Amulet sees an incoming master message coming from the external processor while it is in the process of sending a master message of its own it will finish sending its master message and then immediately respond to the incoming message assuming it is a valid message with a valid CRC After completely responding to the master message the Amulet will then wait for a response to its own master message If the host does not respond to the Amulet message the Amulet will timeout and resend its own master message again Error Responses There are basically two types of communications errors that need to be handled by both the host and Amulet processors CRC errors due to noise on the line and invalid requests If the CRC check does not match the slave should not respond at all The master will timeout and resend its last message If an invalid request is received i e requesting or setting a variable that does not exist then the slave should respond with a NAK and an error code The NAK is defined as the opcode with the Most Significant Bit set Normally the slave would respond back with the opcode sent to them but in the case of an error instead of the opcode the slave would respond with the MSBit set plus the opcode sent to them For instance if the master was requesting a byte variable that did no
59. byte variable or InternalRAM word variable THEN function s The allowable syntax for the THEN function s string are identical to that of the HREF attribute of the tag or the HREF parameter for a Control Widget See Appendix B for available functions ELSE function s Optional The allowable syntax for the ELSE function s string are identical to that of the HREF attribute of the tag or the HREF parameter for a Control Widget See Appendix B for available functions NAME string Specifies the internal name of this meta refresh object Used for Inter Widget Communication only if then else example For example to create a META Refresh object that checks the value of InternalRAM byte 0 every 500ms and f it is less than 5 it sends out an 0 else it will send out an RPC OxFF use the following lt META http equiv Refresh content 0 5 F Amulet InternalRAM byte 0 value LT 5 THEN Amulet UART invokeRPC 0 ELSE Amulet UART invokeRPC OxFF NAME metaRPCLauncher gt switch statement example For example to create a META Refresh object that is similar to a switch statement that checks the value of InternalRAM byte 0 every 500ms and if it equals 0 it sends out RPC O if it equals 1 it sends out RPC 1 if it equals 2 it sends out an RPC 2 if it equals 3 it sends out an RPC 3 else it will send out an RPC OxFF use the following META http equivz Refresh content 0 5 IFzAmulet InternalRAM b
60. call or a group of function calls One type of function call is Inter Widget Communication IWC IWC s allow one Amulet widget to invoke the methods of another Amulet widget See Appendix B for a comprehensive listing of all available function calls See Appendix C for a detailed listing of which IWC methods apply to which widget or object as well as a more in depth description of what the IWC method actually does IWC borrows some of its syntax from Java Script a scripting language used within HTML All IWC function calls start with Amulet document The Amulet signifies that what follows is an Amulet specific command The document represents the Document Object Model Every Page has an object called document which is one large object that contains every object widget text images etc that is on that Page To put it simply document signifies that we re dealing with the current Page IWC also borrows concepts from Java an Object Oriented Programming OOP language Each widget can be thought of as an object As in OOP each object has its own set of data and a set of well defined interfaces to that data As in Java IWC refers to these interfaces as methods Methods are just functions that are specific to a particular object Each object has its own set of methods The same nomenclature as Java is used where a method is called by using the object s name followed by the dot operator followed by the method The href nomenclature for IWC
61. can read and write to virtual dual port RAM which resides on the Amulet side The Amulet has 256 byte variables 256 word variables 256 26 character string variables and a 6 byte deep RPC buffer Amulet Widgets can have href commands that start with Amulet InternalRAM to access these virtual dual port RAM variables command opcodes the same regardless of who is the master or who is the slave This means that a Get byte variable command sent to the Amulet looks exactly like a Get byte variable command sent to the external processor The one difference is the slave ID which is the first byte of every message If the host is sending a master message to the Amulet processor the message will start with the Amulet ID If the Amulet is sending a master message to the host processor the message will start with the Host ID Responses start with the same ID as the original message so if the Amulet sends a master message to the host the message from the Amulet processor will start with the Host ID and the response from the host will also start with the Host ID Conversely if the external processor sends a master message to the Amulet processor the message will start with the Amulet ID and the response from the Amulet processor will also start with the Amulet ID Amulet as Master The Amulet CRC communication protocol piggybacks on the Modbus RTU standard That means if you already support Modbus RTU communication you are almost done
62. capable of buffering incoming messages but it will not process or respond to any incoming messages until the page is fully rendered It can take up to 500ms for some complex pages to be fully rendered so if you were to send a Master Message at the beginning of a page change the Amulet might not respond back for up to 500ms later If the Amulet does respond it will have performed the request albeit maybe not exactly when you thought it should With the above in mind if your processor pounds Master Messages out at a rapid rate you might want to have all your pages start out by sending an set byte or byteOut command that lets your processor know when it is okay to start transmitting again You could also have an RPC set byte or byteOut command go out prior to leaving any page so your processor will know when to halt transmissions as well Sending A Single Byte Without A Response When it is desired to send a single byte out the UART or USB without regard to the Amulet protocol then the href command to use is Amulet UART byteOut x or Amulet USB byteOut x where x is a raw byte to send out By default x is a decimal number but if a hexadecimal number is desired precede the byte with 0x to specify a hexadecimal number For instance to send out a single 0x3D use the following Amulet UART byteOut 0x3D or Amulet USB byteOut 0x3D To send out single ASCII character use single quotes around the ASCII character For instance to se
63. has to be at the same baud rate as the page you are currently on when trying to wake it up 4800 9600 19200 38400 57600 115200 etc By default it will also program at this rate Please contact Amulet if you would like to change the default programming rate to something other than the current baud rate This requires a quick modification of the OS files 5 When entering the programming mode from software wake message there will be an OS version String output after 3 seconds The compiler uses this message to make sure the firmware and compiler version match but you can ignore this if you do not want to use it You can skip the 3 second wait by sending a 0x43 ASCII C after sending the wake up message Additionally the OS version string may contain characters which match the expected FSN but are not valid FSN characters The OS string is encapsulated with and brackets or in hex 0x7B and 0x7D respectively This means if entering program mode with the software command you should wait until after the closing bracket before looking for the FSN to begin programming 6 Xmodem has a CRC but there is an optional secondary CRC that checks the data that was actually written to the flash After sending the EOT byte 0x04 after the last packet in each file you can send what we have dubbed the EOTCRC 0x16 This will cause the Amulet color chip to calculate a new CRC based off of the data in the flash A match is indicated by an ACK
64. if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Control object to provide the input to a View Widget This method is called from a View Widget href reappear Makes the Radio Button visible and touchable on the LCD Counteracts the disappear method setMethod m Changes the method originally specified by the Radio Button s href parameter only valid when the originally specified method is a single function setUARTMethod m Changes the UART method originally specified by the Radio Button s href parameter only valid when the originally specified method is a single function setValue x The Radio Button intrinsic value is changed to x setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Radio Button href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function Can only be used on an individual Radio Button not the entire Radio Button Group setX x Sets the x coordinate of the topleft corner of the individual Radio Button to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the individual Radio Button to the coordinate specified by the word x value Sends the intrinsic value of the Radio Button to the calling widget The calling object then uses th
65. in the figure below By selecting the new LCD profile a window will pop up for user to enter their customizations GEMstudio 9 Font QY B ck QE Backend Create a New GEMstudio Project Open Existing GEMstudio Project Launch GEMcompiler Launch GEM Font Converter The LCD Profile Editor window enables user to select the manufacturer width and height part number and color depth of the LCD display This is also where initialization files can be specified The pixel clock horizontal sync and vertical sync settings can all be configured based on the requirements of the specific display File Edit View Help LCD Profile File STK 480272C Serial No ends with L tft Show Full Path Property Value Width Pixels Part Number Name of File STK 480272C Serial No ends with L Configuration Files Front Porch PixClks Vsync Settings LCD Board Chooser The LCD Board Chooser can be opened from a drop down menu Tools gt LCD Board Chooser on the top of the project window as shown in Figure 1 or the LCD tab of Project Properties when the user creates a new GEMstudio project as shown in Figure 2 GEMstudio CDjBoard hooser Trot arawu Go CSS eS LCD Profile Editor Options Create New GEMstudeo Project Q Open Existing GEMstudio Project Figure 1 Main GEMstudio Window Showing Tools Drop Down Menu gt Project Properties LCD Communication Co
66. invoked after the Touch Area senses a Swipe South gesture To be considered a Swipe South gesture the Touch Area needs to be touched by one finger and then swiped to the bottom As long as the finger continues swiping to the bottom the Swipe South gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeSouth function s will be called See Appendix B for all available functions for the onSwipeSouth event Swipe South Gesture only available on select capacitive touch panels Parameter onSwipeSouthEast value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe South East gesture To be considered a Swipe South East gesture the Touch Area needs to be touched by one finger and then swiped to the bottom and the right As long as the finger continues swiping to the bottom and the right the Swipe South East gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeSouthEast function s will be called See Appendix B for all available functions for the onSwipeSouthEast event Swipe South East Gesture only available on select capacitive touch panels Parameter onSwipeSouthWest value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe South West gesture To be considered a Swipe South West gesture the Touch Area needs to be touched by one finger and then swiped to the bottom and the left As long as t
67. is 2 This is the first byte the master uses to address the slave as per Modbus specifications If used on a peer to peer network the slave ID numbers are not that important as long as they are unique If used in a multi drop network where slave IDs are already defined it might be necessary to give the Amulet and the Host new IDs to suit the existing network Amulet Protocol Overview The Amulet system has two different ways of interfacing with an external processor One method has the Amulet LCD module as the master and the external processor as the slave The other method has the external processor as the master and the Amulet as the slave Both methods can be run concurrently on the same GEMstudio page To set the Amulet as the master the GEMstudio page needs to have href commands that start with Amulet UART The Amulet will send out the href command at an interval based upon the updateRate specified within that particular object The Amulet expects a response from the external processor within 200ms by default The Amulet does not need to be configured to be a slave If the external processor chooses to be the master it can send a valid Amulet message to the Amulet at any time or on any page and the Amulet will become the slave for that message If the Amulet has any further master messages it will once again become the master until the external processor chooses to be the master When the Amulet is the slave the external processor
68. k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp k amp k k amp amp k amp k k lt lt X ko getString ServerRespl SE2 VarType2 2 IF VarType2 Author string SEROUT 16 84 ServerRespl mon thor string THEN Company string VarTypel VarType2 GOTO serial in Company string SEROUT 16 84 ServerRespl VarTypel 2 NULL GOTO serial in Jacob Horn NULL Amulet Technologies 1 lt x x x x lt lt k ck Ck k lt kk I KI lt k k k k lt CIC k k k lt amp k k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp k k k k amp amp k k k k lt lt lt X X M where xx with rate 15 to be set variable to be set using NN Handler for setByte function request Format of request string OxD5xxNN and NN HEX data Returns OxE5xxNN to client dir d di dir di dio di dio di di di diro dir di dio dio dir diro dir dio di dio dio dios dir dio dio di di dio di dio di di dir dir dio dir di dio di dio dir di di dio dio di dir di di dir dio di dio dio dio di di dir dio di di di did setByte ServerRespl 5 5 VarType2 5 THEN Rate IF 2 6 Time Variable 5 has been called
69. message sent to the Amulet is a total of 24 bytes If a graphics primitive is sent that does not fit within the bounds of the given LCD i e a delta x of 380 pixels on a 320 x 240 LCD the Amulet will just ignore the request It will respond back serially but the graphic primitive will not be drawn Notice that the order of the color bytes that sent to the Amulet is blue green red In the HTML when specifying colors the order is red green blue Examples Drawing a Line To draw a line from 0x05 0x07 to 0x65 0x67 using color blue 0x00 green 0x00 red 0x22 and a line weight of 4 the following would be sent to the Amulet 0 09 0 30 0 30 0 30 0 35 0 30 0 30 0 30 0 37 0 30 0 30 0 36 0 35 0 30 0 30 0 36 0 37 Fd pnt 1 x pnt 1 y pnt 2 x pnt 2 y draw 0x05 0 07 0 65 0 67 line opcode 0x30 0x30 0x30 0x30 0x32 0x32 0x34 color line weight b 0x00 g 0x00 0 22 0 04 Drawing Rectangle To draw a rectangle that is 0 10 pixels wide 0x82 pixels tall has a topleft point at 0x0A 0x05 a line weight of 2 and using line color blue 0x00 green 0x00 0 00 the following would be sent to the Amulet 0x30 0x30 0x30 0x41 0x30 0x30 0x30 0x35 0x30 0x31 0x30 0x43 0x30 0x30 0x38 0x32 d pnt 1 x pnt 1 y delta x delta y draw 0x0A 0x05 0x10C 0x82 rectangle opcode 0x30 0x30 0x30 0x30 0x30 0x30 0x32
70. name such as Value Amulet document widgetName setUpdateRate f Amulet document widgetName setValue x Amulet document widgetName setVariableNumber x Amulet document widgetName setX x Amulet document widgetName setY x Amulet document widgetName startUpdating Amulet document widgetName stopUpdating Amulet document widgetName toggleRegionColor Amulet document widgetName toggleStringColor Amulet document widgetName toggleUpdating The update rate for the named widget will change to f where f is a floating point number that represents the update rate in seconds The named widget will receive the intrinsic value of the calling widget where x is the intrinsic value The variable number used in the href of the named widget will change to x where x is the variable index used in the following variable types byte x word x or string x The named Widget will change its topleft x coordinate to the word value x The named Widget will change its topleft y coordinate to the word value x The named View Widget will start updating the displayed data The named View Widget will stop updating the displayed data The named widget will either start or stop displaying in reverse video The named widget s text string will either start or stop displaying in reverse video The named View Widget will either start or stop updating the displayed data 1 Regarding x For Control Widge
71. named widget s text string will either start or stop displaying in reverse video Changes current state of View Widget either starts or stops updating the displayed data Scribble widget uploads its raw image data via the connection and protocol described in the href parameter Returns the intrinsic value of the Control Object The calling object then uses that value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href The value could be a BYTE WORD or STRING depending upon the type of data of the Control Object Table 2 IWC method descriptions ungique to Animated Image Objects IWC Methods fastSpeed oneFrame pause play playBackwards playForward regularSpeed Description of method for animated images Increases animation speed Advances animation one frame Stops animation Starts animation in current direction Starts animating backwards Starts animating forward Normal animation speed slowSpeed superFastSpeed superSlowSpeed Decreases animation speed Fastest animation speed Slowest animation speed Table 3 Matrix of supported IWC methods for Widgets and Objects IWC methods clearCanvas disappear forceHit forceUpdate inverseRegionColor inverseStringColor nextEntry normalRegionColor normalStringColor previousEntry reappear reset
72. not then the packet should be disregarded as the integrity of the data cannot be assured For example a master message from the Amulet chip requesting the value of byte variable 5 would look like this 0 02 0x20 0 05 0 09 Where 0x02 Host Processor slave ID 0x20 Request byte variable Amulet opcode 0x05 Byte variable index 5 0x09 CRC LSByte 0xC3 CRC MSByte Running 0x02 0x20 0x05 through the CRC algorithm results in the 16 bit number 0xC309 Code for the CRC algorithm define CRC_SEED OxFFFF define CRC_POLY OxA001 int calcCRC char ptr int count unsigned short crc CRC SEED initialize CRC int i while count gt 0 crc crc ptr for i28 120 i if crc amp 0 0001 crc gt gt 1 CRC_POLY else crc gt gt 1 Serial Protocol Analyzer With the permission of Docklight Amulet has provided a link to the trial version of Docklight on the download link page which you must install separate from the Amulet GEMstudio By installing Docklight you adhere to the End User License Agreement set forth by Docklight during the install If you would like to purchase the full version of Docklight you can do so by going to Docklight s web site http www docklight de To install the trial version of Docklight follow this download link http www docklight de Follow the onscreen directions to complete the rest of this installation
73. on the LCD Added cfgUSBDelay to the cfgAmulet ini file Adds a default 500ms delay after enumeration to keep from having a USB communication error while programming the serial data flash Changes for GEMstudio version 1 4 0 0 Bug Fixes Fixed overzealous text clipping mainly in stringFields GEMplayer wasn t initializing the comm ports correctly so baud rate remained at last state Line Graphs now update following a reappear StringFields now correctly handle the inverseStringColor and inverseRegionColor Was erroneously not redrawing the text if the string had not changed StringFields now update following a reappear even if the string has not changed GEMplayer can now display the OS version from the Amulet internal OSversionString value call Fixed bug in GEMstudio layout mode when copying and pasting objects Forced that object to have an absolute address instead of relative so the project became more likely to be machine dependent GEMplayer can now support comm ports 10 and above Earlier beta only supported comm ports up to 9 Fixed bug in List widget when the up and down arrows were not present Fixed bug in Animated Bitmaps StringField NumericField and ImageBar widgets If using dual frame buffer starting with version 1 3 0 0 the display would be redrawn at the given updateRate of any of these widgets This potentially would slow the entire system down unnecessarily Fixed memory overwrite problem caused by images tha
74. on the lower left hand corner of the project window or press F1 A help window will pop up and explain the selected widget or parameter Href Editor To add function to the widget the user can include href functions when modifying the widget The user just has to click on the Value next to the Href Property for that particular widget as shown below lt gt GEMstudio Untitled Top Left Bottom Right 114 218 157 261 Width x Height 44 x 44 A new Href Editor window will pop up An example of the Href Editor window is shown below Event Method List Edit Foldings Tools 1 0 Press Tab For Options To customize the look and feel of the Href Editor select options from the drop down Tools menu on the top of the Project window Options Code Editor Java Syntax Highlighting Keywords Bold C Italic C Underline Comments Bold Italic C Underline Strings C Bold Italic C Underline Numbers Bold C Italic C Underline Autocomplete Applies Standard Case Auto Close Brackets Auto Indent New Lines Highlight Block When Hovering Mouse Over Gutter Circle Matching Brackets Display Line Numbers user customize the Editor with the following options Syntax Highlighting 1 Keywords customize the color from a color picker that pops up when you click on the color selection and font style bold italic and or underline Comments c
75. previous example Amulet UART invokeRPC 5 would be called first and then a hyperlink to page2 open would follow As soon as a page is linked to any subsequent function calls are discarded For this reason if it is desired to link to another page that must be the last function call within a multiple function call Important notes regarding the order of multiple function calls If there is a mix of UART and InternalRAM or IWC function the functions might not be performed from left to right The reason for this is that UART functions are loaded into UART transmit buffer whereas InternalRAM and IWC functions are loaded into a different function buffer Due to the nature of UART transmissions they will take a considerable amount of processor time to complete the function call in comparison to InternalRAM and IWC functions Therefore any InternalRAM or IWC function which is part of a multiple function call will most likely be finished prior to any UART function call which is part of the same multiple function call Sequenced Function Calls Control Objects Widgets can also call sequenced functions by separating the functions by semi colons Sequenced functions allow for different function calls at each successive hit Sequenced function calls are performed in the order they are entered on the line from left to right The sequences continually wrap so the first sequence follows the last sequence To illustrate how to use sequenced function
76. received If UNCHECKED or the attribute is not present the Custom Slider handle momentarily starts at the minAt location until the initHref function receives its data If waitForlnit not specified the default is UNCHECKED FunctionButton Function Button Widget FunctionButton class image depending upon the button type to invoke a function or set of functions when hit By default function button images appear to depress when touched You can also setup the button Function Button Widget image to shade when touched with the alpha color By default when hit a button invokes a function or set of functions Optionally function buttons can be set to auto repeat while pressed Initial delay and repeat frequency can both be customized Each button can have a user defined label text or numeric within the button image If the label is specified as frominitHref the label will be based upon a string variable that is passed from the initHref function at run time The label text will automatically wrap if the string exceeds the width of the function button User defined wraps can be specified by entering An at the point of the desired wrap Function buttons can also be set up to auto repeat When pressed an auto repeat button delays a user defined amount of time then invokes a function or set of functions at a user defined frequency while the button is still being pressed As a side benefit of the auto repeat functionality a but
77. s is Amulet document widgetName method Where Amulet is the Amulet script escape telling the compiler that Amulet specific commands follow document is the name of the Document Object Model the generic name for the current page widgetName is the user defined name of the called widget method is the name of the method the called widget is to perform Control Widgets Objects using IWC can send data to other widgets objects or invoke other widgets objects methods View Widgets using IWC can request data from Control Widgets In addition to widgets there are other objects that have methods that can be invoked using IWC Images and animated images referred to as View Objects have methods that Control Widgets Objects can call To use IWC the widget object to be called must have a name See WidgetsColor on how to specify a name for an Amulet widget To perform IWC methods on Control View Objects except META REFRESH make sure the widget object has a unique name For example to create a radio button to change the playback speed of an animated GIF do the following 1 First add the animated image onto the page i e Runner gif 2 Next use the following radio button href Amulet document Runner slowSpeed 3 When the radio button is selected the animated image will start playing back at a slower speed To perform IWC methods on a META REFRESH append NAME user defined name to the CONTENT attribute For example
78. setting hrefOnHitOnly to CHECKED the href will only be launched upon the check box physically being selected or upon a forceHit call Parameter initHref value function Specifies the function called when the page is loaded Use this attribute when FromlnitHref is used as the initialCondition All boxes within a group must have the same function s If part of a group the function must return a BYTE value and the value returned is compared to the checkedValue If the checkedValue bit is set in the returned value the box will initially start out in the on position If a lone check box then the returned value is compared to the internalNumber and if equal the lone check box initially starts out in the on position See Appendix B for all available functions Parameter internalNumber value number Specifies the internal number of the lone checkbox which is used to determine if the initial condition of the lone check box is on or off if FromlnitHref is used as the initialCondition Should only be used if using initHref If the value returned from the initHref function matches the internalNumber of the lone check box then the check box starts out in the on position If the internalNumber is not specified the checkedValue is used instead Parameter trackinglmage value image Specifies the image to use when the checkbox is in the pen down state If this attribute is not present then a default image a black and white squar
79. specified by the word setY x Sets the y coordinate of the topleft corner of the Linear Gauge to the coordinate specified the word x List disappear Makes the List not visible or touchable on the LCD forceHit List performs its hit method without user input The hit method will invoke all href functions of that object forceUpdate Forces the List to call its initHref function immediately Only valid if initialCondition is FromlnitHref Updates the List and performs a hit maskedValue y Sends the intrinsic value of the List to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Control object to provide the input to a View Widget This method is called from a View Widget href nextEntry Highlighted box of a list box widget moves to next entry in the list Effectively moves the highlighted box down one entry Does NOT automatically perform a hit method previousEntry Highlighted box of a list box widget moves to previous entry in the list Effectively moves the highlighted box up one entry Does NOT automatically perform a hit method reappear Makes the List visible and touchable on the LCD Counteracts the disappear method setMethod m Changes the method originally specified by the List s href parameter only valid when the ori
80. the word x setY x Sets the y coordinate of the topleft corner of the Dynamic Image to the coordinate specified by the word x Function Button buttonDown Sets the Function Button Widget to look like it is its down state This method does NOT invoke the href functions It only affects the looks of the button not the functionality buttonUp Sets the Function Button Widget to look like it is its up state This method does NOT invoke the href functions It only affects the looks of the button not the functionality disappear Makes the Function Button not visible or touchable on the LCD forceHit Function Button performs its hit method without user input The hit method will invoke all href functions of that object forceUpdate Forces the Function Button to call its initHref function immediately Only valid if label is frominitHref Updates the Function Button label without performing a hit maskedValue y Sends the intrinsic value of the Function Button to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Function Button to provide the input to a View Widget This method is called from a View Widget href reappear Makes the Function Button visible and touchable on the LCD Counteracts the disappear method setMethod m Changes the method ori
81. the Amulet receives a Set or Draw command by default it responds back with the corresponding response byte followed by an echo of all the bytes sent to the Amulet To cut back on unnecessary bytes the SlaveAckRsp META tag attribute can be used Instead of sending an echo of the entire message it will only respond with an ACK OxFO If no response is desired the SlaveNoRsp attribute can be used Examples lt META NAME Amulet Content SlaveAckRsp Project gt META NAME Amulet Content SlaveNoRsp Project gt Amulet Protocol Overview The Amulet system has two different ways of interfacing with an external processor One method has the Amulet LCD module as the master and the external processor as the slave The other method has the external processor as the master and the Amulet as the slave Both methods can be run concurrently on the same page To set the Amulet as the master the page to be compiled needs to have href commands that start with Amulet UART port or Amulet USB where port can be comm or prog If no port is specified then it defaults to comm The Amulet will send out the href command at an interval based upon the updateFreq specified in the widget The Amulet expects a response from the external processor within 200ms by default The Amulet does not need to be configured to be a slave If the external processor chooses to be the master it can send a valid Amulet message to the Amulet at any time or on any page
82. to help speed up page transitions noSDRAM parameter added to Check Box Custom Button Function Button Radio Button Allows ability to save SDRAM and potentially speed up page transitions although each widget loses certain abilities if SDRAM is not used The default state is to use SDRAM on all widgets e In many objects that contained images with transparency it was required for the user to specify that the image had transparency GEMstudio now internally sets the transparency flag if the image in question has transparency properties without any action required by the developer e SDRAM and Serial Data Flash Size now specified in the LCD Configuration Amulet GEMstudio Copyright 2000 2013 by Amulet Technologies LLC 2003 2013 Amulet Technologies U S amp European Patents Granted Other Patents Pending GEMstudio Graphical Operating System Graphical OS Chip KHTML are Trademarks of Amulet Technologies Warranty Information AMULET TECHNOLOGIES LLC Warranty Information For a period of one 1 year ninety 90 days for products with glass from the date of shipment Seller warrants to Buyer that products delivered hereunder shall comply with the applicable Seller s Data Sheet or the mutually agreed upon specifications and shall be free from defects in material and workmanship under normal use and service All other products including but not limited to products which are loaners products shipped on cons
83. to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Slider to the coordinate specified by the word x value Sends the intrinsic value of the Slider to the calling widget The calling object then uses that value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href String Field disappear Makes the String Field not visible on the LCD forceUpdate Forces the String Field to call its href function immediately regardless of the updateRate inverseRegionColor Makes the entire String Field both the background and the text display in reverse video Counteracts the normalRegionColor method inverseStringColor Makes the String Field s text string display in reverse video Counteracts the normalStringColor method normalRegionColor Makes the entire String Field both the background and the text display in normal video Counteracts the inverseRegionColor method normalStringColor Makes the String Field s text string display in normal video Counteracts the normalStringColor method reappear Makes the String Field visible on the LCD Counteracts the disappear method setValue x String Field uses x as an input This allows a Control Widget to provide the input to a String Field setMethod m Changes the method originally specified by the String Field s href parameter setUARTMethod m
84. trigger statement By having multiple THEN statements the meta can be used like a switch statement The IF attribute is like a View Widget s HREF parameter The THEN and ELSE attributes are like a Control Widget s HREF parameter CONTENT fields are described below updateRate delayRate The updateRate specifies the frequency that the IF function is called specified in seconds with a single floating point number The range is 0 00 655 35 0 00 means update never The delayRate specifies the delay time from when the page is loaded until the initial ONVAR function is called specified in seconds with a single floating point number The range is 0 01 655 35 If the delayRate is not specified then the delay time defaults to the updateRate frequency value If the delayRate is specified and the updateRate is 0 00 then the IF function s is called after the delay time specified by the delayRate and does not update again IF function The value returned by this function call is used to trigger the function s in THEN The behavior and syntax of this META attribute is identical to that of the HREF parameter for a View Widget See Appendix B for available functions EQ GT LT NEQ number This attribute specifies the value and condition that triggers the THEN function s If the value returned from the IF function meets the condition the immediately following THEN function s is called The value of number can be a byte word InternalRAM
85. used Parameter fulllmage value image Specifies the image to use when the radio button is in the set state If this attribute is not present then a default image the Amulet logo is used Parameter hrefOnHitOnly value CHECKED or UNCHECKED Specifies if the radio button href function s is launched only upon a hit not By default hrefOnHitOnly is UNCHECKED which means if the radio button has an initHref function the href of the radio button which starts out on is launched upon loading the page The href is also launched after a forceUpdate call By setting hrefOnHitOnly to CHECKED the href will only be launched upon the radio button physically being selected or upon a forceHit call Parameter initHref value function Specifies the function called when the page is loaded Use this attribute whenever FromlnitHref is used as the initialCondition All radio buttons within a group must have the same initHref function The value of the data returned from the initHref function must match the internalNumber of one of the radio buttons in the group If there is See Appendix B for all available functions Parameter internalNumber value number Specifies the internal number of the radio button used by the OS to determine which radio button is on Should only be used if using initHref Each button within a radio button group must have a unique internal number If the value of the data returned from the initHref fun
86. using two or more fingers To be considered a Multi Touch Tap the Touch Area needs to be touched by two or more fingers for 150ms or less It is possible to adjust the time required to be considered a multi touch tap by contacting Amulet Technologies See Appendix B for all available functions for the onMultiTouchTap event Multi Touch Tap Gesture only available on select capacitive touch panels Parameter onPinch value function s the function or multiple sequenced functions invoked after the Touch Area senses the Pinch gesture The Pinch gesture is sensed when the Touch Area is touched by two fingers that are apart and then pinched in together As long as the two fingers are pinching in the Pinch gesture will be sensed See Appendix B for all available functions for the onPinch event Pinch Gesture only available on select capacitive touch panels Parameter onSlideOff value function s the function or multiple sequenced functions invoked after touching the Touch Area then sliding off the Touch Area while still making contact with the touch panel The Slide Off event will only launch once for every Slide Off occurrence It is possible to have multiple Slide Off occurrences if the finger slides back on the Touch Area and then off again See Appendix B for all available functions for the onSlideOff event Parameter onSlideOn value function s the function or multiple sequenced functions invoked after touching the Touch Ar
87. very very very very 1 Circle Matching Brackets CHECKED or UNCHECKED If CHECKED GEMstudio will circle the matching brackets as the user closes the bracket 2 Display Line Numbers CHECKED or UNCHECKED If CHECKED GEMstudio will display line number a gutter on the left of the Page Functions Editor Href Editor Tips 1 Auto complete is activated with the TAB key If the cursor is not at the end of a line auto complete will not show visual gray The user must hit TAB to show the available options If the cursor is at the end of a line and there are multiple options available the user must hit TAB to show options However if there is only one option available hitting TAB will auto complete the visually grayed function style comments are supported as shown the Figure below Auto complete is not available inside comments Event Method List Edit Foldings Tools 1 28 1 xample 1 of Href Editor Amulet document MyScribble disappear 4mulet document MyScribble reappear gt 1 The user can fold and unfold blocks of comments unlike the Page Functions Editor for easier reading and navigation The user can access these commands from the Folding drop down menu Arrows shown in the left gutter of the editor can also be used to collapse or expand blocks of code An example is shown below Event Method List Edit Foldings Tools 5 0 1 J Example 1 of Href Editor
88. which uses Internal RAM variables as both a variable index as well as an argument It can be a little confusing to look at though The following is a valid href Amulet InternalRAM word InternalRAM byte 5 setValue InternalRAM word 6 Which would result in the Internal RAM word variable number defined by the value of InternalRAM byte variable 5 set to the value of Internal RAM word variable 6 Note regarding using InternalRAM string variable for a button label When using an InternalRAM string as the label for a button which is using FromlnitHref as its label the initHref parameter of the button should look like Amulet InternalRAM label x value where is the index of the Internal RAM string variable There is not a separate bank of Internal RAM label variables this function will return the string associated with Internal RAM string variable 4 x Due to the requirement of the button to have a label returned to it it was necessary to create an InternalRAM label variable but it shares the exact same memory space as the Internal RAM string variables The Internal RAM label should only be used in this application Initializing Internal RAM variables at compile time By default all Internal RAM variables are initialized to zero You can initialize Internal RAM variables at compile time by including an initialization file in your project The initialization file must have an ini extension You can include the initialization file in yo
89. widget object only valid when the originally specified method is a single function Cannot be used as part of a multiple href function Changes the update rate originally specified by the widget object Argument is a floating point number specifying time in seconds Cannot be used as part of a multiple href function Object receives the value of the calling object This allows a Control Widget to provide the input to a View Widget This method is called from a Control Widget href The type of data can be either a BYTE WORD or STRING The variable number used in the href of the named widget will change to x where x is the variable index used in the following variable types byte x word x or string x The y gets changed to the argument specified in setVariableNumber x Changes the X coordinate of the top left corner of the named widget object Should be preceded by a disappear method and followed by a reappear method setY x 19 startUpdating stopUpdating toggleRegionColor toggleStringColor toggleUpdating uploadimage value Changes the Y coordinate of the top left corner of the named widget object Should be preceded by disappear method and followed by a reappear method View Widget starts updating the displayed data Counteracts the stopUpdating method View Widget stops updating the displayed data The named widget will either start or stop displaying in reverse video The
90. 0x00 or Amulet USB byteOut 0x00 immediately following the streamOut function call separated by a comma such as Amulet UART stringOut 123 ABC Amulet UART byteOut 0x00 Amulet USB stringOut 123 ABC Amulet USB byteOut 0x00 As is the case with the byteOut function call the GEM Graphical OS Chip is not expecting nor accepting any responses to the stringOut function call Graphic Primitives See Graphic Primitives for more information regarding the use of graphic primitives Table 2 defines the three types of messages regarding graphic primitives that can be sent between an external processor and the Amulet If a graphics primitive is sent that does not fit within the bounds of the given LCD i e a delta x of 380 pixels on a 320 x 240 LCD the Amulet will not draw the graphic primitive Message Byte 1 Byte 2 Byte 3 Byte4 Byte5 Byte6 Byte7 Byte8 Byte9 Draw Line OxD9 Pnt1X Pnt1X Pnt1X Pnt1X Pnt1Y Pnt1Y Pnt1Y Pnti1Y Primitive Hi Byte HiByte Lo Byte LoByte HiByte HiByte Lo Byte Lo Byte Hi Lo Hi Lo Hi Lo Hi Lo Nibble Nibble Nibble Nibble Nibble Nibble Nibble Nibble Byte 10 Byte 11 Byte12 Byte13 Byte14 Byte15 Byte16 Byte17 Byte18 Byte 19 Pnt 2 X Pnt2X Pnt2X Pnt2X Pnt2Y Pnt2Y Pnt2Y Pnt2Y Blue Blue Hi Byte Hi Byte Lo Byte Lo Byte HiByte HiByte Lo Byte Lo Byte Hi Lo Hi Nibble Lo Hi Lo Hi Lo Hi Lo Nibble Nibble Nibble Nibble Nibble Nibble Nibble Nibble Nibble Byte 20 Byte 21 Byte22 Byte23 Byte 24 Green Green Red Red L
91. 0x34 Set byte variable array 0x35 Set word variable array 0x36 Set color variable array 0x37 Invoke RPC X 0x40 Set Graphic Primitive 8 bit color 0x41 Set Graphic Primitive 32 bit color 0x42 Set Graphic Primitive InternalRAM color index 0x43 Set Graphic Primitive Line Weight 0x44 Draw Pixel 0x45 Draw Line 0x46 Draw Rectangle 0x47 Draw Filled Rectangle 0x50 Jump To Page Table 4 Listing of all Amulet CRC protocol command opcodes and response opcodes CRC Based Graphic Primitives Using GEMstudio to create your projects at compile time allows you to make rich user interfaces quickly and easily Sometimes though the ability to draw graphic primitives like lines rectangles and filled rectangles at runtime is needed GEMstudio does not inherently give you the ability to do this The CRC based protocol allows the external processor to send unsolicited graphic primitives to the Amulet The drawing of these graphic primitives is independent of the uHTML that is currently being run on the Amulet You do need to keep in mind that the UHTML will still be running so any widgets or objects that write to the LCD might write over the graphic primitives you send to the LCD There are four graphic primitive commands used to set the color and weight of the lines used The color and line weight should be sent prior to sending the actual graphic primitive drawing commands Once the color and line weight is set it does not need to be resent unle
92. 1 Y Hi Byte Hi Nibble Byte 16 Delta Y Lo Byte Hi Nibble Byte 6 Pnt 1 Y Hi Byte Hi Nibble Byte 16 Delta Y Lo Byte Byte 7 Pnt1 Y Hi Byte Lo Nibble Byte 17 Delta Y Lo Byte Lo Nibble Byte 7 Pnt1 Y Hi Byte Lo Nibble Byte 17 Delta Y Lo Byte Byte 8 Pnt 1Y Lo Byte Hi Nibble Byte 18 Blue Hi Nibble Byte 8 Pnt 1Y Lo Byte Hi Nibble Byte 18 Blue Byte 9 Pnt 1Y Lo Byte Lo Nibble Byte 19 Blue Lo Nibble Byte 9 Pnt 1Y Lo Byte Lo Nibble Byte 19 Blue Hi Nibble Byte 20 Green Hi Nibble Message Amulet Response Byte 10 Delta X Hi Byte Hi Nibble Byte 20 Green Hi Nibble Lo Nibble Byte 21 Green Lo Nibble Byte 1 OxEB Byte 11 Delta X Hi Byte Lo Nibble Byte 21 Green Lo Nibble Hi Nibble Byte 22 Red Hi Nibble Byte 2 Pnt 1X Hi Byte Hi Nibble Byte 12 Delta X Lo Byte Hi Nibble Byte 22 Red Hi Nibble Lo Nibble Byte 23 Red Lo Nibble Byte 3 Pnt 1 X Hi Byte Lo Nibble Byte 13 Delta X Lo Byte Lo Nibble Byte 23 Red Lo Nibble Hi Nibble Byte 24 Line Weight Byte 4 Pnt 1 X Lo Byte Hi Nibble Byte 14 Delta Y Hi Byte Hi Nibble Byte 24 Line Weight Lo Nibble Byte 5 Pnt 1 X Lo Byte Lo Nibble Byte 15 Delta Y Hi Byte Lo Nibble Hi Nibble Byte 6 Pnt 1 Y Hi Byte Hi Nibble Byte 16 Delta Y Lo B
93. 2pt Parameter fontColor value See color entry conventions Specifies the desired font color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value PLAIN or BOLD or ITALIC Specifies the style associated with the button label font The available font styles are e PLAIN The option text is standard font i e text e BOLD The option text is bold i e text e ITALIC The option text is italicized i e text Parameter href value function s The function or multiple sequenced functions invoked when the button is hit See Appendix B for all available functions for the Custom Button widget Parameter onButtonPress value ALPHA or CUSTOM or DEPRESS Specifies the look of the button during a pen down condition CUSTOM causes the downlmage to appear and label text if any to shift down and to the right to give the illusion of being pressed ALPHA blends a transparent color specified by alphaColor with the uplmage and prohibits the downlmage from appearing DEPRESS gives the illusion of the button being pressed using only the uplmage and the downlmage will not appear CUSTOM is the default valuez image Image used when custom button is not pressed Image file must be of type GIF JPG or PNG Parameter cachelmage valuez CHECKED or UNCHECKED A checkbox that specifies to GEMst
94. 5 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If the second number is not specified then the delay time defaults to the value of updateFreq Parameter waitForlnit value CHECKED or UNCHECKED Specifies if the Linear Gauge pointer will wait for valid data before being displayed on the linearlmage If CHECKED the Linear Gauge pointer will not display until valid data is received If UNCHECKED or the attribute is not present the Linear Gauge pointer starts at the minAt location until the first packet of data is received Optional Linear Gauge Parameter Attributes Parameter orientation value HORIZONTAL or VERTICAL Specifies if the pointer icon is to travel horizontally or vertically The orientation parameter will override the orientation determined by the height and width dimensions Parameter pointerOffset valuez number Specifies the number of pixels from the center of the channel the handle is located If a vertical slider positive numbers shift the handle to the right and negative numbers shift it to the left If a horizontal slider positive numbers shift the handle to the bottom and negative numbers shift it to the top The range is 100 through 100 Field Field Widget N
95. 5 setValue My String gt To launch to Page1 when the value of external byte variable 1 is greater than OxCO which is polled every 500ms to Page2 if the value is less than 0x40 use the following META REFRESH objects lt META HTTP EQUIV REFRESH CONTENT 0 5 ONVAR Amulet UART byte 1 value TRIGGER GT 0xC0 URL setValue Page1 open gt META HTTP EQUIV REFRESH CONTENT 0 5 ONVAR Amulet UART byte 1 value TRIGGER LT 0x40 URL setValue Page2 open gt Amulet Communication Protocols The Amulet system has two different ways of interfacing with an external processor using UART or USB One method has the Amulet LCD module as the master and the external processor as the slave The other method has the external processor as the master and the Amulet as the slave Both methods can be run concurrently on the same GEMstudio page To set the Amulet as the master the GEMstudio page needs to have href commands that start with Amulet UART port or Amulet USB where port can be comm or prog If no port is specified then it defaults to comm The Amulet will send out the href command at an interval based upon the updateRate specified within that particular object The Amulet expects a response from the external processor within 200ms by default The Amulet does not need to be configured to be a slave If the external processor chooses to be the master it can send a valid Amulet message to the Amulet at any time
96. 54 0 00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Optional Line Graph Parameter Attributes Parameter axisColor value See color entry conventions Specifies the desired linegraph axis color See section on colors for more information If no axis color is specified the default color is black This attribute is only applicable when showAxis is CHECKED Parameter columnClear value CHECKED or UNCHECKED Specifies if the Line Graph is cleared a column at a time instead of the entire background at a time If CHECKED flicker may be minimized but graph updates will take longer Parameter enableVertical valuez CHECKED or UNCHECKED Specifies if the Line Graph can have vertical lines or not If CHECKED then two data points are needed for every plot point If a vertical line is not desired then both points should be the same value Basically every x coordinate gets two y coordinates So if xSamples is set to 10 you will need to furnish the Line Graph with 20 data points If this attribute is not present it defaults to false Parameter showAxis valuez CHECKED or UNCHECKED Specifies if the Line Graph is to have an x and y axis frame By default the Line Graph does not have a frame Checking showAxis will cause the Line Graph to have a frame Line Plot Line Plot Widget LinePlot class The Line Plot Widget is a live 2 dimensional line plot that represents a byte or word ret
97. 7F are valid The Amulet protocol expects any characters above 0x7F to be in the UTF 8 format See the documentation on UTF 8 below In order for the Amulet to display characters over 0x7F the font used to display these characters must have those characters explicitely defined in the amf file By default only the characters 0x20 0x7F are saved in the amf file but in the Amulet GEM Font Converter you can optionally save all the characters up to 0xFFFF UTF 8 UTF 8 8 bit Unicode Transformation Format is a variable length character encoding for Unicode Like UTF 16 and UTF 32 UTF 8 can represent every character in the Unicode character set but unlike them it has the special property of being backwards compatible with ASCII UTF 8 encodes each character code point in 1 to 4 octets 8 bit bytes The first 128 characters of the Unicode character set which correspond directly to the ASCII use a single octet with the same binary value as in ASCII UTF 8 encoding is variable width with each character represented by 1 to 4 bytes Each byte has 0 4 leading consecutive 1 bits followed by a 0 bit to indicate its type 2 or more 1 bits indicates the first byte in a sequence of that many bytes The scalar value of the Unicode code point is the concatenation of the non control bits In this table zeros and ones in black represent control bits each x represents one of the lowest 8 bits of the Unicode value y represents the next higher
98. 8 bits and z represents the bits higher than that Unicode range Encoded Bytes Example Hex Binary U 0000 0000000010 U 0024 to Od LTD 00100100 U 007F 00100100 0x24 U 0080 00000000 10000000 110yyyxx10 U 00A2 to to 00000000 10100010 U 07FF 00000111 11111111 gt 11000010 10100010 0xC2 0xA2 U 0800 00001000 00000000 1110yyyy10 U 20AC to to yyyyxx10 00100000 10101100 JT ILILILILIL XXXXXX 11100010 10000010 10101100 0xE2 0x82 OxAC So the first 128 characters US ASCII need one byte The next 1 920 characters need two bytes to encode This includes Latin letters with diacritics and characters from Greek Cyrillic Coptic Armenian Hebrew Arabic Syriac and Tana alphabets Three bytes are needed for the rest of the Basic Multilingual Plane which contains virtually all characters in common use Four bytes are needed for characters in the other planes of Unicode which include less common CJK characters and various historic scripts With these restrictions bytes in a UTF 8 sequence have the following meanings The ones marked in red can never appear in a legal UTF 8 sequence The ones in green are represented in a single byte The ones in blue must only appear as the first byte in a multi byte sequence and the ones in orange can only appear as the second or later byte in a multi byte sequence UTF 8 byte range Interpretation
99. 83 23 232 23 1 2 E 7 53 23 232 23 1 1 142 0 83 112 53 82 D 0 52 2 Table 1 Image Sequence Example Image Sequence Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Image Sequence is to start out invisible or not If the attribute is UNCHECKED then by default the Image Sequence is visible If the Image Sequence starts out invisible the only way make it visible again is via the IWC method reappear Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Image Sequence widget The function is called at an update rate specified by the updateRate attribute Parameter max value number Maximum value returned from the href function must be greater than min If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 OxFFFF Parameter min value number Minimum value returned from the href function must be less than max If the function returns a byte the range is O 254 0 00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Parameter sequence value image1 image2 image3 etc List of images used separated by semicolons Images can be either GIF JPG or PNG The range is 1 255 images Parameter updateFreq value number
100. AM word z maskedV amp leie x the value of Internal RAM word variable z ANDed with the Amulet InternalRAM word z mul x mask x Multiply the Internal RAM word variable z by the word value x Result is stored in Internal RAM word variable z Amulet InternalRAM word z setValue amp bt the value of Internal RAM word variable z to the word value x Amulet InternalRAM word z sub x Subtract the word value x from the Internal RAM word variable z Result is stored in Internal RAM word variable z Amulet InternalRAM word z value Return the value of Internal RAM word variable z Amulet InternalRAM word z xor x Logically EXCLUSIVE OR the Internal RAM word variable z with the word value x Result is stored in Internal RAM word variable z Table 3 InternalRAM color method descriptions InternalRAM Color Methods Descriptions Amulet lnternalRAM color z set x Sets the Internal RAM color variable z to x using color entry conventions Amulet lnternalRAM color z setBlue x Sets the Blue Byte of Internal RAM color variable z to x Amulet InternalRAM color z setGreen x Sets the Green Byte of Internal RAM color variable z to x Amulet InternalRAM color z setRed x Sets the Red Byte of Internal RAM color variable z to x Amulet InternalRAM color z value Returns the 32 bit value of Internal RAM variable color z Table 4 InternalRAM string method descriptions InternalRAM String Methods Descriptions Amulet InternalRAM string z a
101. AR Amulet UART byte 5 value value InternalRAM byte 5 gt The above example will request the value of external byte variable 5 once 10ms after loading the page and save that value into InternalRAM byte variable 5 lt META HTTP EQUIV Refresh CONTENT 0 0 01 ONVAR Amulet UART words 0 array 4 value InternalRAM words 0 gt The above example will request the value of external word variables 0 3 once 10ms after loading the page and save that value into InternalRAM word variables 0 3 4 Be a container object byte word or string variable META HTTP EQUIV REFRESH CONTENT 1st number 2nd number ONVAR function URL Amulet nop VALUE number lt gt This meta tag does not need to call any functions It exists to hold a variable value either BYTE WORD or STRING Other control objects widgets can set the value of this variable by using Amulet document name setValue and the value of the variable can be read by using Amulet document name value where name is the internal name given in See note regarding Control Object intrinsic values With the addition of InternalRAM variables using the META as a container object is not needed InternalRAM uses less uHTML space as well as the additional benefit of existing outside of a specific page META objects are only valid in the page that they are defined in and will be reinitialized every time the page is re entered InternalRAM can surv
102. Also resets timers in anchors and META refresh tags Redraws the canvas image from flash for scribble dynamic image Saves the current state of the canvas to the flash Writes over the original canvas specified at compile time Sets the line weight for the scribble widget range 1 15 Changes the href method originally specified by the widget object only valid when the originally specified setOnVarMethod m 2 setOnVarUARTM ethod m setOnVarVariableNumber x setTrigger x setUARTMethod m setUpdateRate f setValue x setVariableNumber x 19 method is single function Cannot be used as part of a multiple href function Changes the ONVAR method originally specified by the widget object only valid when the originally specified method is a single function Cannot be used as part of a multiple href function Changes the ONVAR UART method originally specified by the widget object only valid when the originally specified method is a single function Cannot be used as part of a multiple href function Changes the variable number originally specified by the object s onVar parameter Can be used only if the object s onVar has a byte y word y or string y In all cases the y gets changed to the argument specified in setOnVarVariableNumber x Changes the equal gt or It value originally specified by the object to the byte value x Changes the href UART method originally specified by the
103. Amulet 0 02 0 36 Variable Countof Value Value Value Last Value CRC CRC Set Color Start Colors in Bits Bits 23 16 Bits 15 8 Bits 7 0 LSByte MSByte Variable Array Index Array 31 24 Blue Green Red Alpha in Array Server 0 02 0x36 CRC CRC None None None None None None Response ACK LSByte MSByte Amulet Invoke 0x02 0x37 RPC CRC CRC None None None None None Remote Index LSByte MSByte Procedure Call RPC Server 0x02 0x37 CRC CRC None None None None None None Response ACK LSByte MSByte 1 Denotes command is only applicable when Amulet is the Slave Table 1 Seventeen types of messages can be sent between the master and the slave not counting the graphic primitives Synchronization The master initiates all communications by sending a message to the slave All valid messages from the master to the slave start with the slave s ID By default the Amulet ID is 01 and the host processor s ID is 02 The payload is comprised of the Amulet message opcode Byte 2 up to but not including the CRC bytes The number of bytes following the opcode is dependent upon the opcode itself as each opcode has its own message structure When the Amulet is the master upon receiving the last byte of a valid message from the master the slave then has by default 200ms to respond to the message before the master times out After 200ms if there is no response the master will continue to repeat the message until a response is received After 10 unsuccessfu
104. Binary Hex Decimal 00000000 011110047F 0 127 Single byte encoding compatible with US ASCII 10000000 1011180 128 191 Second third fourth byte of a multi byte sequence BF 11000000 1100000 192 193 Overlong encoding start of 2 byte sequence but would CI encode a code point lt 127 11000010 11011 194 223 Start of 2 byte sequence DF 11100000 11101 0 224 239 Start of 3 byte sequence 11110000 11110F06 240 244 Start of 4 byte sequence including invalid codepoints F4 between 110000 and 13FFFF 11110101 11110 245 247 Restricted 3629 start of 4 byte sequence for F7 codepoint above 10FFFF actually starts at 140000 11111000 1111168 248 251 Restricted 3629 start of 5 byte sequence FB 11111100 11111 0 252 253 Restricted 3629 start of 6 byte sequence FD 11111110 11111 254 255 Invalid not defined by original UTF 8 specification FF Sending strings to the Amulet which contain the font style escape byte Amulet StringField Widgets can statically set the font style of the dynamic string at compile time The font styles available are plain bold italic underline and strikethrough If it is desired to change the font style at runtime that can be done by using the font style escape character 0x02 The byte following the font style escape charac
105. Chip AGB75LCO4 BG E 225 BGA packaged GEM Graphical OS Chip AGB75LCO4 BG E 206 pin packaged GEM Graphical OS Chip Flash AT45DBO8 8 MBit Atmel Flash ATA5DB16 16 MBit Atmel Flash AT45DB32 32 MBit Atmel Flash AT45DB64 64 MBit Atmel Flash SDRAM 1S42S32200E 64 MBit ISSI SDRAM 15425328000 256 MBit ISSI SDRAM e SPI Init File AGB75L default default SPI init file Miscellaneous e SPI Port Used for LCD Initialization if LCD requires SPI Initialization 1 SPI Slave Select 1 e 2 SPI Slave Select 2 e 3 SPI Slave Select 3 e Slow USB Clock While ProgrammingFalse Select False to use the normal clock for USB programming True Select True if user is having problems programming via USB The result of this selection is slightly slower programming speed and the LCD will have a flicker during actual programming Once the programming is done it goes back to full speed Page Functions Editor There are 2 ways to open a Page Functions window to include META REFRESH functions to the page First select Page Functions from the Project drop down menu at the top of the project window as shown in the first figure below Second select Edit Page Functions from a pop up menu that appears when the user right clicks on the page name as shown in the second figure below Xx GEMstudio Untitled Famed Back 98 Backward Edk Page Functions Paga Properties Project Properties Copy Th
106. Control Objects Typically Control Widget Object function calls are initiated by a hit of the widget hit can occur one of two ways The typical way is the physical hit which occurs when the active region of the object widget on the touchscreen is touched and then released while still within the bounds of the active region The object widget must be in focus when letting up on the touchscreen for the object widget to initiate its function calls If you touch an active region but move off the region while still touching the touchscreen the object widget will lose focus therefore letting up on the touchscreen will do nothing The alternative way a hit can occur is to have one Control Object Widget invoke the forceHit method of another Control Object Widget See IWC documentation for more information There are three exceptions to the rule that a hit initiates all function calls The first exception is the Slider Widget As soon as a pen down event occurs within the boundaries of a slider a function call is initiated If while still in the pen down state new values of the slider are selected new function calls will be initiated The second exception is Custom Function Buttons which are set up to auto repeat If an auto repeatable Custom Function Button is touched and stays in a pen down state longer than the time specified by the repeatDelay attribute then a function call is initiated As long as the button remains in a pen dow
107. Control Widget href functions for inter widget communications with animated GIFs Amulet document imageName oneFrame Amulet document imageName fastSpeed Amulet document imageName pause Amulet document imageName play Amulet document imageName playBackwards Amulet document imageName playForward Amulet document imageName regularSpeed Amulet document imageName slowSpeed Amulet document imageName superFastSpeed Amulet document imageName superSlowSpeed The named image advances one frame The named image animates quickly The named image stops animating The named image starts animating in current direction The named image starts animating backwards The named image starts animating forward The named image animates at normal speed The named image animates slowly The named image animates very quickly The named image animates very slowly Table 4 Control Widget href functions for inter widget communications with Scribble Widgets Amulet document widgetName clearCanvas Clears the scribble canvas completely including any Amulet document widgetName paintBackground Amulet document widgetName paintCanvas Amulet document widgetName reappear Amulet document widgetName saveCanvas Amulet document widgetName setLineWeight x Amulet document widgetName uploadImage 1 Regarding reappear If reappear is selected background images in the canvas Red
108. D or UNCHECKED Specifies if the Numeric Field will wait for valid data before being displayed on the LCD If CHECKED the Numeric Field will not display any dynamic numbers until the first packet of data is received If UNCHECKED or the attribute is not present the Numeric Field starts out displaying the minimum value until the first packet of data is received Optional Numeric Field Parameter Attributes Parameter colorlnvert value REGION or STRING or NONE Specifies if the string is shown with alternate colors If REGION selected the fillColorAlt and fontColorAlt will be used instead of fillColor and fontColor If STRING selected only fontColorAlt will be used instead of fontColor If NONE selected String Field will use fillColor and fontColor Only one value is allowed you cannot mix color inversion properties Default is NONE Parameter fillColorAlt value See color entry conventions Specifies the desired Numeric Field fill color if set to REGION See section on colors for more information If no alternate fill color is specified the default alternate fill color is the logical inverse of the current fillColor If the alpha is FF then the fillColorAlt is fully opaque Parameter fontColorAlt value See color entry conventions Specifies the desired font color if set to either REGION or STRING See section on colors for more information If fontColorAlt is not specified
109. E number NAME string gt This meta tag acts like an anchor that calls its function based upon a timer event instead of a user hit Notice the strange syntax with all of the semi colon delimited fields enclosed within one set of quotes Also REFRESH must be all uppercase CONTENT fields are described below 1st number 2nd number The 1st number specifies the frequency that the URL function s is called specified in seconds with a single floating point number The range is 0 00 655 35 0 00 means update never The 2nd number specifies the delay time from when the page is loaded until the initial URL function s is called specified in seconds with a single floating point number The range is 0 01 655 35 If the 2nd number is not specified then the delay time defaults to the 1st number frequency value If the 2nd number is specified and the 1st number is 0 00 then the function s is called after the delay time specified by the second number and does not update again URL function s The allowable syntax for the URL function s string are identical to that of the HREF attribute of the tag or the HREF attribute for a user input widget See Appendix B for available functions VALUE number Specifies the intrinsic value of this meta refresh object This parameter is optional because the intrinsic value can be specified directly within the URL function call as the argument to the method See note regarding Control Object intrinsic values
110. FT for horizontal sliders and BOTTOM for vertical sliders The options are LEFT The slider value increases from left to right horizontal slider only RIGHT The slider value increases from right to left horizontal slider only TOP The slider value increases from top to bottom vertical slider only BOTTOM The slider value increases from bottom to top vertical slider only Optional Custom Slider Parameter Attributes Parameter handleOffset value number Specifies the number of pixels from the center of the channel the handle is located If a vertical slider positive numbers shift the handle to the right and negative numbers shift it to the left If a horizontal slider positive numbers shift the handle to the bottom and negative numbers shift it to the top The range is 100 through 100 Parameter initHref value function Specifies the function called when the page is loaded Use this attribute whenever FromlnitHref is used as the initialCondition The value returned from this function call will be used as the initial condition of the Custom Slider handle See Appendix B for all available functions Parameter waitForInit value CHECKED or UNCHECKED Only valid if FromlnitHref is used as the initialCondition Specifies if the Custom Slider handle will wait for valid data before being displayed on the channel If CHECKED the Custom Slider handle will not display until the data from the initHref function is
111. Japan Initial Condition America The href line invokes the setValue method on Tour If the list entry France is selected then the call to Tour setValue causes the widget named Tour to receive 0x03 When dealing with View Widgets their values are what they use as their input So Tour will use 0x03 as its input value Methods that return a value Only View Widgets can invoke methods that return a value Only Control Widgets have an intrinsic value to return Therefore the method value is only a valid method for Control Widgets And only View Widgets are allowed to invoke the value method See example below where an image sequence widget requests a list widget s Country intrinsic value to use as the input to the image sequence widget Href line Amulet document Country value Sequence america gif australia gif china gif france gif goldengate gif Japan gif Update Freq 0 04 The href line invokes the value method on Country So every 40ms Country s value method will return the intrinsic value of Country to Tour Country s intrinsic value is then used as the input for Tour Table 1 IWC method descriptions IWC Methods Description clearCanvas Clears the scribble dynamic image canvas completely including any background images in the canvas buttonDown Sets the Custom Function Button Widget to look like it is in the down state This method does NOT invoke the href functions it only affects the looks of the button
112. L project including in the initialization of Internal RAM variables For example to initialize an Internal RAM byte variable referenced by the macro counter to a value of 16 you would use the following nomenclature in the Internal RAM initialization file InternalRAM byte counter 16 You can also use a macro as the value of an InternalRAM variable as well For example InternalRAM byte counter time Appendix A UART Code examples Below you will find implementations of the Amulet UART protocol written BASIC assembly Please note that these code snippets are presented here to illustrate the workings of the protocol not serve as a model implementation C source code BASIC source code Assembly source code C Source Code RR KK IK RK IA K KOK K KOK KOK KOK K K KOK K K KOK KOK KOK K KOK K KOK KOK KK KOK KOK K KOK OK K KOK K kk kk R MAIN ROUTINE initializes RingBuffer and sets the baud to 9600 then stays in an infinite loop polling the serial line to see if anything has been received and then handling the byte received NOTE the serIn function simply checks the serial line to see if anything is there if not it returns FA RK lt kk k K k k K K K Kk K K K KOK K KOK KOK KOK KOK KOK KOK KOK A KOK KOK KOK KOK KOK kk KC I KOK KOR KOR KOK k ke K e OK int main rbInit buffer setbaud BAUD9600 while 1 serIn amp buffer return 0
113. My Network Save as type Amulet Unicode Font file auf Cancel My Documents Selecting Range of Characters to Convert The Amulet GEM Font Converter has the ability to convert all characters from 0 0 to OxFFFF By default the Amulet GEM Font Converter only converts and saves the lower ASCII characters 0x21 0x7F To convert and save either more or less than the default select File Options A pop up menu will appear similar to this First Character Last Character oxzt ir The First Character range is OxO OxFFFF The Last Character range is OxO OxFFFF The First Character value should be less than or equal to the Last Character value This allows for displaying font characters that are not part of the ASCII range The characters that can be found in the Unicode section 0x80 and above are not always going to be the same from font to font so ensure that the character you are interested in displaying is available in the font you are using This option also allows for saving a smaller subset of a font if you are sure that you will only be using a portion of a specific font For instance you may want a large number font to be used as part of a numeric field widget Being it is a large font if you saved all lower ASCII characters it would result in a very large auf file which would eat up a large portion of your project s flash space By setting the First Character to 0x30 and the
114. N over character character character character F r Format of request string OxD8xx where xx function to invoke Returns OxE8xx to client k Ck lt k x ck lt ck lt k ck ck ck ck lt k ck ck lt ck ck k ck ck lt ck ck ck k ck lt ck k x x lt r ha Re OV lo Read both nibbles of xx and assemble into a byte If carry cleared then invalid To simplify this snippet all in a look up table was left out Time to go execute the function Acknowledge valid command Rotate MSNibble into LSNibble position Convert LSNibble of buffer to an ASC Echo back MSNibb Convert e of variable t LSNibble ndleI rcall getByte turn in buffer brcc try again er mov which buffer oks up the function xx icall ldi buffer InvokeResponse rcall putch mov buffer which Swap buffer rcall nib2ascii rcall putch mov buffer which rcall nib2ascii rcall putch rjmp try again e of variable Echo back LSNibb Done wil th Invoke command so start over value so start the code which character of buffer to an ASC character Appendix All Commands Valid Control Widget href functions Table 1 Control Widget href functions
115. Name reappear Amulet document widgetName reset Amulet document widgetName setMethod m Amulet document widgetName setOnVarMethod m Amulet document widgetName setOnVarUARTMethod m Amulet document widgetName setOnVarVariableNumber x Amulet document widgetName setTrigger x Amulet document widgetName setUARTMethod m The named widget will display in normal video The named widget s text string will display in normal video The named List widget will move its highlighted bar up to the previous entry Does not perform a hit on the new entry The named widget will reappear on the LCD in its original location if itis a View Widget it will also start updating The named widget will initialize internal variables and re draw The href method for the named widget will change to m where m is the method name such as value or disappear The IF method for the named widget will change to m where m is the method name such as value or disappear The ONVAR UART method for the named widget will change to m where m is the method name such as Value The variable number used in the ONVAR of the named widget will change to x where x is the variable index used in the following variable types byte x word x or string x The named Widget will change its equal gt or It value to the byte value x The href UART method for the named widget will change to m where m is the UART method
116. OR KOR KOK ke ke ke ke ee x void setByte void char index hexVal index ascii2hex hiNib lt lt 4 index ascii2hex loNib hexVal ascii2hex setValHi lt lt 4 hexVal ascii2hex setValLo byteData index hexVal putchar serverResp putchar hiNib putchar loNib putchar setValHi putchar setValLo J FCKCKCKCKCKCkCk RA I kA A A A A eA A eA AE Ck AA I AA kk kk KC kk I A ke kk Handler for a getWord function request Format of request string is three by variable tes gt OxD1 vH vL wher index of word V vH is ASC version of high nibble of v and vL is ASC of low nibble of v Returns seven bytes gt 0xF1l vH vL PH PL NH NL where value of variable v high byte N value of variable v low byte PH is ASC version of high nibble of P and PL is ASC of low nibble of P NH is ASC version of high nibble of N and NL is ASC of low nibble of N A k k k K K Kk K K K KOK K KOK KOK KOK KOK KOK K K KOK KOK KOK KOK KOK Kk KOK KOK KOK KOK KOK KOK A R ORO K ORO KOR R ke ke ke R K f void getWord void char index valMSBhinib valMSBlonib valLSBhinib valLSBlonib unsigned int wordValue index ascii2hex hiNib lt lt 4 index ascii2hex loNib wordValue wordData index
117. OnVarVariableNumber x setTrigger x Changes the trigger value originally specified by the META Refresh s trigger trigger gt or trigger It parameter to the byte value x setUARTMethod m Changes the UART method originally specified by the META Refresh Tag s URL parameter it is only valid when the originally specified method is a single function If the URL method does not use the UART then you must use the setMethod method setUpdateRate f Changes the update rate originally specified by the META Refresh Tag the argument being a floating point number specifying time in seconds setVariableNumber x Changes the variable number originally specified by the META Refresh s URL parameter Can be used only if the META Refresh URL has a byte y or string y In all cases the y gets changed the argument specified in setVariableNumber x it is only valid when the originally specified method is a single function value Sends the intrinsic value associated with the META Refresh Tag to the calling widget The calling object then uses that value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href Regarding Method Parameters Regarding x For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out Anchors META Refresh Tags Area Maps and Fu
118. Page 1 0 20 File Size Ox19E downarrow gif 0x21 File Size Ox34E uparrow gif 0x22 File Size Ox34E downarrowAlt gif 0x23 File Size Ox34E uparrowAlt gif 0x24 File Size Ox34E define Page 2 0x25 File Size OX19E fonthdr auf OxF FileSize 20x28 internalram bin Ox6 File Size Ox214E ledconfigproject bin 0x3 File Size 6 Amulet fileNumber x Following the File Name is the Flash Index in hexadecimal format This is the internal file number that the GEMcompiler assigns to each file This number can be used to hyperlink directly to a given page within the project by using the Amulet fileNumber x function where x is the Flash Index number Any Control Object Widget could use Amulet fileNumber x as its href function The Amulet fileNumber x function works exactly the same as if you entered just a File Name Using the above map file lt A HREF Page_1 htm gt link to Page_1 htm lt A gt is equal to lt A HREF Amulet fileNumber 0x20 gt link to Page_1 htm lt A gt Amulet internal fileNumber value The Amulet internal fileNumber value function returns the value of the flash index number of the given page Any View Widget that expects a word value can use the Amulet internal fileNumber value function Using the above map file again a View Widget in Page_1 htm could have an href function that looks like Amulet internal fileNumber value Th
119. RAM variables can be used as arguments within Amulet methods i e Amulet UART byte 0 setValue InternalRAM byte 2 4 Internal RAM variables can be used as variable indices i e Amulet UART byte InternalRAM byte 0 setValue 2 Internal RAM nomenclature The href nomenclature for Internal RAM s is Amulet InternalRAM variableType variableNumber method Where Amulet is the Amulet script escape telling the compiler that Amulet specific commands follow InternalRAM is the specifier for Amulet s dual port Internal RAM variableType is the type of variable either byte word or string variableNumber is the variable index within the variable type 0 255 for bytes 0 255 for words and 0 198 for strings method is the name of the method to be performed by the InternalRAM variable Asapoint of reference the nomenclature to specify the Internal RAM variables in the code is the same as specifying external variables External variables expect the UART object to be used whereas the Internal RAM variables use the InternalRAM object For example to have an Amulet Bargraph Widget tied to an external byte variable 2 the href attribute would look like this Amulet UART byte 2 value To be tied to an Internal RAM byte variable 2 then the href attribute would look like this Amulet InternalRAM byte 2 value UART object specifies the Amulet will send out serial message to an external processor requesting the value o
120. S usun uy nu m ADP OD CR 202 GEMSst dio Produ ction Files ertet e ete 203 Palm Database Format uice ev p bc ae das Ore e EOD do rebar 204 Pass Thru Programming tte UA 206 xModem Protocol with be e a LE e e Hd vea 208 MideoT tohials yman ep MU Chad ba n M M 212 CaN BE LOB zo baee a t n n mma HU UO HI REO 213 Warranty Informations ioo dette tee tte Gate tret he ve teret edet hse eot oyentes kum Re 222 Welcome Congratulations on your Amulet purchase Please take a few minutes to read this file which contains the latest information about setting up and using your Amulet product This documentation is valid for GEMstudio Pro software version 2 0 0 0 Overview The Amulet method of displaying graphics on an LCD is totally different from traditional methods The Amulet GEM Graphical OS Chip handles all the LCD and touchpanel functions so your micro doesn t have to Hardware wise the only requirement is that your micro needs a UART or USB in order to use the Amulet system On the software side you need to create an Amulet serial protocol handler Generally the only thing that is being sent via the serial link is data Here s the Amulet system in a nutshell 1 GUI authoring tool called GEMstudio Pro is used to create a Graphical User Interface GUI 2 GEMs
121. Set color variable command Amulet UART color x setValue y An Invoke Remote Procedure Call RPC command Amulet UART invokeRPC x If the message is valid the slave should either return the requested data if a Get request or confirm the message was received if an Invoke Set or Draw command If the message is not valid the slave should respond with an acknowledge ACK to have the Amulet move to the next request or the slave can respond with a negative acknowledgement NAK to have the Amulet resend the last message If there is a CRC error following the Modbus standard the message should be ignored If the message is not responded to the Amulet will resend the message after a timeout period of 200ms Table 1 defines thirteen messages that can be sent between the master and the slave not counting the graphic primitive messages The valid range of variables and Remote Procedure Calls is O OxFF The valid range for byte variable values returned from the slave in response to the Get Byte variable request is also O OxFF The valid range for word variable values returned from the slave in response to the Get Word variable request is O OxFFFF String and label variable values returned from the slave in response to the Get String variable request can have a maximum of 250 characters plus a null termination character 0x00 The first byte of all master messages is the ID of the slave processor If the master is the Amul
122. String Variable Server Response Amulet Get Color Variable Server Response Amulet Get Label Variable Server Response Amulet Get OxD4 Remote Procedure Calls RPC OxD1 OxE1 0 02 OxE2 OxF4 OxF5 0xD3 OxE3 Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble RPC flag Hi Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble RPC flag Lo Nibble None None Hi Value Hi Hi Nibble Lo Nibble None None ASCII char ASCII char None Red Byte Hi Nibble Lo Nibble None None ASCII char ASCII char None None None None None None None None LS Byte Value Lo Value Lo Hi Nibble Lo Nibble None None None None None None ASCII ASCII 0x00 char char None None None Green Byte Blue Alpha Hi Nibble Byte Byte Lo Nibble Hi Nibble Hi Nibble Lo Nibble Lo Nibble None None None None None None ASCII ASCII 0x00 char char None None None None None None None None None None None None Server Response Amulet Set Byte Variable Server Response Amulet Set Word Variable Server Response Amulet Set String Var
123. VH EVK HX HDA570ST V EVK KA TCG057VGLBL C50 EVK SY SCA05711 BFN LRA EVK KA TCGO62HVLBC G20 EVK SY SCA07010 BFN LRA EVK TA TMO70RBH10 GEMboard GEMboard II STK 480272C MK 480272C 2 Power up the unit 3 Plug in the USB cable 4 GEMstudio select File then Restore Amulet OS NOTE Select the correct COM PORT and display settings Switch 18 18 18 18 12 12 Dip GEMstudio Production Files Once you are finished with your project you can save the project files along with the latest OS files tuned specifically for your display in one production ready file There are two production file types The first is a gem file which is compressed not easily parsable gem file can be used if GEMstudio GEMcompiler or GEMprogrammer will be used to program the gem file into the Amulet module The second is a pdb file which is not compressed and easily parsable A pdb file is useful if you are going to program the Amulet module via your processor Please contact Amulet for more information on parsing pdb files and programming the Amulet module via your processor Saving a Production File Choose File gt Save As Production File and a File Dialog box will appear In the Save as type pull down menu you can select either pdb the default or gem The choice you make in that pull down menu will determine which type of Production File will be saved Opening a Production File You can open either a gem or
124. Variable Server Response Amulet Set String Variable Server Response Amulet Set Color Variable Server Response Amulet Set Byte Variable Array Server Response Amulet Set Word Variable Array Server Response 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x30 0x30 0x31 0x31 ACK 0x32 0x32 ACK 0x33 0x33 ACK 0x34 0x34 ACK 0x35 0x35 Variable Value CRC CRC None None Index LSByte MSByte CRC CRC None None None None LSByte MSByte Variable Value Value CRC CRC None Index MSByte LSByte LSByte 5 CRC CRC None None None None LSByte MSByte Variable UTF 8 UTF 8 UTF 8 UTF 8 0 00 Null Index char char char char Terminator CRC CRC None None None None LSByte MSByte Variable Value Value Value Value CRC Index Bits Bits 23 16 Bits 15 8 Bits 7 0 LSByte 31 24 Blue Green Red Alpha CRC CRC None None None None LSByte MSByte Variable Count Value Value Value Last Value Start of Bytes in Array Index in Array CRC CRC None None None None LSByte MSByte Variable Countof Value Value Value Last Value Start Wordsin MSByte LSByte MSByte LSByte in Index Array Array CRC CRC None None None None LSByte MSByte None None None None None None None None CRC CRC LSByte MSByte None None CRC None MSByte None None CRC CRC LSByte MSByte None None CRC CRC LSByte MSByte None None
125. able 01 0x38 External processor s string variable 01 Abc External processor s word variable 03 Ox10E8 Amulet Internal RAM byte variable 4 OxA8 Amulet Internal RAM word variable 0x76 Ox0000 Amulet Internal RAM RPC buffer 0x52 only Following the communication session the following has occurred External processor s byte variable 01 OxFE External processor performs user defined RPC 02 There are no reserved RPC s so all 256 RPC s can perform any desired function on your processor Amulet Internal RAM word variable 0x76 0 02 9 Amulet Internal RAM RPC buffer empty Amulet LCD Module Dir External Processor 0 02 0 20 0 01 0 08 0 00 gt gt lt lt 0 02 0 20 0 01 0 38 0 00 0 14 0 02 0 22 0 01 0 09 0 60 gt gt lt lt 0 02 0 22 0 01 0 41 0 62 0 63 0 00 0 9 0 90 A b Ct 0x02 0 30 0 01 OxFE gt gt 0 81 0 83 lt lt 0 02 0 30 0 00 OxC4 0 02 0 37 0 02 0 47 1 gt gt lt lt 0 02 0 37 0 41 0 06 0 02 0 21 0 03 0 88 0 51 gt gt lt lt 0x02 0x21 0x03 0x10 OxE8 OxAA 0x72 0x02 0x20 0x04 0 8 0x03 gt gt lt lt 0x02 0x05 0x68 0x03 lt lt 0x01 0x20 4 0x38 0x47 Description Get byte variable 1 Return byte of byte var 1 Get string variable 1 Return string of string var 1 Set byte variable 1 to Ack set byte variable 1 to Invoke RPC2 User defined Ack invoke RPC2 Get wo
126. actly the same as the dimensions of the Scribble Widget If the canvas is saved the image overwrites the existing canvas image If the initial image is desired to be saved use the background attribute Image file must be of type GIF JPG or PNG Parameter href value function The function invoked upon receiving the uploadlmage IWC method Only valid function is currently Amulet UART xmodemUploadlmage Parameter lineColor value See color entry conventions Specifies the color of the active freehand drawing line See section on colors for more information If no line color is specified the default color is black If the alpha is FF then the line color is fully opaque Parameter lineWeight value pixels Defines the weight thickness of the active freehand drawing line in pixels The range is 1 15 0x01 OxOF Optional Scribble Parameter Attributes Parameter border value number Specifies width in pixels of the border around the dimensions of the Scribble Widget Default is O meaning no border Parameter borderColor value See color entry conventions Specifies the color of the border around the dimensions of the Scribble Widget See section on colors for more information If no border color is specified the default color is black Only applicable if border has a value of 1 or greater If the alpha is FF then the border color is fully opaque Parameter background value image Specif
127. aded Dynamic Image Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Dynamic Image is to start out invisible or not If the attribute is UNCHECKED then by default the Dynamic Image is visible If the Dynamic Image starts out invisible the only way to make it visible again is via the IWC method reappear Parameter canvas value image Specifies the image used for the canvas of the Dynamic Image Widget This is a required parameter The canvas can contain a default image or it can be a completely blank image but the dimensions of the canvas MUST be exactly the same as the dimensions of the Dynamic Image Widget Image file must be of type GIF JPG or PNG ImageBar Image Bar Widget ImageBar class The Image Bar Widget uses two images empty bar and full bar to create custom bargraph byte or word returned from a function call is the widget input Based upon the value of the byte or word returned a percentage of the empty bar and a percentage of the full bar are displayed For further customization the wipe between empty and full can be from left to right right to left bottom to top or top to bottom When the minimum value is returned the entire empty image is displayed When the maximum value is returned the entire full image is displayed Image Bar Widget Image Bar Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if t
128. alCondition Specifies if the Slider handle will wait for valid data before being displayed on the channel If CHECKED the Slider handle will not display until the data from the initHref function is received If UNCHECKED or the attribute is not present the Slider handle momentarily starts at the minAt location until the initHref function receives its data Touch Area Widget TouchArea class Touch Areas are rectangular touchable regions that can be placed anywhere on the display Touch Areas are not visible when not touched and have no visual feedback by default when touched Touch although they can be set up to shade the area underneath the Touch Area with a transparent color Widget orinvert the colors in the area underneath the Touch Area Instead of a single HREF that is launched upon release like most other control widgets the Touch Area has a number of events that can all have their own function call s associated with them There are a number of events that are valid for all touch screens like onRelease onSlideOff onSlideOn onTap onDoubleTap and onTouch There are also many gesture events that are only valid on certain capacitive touch panels like onPinch onZoom onSwipeEast onMultiTouchSwipeEast etc Only the optional events that are applicable for the currently selected touch panel will show up in the Add Remove Parameter dialog box Like Function Buttons Touch Areas can also be set up to auto repe
129. alue Sends a getString request over the UART where x is the string variable number returns a null terminated ASCII string Valid Scribble widget href functions Table 8 Scribble Widget href function Amulet UART xmodemUploadlmage Scribble Widget will upload raw image data out the UART using an xmodem protocol upon receiving the uploadimage IWC method Valid Line Graph widget href functions Table 9 Line Graph Widget href function Amulet internalRAM bytes x arrdyftyrns the array of internalRAM bytes starting at variable x through variable x y Amulet internalRAM words x arrBgtyyrns the array of internalRAM words starting at variable x through variable x y Amulet UART bytes x array y Sends a getByteArray request over the UART where x is the starting byte variable number y is the number of bytes in the array returns the array of byte variables from x to x y Amulet UART words x array y Sends a getWordArray request over the UART where x is the starting word variable number y is the number of words in the array returns the array of word variables from x to x y Appendix Inter Widget Commands Inter Widget Communication allows Amulet widget to the methods of another Amulet widget See Appendix B for a comprehensive listing of all available function calls Below you will find a description of the valid IWC methods for each widget in addition to a brief description of how t
130. alue ANDed with the mask y as its input This method is only valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Custom Button to provide the input to a View Widget This method is called from a View Widget href reappear Makes the Custom Button visible and touchable the LCD Counteracts the disappear method setMethod m Changes the method originally specified by the Custom Button s href parameter only valid when the originally specified method is a single function setUARTMethod m Changes the UART method originally specified by the Custom Button s href parameter only valid when the originally specified method is a single function setValue x The Custom Button intrinsic value is changed to x setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Custom Button href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function setX x Sets the x coordinate of the topleft corner of the individual Custom Button to the coordinate specified by the word x e setY x Sets the y coordinate of the topleft corner of the individual Custom Button to the coordinate specified by the word x e value Sends the intrinsic value of the Custom Button to the calling widget The calling obje
131. am or not If noSdramzCHECKED then applying the disappear IWC method could result in strange behavior and it could take a little longer for the images to be drawn on state changes depending upon the size of the images If the parameter is UNCHECKED the Custom Button widget will allocate space in the SDRAM equivalent to the size of the button within the frame buffer times three UNCHECKED is the default Parameter repeatDelay value number Time to delay from when button is initially pressed until it starts to auto repeat Specified in seconds with a single floating point number The range is 0 01 655 35 Parameter repeatRate value number The href function call frequency while button is being pressed after the initial delay determined by repeatDelay Specified in seconds with a single floating point number The range is 0 00 655 35 0 00 means do not repeat Parameter verticalAlign valuez TOP or MIDDLE or BOTTOM Specifies the vertical alignment of the string associated with the label attribute within the Custom Button dimensions Only one value is allowed you cannot mix vertical alignments Default is MIDDLE CustomSlider Custom Slider Widget CustomSlider class The Custom Slider Widget acts like a regular Slider Widget except for the fact that get to specify the channel image two different handle images Custom Custom Slider Widget Slider Widget invokes a function or set of funct
132. and a non match by a NACK The FSN will begin transmission after the ACK or NACK A NACK d file should be reprogrammed Every 500ms during the flash read and CRC calculation a 0x14 will be sent to let the host know we re still alive but working on the CRC verification This would only happen on larger files 7 When there more files to send the Amulet send 0 17 and the Amulet will reboot start running at the new homepage that you just programmed XModem Protocol with CRC Introduction The Xmodem protocol was created years ago as a simple means of having two computers talk to each other With its half duplex mode of operation 128 byte packets ACK NACK responses and CRC data checking the Xmodem protocol has found its way into many applications In fact most communication packages found on the PC today have a Xmodem protocol available to the user NOTE Amulet uses a slightly modified 128 byte or 1K Xmodem with 16 bit CRC protocol For 1k Xmodem the SOH byte is 0x02 and for 128 byte it is 0x01 Theory of Operation Xmodem is a half duplex communication protocol The receiver after receiving a packet will either acknowledge ACK or not acknowledge NAK the packet The CRC extension to the original protocol uses a more robust 16 bit CRC to validate the data block and is used here Xmodem can be considered to be receiver driven That is the receiver sends an initial character C to the sender indicati
133. and initialize strings that are longer than 25 characters You just need to be aware that the string will run on into the next string variable s RAM space So if you know your Internal RAM strings are going to be more than 25 characters you might want to only use every other string variable index i e InternalRAM string 0 InternalRAM string 2 InternalRAM string 4 etc Keep in mind that this will effectively give you only 128 51 character string variables instead of the standard 256 In this example the strings are 51 characters instead of 50 beacause the null between string 0 string 1 becomes usable character When initializing Internal RAM strings user defined wraps can be specified by entering An within the string Since we use double quotes to define a string to have a literal double quote appear in the string enter two double quotes in a row User defined wrap example InternalRAM string 0 top line nbottom line Double quote example InternalRAM string 0 this phrase is quoted Initializing multiple Internal RAM variables It is also possible to initialize a block of contiguous Internal RAM variables The syntax to initialize a block of Internal RAM variables is as follows InternalRAM variableType variableNumberStart variableNumberEnd value Where variableType is the type of variable either byte word color or string variableNumberStart is the variable index within the variable type 0 255
134. ar widgets with a non zero value for min When sent the reappear method it would cause problems InternalRAM RPC messages sent using the CRC protocol were missing the CRC at the end of the message e Watchdog would reset if uploading a large image primitive e Multiple hrefs with InternalRAM variables now work as expected InternalRAM variables can be modified in a previous function call and you can now use that InternalRAM variable in a later function call i e Amulet InternalRAM byte 0 add 2 Amulet InternalRAM string InternalRAM byte 0 setValue fixed will now use the correct value for InternalRAM byte 0 as the argument in the second function In previous GEMstudio versions it was required to split up the multiple functions into separate META tags which added to the code space used and made it harder to follow e If only one image on a page was cached it didn t really get cached in version 1 2 1 e Amulet math randomByte maskedValue x Amulet math randomFilteredByte value and Amulet math randomFilteredByte maskedValue x all correctly supported The OS fonts took up twice as much serial data flash space as they were supposed to e GEMstudio layout now correctly shows a line feed when n entered in the label of a button It looked correctly in the GEMplayer or in the actual module but the WYSIWYG showed the literal Nn e Fixed bug in List Box Widget regarding a forceUpdate being called on a list box and the new list choice wa
135. at When pressed an auto repeat Touch Area delays a user defined amount of time then invokes a function or set of functions at a user defined frequency while the Touch Area is still being pressed See onAutoRepeat repeatDelay and repeatRate for more information Touch Area Parameter Attributes Parameter onRelease value function s The function or multiple sequenced functions invoked after the Touch Area is touched and then released while still within the Touch Area boundaries See Appendix B for all available functions for the onRelease event Parameter visualFeedback value None or Alpha or Invert Specifies the visual action of the Touch Area while being touched None causes no visual change on the display Alpha shades the area underneath the Touch Area with a transparent color defined alphaColor Invert causes the colors in the area underneath the Touch Area to become inverted Sliding off or releasing the Touch Area returns the area underneath the Touch Area back to its original state None is the default Optional Touch Area Parameter Attributes Parameter alphaColor value See color entry conventions If visualFeedback equals Alpha this attribute specifies the alpha color mask used to notify the user the Touch Area has been depressed See section on colors for more information If no alphaColor is specified the default color is a transparent gray If the color specified does not have an alpha co
136. at value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href Scribble Slider disappear Makes the Scribble Widget not visible or touchable on the LCD reappear Makes the Scribble Widget touchable on the LCD Partialy counteracts the disappear method Should be immediatly followed by a paintBackground or paintCanvas paintBackground Redraws the background image from flash paintCanvas Redraws the canvas image from flash reset Clears the canvas image currently on the Scribble Widget and redraws the canvas image stored in flash saveCanvas The canvas displayed the LCD is saved to flash overwriting the previous canvas image setLinePattern x Changes the line pattern of the active freehand drawing line to x setLineWeight x Changes the line weight of the active freehand drawing line in pixels to x setX x Sets the x coordinate of the topleft corner of the Scribble Widget to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Scribble Widget to the coordinate specified by the word x uploadimage The canvas displayed on the LCD is uploaded to an external processor using xmodem crc protocol The image will be sent in the Amulet Bitmap Format disappear Makes the Slider not visible or touchable on the LCD forceHit Slider performs its hit method without user input
137. ata to determine which image to display Counteracts the stopUpdating method stopUpdating Image Sequence stops using its input data to determine which image to display toggleUpdating Changes current state of Image Sequence either starts or stops using its input data to determine which image to display Line Graph disappear Makes the Line Graph not visible on the LCD forceUpdate Forces the Line Graph to call its href function immediately regardless of the updateRate reappear Makes the Line Graph visible on the LCD Counteracts the disappear method reset Clears the Line Graph setMethod m Changes the method originally specified by the Line Graph s href parameter setUARTMethod m Changes the UART method originally specified by the Line Graph s href parameter setUpdateRate f Changes the update rate originally specified by the Line Graph the argument being a floating point number specifying time in seconds setValue x Line Graph uses x as its input This allows a Control Widget to provide the input to a Line Graph setVariableNumber x Changes the variable number originally specified Line Graph be used only if the Line Graph href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber x setX x Sets the x coordinate of the topleft corner of the Line Graph to the coordinate specified by the word x setY x Sets t
138. ate Calibrate pdb 8 43616069 18 66666666 26 66666661 36 66660666 7548544 56 80800008 66 63360666 78 641F 6666 88 7273696F 90 01738286 AG FF780004 B8 FFB96664 FF176164 62726174 66666666 BS8BC 8075 6666667E 66666666 66666666 66666666 66666666 6E26322E FF 61126D FF8E 6611 FFBF 6611 FF1D61 64 65666666 66666666 B8BC 8075 66666666 66666666 63 66 6666 63546666 68066666 312E37 66 FF 4C 666D FF9E 6669 FFFC 6669 FFBS 6164 66666666 66666666 BSBC 8075 4D524C4E 6666 6666 66666666 66666666 66665665 66266666 FF62666D FFA 6663 FF 656163 FF196261 CalibrateEEBEEEEN PET EY Hu 548 uHTHEBEEEEEEEREN PTT EY rsion 2 1 788 NN ESEBUENNQL EEUDEE TTT TT Ioj x Ei The total number of record entries user interface pages is stored as a 16 bit number in the header at location Ox4C In this example there are 6 unique record entries Immediately following the total number of record entries are the record entry arrays consisting of 8 bytes per array for each of the 6 record entries In the case of the example in Figure above the first record entry array equals 00 00 00 8D 00 00 00 00 The important part of the record entry array is the starting offset of the raw data which is a 32 bit number which can be found in bytes 1 through 4 0x0000008D As you can see
139. ather it gives you the flexibility to have the Amulet module send you small commands that do not need to be answered Please see the Amulet UART CRC Protocol document for more details Your LCD s user interface is created using GEMstudio Pro Amulet has created a number of I O objects referred to as Amulet Widgets There are two types of Amulet Widgets Control Widgets and View Widgets Control Widgets are input objects like function buttons sliders radio buttons etc Control Widgets have a function or a set of functions that can be applied to them For instance a function button can be set to send a Remote Procedure Call 5 out the or USB every time it is pressed View Widgets are output objects like bargraphs numeric fields string fields etc View Widgets call a function which returns the data used as the input for that particular widget For instance a bargraph can have a function which requests external byte variable 3 every 100ms over the UART or USB The complexity of the serial protocol handler depends upon the type of communication you will be using in your system You can set up your project so that the Amulet module is the master requesting data at given update rates and sending command messages asynchronously Or your micro can be the master sending data to the Amulet module unsolicited And you can also use a dual master setup where the Amulet module is sending asynchronous command messages to your micro yet yo
140. ating point numbers and 0 to Oxffff when using hex numbers See note regarding the span between minFld and maxFld Formatting Value minFld Example maxFld Example 963i 20 10 963i 200 999 963i 200 40 965 2f 2 00 0 00 965 2f 0 00 25 00 966 2f 50 00 50 00 96H4x 0x00 Oxff 962X OxFF OxAA Table 1 Numeric Field formatting examples using the right justified default The implied ranges are arbitrary Parameter printf valuez text format text Specifies the text and the formatted numeric field to be displayed similar to the standard C program printf command The Numeric Field Widget can display integer hexadecimal and floating point numbers To display integers the format is where a is the number of character spaces and i specifies integers With floating point numbers the format is a bf where a is the total number of character spaces b is the number of digits to the right of the decimal point and f specifies floating point numbers With hexadecimal numbers the format is aX or ax where a is the number of character spaces and specifies that the hexadecimal digits will be upper case A F while x specifies lower case a f NOTE To display a symbol in the numeric field use e g Duty Cycle 5 2f will display Duty Cycle 99 99 There are also flags that change the numeric field format Format flags are entered between the and the character space specification The flags
141. butes Parameter borderColor value See color entry conventions Specifies the desired button border color See section on colors for more information If no border color is specified the default color is black Parameter fillColor value See color entry conventions Specifies the desired button fill color See section on colors for more information If no fill color is specified the default color is the current background color Parameter font value font font size Specifies the font used for the button label See Amulet GEM Font Converter for more information regarding the creation of auf font files Default is Bitstream Vera Sans The font size for the button label defaults to 12pt Parameter fontColor value See color entry conventions Specifies the desired font color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle valuez Plain or Bold or Italic Specifies the style associated with the button label font The available font styles are e Bold The option text is bold i e text e Italic The option text is italicized i e text e Plain The option text is standard font i e text Parameter alphaColor value See color entry conventions If onButtonPress equals ALPHA this attribute specifies the alpha color mask used to notify the user the Function Button has been depressed See section on colors for m
142. c primitive color command and the line weight is specified by the most recently sent set graphic primitive line weight command The rectangle primitive opcode 0x46 draws a rectangle with a given starting top left point x and y coordinates and a delta x and delta y The payload is made up of an x and y coordinate plus a 16 bit delta x and a 16 bit delta y so there are a total of 8 bytes in the payload making for a total of 12 bytes in the command The color is determined by the most recently sent set graphic primitive color command and the line weight is specified by the most recently sent set graphic primitive line weight command The fill rectangle primitive draws a solid rectangle with a given starting top left point x and y coordinates and a delta x and delta y The payload is made up of an x and y coordinate plus a 16 bit delta x and a 16 bit delta y so there are a total of 8 bytes in the payload making for a total of 12 bytes in the command The color is determined by the most recently sent set graphic primitive color command The line weight is not used for the file rectangle graphic primitive If a graphics primitive is sent that does not fit within the bounds of the given LCD i e a delta x of 380 pixels on a 320 x 240 LCD the Amulet will ignore the request It will respond back serially but the graphic primitive will not be drawn Note on 32 bit color and the Alpha Component 32 bit colors that are entered through GEMstu
143. change of polarity Sends out a raw byte x Put x in single quotes to be treated as an ASCII character i e 9 is equal to 0x39 Sends out the invokeRPC command over the UART with x being the RPC number Sends out the setByte command over the UART where z is the byte variable number and x is the value to set it to Sends a stream of raw bytes x1 x2 xn out the UART No response is required or desired Sends an ASCII string x not null terminated out the UART No response is required or desired Where x is a single quoted string or x can also be an InternalRAM string variable Sends out the setString command over the UART where z is the string variable number and x is the string to set it to Sends out the setWord command over the UART where z is the word variable number and x is the value to set it to Hyperlink to the file 1 Regarding x For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out META REFRESH tags and Function Custom Buttons should use x The range for x is 0 255 Ox00 Oxff for a BYTE 0 65535 Ox00 Oxffff for a WORD and 250 character strings in double quotes for STRINGs Table 2 Control Widget href functions for Inter Widget Communications IWC Amulet document widgetName buttonDown Amulet document widgetName buttonUp Amulet document widgetName clearCanvas Amu
144. ck If the alpha is FF then the channel color is fully opaque Parameter handleColor value See color entry conventions Specifies the color inside of the handle See section on colors for more information If no handle color is specified the default color is white If the alpha is FF then the handle color is fully opaque Parameter handleFrameColor value See color entry conventions Specifies the color of the handle frame See section on colors for more information If no handle frame color is specified the default color is black If the alpha is FF then the handle frame color is fully opaque Parameter handleTrackingColor value See color entry conventions Specifies the color of the handle when being touched See section on colors for more information If no handle frame color is specified the default color is black If the alpha is FF then the handle tracking color is fully opaque Parameter href value function s The function or multiple sequenced functions invoked upon the event specified in hrefEvent See Appendix B for all available functions for the Slider widget Parameter hrefEvent value On Change or On Release The event which triggers the launching of the href function If set to On Change the slider will launch the function call whenever the handle is moved If set to On Release the slider will only launch the function call upon the releasing of the slider handle If hrefEvent is no
145. ckwards playForward Starts animating forward reappear Makes the image visible on the LCD Counteracts the disappear method regularSpeed Normal animation speed setX x Sets the x coordinate of the topleft corner of the animated image to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the animated image to the coordinate specified by the word x slowSpeed Decreases animation speed superFastSpeed Fastest animation speed superSlowSpeed Slowest animation speed disappear Makes the image not visible on the LCD reappear Makes the image visible on the LCD Counteracts the disappear method setX x Sets the x coordinate of the topleft corner of the image to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the image to the coordinate specified the word x META Refresh Tag disappear Stops the META Refresh Tag URL from being launched forceHit META Refresh Tag will perform its hit method without user input The hit method will invoke all href functions of the META Refresh Tag forceUpdate Forces the META Refresh Tag to call its trigger variable function immediately maskedValue y Sends the intrinsic value associated with the META Refresh Tag to the calling widget calling object then uses that value ANDed with the mask y as its input This method is only valid if the intrins
146. color is specified the default color is white if the alpha is FF then the background color is fully opaque Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Bargraph Widget The function is called at an update rate specified by the updateFreq attribute Parameter min value number Minimum value returned from the href function must be less than max If the function returns byte the range is 0 254 0x00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Parameter max value number Maximum value returned from the href function must be greater than min If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 OxFFFF Parameter SweepFrom valuez LEFT or RIGHT or TOP or BOTTOM Determines where to begin drawing the bargraph The options are LEFT The bargraph is drawn from left to right default RIGHT The bargraph is drawn from right to left TOP The bargraph is drawn from top to bottom BOTTOM The bargraph is drawn from bottom to top Parameter updateFreq value number The number specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number The nu
147. ct polarity If the image changes while the anchor is selected it is possible to have the polarity get swapped Having the surrounding anchor href perform this on the Image Sequence will allow the image to stay correctly synched forceUpdate Forces the Image Sequence to call its href function immediately regardless of the updateRate reappear Makes the Image Sequence visible on the LCD Counteracts the disappear method setMethod m Changes the method originally specified by the Image Sequence s href parameter setUARTMethod m Changes the UART method originally specified by the Image Sequence s href parameter setUpdateRate f Changes the update rate originally specified by the Image Sequence the argument being a floating point number specifying time in seconds setValue x Image Sequence uses x as its input This allows a Control Widget to provide the input to an Image Sequence setVariableNumber x Changes the variable number originally specified by an Image Sequence Can be used only if the Image Sequence href is byte y value or word y value In either case the y gets changed to the argument specified setVariableNumber x setX x Sets the x coordinate of the topleft corner of the Image Sequence to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Image Sequence to the coordinate specified by the word x startUpdating Image Sequence starts using its input d
148. ct then uses that value as its input This allows a Custom Button to provide the input to a View Widget This method is called from a View Widget href Custom Slider disappear Makes the Custom Slider not visible or touchable on the LCD e forceHit Custom Slider performs its hit method without user input The hit method will invoke all href functions of that object e forceUpdate Forces the Custom Slider to call its initHref function immediately Only valid if initialCondition is FromlnitHref Updates the Custom Slider and performs a hit e maskedValue y Sends the intrinsic value of the Custom Slider to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a Control object to provide the input to a View Widget This method is called from a View Widget href e reappear Makes the Custom Slider visible and touchable on the LCD Counteracts the disappear method setValue x The Custom Slider intrinsic value is changed to x e setMethod m Changes the method originally specified by the Custom Slider s href parameter only valid when the originally specified method is a single function e setUARTMethod m Changes the UART method originally specified by the Custom Slider s href parameter only valid when the originally specified method is a single functio
149. ction matches the internalNumber of the radio button then that radio button starts out in the on position If the internalNumber is not specified the first radio button found in the project will be assigned internal number 1 with the internal numbers incrementing with each subsequent radio button found which is part of the same radio button group Parameter noSdram value CHECKED or UNCHECKED Specifies if the background of the Radio Button and the three images are to be stored in SDRAM or not If noSdram CHECKED then applying the disappear IWC method could result in strange behavior If the parameter is UNCHECKED the button widget will allocate space in the SDRAM equivalent to the size of the Radio Button times four within the frame buffer UNCHECKED is the default Parameter trackinglmage value image Specifies the image to use when the radio button is in the pen down state If this attribute is not present then a default image trackinglmage gif located in Amulet Color Configuration Widgets RadioButton is used Scribble Scribble Widget Scribble class The Scribble Widget allows for freehand drawing on a canvas Assuming a stylus is being used when the stylus sets down the canvas of the Scribble Widget and starts moving within the canvas a freehand line is drawn following the directions of the stylus The freehand line can be 1 to 15 pixels thick and can be any color The Scribble canvas can have an o
150. cursor color is specified the default color is black If the alpha is FF then the cursor color is fully opaque Parameter fillColor value See color entry conventions Specifies the desired lineplot line color See section on colors for more information If no fill color is specified the default color is white If backgroundlmage specified fillColor is not used If the alpha is FF then the fill color is fully opaque Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Line Plot Widget The function is called at an update rate specified by the updateRate attribute Parameter lineColor value See color entry conventions Specifies the desired lineplot line color See section on colors for more information If no line color is specified the default color is black If the alpha is FF then the line color is fully opaque Parameterz lineWeight value pixels Defines the weight thickness of the active line plot in pixels The range is 1 7 0x01 0x07 Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating poi
151. d NumericField and ImageBar widgets If using dual frame buffer starting with version 1 3 0 0 the display would be redrawn at the given updateRate of any of these widgets This potentially would slow the entire system down unnecessarily Fixed memory overwrite problem caused by images that extend below the bottom of the screen InvokeRPC calls now follow the same path as SetValue commands meaning they will go out in the order expected Starting with version 1 3 0 0 the InvokeRPC command could potentially be sent out prior to SetValue commands that were actually called before the InvokeRPC command in the code Dual master communication collisions handled better closing any window that could have resulted in losing sync USB communication packets that are a multiple of 64 now work correctly GEMstudio now supports Turkish version of MS Windows The Flashing pages within the Amulet OS files now wait 20ms before calling Amulet loadFlash reset instead of calling it immediately This allows Please wait while programming flash to always show on dual frame buffer projects Within the GEMstudio layout window Custom Button Widget labels now handle user defined wraps An Amulet OS files now includes the 4th digit of the version Fixed bug in GEMplayer that caused a crash when an Amulet UART invokeRPC x was called Enhancements All UART messages are now deterministic as far as when they will go out the serial port Prior to this
152. d 1 00 is fully opaque no transparency 0 50 would be half transparency 6 Use an absolute hex number This number is not converted so this can be used to specify a specific index number within a color palette HOOFFFF 000000 0000FF FFOOFF Aqua Black Blue Fuchsia 808080 4008000 00FFOO 800000 Gray Green Lime Maroon 000080 808000 FFA500 800080 Navy Olive Orange Purple FFOOOO COCOCO 008080 HFFFFFF Red Silver Teal White FFFFOO Yellow Figure 1 HTML color names along with the rrggbb convention equivalent Control Widgets and Intrinsic values The intrinsic values for most Control Widgets can be either a BYTE WORD or STRING The exceptions to this are the slider widget and the grouped check box widget which can only have numbers BYTES or WORDS for their intrinsic value If the href function call is BYTE specific i e Amulet UART byte S setvalue then the range of the intrinsic value should be 0 255 0x00 OxFF You can alternately specify a BYTE by putting an ASCII character between single quotes i e A which would be the BYTE equivalent of 0x41 or 65 decimal If the intrinsic value can become greater than 255 then you should use WORD specific function calls If the href function call is WORD specific i e Amulet UART word 5 setvalue then the range of the intrinsic value is 0 65535 0x0000 0xFFFF Entering Static Strings If the href function call is STRING specific i e Amulet UART string 5 s
153. d a Master Message at the beginning of a page change the Amulet might not respond back for up to 500ms later If the Amulet does respond it will have performed the request albeit maybe not exactly when you thought it should With the above in mind if your processor pounds Master Messages out at a rapid rate you might want to have all your pages start out by sending an RPC set byte or byteOut command that lets your processor know when it is okay to start transmitting again You could also have an RPC set byte or byteOut command go out prior to leaving any page so your processor will know when to halt transmissions as well Graphic Primitives See Graphic Primitives for more information regarding the use of graphic primitives Table 2 defines the four types of messages regarding graphic primitives that can be sent between an external processor and the Amulet If a graphics primitive is sent that does not fit within the bounds of the given LCD i e a delta x of 380 pixels on a 320 x 240 LCD the Amulet will not draw the graphic primitive Message Byte1 Byte Byte Byte Byte Byte Byte Byte Byte Byte Byte 2 3 4 5 6 7 8 9 10 11 Set 8 bit 0 01 0 40 8 bit CRC CRC Color for color LSByte MSByte Primitive index Amulet 0x01 0x40 CRC CRC Response ACK LSByte MSByte Message Byte 1 Byte Byte Byte Byte Byte Byte Byte Byte Byte Byte 2 3 4 5 6 7 8 9 10 11 Set 32 bit 0 01 0x41 Alpha Blue Green Red CRC CRC Color for LSByte MSByte Primitive Amulet
154. d of the Check Box and the three images are to be stored in SDRAM or not If noSdram CHECKED then applying the disappear IWC method could result in strange behavior If the parameter is UNCHECKED the button widget will allocate space in the SDRAM equivalent to the size of the Check Box times four within the frame buffer UNCHECKED is the default Parameter unCheckedValue value number Specifies the unchecked box value This attribute is only valid when NOT part of a checkbox group The checkedValue can be a BYTE WORD or STRING See note regarding Control Widget intrinsic values Parameter emptylmage value image Specifies the image to use when the checkbox is in the unchecked state If this attribute is not present then a default image an empty black and white square is used Images can be either GIF JPG or PNG Parameter fulllmage value image Specifies the image to use when the checkbox is in the checked state If this attribute is not present then a default image a grayed out block and white square is used Images can be either GIF JPG or PNG Parameterz hrefOnHitOnly value CHECKED or UNCHECKED Specifies if the check box href function s is launched only upon a hit or not By default hrefOnHitOnly is UNCHECKED which means if the check box has an initHref function the href of the check box group or lone is launched upon loading the page The href is also launched after a forceUpdate call By
155. dated If the image has transparency components the handleTrackinglmage will be forced to be redrawn at each new location This will result in a slightly slower update of the tracking handle Custom Slider Parameter Attributes Parameter invisible valuez CHECKED or UNCHECKED Specifies if the Custom Slider is to start out invisible or not If the attribute is not CHECKED then by default the Custom Slider is visible If the Custom Slider starts out invisible the only way to make it visible again is via the IWC method reappear If invisible not specified the default is UNCHECKED Parameter channellmage value image Image used as the background over which the slider handle travels Image dimensions MUST be exactly the same as the dimensions of the Custom Slider Widget Image file must be of type GIF JPG or PNG Parameter handlelmage value image Image used as the slider handle when not pressed Image file must be of type GIF JPG or PNG Parameter handleTrackingl mage value image Image used as the slider handle when pressed Image file must be of type GIF JPG or PNG Parameter href value function s The function or multiple sequenced functions invoked upon the event specified in hrefEvent See Appendix B for all available functions for the Slider widget Parameter hrefEvent valuez On Change or On Release The event which triggers the launching of the href function If set to On C
156. ded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the updateRate value Parameter xSamples valuez number Number of samples along the horizontal x axis The range is 2 125 for a UART byte array 2 62 for a UART word array 2 256 for an InternalRAM byte array and 2 256 for an InternalRAM word array NOTE The value must be less than the value specified in the WIDTH attribute of the tag In order for the graph to reach the far right of the dimensions of the Line Graph refer to the following algorithm 4 of pixels between plot points WIDTH of 1 xSamples 1 For example if you want to completely fill the graph of a 101 pixel wide line graph then you should have a number that is one greater than a perfect divisor of 100 as your xSamples So your xSamples could be 3 5 6 11 21 26 41 51 If 6 is chosen the of pixels between plot points is 201 1 6 1 40 pixels Parameter yMax value number Maximum value returned from the href function must be greater than yMin If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 OxFFFF Parameter yMin value number Minimum value returned from the href function must be less than yMax If the function returns a byte the range is O 2
157. dgets can now send their current values out via Inter Widget Communication if requested ImageSequence Widgets can now use cached images ImageSequence image chooser allows user to add multiple images at one time instead of only a single image at a time Background images now have the noSDRAM attribute set to TRUE by default if the image is full screen hrefOnHitOnly added to both the Custom Slider and List Widgets Changes for GEMstudio version 1 2 1 0 New Features Bug Fixes Added Run button from GEMcompiler allowing for direct access to the GEMplayer for any HTML based project Only valid on 30 day trials and full versions of the GEMstudio After the 30 day trial has expired the GEMcompiler will still work but the access to the GEMplayer is disabled Fixed bug in UART programming Watchdog timer was erroneously resetting the processor five seconds into programming the flash Fixed bug in get byte array and get word array in ASCII communications protocol After adding the CRC protocol these two opcodes were erroneously removed from the ASCII protocol Fixed hole in 8 bit color depth and gifs with a transparent color If the gif palette and the Amulet were not exactly the same there was a chance the transparent color would not be interpreted correctly Fixed bug in button label wrapping within GEMstudio WYSIWYG edit mode Newly created projects now appear in the list of last opened files Added a negative number sanity check t
158. dio are entered using the rrggbbaa notation where rr is the 8 bit red value gg is the 8 bit green value bb is the 8 bit blue value and aa is the 8 bit alpha transparency value Each value can be a number from 00 to ff in hex The level of transparency is set by the alpha channel The alpha channel is fully transparent with a value of 00 and completely opaque no transparency with a value of FF Internally the colors are stored pre multiplied with the alpha component and the alpha component is stored inverted This speeds up internal drawing but when it comes to adding colors that haven t been entered through GEMstudio things can get confusing This is important because any color that is entered through the serial port is going straight into the internals of the OS so you must pre multiply the colors with the alpha component and then invert the alpha prior to sending it to the Amulet If a fully opaque color is desired then just use an alpha component of 0x00 and the red green and blue components will just use the colors specified If on the other hand you want to have a partially transparent color you must do the following to pre multiply the colors and the alpha component prior to sending the colors to the Amulet controller Multiply each color component with the alpha component and then divide by OxFF to get the pre multiplied value and then invert the Alpha component For example Original colors Alpha Red 0x80 Gree
159. dio di dio dir dir di dir di di dir dio dir di di dio dio dio di dio dir diri di di dio di di di di di dir di dio di dio di dio di di di dio dio di dir dio di didi di dio d di dir di di di dio serial in SERIN 16 84 RxType VarTypel VarType2 SetVarl SetVar2 SERIN 16 84 STR incoming N60 Read a max of 6 bytes or stop when received a null termination character RxType incoming 0 VarTypel incoming 1 VarType2 incoming 2 IF RxType D5 THEN setByte asking for a setByte IF RxType 500 THEN getByte asking for a getByte IF RxType D2 THEN getString asking for a getString IF RxType 501 THEN getWord asking for a getWord IF RxType gt D5 THEN serial value on line is not a function go back to wait for another command 1 lt x x x x lt x ck Ck k lt k x lt k lt lt lt I k k I I lt k lt lt k k II k k k amp amp k k k k amp amp k amp amp k k k k X X lt Handler for getByte function request f request string 0xD0xx Format of Returns OxEOxxNN where NN equals the data of the variable variable being requested 1 lt x x x x lt x lt x k lt lt k x lt k lt lt lt lt k k lt I k k lt k k k k amp amp k k k k amp amp k k k k
160. dlmage value image Image used as the Line Graph background image Image dimensions should be the same as the dimensions of the Line Graph Widget Image file must be of type GIF JPG or PNG If no image specified the default background will be blank Parameter fillColor value See color entry conventions Specifies the desired linegraph line color See section on colors for more information If no fill color is specified the default color is white If the alpha is FF then the fill is fully opaque Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Line Graph Widget The function is called at an update rate specified by the updateRate attribute Parameter lineColor value See color entry conventions Specifies the desired linegraph line color See section on colors for more information If no line color is specified the default color is black If alpha is FF then the lineColor is fully opaque Parameterz lineWeight value pixels Defines the weight thickness of the active line graph in pixels The range is 1 7 0x01 0x07 Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loa
161. e 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x24 0x24 0x25 0x25 0x26 0x26 0x27 0x27 0x28 0x28 Variable Start Index Variable Start Index Variable Start Index Variable Start Index Variable Start Index Variable Start Index CRC LSByte Count of RPCs in Buffer Variable Index Variable Index Count of Bytes in Array Count of Bytes in Array Count of Words in Array Count of Words in Array Count of Colors in Array Count of Colors in Array CRC MSByte RPC 1 CRC LSByte UTF 8 Char CRC CRC LSByte MSByte Value Value CRC CRC LSByte MSByte Value Value MSByte LSByte CRC CRC LSByte MSByte Value Value Bits Bits 31 24 23 16 Alpha Blue None None 2 3 MSByte UTF 8 UTF 8 Char Char None Value None Value MSByte None Value Bits 15 8 Green None RPC 4 None UTF 8 Char None Last Value in Array None Last Value LSByte in Array None Last Value Bits 7 0 Red in Array None RPC n None 0 00 Null Terminator None CRC LSByte None CRC LSByte None CRC LSByte None CRC LSByte None CRC LSByte None CRC MSByte None CRC MSByte None CRC MSByte None CRC MSByte None CRC MSByte Amulet Set Byte Variable Server Response Amulet Set Word
162. e function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe South gesture To be considered a Multi Touch Swipe South gesture the Touch Area needs to be touched by two or more fingers and then swiped to the bottom As long as the fingers continue swiping to the bottom the Multi Touch Swipe South gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeSouth function s will be called See Appendix B for all available functions for the onMultiTouchSwipeSouth event Multi Touch Swipe South Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeSouthEast value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe South East gesture To be considered a Multi Touch Swipe South East gesture the Touch Area needs to be touched by two or more fingers and then swiped to the bottom and the right As long as the fingers continue swiping to the bottom and the right the Multi Touch Swipe South East gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeSouthEast function s will be called See Appendix B for all available functions for the onMultiTouchSwipeSouthEast event Multi Touch Swipe South East Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeSouthWest value function s The function or m
163. e above function would return a word value of 0x20 One way to use the Amulet internal fileNumber value function is to have each page within a project have a couple of METAs that looks like lt META HTTP EQUIV Refresh CONTENT 0 0 01 URL Amulet nop ONVAR Amulet internal fileNumber value value InternalRAM word OxFF gt META HTTP EQUIV Refresh CONTENT 0 0 02 URL Amulet UART word OxFF setValue InternalRAM word OxFF The first META loads InternalRAM word variable with the flash index number of the given page Just a note on why this saves the flash index number to InternalRAM word variable 0 META s by their nature will hold data in their own memory space not in InternalRAM but this can be changed by using the value attribute in the META and specifying a specific Internal RAM variable In this case we set the value to InternalRAM word OxFF so instead of saving its value its own memory space it now saves its value in Internal RAM word variable OxFF The second META then sends out a setWord command out the UART setting external word variable OxFF to the value of Internal RAM word variable 0xFF which was just loaded with the flash index number of the given page Notice that the second META is launched 10ms after the first one This allows for the updating of Internal RAM word variable OxFF Using the above inc file again if these two METAs were in Page 1 htm they would be the equivalent to the fol
164. e bit 0 If the box is part of a group the range is 1 255 0x01 OxFF If a lone box the checkedValue can be a BYTE WORD STRING See note regarding Control Widget intrinsic values Parameter font value font font size Specifies the font and font size used for the checkbox label See Amulet GEM Font Converter for more information regarding the creation of auf font files Default font is Bitstream Vera Sans Default font size is 12pt Parameter fontColor value See color entry conventions Specifies the desired font color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value BOLD or ITALIC or PLAIN Specifies the style associated with the checkbox label font The available font styles are BOLD The option text is bold i e text ITALIC The option text is italicized i e text PLAIN The option text is standard font i e text Parameter groupName value text For a grouped checkbox specifies the checkbox group assignment Attribute not needed if a lone checkbox Parameter href value function s The function or multiple sequenced functions invoked when a checkbox is toggled checked or unchecked If the checkbox is NOT part of a checkbox group the argument of the function is determined by the state of the checkbox If checked the argument is determined by the checkedValue parameter if unchecked
165. e required font file cannot be found Please restart GEMstudio to use the new saved font NOTE The font size that you load must match the font size used in the page you created earlier The save file name is the font name with _xx appended to the end where _xx is the corresponding point size This is the format that must be used for the compiler to compile correctly Save as Amulet Font Savein Fonts 0 00 A e 2 Amulet Sans Serif 8 auf Bitstream Vera Sans Mono 8 auf Bitstream i E Amulet Sans Serif 10 auf Bitstream Vera Sans Mono_10 auf Bitstream My Recent Amulet Sans Serif_12 auF Bitstream Vera Sans 12 auf Colaborat Documents Amulet Sans Serif _14 auf Bitstream Vera Sans Mona 14 auf Colaborat 2 Amulet Sans Serif 18 auf Bitstream Vera Sans Mono 18 auf Colaborat 4rial_8 auf El Bitstream Vera Sans_8 aufF Colaborat Desktop Arial 9 auf Bitstream Vera Sans_10 auf E Colaborat Arial 10 auf El Bitstream Vera Sans 12 auf Arial 11 auf Bitstream Vera Sans 14 auf E Diavlo Ligl Arial 12 auf Bitstream Vera Sans 18 auf E Diavlo Ligl Arial 14 auf Bitstream Vera Serif 8 auf Arial 16 auf Bitstream Serif_10 auf Ligl PE Arial 18 auf Bitstream Vera Serif 12 auF Existence Computer lt File name 5 ystem 12 m
166. e with a check in it is used Images can be either GIF JPG or PNG CustomButton Custom Button Widget CustomButton class The Custom Button Widget uses two images a pressed and a not pressed to create a custom button Custom buttons are Amulet anchors that allow a separate pressed image to appear instead ye of merely inverting the image Custom buttons can be set to be either a spring loaded or a toggle button By default when hit a custom button invokes a function or set of functions S Optionally custom buttons can be set to auto repeat while pressed Initial delay and repeat frequency both customized Each custom button can have a user defined label text or numeric within the button image If the label is specified as fromlnitHref the label will be based upon a string variable that is passed from the initHref function at run time The label text will automatically wrap if the string exceeds the width of the custom button User defined wraps can be specified by entering An at the point of the desired wrap Custom buttons can also be set up to auto repeat When pressed an auto repeat button delays a user defined amount of time then invokes a function or set of functions at a user defined frequency while the button is still being pressed As a side benefit of the auto repeat functionality a button can be created that will appear to invoke its function s immediately upon being pressed instead of waitin
167. ea then sliding off and then sliding back on the Touch Area while maintaining contact with the touch panel The Slide On event will only launch once for every Slide On occurrence It is possible to have multiple Slide On occurrences if the finger slides back off the Touch Area and then back on again See Appendix B for all available functions for the onSlideOn event Parameter onSwipeEast value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe East gesture To be considered a Swipe East gesture the Touch Area needs to be touched by one finger and then swiped to the right As long as the finger continues swiping to the right the Swipe East gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeEast function s will be called See Appendix B for all available functions for the onSwipeEast event Swipe East Gesture only available on select capacitive touch panels Parameter onSwipeNorth value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe North gesture To be considered a Swipe North gesture the Touch Area needs to be touched by one finger and then swiped to the top As long as the finger continues swiping to the top the Swipe North gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeNorth function s will be called See Appendix B for all available functions for the onSwipeNorth eve
168. enDump page embedded in the OS files ScreenDump page uploads the image on the LCD in the Amulet Bitmap Format using the xmodem with crc protocol Sends a raw byte x out the SPI bus while taking Amulet SPI slave select line z low Put x in single quotes to be treated as an ASCII character i e 9 is equal to 0x39 Sends a stream of raw bytes x1 x2 xn out the SPI bus while taking Amulet SPI slave select line z low If the spixCSAAT 1 in the SPI Configuration settings then the slave select will stay low between each byte if spixCSAAT 0 then the slave select will go high between each byte Amulet SPI z stringOut x 1 Amulet togglePolarity Amulet UART byteOut x 1 Amulet UART invokeRPC x Amulet UART byte z setValue x Amulet UART streamOut x1 x2 xn Amulet UART stringOut x Amulet UART string z setValue x Amulet UART word z setValue x filename open Sends an ASCII string x not null terminated out the SPI bus while taking Amulet SPI slave select line z low If the spixCSAAT 1 in the SPI Configuration settings then the slave select will stay low between each byte if spixCSAAT 0 then the slave select will go high between each byte Where x is a single quoted string or x can also be an InternalRAM string variable Toggles the display polarity of the LCD between positive and negative Once toggled the state of the polarity is saved in the flash Need to reload a page to see the resultant
169. equence will be loaded in the sdram for faster page load However this does not affect image to image transition If loadlmmediately is UNCHECKED then the images won t be loaded in the sdram Page loading will be slower because the images needed to be loaded into the sdram first The default for loadlmmediately is UNCHECKED Line Line Graph Widget LineGraph class The Line Graph Widget is a static 2 dimensional line graph that represents an array of bytes or words returned from an href function call Each byte or word in the array represents a point on the line graph The line weight thickness is user defined as well as the number of samples in the x direction and the sampling rate The line graph can be drawn over a background image The graph is scaled in the y direction based on yMin and yMax There is a slight yet noticeble flicker every time the line graph is updated Because of this it is recommended that you update only when there is a change data The IWC method forceUpdate can be used to force an update at asynchronous intervals Line Graph Widget Line Graph Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Line Graph is to start out invisible or not If the attribute is not present then by default the Line Graph is visible If the Line Graph starts out invisible the only way to make it visible again is via the IWC method reappear Parameter backgroun
170. ered into GEMstudio stay hex numbers rather than automagically being converted to decimal 30 day trial version can now program up to 5 GEMstudio pages instead of only 1 This change log can now be accessed from within GEMstudio using Help gt View Change Log Changes for GEMstudio version 1 0 3 1 Bug Fixes Fixed bug in slave communications if display uses SPI for initialization Resulted in no response from the Amulet Custom arrow images for the List widget can now be used GEMplayer now handles initialized InternalRAM variables correctly Enhancements GEMstudio projects can now be edited while help windows are open Help windows launched from the href editor or page functions window are still modal meaning they must be closed before editing within GEMstudio Background images that have no transparency default to having cachedlmage set to True Changes for GEMstudio version 1 0 3 0 Bug Fixes Fixed bug in the communications protocol when two masters sent a command at the same time Error was with the way the Amulet handled the incoming master message It responded fine but it erroneously would resend its own master message again immediately rather than waiting for the timeout period Fixed bug in dual master protocol when the Amulet received a page change command via serial protocol and while on the new page the Amulet received an unsolicited response to a master message prior to sending any master messages out the A
171. ermined by scaling the value returned from the href Image Sequence function call The following algorithm is used Widget 5 The Image Sequence Widget is similar to an animated bitmap However instead of being linked to a Image total of images value of byte from function min max min 1 The resultant number truncated to an integer is the number of the image to display where the first image in the sequence is numbered 0 For all images to be displayable max min 1 must be greater than or equal to the number of images Also if the href function returns a value less than the specified min the value will be treated as equal to the specified min Likewise if the href function returns a value greater than the specified max the value will be treated as equal to the specified max Consider the following example A sequence of 7 separate images ImageO Image6 N An href function that returns a byte that ranges between a min of 23 and a max of 232 Although the value returned by the href function may vary with time only one of the seven images will be displayed at any one time Table 1 below maps each value range to the image that will be displayed Note that values below 23 are treated like a 23 and values above 232 are treated like a 232 5 203 255 67 203 23 232 23 1 6 7 173 23 232 23 1 5 173 202 7 143 23 232 23 1 4 17 113 23 232 23 41 3 7
172. ersion 1 3 0 0 Change Log for GEMstudio version 1 2 1 0 Change Log for GEMstudio version 1 2 0 0 Change Log for GEMstudio version 1 0 3 1 Change Log for GEMstudio version 1 0 3 0 Changes for GEMstudio Pro version 2 0 0 0 New Features GEMscript a new scripting language accessible via the Page Functions is now available A GEMstudio tutorial called Jumping Into GEMstudio has been added to the GEMstudio Help menu which walks new GEMstudio users through the creation of a simple project Added the ability to nest pages by dragging one page into another allowing child pages to inherit content from their parent pages such as a common menu bar common page functions The 480x272Demo now uses nested pages A custom bezel can now be added to reflect what your end product will actually look like When used it will appear in both the Layout mode and GEMplayer The Amulet OS now supports touching off screen objects if the touchscreen is larger than the display GEMstudio now has the ability to increase or decrease the size of the layout canvas layout This is particularly useful when dealing with off screen objects Added support for GIMP Palette files Any Display can now be rotated or 90 180 270 degrees from their native orientation with a project setting Additionally it is possible to flip between 0 and 180 or between 90 and 270 at runtime with a new IWC command Enhancements Added page buffer size monitor
173. es the method originally specified by the Image Bar s href parameter setUARTMethod m Changes the UART method originally specified by the Image Bar s href parameter setUpdateRate f Changes the update rate originally specified by the Image Bar the argument being a floating point number specifying time in seconds setVariableNumber x Changes the variable number originally specified Image Bar be used only if the Image Bar href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber x setValue x Image Bar uses x as its input This allows a Control Widget to provide the input to an Image Bar setX x Sets the x coordinate of the topleft corner of the Image Bar to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Image Bar to the coordinate specified by the word x startUpdating Image Bar starts graphing based upon its input data Counteracts the stopUpdating method stopUpdating Image Bar stops graphing toggleUpdating Changes current state of Image Bar either starts or stops graphing Image Sequence disappear Makes the Image Sequence not visible on the LCD forceRefresh Forces the Image Sequence to paint the image at the next update even if the incoming value is the same as the current state Useful if an anchor is used around an Image Sequence to force the image to be the corre
174. et of methods Examples Amulet UART byte 0 value UART specifies that a serial message will go out the UART byte 0 specifies byte variable 0 value specifies the value of byte variable 0 is returned Amulet internalRAM word 5 setValue OxF020 internalRAM specifies the dual port RAM onboard the Amulet word 5 specifies the internal RAM word variable 5 setValue OxF020 specifies internal RAM word variable 5 is to be set to the value OxFO20 Amulet internalRAM string 5 setValue Your String internalRAM specifies the dual port RAM onboard the Amulet string 5 specifies the internal RAM string variable 5 setValue Your String specifies that internal RAM string variable 5 is to contain the null terminated string Your String For more information regarding string variables see the note regarding string variables The same nomenclature as Java is used where a method is called by using the object s name followed by the dot operator followed by the method Amulet has added a new wrinkle with the concept of multiple byte word and string variables Since there can be 256 different byte variables 256 different word variables and 201 different 19 character string variables there needs to be a way of specifing the type of variable as well as the variable number Therefore if the object is a byte word or string variable the nomenclature is of the following type Amulet object variable variable method argument if needed
175. et processor the first byte is the Host ID If the slave is responding to a master message it will also start with the ID of the slave processor The second byte is always the opcode of the function See Table 4 for the full list of available opcodes The remaining payload bytes opcode dependent final two bytes is the LSByte MSByte of the See the CRC documentation on how to derive the 16 bit CRC Essentially all bytes prior to the two CRC bytes are run through the CRC algorithm The result is the last two bytes of the message If the CRC received is not the same as the CRC derived then the message should be disregarded as the integrity of the message cannot be assured For example if the GEMstudio file being compiled has a view widget with an href of Amulet UART byte 0x1A value which will send out the Get Byte Variable 0x1A request the message to be transmitted would consist of five bytes The first byte is the Host ID 0x02 the second byte is the Get Byte Variable opcode 0x20 third byte is the byte variable number 0x1A fourth byte is the LSByte of the 16 bit CRC of the first three bytes 0x48 and the seventh and final byte is the MSbyte of the 16 bit 0x0B So the five byte message looks like 0 02 0x20 OxA1 0 48 OxOB NOTE The slave must respond to every valid Amulet command When commands are not responded to a time out will occur after 200ms by default and that message will be repea
176. etvalue then the intrinsic value should be specified between double quotes i e My string The maximum length of a string value is 254 characters Using Backslashes Commas and Semi colons within Strings stored in Function Calls Since commas and semi colons are used to distinguish Multiple Function Calls and Sequenced Function Calls in order to use commas and semi colons within strings that are used in function calls you must use the escape character V prior to the comma or semi colon Conversely since the backslash is used as the escape character in order to use a backslash within a string you must use two backslashes in a row For example to set InternalRAM string variable 5 to the string To use a comma or backslash X use the escape character same for the semi colon the href would look like this Amulet InternalRAM string 5 setvalue To use or back slash W use the escape character same for the semi colon If you fail to use the escape character in front of commas semi colons and back slashes you will get an error when you try to Run or Program the project although it won t explicitely say that the escape character is missing Rather you will get an error complaining of a missing link Object Amulet object type widget consists of three widgets Image e Animated Image e Static Text Image Although they cannot represent data like other View Widgets can images do have internal methods
177. f the Amulet was requesting the value of a byte variable that resides on the external processor RPC buffer If a setup where the Amulet is always the slave is needed or desired then up to six RPCs can be buffered in the Amulet s Internal RAM The external processor can request the contents of the RPC buffer by sending a Get Internal RAM RPC buffer request 0x27 When the Amulet is the master and an RPC is invoked the Amulet will immediately send out the RPC command If the Amulet is setup to use the Internal RAM RPC buffer instead then the Amulet will send the RPC to an RPC buffer The RPC buffer can only be read by an external processor by sending a Get Internal RAM RPC buffer request 0x27 The Amulet will respond with a count byte and all the RPCs up to six stored in the RPC buffer After sending out the contents of the RPC buffer the Amulet will then flush the buffer For example to request the contents of the InternalRAM RPC buffer the following would be sent to the Amulet 0x01 0x27 0x40 Ox3A If the InternalRAM RPC buffer has the following RPCs in it 0x01 0x05 0x05 0x06 the following would be returned by the Amulet 0x01 0x27 0x04 0x01 0x05 0x05 0 06 Ox6E 0x78 If the same request is made before the InternalRAM RPC buffer is repopulated the following would be returned by the Amulet 0 01 0 27 0 00 Where is the slave ID The Amulet ID this case is the Amulet message to send is the two
178. f View Widgets Bargraph Dynamic Image Image Bar Image Sequence Line Graph Line Plot Linear Gauge Numeric Field String Field BarGraph Bargraph Widget BarGraph class A Bargraph Widget is a live bargraph that represents the byte or word value returned from a function call The bargraph moves from left to right right to left bottom to top or Bar Graph top to bottom Widget Bargraph Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Bar Graph is to start out invisible or not If the attribute is UNCHECKED then by default the Bar Graph is visible If the Bar Graph starts out invisible the only way to make it visible again is via the IWC method reappear Parameter fillColor value See color entry conventions Specifies the desired bargraph fill color See section on colors for more information If no fill color is specified the default color is black If the alpha is FF then the fill color is fully opaque Parameter borderColor value See color entry conventions Specifies the desired bargraph border color See section on colors for more information If no border color is specified the default color is the fillColor color If the alpha is FF then the border color is fully opaque Parameter backgroundColor value See color entry conventions Specifies the desired bargraph background color See section on colors for more information If no background
179. f the external byte variable number 2 The InternalRAM object specifies that the Amulet will read the value of the Internal RAM byte variable number 2 The InternalRAM object will not send out any serial requests since the Amulet is capable of reading the Internal RAM directly Using InternalRAM variables as method arguments A powerful feature of Internal RAM variables is that they can be used as arguments within Amulet href methods This means that instead of using a Control Widget s intrinsic value as a function parameter you can use Internal RAM variables which can be changed at run time by your external processor Internal RAM byte word and string variables can all be used as method arguments For example to have a button send out an RPC that is defined by Internal RAM byte variable 1 you would use the following nomenclature Amulet UART invokeRPC InternalRAM byte 1 The value which is contained within Internal RAM byte variable 1 would be sent out as the RPC number over the UART Another example which sends out an Internal RAM string variable Amulet UART string 0 setValue InternalRAM string 2 This sends the string contained within Internal RAM string variable 82 out the UART as a set external string variable H0 command to an external processor When using Internal RAM variables as method arguments use the following naming conventions InternalRAM byte x InternalRAM string x InternalRAM word x Do not precede with Amulet
180. fault the protocol does not provide for a termination character except when sending strings The Amulet can be forced to null terminate every single response by using a META tag in the Page Properties or Project Properties windows With this META attribute all messages sent from the Amulet will be followed by a 0x00 This can be handy in the receive section of your serial protocol code if you don t have time to analyze each byte received as it is coming in Example lt META NAME Amulet Content NullTerminate Project gt Basic Stamp If you are using a BASIC Stamp product you should use the BASICStamp META tag attribute You should also use 9600 baud The BASICStamp attribute essentially sets both the UARTDelay and NullTerminate flags The interbyte delay will be between 2 3ms and all messages from the Amulet will be null terminated When using the SERIN command use the following special string formatter SERIN 16 84 STR ByteArray L E Where ByteArray is the name of an internal byte array in the BASIC Stamp L is the size of the byte array and E is the termination character In the Amulet case E would be 0 Make sure you do not put quotes around 0 otherwise the BASIC Stamp will be looking for a termination character of 0 or 0x30 Please see your BASIC Stamp documentation for full details regarding the SERIN command Example of the BASICStamp META tag attribute lt META NAME Amulet Content BASICStamp Project gt Response When
181. fe palette Colors can be entered in one of five different ways 1 Use one of the 17 HTML standard color names See Figure 1 2 Specify the red green and blue values in hex using the following convention rrggbb where rr is the 8 bit red value gg is the 8 bit green value and bb is the 8 bit blue value Each value can be a number from 00 to ff in hex 3 Specify the red green blue and alpha values in hex using the following convention rrggbbaa where rr is the 8 bit red value gg is the 8 bit green value bb is the 8 bit blue value and aa is the 8 bit alpha transparency value Each value can be a number from 00 to ff in hex The level of transparency is set by the alpha channel The alpha channel is fully transparent with a value of 00 and completely opaque no transparency with a value of FF 4 Specify the red green and blue values in decimal using the following convention rgb rrr ggg bbb where rrr is the 8 bit red value ggg is the 8 bit green value and bbb is the 8 bit blue value Each value can be a number from 0 to 255 in decimal 5 Specify the red green blue and alpha values in decimal using the following convention rgb rrr ggg bbb a aa where rrr is the 8 bit red value ggg is the 8 bit green value bbb is the 8 bit blue value and a a is the decimal value of alpha transparency The color values be a number from 0 to 255 in decimal The alpha value can range from 0 00 to 1 00 0 00 is fully transparent an
182. for bytes 0 255 for words 0 255 for color and 0 255 for strings variableNumberEnd is the variable index within the variable type 0 255 for bytes 0 255 for words 0 255 for color and 0 255 for strings value is the initialization value of the Internal RAM variable range if byte 0 0xFF if word O OxFFFF if color 0 OxFFFFFFFF if string 1 25 character string Example InternalRAM byte OxFC OxFF Ox7F InternalRAM word 0x00 OxFF OxFFFF InternalRAM color 0x00 OxFF OxFFFFFFFF InternalRAM string 0 10 undecided Note When initializing a block of contiguous Internal RAM strings the initialization string must be 25 characters or less By default each Internal RAM string variable holds a maximum of 25 characters and null character Initializing special attributes in Internal RAM string variables When initializing string variables it is possible to specify special attributes such as font style line feeds and upper ASCII characters The font styles available are plain bold italic underline and strikethrough If it is desired to set the font style within the initInternalRAM file that can be done by using the font style escape sequence 96s xxx where is bit representation of the desired font style See the table below for the list of font styles and their corresponding bit location Each font style is represented by a single bit within the font style byte Multiple font styles can be specified at one time except i
183. for more information Sets the software calibration bit in the flash memory Causes Amulet to go in calibration mode Amulet internalRAM byte z method x 1 Amulet internalRAM clearRPCBuf Amulet internalRAM invokeRPC x 2 Amulet internalRAM saveToFlash Amulet internalRAM string z method x Amulet internalRAM word z method x Amulet IcdController off Amulet IcdController on Amulet loadFlash back Amulet loadFlash reset upon a soft or hard reset Bit is cleared after succesful calibration Performs the named Internal RAM byte method See Internal RAM documentation for list of available methods Clears the internalRAM RPC buffer Adds the RPC number x to the internalRAM RPC buffer Saves the current state of all the Internal RAM variables byte word and string in the serial data flash There is a 100 000 max write limit on the life of the serial data flash After 10 000 writes the Amulet OS and the user s project should be reprogrammed to maintain data integrity Performs the named Internal RAM string method See Internal RAM documentation for list of available methods Performs the named Internal RAM word method See Internal RAM documentation for list of available methods Turns the LCD controller off The display will go black but everything on the page is still active as far as the touch panel is concerned Turns the LCD controller back on if the LCD controller is off Used in
184. from this example data is stored Big Endian style meaning the bytes go from most significant to least significant The starting offset is from the start of the PDB file 0 00 You can calculate the size of the raw data by subtracting the starting offset from the the next chunk s starting offset if one is available If not then use the end of the file to calculate the last entry s raw data size To help clear this up see the table below File Starting Offset of Starting Offset of Next Length of Current Record Record Raw Data 1 0 00000080 0 00000306 0 0279 2 0 00000306 0 00000330 0 002 3 0x00000330 0x00000354 0x0024 4 0x00000354 0x0000041F 0x00CB 5 0x0000041F 0 000008 6 0x04A7 6 0 000008 6 End of File 0 08 0x002D It is the raw data of the individual record entries which need to be transmitted via xmodem over to the Amulet chip Now that you know how to parse a Palm database file you can easily implement the xmodem protocol in your microprocessor firmware and have the flexibility of reprogramming any Amulet module via your controller Pass Programming Here are the basics you need to know to program the Amulet Color chip from an external processor 1 You need to save your compiled project as a pdb file In Version 1 1 4 and later this feature is part of the full GEMstudio license 2 You need to extract the individual files from the pdb format so you have individual binary files which can be sent to the Am
185. g until the button is released To create an instant hit button set the delay very small and the frequency at 0 The button will invoke its function s after the very short delay time and not repeat again NOTE To display a literal symbol in the label use a double backslash in the string e g 25 NN 5 would display 25 V 5 within the button Custom Button Parameter Attributes Parameter invisible valuez CHECKED or UNCHECKED Specifies if the Custom Button is to start out invisible or not If the attribute is not CHECKED then by default the Custom Button is visible If the Custom Button starts out invisible the only way to make it visible again is via the IWC method reappear Parameter buttonType value TOGGLE or SPRING LOADED Specifies the action of the button when hit TOGGLE causes the button to depress or invert on a pen down event and stay depressed on the ensuing pen up event SPRING LOADED causes the button to depress on a pen down event and return to its original state on the following pen up event SPRING LOADED is the default Parameter downlmage value image Image used when custom button is pressed Image file must be of type GIF JPG or PNG Parameter font value font font size Specifies the font and font size used for the button label See Amulet GEM Font Converter for more information regarding the creation of auf font files Default font is Bitstream Vera Sans The default font size is 1
186. g z copyToRamString x Copy string stored at Internal RAM string variable z into Internal RAM string variable x Result is stored in Internal RAM string variable x Amulet InternalRAM string z copyViaByteVarPtr Jopy string stored at Internal RAM Amulet InternalRAM string z setChar y string variable z into the Internal RAM string variable whose index is the byte value stored at Internal RAM byte x Result is stored in the Internal RAM string variable pointed to by the Internal RAM byte variable x Stores the UTF 8 character y into Internal RAM string variable z setChar adds the null termination to the character y Amulet InternalRAM string z setValue y Amulet InternalRAM string z stringToByte x Amulet InternalRAM string z stringToWord x Amulet InternalRAM string z value Stores the UTF 8 string y into Internal RAM string variable z Converts the ASCII string of a decimal number stored in Internal RAM string variable z to an actual number to be stored in Internal RAM byte variable x Converts the ASCII string of a decimal number stored in Internal RAM string variable z to an actual number to be stored in Internal RAM word variable x Return the null terminated string of Internal RAM string variable z Table 5 Miscellaneous InternalRAM method descriptions InternalRAM Methods Amulet InternalRAM clearRPCBuf Amulet InternalRAM invokeRPC x Amulet InternalRAM saveToFlash Descriptions
187. ge but the period and pulse width values will not be set when the page is loaded and the PWM will not be explicitely set to either on or off This allows for re instantiating a PWM object which has already been created earlier in the project without changing its setup values and current state The default value is ON Parameter periodln ms value time in ms Specifies the period of the waveform ms Range is 0 01 104 Parameter pulseWidthln_ms value time in ms Specifies the pulse width of the waveform in ms Range is 0 01 103 99 RadioButton Radio Button Widget RadioButton class Radio Button 1 A Radio Button is a labeled round button used to make a single selection from several options Radio Button Seta radio button click on either the button or the adjacent label All radio buttons that have the Widget same groupName are considered part of a radio button group Only one radio button within a group can be set at any one time When a radio button is selected its function s are called with the argument being the intrinsic value of the radio button Each radio button can invoke its own href function or set of functions When using initHref to determine the initialCondition of the radio button group the value of the data returned from the initHref function must match the internalNumber of one of the radio buttons in the group If the internalNumber is not specified the first radio button found in the project will be as
188. getByte function request Format of request string is three bytes gt 0xDO vH vL where v variable being requested vH is ASC version of high nibble of v and vL is ASC of low nibble of v Returns five bytes gt 0 0 vH vL NH NL where N value of variable v low byte NH is ASC version of high nibble of N and NL is ASC of low nibble of N FA KCKCKCK kk k k k k k K k k K K KOK KOK KOK KOK KOK CK Ck KOK K K KOK K K KOK Ck CK KK Ck CK KOK KOK KOK KOK KOK KOK K KOK K kk ke kk ke ke ke ke ke ke x kx void getByte void char index byteValue valueHiNib valueLoNib index ascii2hex hiNib lt lt 4 index ascii2hex loNib byteValue byteData index valueHiNib hex2ascii byteValue gt gt 4 valueLoNib hex2ascii byteValue amp 0 0 putchar serverResp putchar hiNib putchar loNib putchar valueHiNib putchar valueLoNib J FCKCKCKCKCKCkCk k K k k K K k k K K K K KOK KOK K K KC K K KOK K K KOK KK OK K K KOK K K KOK K KOK KOK KOK K K KOK K KOK K CK Sk KOK KKK Sk kk K KKK K K Handler for getString function request Format of request string is three bytes gt 0 2 vH vL where v index of string variable vH is ASC version of high nibble of v and vL is ASC of low nibble of v Returns variable number of byte 0 2 vH vL String Null to client
189. ginally specified by the Function Button s href parameter only valid when the originally specified method is a single function setUARTMethod m Changes the UART method originally specified by the Function Button s href parameter only valid when the originally specified method is a single function setValue x The Function Button intrinsic value is changed to x setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Function Button href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function setX x Sets the x coordinate of the topleft corner of the Function Button to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the Function Button to the coordinate specified by the word x value Sends the intrinsic value of the Function Button to the calling widget The calling object then uses that value as its input This allows a Function Button to provide the input to a View Widget This method is called from a View Widget href Image Bar disappear Makes the Image Bar not visible on the LCD forceUpdate Forces the Image Bar to call its href function immediately regardless of the updateRate reappear Makes the Image Bar visible on the LCD Counteracts the disappear method setMethod m Chang
190. ginally specified method is a single function setUARTMethod m Changes the UART method originally specified by the List s href parameter only valid when the originally specified method is a single function setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used if the List href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function setX x Sets the x coordinate of the topleft corner of the List to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the List to the coordinate specified by the word x value Sends the intrinsic value of the List to the calling widget The calling object then uses that value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href Numeric Field disappear Makes the Numeric Field not visible on the LCD forceUpdate Forces the Numeric Field to call its href function immediately regardless of the updateRate inverseRegionColor Makes the entire Numeric Field both the background and the text display in reverse video Counteracts the normalRegionColor method inverseStringColor Makes the Numeric Field s text string display in reverse video Counteracts the normalStringColor method normalRegionColor
191. hange the slider will launch the function call whenever the handle is moved If set to On Release the slider will only launch the function call upon the releasing of the slider handle If hrefEvent is not specified the default is On Change Parameter initialCondition value number or FromlnitHref Specifies handle position when the page is loaded The position value becomes the argument given to the href function s If FromlnitHref is selected the function specified by the InitHref attribute is called The returned value determines the handle position The range is 0 65535 0x00 OxFFFF Parameter max value number maximum value used as the argument given to the function s specified in href By default maximum value is achieved when handle is full right on a horizontal slider or full top on a vertical slider The range is 1 65535 0x01 0xFFFF Parameter min value number The minimum value used as the argument given to the function s specified in href By default minimum value is achieved when handle is full left on a horizontal slider or full bottom on a vertical slider The range is 0 65534 0x00 OxFFFE Parameter minAt value LEFT or RIGHT or TOP or BOTTOM Determines where the minimum value of the slider is located As the handle sweeps from the minAt location the value increases until the maximum value is reached at the opposite extreme of the minAt location Default values are LE
192. he Image Bar is to start out invisible or not If the attribute is UNCHECKED then by default the Image Bar is visible If the Image Bar starts out invisible the only way to make it visible again is via the IWC method reappear Parameter empty value image Image used when minimum value is returned from the href function Image file must be of type GIF JPG or PNG Parameter full value image Image used when maximum value is returned from the href function Image file must be of type GIF JPG or PNG Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Image Bar widget The function is called at an update rate specified by the updateRate attribute Parameter max value number Maximum value returned from the href function must be greater than min If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 OxFFFF Parameter min value number Minimum value returned from the href function must be less than max If the function returns a byte the range is O 254 0 00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Parameterz sweepFrom value LEFT or RIGHT or TOP or BOTTOM Determines where within the image bar cell to begin the image transition The options are LEFT The full and empty images tran
193. he finger continues swiping to the bottom and the left the Swipe South West gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeSouthWest function s will be called See Appendix B for all available functions for the onSwipeSouthWest event Swipe South West Gesture only available on select capacitive touch panels Parameter onSwipeWest value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe West gesture To be considered a Swipe West gesture the Touch Area needs to be touched by one finger and then swiped to the left As long as the finger continues swiping to the left the Swipe West gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeWest function s will be called See Appendix B for all available functions for the onSwipeWest event Swipe West Gesture only available on select capacitive touch panels Parameter onTap value function s the function or multiple sequenced functions invoked after the Touch Area is tapped using one finger To be considered a Tap the Touch Area needs to be touched by one finger for 150ms or less It is possible to adjust the time required to be considered a tap by contacting Amulet Technologies See Appendix B for all available functions for the onTap event Parameter onTouch value function s the function or multiple sequenced functions invoked after the Touch Area is initially touched
194. he min value is determined by the minAt attribute left right top or bottom The height and width dimensions determines whether the slider is horizontal or vertical The longer dimension establishes the path that the slider travels while the shorter dimension determines the maximum handle size In addition the widget creates a 3 pixel wide channel along the slider path To move the slider touch the handle and drag it along the channel If hrefEvent is setup as onChange the slider invokes the function s whenever the handle moves If hrefEvent is setup as onPenUp the slider invokes the function s only upon releasing the handle Touching anywhere on the channel causes the handle to snap to that location and invoke the function s with the corresponding argument Tick marks are optional As an option you can specify the offset of the handle from the center of the channel by using the handleOffset parameter Slider Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Slider is to start out invisible or not If the attribute is not CHECKED then by default the Slider is visible If the Slider starts out invisible the only way to make it visible again is via the IWC method reappear Parameter channelColor value See color entry conventions Specifies the color of the channel the handle slides along See section on colors for more information If no channel color is specified the default color is bla
195. he y coordinate of the topleft corner of the Line Graph to the coordinate specified by the word x startUpdating Line Graph starts plotting based upon its input data Counteracts the stopUpdating method stopUpdating Line Graph stops plotting toggleUpdating Changes current state of Line Graph either starts or stops plotting Line Plot disappear Makes the Line Plot not visible on the LCD forceUpdate Forces the Line Plot to call its href function immediately regardless of the updateRate reappear Makes the Line Plot visible on the LCD Counteracts the disappear method reset Clears the Line Plot setMethod m Changes the method originally specified by the Line Plot s href parameter setUARTMethod m Changes the UART method originally specified by the Line Plot s href parameter setUpdateRate f Changes the update rate originally specified by the Line Plot the argument being a floating point number specifying time in seconds setValue x Line Plot uses x as its input This allows a Control Widget to provide the input to a Line Plot setVariableNumber x Changes the variable number originally specified by an Line Plot Can be used only if the Line Plot href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber x setX x Sets the x coordinate of the topleft corner of the Line Plot to the coordinate specified by the word x setY x Se
196. heck Box Group not an individual CheckBox setX x Sets the x coordinate of the topleft corner of the individual CheckBox to the coordinate specified by the word x e setY x Sets the y coordinate of the topleft corner of the individual CheckBox to the coordinate specified by the word x value Sends the intrinsic value of the CheckBox to the calling widget The calling object then uses that value as its input This allows a CheckBox to provide the input to a View Widget This method is called from a View Widget href Custom Button buttonDown Sets the Custom Button Widget to look like it is its down state This method does NOT invoke the href functions It only affects the looks of the button not the functionality buttonUp Sets the Custom Button Widget to look like it is its up state This method does NOT invoke the href functions It only affects the looks of the button not the functionality disappear Makes the Custom Button not visible or touchable on the LCD e forceHit Custom Button performs its hit method without user input The hit method will invoke all href functions of the Custom Button e forceUpdate Forces the Custom Button to call its initHref function immediately Only valid if label is fromInitHref Updates the Custom Button label without performing a hit e maskedValue y Sends the intrinsic value of the Custom Button to the calling widget The calling object then uses that v
197. hose methods specifically act Click on the following links to jump to the specific widget s IWC methods Widgets Control Widgets View Widgets Check Box Bargraph Custom Button Dynamic Image Custom Slider Image Bar Function Button Image Sequence List Line Plot Pulse Width Modulation Line Graph Radio Button Linear Gauge Scribble Numeric Field Slider String Field Objects Control Objects View Objects META Refresh Tag Animated Image Image Notes Regarding Method Parameters x m and f BarGraph disappear Makes the BarGraph not visible on the LCD forceUpdate Forces the BarGraph to call its href function immediately regardless of the updateRate reappear Makes the BarGraph visible on the LCD Counteracts the disappear method setValue x BarGraph uses x as its input This allows a Control Widget to provide the input to a BarGraph setMethod m Changes the method originally specified by the BarGraph s href parameter setUARTMethod m Changes the UART method originally specified by the BarGraph s href parameter setUpdateRate f Changes the update rate originally specified by the BarGraph the argument being a floating point number specifying the time in seconds setVariableNumber x Changes the variable number originally specified by a BarGraph Can only be used if the BarGraph href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber
198. iable Server Response Amulet Set Color Variable Server Response 0xE4 0xD5 5 0xD6 OxE6 OxD7 OxE7 OxF6 OxF7 RPC flag Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble Variable Hi Nibble RPC flag Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble Variable Lo Nibble RPC 1 Hi Nibble Value Hi Nibble Value Hi Nibble RPC 1 Lo Nibble Value Lo Nibble Value Lo Nibble Hi Value Hi Hi Nibble Lo Nibble Hi Value Hi Hi Nibble Nibble ASCII char ASCII char Lo ASCII char ASCII char Red Byte Hi Nibble Lo Nibble Red Byte Hi Nibble Lo Nibble RPC 2 RPC 2 0x00 Hi Nibble Lo Nibble None None None None None None None None None None None None LS None None None Byte Value Lo Value Lo Hi Nibble Lo Nibble LS None None None Byte Value Lo Value Lo Hi Nibble Lo Nibble ASCII ASCII 0x00 char char ASCII ASCII 0x00 char char Green Byte Blue Alpha Hi Nibble Byte Byte Lo Nibble Hi Nibble Hi Nibble Lo Nibble Lo Nibble Green Byte Blue Alpha Hi Nibble Byte Byte L
199. ic value is a byte or word The mask y can be either a byte or word This allows a Control object to provide the input to a View Widget This method is called from a View Widget href reappear Allows the META Refresh Tag URL to be launched Counteracts the disappear method reset Resets timers in the META Refresh Tag setValue x The META Refresh Tag intrinsic value is changed to x setMethod m Changes the method originally specified by the META Refresh Tag s URL parameter it is only valid when the originally specified method is a single function If the URL method uses the UART then you must use the setUARTMethod method setOnVarMethod m Changes the method originally specified by the META Refresh Tag s trigger variable parameter it is only valid when the originally specified method is a single function If the ONVAR method uses the UART then you must use the setOnVarUARTMethod method setOnVarUARTMethod m Changes the UART method originally specified by the META Refresh Tag s trigger variable parameter it is only valid when the originally specified method is a single function If the ONVAR method does not use the UART then you must use the setOnVARMethod method setOnVarVariableNumber x Changes the variable number originally specified by the META Refresh s onVar parameter Can be used only if the META Refresh onVar has a byte y word y or string y In all cases the y gets changed to the argument specified in set
200. ies the optional background image used for the canvas of the Scribble Widget This is an optional parameter The image does not have to be the exact same dimensions as the Scribble Widget but it will start drawing the background image from the topleft corner of the Scribble Widget By default the background image is initially displayed upon page load If the canvas is saved it will replace the canvas image and the background image will be left untouched Image file must be of type GIF JPG or PNG Parameter initlmage value Canvas or Background or Fillcolor Specifies if the background image is displayed initially upon page load If set to Canvas the canvas image is displayed initially upon page load Defaults to Canvas if initlmage is not specified Parameter fillColor value See color entry conventions Specifies the desired lineplot line color See section on colors for more information If no fill color is specified the default color is white If backgroundlmage specified fillColor is not used If the alpha is FF then the fill color is fully opaque Slider Slider Widget Slider class The Slider Widget invokes a function or set of functions either upon 1 any movement of the handle onChange 2 only when the handle has been released onPenUp argument is determined by the location of the handle and the limits setup with the min Slider Widget and max attributes The location of t
201. ignment and or prototypes are sold AS IS WITH ALL FAULTS and with no warranty whatsoever If during the applicable warranty period i Seller is notified promptly in writing upon discovery of any defect in the products including a detailed description of such defect ii such products are returned to Seller and Buyer prepays freight cost accompanied by Seller s Returned Material Authorization form and iii Seller s examination of such products discloses to Seller s satisfaction that such products are defective and such defects are not caused by accident abuse alteration misuse neglect improper installation repair improper testing improper maintenance negligence improper handling inadequate packaging damage by excessive voltage or current or otherwise had its serial number or any other part altered defaced or removed or use contrary to any instructions issued by Seller Seller shall at its sole option either repair or replace such products No products may be returned to Seller without Seller s Returned Material Authorization form All defective items replaced hereunder shall become the property of the Seller Any modifications changes or alterations to the products by the Distributor or end customer voids the warranty The warranty set forth herein cannot be extended altered or modified except by written amendment to this Agreement Seller reserves the right at Seller s option to inspect and or repair
202. ile The new and improved map file contains all the memory usage both SDRAM and Serial Data Flash for each object and each page of the project Both the map and inc files are now located in the Map subfolder of the root project folder Added the ability to change the touch priority when dealing with layered objects By default as far as touch priority goes the objects that are on a visually higher layer have priority over objects on a visually lower layer Meaning if you touch an area that has two touchable objects the object that is visually lower actually takes control of the touch If it is desired to use the opposite touch priority use the From Bottom To Top selection in the Touch Priority option found in either the Page or Project Options menu AlphaColor can be used on Function and Custom Buttons as a visual notification of being pressed Choices for OnButtonPress are now Alpha and Depress 32 bit or 8 bit color depth can be specified within the LCD Configuration dialog box By default GEMstudio will use the AmuletDefault pal Web Safe palette if 8 bit color depth is chosen PWM widget now has a new initialState option Along with On and Off No Change has been added so PWM widget can be added to a page without affecting a currently running PWM widget Image Sequence Widget can now handle more than 256 images Prior to this release the Image Sequence was limited to 256 images Radio Buttons and Check Boxes can now use cached images
203. ill not work and the visualFeedback will default to Invert Parameter is only valid if visualFeedback is set to Alpha but if set to CHECKED it in essence changes visualFeedback to Invert so just setting visualFeedback will result in the same behavior Default is UNCHECKED Parameter onAutoRepeat value function s function or multiple sequenced functions invoked after the Touch Area is touched for at least the time specified in repeatDelay The function s will be launched at the given update rate specified by repeatRate as long as the Touch Area remains touched See Appendix B for all available functions for the onAutoRepeat event Parameter onDoubleTap value function s the function or multiple sequenced functions invoked after the Touch Area is tapped twice in a row To be considered a Double Tap the Touch Area needs to be touched for 150ms or less twice in a row with the time between the two taps at 75ms or less It is possible to adjust the time required to be considered a Double Tap by contacting Amulet Technologies See Appendix B for all available functions for the onDoubleTap event Parameter onJogBackward value function s The function or multiple sequenced functions invoked after the Touch Area senses a Jog Backward gesture To be considered a Jog Backward gesture the Touch Area needs to be touched by a single finger and then rotated in a counter clockwise manner As long as the finger stays rotati
204. imitive rectangle command 0x01 0x46 0x00 0x0A 0x00 0x05 0x01 0x0C 0x00 0x82 0x1C 0x3F x amp yoftopleft deltax amp y CRC ID draw rectangle Draw a Filled Rectangle To draw a filled rectangle that is 0x140 pixels wide OxFO pixels tall has a topleft point at 0x00 0x00 and using the same color as the previously drawn graphic primitive the following would be sent to the Amulet Since the color has already been set no need to send that string Since line weight is not used by the fill rectangle command no need to send that either Send the draw graphic primitive fill rectangle command 0x01 0x47 0x00 0x00 0x00 0x00 0x01 0x40 0x00 0xF0 0x36 0x5D x amp yoftopleft deltax amp y CRC ID draw fill rectangle CRC Used In The Amulet CRC Communication Protocol The Amulet CRC Communication Protocol uses a 16 bit CRC Cyclic Redundancy Check to ensure data integrity Each message sent is comprised of a slave ID an Amulet opcode a variable number of bytes within the message payload and finally the two bytes of the CRC The slave ID Amulet opcode and all the bytes of the message payload are run through the CRC algorithm The resulting 16 bit CRC is appended to the end of every message The Least Significant Byte of the CRC is sent first followed by the Most Significant Byte of the CRC When receiving a packet of information from the Amulet module the calculated CRC should match the last two bytes of the packet If
205. in the link map file which will be generated after saving or programming your project To correctly use the Dynamic Image Widget the IWC method Amulet loadFlash rturn needs to be used Once that method is invoked the Amulet will start sending C s ready to receive the incoming xmodem data from an external source Once the image is fully sent and the xmodem protocol is complete meaning the external source sent an EOT 0x04 and the Amulet answered back with an ACK 0x06 the external source needs to send an ETB 0x17 which will take the Amulet out of the xmodem mode and return to the active page The Dynamic Image Widget must then be sent a reset IWC method The easiest way to accomplish this all is via a META REFRESH using a trigger The META would look something like lt META HTTP EQUIV REFRESH CONTENT 0 0 25 ONVAR Amulet UART byte 5 value TRIGGER 0xFF URL Amulet loadFlash return Amulet docun In the above case when the external processor is ready to send over a new image it would respond back to the Amulet UART byte 5 value request with a value of OxFF which would cause the Amulet to enter the loadFlash routine which means C s will start coming from the Amulet After the image has been uploaded to the Amulet and the external processor sends the ETB 0x17 the Amulet returns to the active page and then performs a reset condition to the Dynamic Image Widget called Dyn1 which forces a repaint using the new image which was just uplo
206. ine Hi Nibble Lo Hi Lo Weight Nibble Nibble Nibble Message Amulet Response Byte 10 Pnt 2 X Hi Byte Hi Nibble Byte 20 Green Hi Nibble Message Draw Rectangle Primitive Byte 10 Delta X Hi Byte Hi Nibble Byte 20 Byte 1 9 Byte 11 Pnt 2 X Hi Byte Lo Nibble Byte 21 Green Lo Nibble Byte 1 OxDA Byte 11 Delta X Hi Byte Lo Nibble Byte 21 Byte 2 Pnt 1X Hi Byte Hi Nibble Byte 12 Pnt2X Lo Byte Hi Nibble Byte 22 Red Hi Nibble Byte 2 Pnt 1X Hi Byte Hi Nibble Byte 12 Delta X Lo Byte Hi Nibble Byte 22 Byte 3 Pnt 1X Hi Byte Lo Nibble Byte 13 Pnt 2 X Lo Byte Lo Nibble Byte 23 Red Lo Nibble Byte 3 Pnt 1 X Hi Byte Lo Nibble Byte 13 Delta X Lo Byte Lo Nibble Byte 23 Byte 4 Pnt 1 X Lo Byte Hi Nibble Byte 14 Pnt 2 Y Hi Byte Hi Nibble Byte 24 Line Weight Byte 4 Pnt 1 X Lo Byte Hi Nibble Byte 14 Delta Y Hi Byte Hi Nibble Byte 24 Byte 5 Pnt1X Lo Byte Lo Nibble Byte 15 Pnt 2 Y Hi Byte Lo Nibble Byte 5 Pnt1X Lo Byte Lo Nibble Byte 15 Delta Y Hi Byte Lo Nibble Byte 6 Pnt 1 Y Hi Byte Hi Nibble Byte 16 Pnt 2 Y Lo Byte Hi Nibble Byte 6 Pnt Hi Byte Hi Nibble Byte 16 Delta Y Lo Byte Hi Nibble Byte 7 Pnt 1 Y Hi Byte Lo Nibble Byte 17 Pnt 2 Y Lo Byte Lo Nibble Byte 7 Pnt 1 Y Hi Byte L
207. ine weight is a 4 bit number The delta x is a 16 bit number specifying the length of the rectangle in the x direction and the delta y is a 16 bit number specifying the height of the rectangle in the y direction The line weight specifies the thickness of the line range of 1 15 The entire rectangle primitive message sent to the Amulet is a total of 24 bytes The fill rectangle primitive draws a solid rectangle with a given starting top left point x and y coordinates and a delta x and delta y plus a line color The fill rectangle primitive is drawn by sending out the Draw fill rectangle primitive opcode 0xDB followed by four bytes specifying the the x coordinate of the topleft point four bytes specifying the y coordinate of the topleft point four bytes specifying the delta x four bytes specifying the delta y six bytes specifying the fill color and finally one filler byte The x and y coordinates and the delta x and delta y are all 16 bit numbers The delta x is a 16 bit number specifying the length of the rectangle in the x direction and the delta y is a 16 bit number specifying the height of the rectangle in the y direction The fill color is comprised of six different bytes two bytes for the blue component two bytes for the green component and two bytes for the red component The line weight is a 4 bit number but the line weight is not used by this primitive but the byte still must be sent range of 1 15 The entire fill rectangle primitive
208. ing GEMstudio will now warn you if your memory usage grows beyond the page buffer Page Buffer Size can now be set via the Misc tab of the Project Properties dialog Strings with characters outside of ASCII can now be used in Meta Tags in the Page Functions Editor The Macro file and the InitInternalRAM file now handle UTF 8 characters Improved Palette handling when using a custom palette in 8 bit mode Palettes are now part of the OS and only loaded once per boot Static text now allows in line linewraps n and leading spaces Added automatic USB driver pre installation through the full GEMstudio installer and digitally signed the driver to remove warning messages Added new error message when trying to program when port is already open Added Rebuild Project and Rebuild Current Page Only options under the Project menu Pages now have a fixed order in the flash The Home Page is index 0x21 incrementing by one for every new page Changed what characters are allowed in page names The only valid characters a through z A though Z 0 through 9 and _ underbar Page Names may start with any valid character Enhanced GEMstudio GUI Layout preview with macro expansion and InternalRAM initialization prior to preview If using InternalRAM colors the preview now uses the colors defined in the InternalRAM Initialization file InternalRAM Colors defualt to black if not initialized e Added 8 bit color capabilities to the GEMplayer a
209. ions either upon change or release depending upon the hrefEvent parameter If hrefEvent is setup as on Change the slider invokes the function s whenever the handle moves If hrefEvent is setup as on Release the slider invokes the function s only upon releasing the handle Touching anywhere on the channel causes the handle to snap to that location and invoke the function s with the corresponding argument The argument is determined by the location of the handle and the limits setup with the min and max attributes The location of the min value is determined by the minAt attribute left right top or bottom The height and width dimensions determines whether the slider is horizontal or vertical The longer dimension establishes the path that the slider handle travels An image channellmage is used as the slider s channel which must be the same dimensions as the Custom Slider Widget Two different images are used for the slider handle One image handlelmage is used when the handle is not touched and another handleTrackinglmage for when the handle is active As an option you can specify the offset of the handle from the center of the channel by using the handleOffset parameter It is possible to use a handleTrackinglmage that contains transparent components If the handleTrackinglmage does not have transparency components then a single copy of the handleTrackinglmage will be moved along the channel and the transparency components will not be up
210. is Page Duplicate This Page Delete This Page Run This Page Orly Program This Page Orly Set As Home Page Set Home Page Run Project Run Current Page Orly Culssh t R Program Project Chile P Program Current Page Orly Cul Sh t P Page Functions Pape Properties Project Properties A new Page Functions window will pop up An example of the Page Functions window is shown below gt Page Functions fe Edt Foldngs Tools 1 0 No selected symbol X To customize the look and feel of the Page Functions Editor and HREF Editor select options from the drop down Tools menu on the top of the Page Functions window Options Code Editor Java Syntax Highlighting Keywords Bold 1talic C Underline Comments C Bold Italic C Underline Strings C Bold Italic C Underline Numbers C Bold C 1talic C underline Autocomplete Applies Standard Case C Auto Close Brackets Auto Indent New Lines Highlight Block When Hovering Mouse Over Gutter Circle Matching Brackets Display Line Numbers Cancel The user can customize Code Editor with the following options Syntax Highlighting 1 Keywords customize the color from color picker that pops up when you click on the color selection and font style bold italic and or underline Comments customize the color from a color picker that pops up when you click on the color selection and font style bold italic and or
211. itHref is used as the label Only available function is of type Amulet UART label x value See note regarding the use of InternalRAM label variables as button labels Parameter label value text or FromlnitHref Specifies the text that appears inside the button The button will NOT automatically re size to fit the text If there is enough vertical room text will automatically wrap Any text that will not fit within the confines of the button will be truncated User defined wraps can be specified by entering n within the text at the spot you would like the wrap to occur There is a maximum of 5 lines for a button label The name field can be left blank blank is the default To have the label be dynamically entered at runtime by the server enter FromlnitHref By default the dynamic button label can be a maximum of 25 characters in length To increase the maximum number of characters put the desired number in parentheses after FromlnitHref For example to have a dynamic label up to 50 characters long use FromlnitHref 50 The attribute initHref needs to be of the type Amulet UART label x value It will be called only once upon the loading of the page with the string returned from the server becoming the button label See note regarding the use of InternalRAM label variables as button labels Parameter noSdram value CHECKED or UNCHECKED Specifies if the background of the button and the uplmage and downlmage are stored in sdr
212. ive from page to page will not be reinitialized every time the page is re entered unless you specify it and InternalRAM can actually be saved back to the flash so the variable can persist even after powering down Examples To send out an invoke RPC 5 message when the value of a slider Slider1 equals 0xFF which is polled every 500ms use the following META REFRESH object lt META HTTP EQUIV REFRESH CONTENT 0 5 ONVAR Amulet document Slider1 value TRIGGER 0xFF URL Amulet UART invokeRPC 5 NAME Me This META will continue to send the RPC every 500ms until the slider value no longer equals OxFF To have the META send it out only once you could have the META URL include the following function after the invokeRPC function Amulet document MetaOne setUpdateRate 0 This will make the META turn itself off after the first invokeRPC is sent To send out a set byte variable 2 to 0x78 message when the value of external byte variable 4 equals OxFF which is polled every 500ms use the following META REFRESH object META HTTP EQUIV REFRESH CONTENT 0 5 ONVAR Amulet UART byte 4 value TRIGGERZOxFF URL Amulet UART byte 2 setValue 0x78 To send out a set string variable 5 to My String message when the value of external byte variable 4 equals OxFO which is polled every 500ms use the following META REFRESH object META HTTP EQUIV REFRESH CONTENT 0 5 ONVAR Amulet UART byte 4 value TRIGGER OxFO URL Amulet UART string
213. l attempts the Amulet will flush its transmit buffer and reset all UART variables Other time out durations are set in the Project Properties menu from within GEMstudio By Modbus RTU standard if a CRC error occurs the slave should not respond at all The master will timeout and resend the previous message NOTE The external processor slave must respond to every valid Amulet master command When commands are not responded to a time out will occur and that message will be repeated 10 more times before flushing the transmit buffer and resetting all UART variables Amulet as Slave In the Amulet communications CRC protocol the slave should not respond until the master is done sending its message If the Amulet is going to be the slave in the protocol the external processor master can send twenty four different types of messages to the Amulet LCD module slave The external processor can read from and write to all the Amulet Internal RAM variables The external processor can also send graphic primitives pixel line rectangle and filled rectangle to the Amulet The external processor can also force the Amulet to jump to a specific page A Get Internal RAM byte variable request A Get Internal RAM word variable request word 2 bytes A Get Internal RAM string variable request A Get Internal RAM color variable request color 4 bytes A Get Internal RAM byte array request A Get Internal RAM word array request wo
214. le into a byte Return in buffer bree try again 2 carry cleared then invalid value and start over mov which buffer idi buffer StringResponse rcall putch Acknowledge valid command mov buffer which Swap buffer Rotate MSNibble into LSNibble position rcall nib2ascii Convert LSNibble of buffer to an ASC character rcall putch Echo back MSNibble of variable xx mov buffer which rcall nib2ascii Convert LSNibble of buffer to an ASC character rcall putch Echo back LSNibble of variable xx To simplify this snippet all the code which looks up the string xx in a look up table was left out icall Time to go pound the null terminated string out rjmp try again Done with string command so start over k lt x k k lt ck ck lt k ck ck lt ck ck k k ck ck ck ck k ck ck ck ck ck ck ck ck lt ck k ck x kk Handle S command to Set variable data Format of request string OxD5xxNN where xx variable to set NN HEX data for variable Returns OxE5xxNN to client k x lt lt lt ck k ck lt ck ck ck k ck ck ck ck ck k ck ck ck ck ck ck ck lt ck k ck x kk handles rcall getByte Read both nibbles of xx and assemble into a byte Return in buffer brcc try again carry cleared then invalid value so start over mov which buffer rcall getByte Read both nibbles of NN and assemble into a
215. le with ASCII UTF 8 encodes each character code point in 1 to 4 octets 8 bit bytes with the single octet encoding used only for the 128 US ASCII characters from 0x20 Ox7F The UTF 8 encoding is variable width ranging from 1 4 bytes Each byte has 0 4 leading consecutive 1 bits followed by a zero bit to indicate its type N 1 bits indicates the first byte in a N byte sequence with the exception that zero 1 bits indicates a one byte sequence while one 1 bit indicates a continuation byte in a multi byte sequence this was done for ASCII compatibility The scalar value of the Unicode code point is the concatenation of the non control bits In this table zeroes and ones represent control bits x s represent the lowest 8 bits of the Unicode value y s represent the next higher 8 bits and z s represent the bits higher than that Unicode Byte1 Byte2 Byte3 Byte4 example U 0000 U U 0024 007 00100100 0x24 0 0080 0 110 10 U 00A2 07 gt 11000010 10100010 0 2 0 2 U 0800 U 1110 10 10 U 20AC 11100010 10000010 10101100 0 2 0 82 0 0 10000 0 111102722 10zzyyyy 10 10 U 024B62 lOFFFF 11110000 10100100 10101101 10 0xA4 0xAD 0xA2 So the first 128 characters US ASCII need one byte The next 1 920 characters need two bytes to encode This includes
216. let document widgetName disappear Amulet document widgetName forceHit Amulet document widgetName forceRefresh Amulet document widgetName forceUpdate Amulet document widgetName inverseRegionColor Amulet document widgetName inverseStringColor Amulet document widgetName nextEntry The named Function Custom Button Widget will appear as if it is currently being touched The named Function Custom Button Widget will appear as if it is currently NOT being touched The named Scribble Dynamic Image Widget clears its canvas including any background images The named widget will clear itself from the LCD if it is a View Widget it will also stop updating The named Control Widget will act as if it was hit The named View Image Sequence Widget will paint the image at the next update even if the incoming value is the same as the current state Useful if an anchor is used around an Image Sequence Widget The named View Widget will act as if it s update rate time was activated Allows for asynchronous updating The named widget will display in reverse video The named widget s text string will display in reverse video The named List widget will move its highlighted bar down to the next entry Does not perform a hit on the new entry Amulet document widgetName normalRegionColor Amulet document widgetName normalStringColor Amulet document widgetName previousEntry Amulet document widget
217. ll The height and width dimensions of the background image determine whether the pointer travels horizontally or vertically By default the longer dimension establishes the path that the pointer travels Optionally the orientation can be specified if it is desired to have the pointer travel the shorter dimension It is possible to use a pointerlmage that contains transparent components Linear Gauge Widget Linear Gauge Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Linear Gauge is to start out invisible or not If the attribute is not present then by default the Linear Gauge is visible If the Linear Gauge starts out invisible the only way to make it visiblare again is via the IWC method reappear Parameter backgroundlmage value image Image used as the linear background image Image dimensions must be exactly the same as the dimensions of the Linear Gauge Widget Image file must be of type GIF JPG or PNG Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Linear Gauge widget The function is called at an update frequency specified by the updateFreq attribute Parameter max value number Maximum value returned from the href function must be greater than min If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01
218. llowing format Baud Rate 9600 19200 57600 or 115200bps Parity None Data Bits 8 Stop Bits 1 The default baud rate is 115 200 bps Other baud rates set by using a tag the Page Properties page functionality or Project Properties global functionality by using the Amulet META attribute Baud Project xxxxx or Baud Page xxxxx where xxxxxx is either 9600 19200 57600 or 115200 Baud Project should be used if the baud rate is going to be the same on all pages of the project If using the Baud Project META attribute you only need to include that Amulet META on the home page Example lt META NAME Amulet Content Baud Project 19200 gt Communication Modifications Time Out The default communication time out period is 200ms Other time out periods are set by using a META tag in the Page Properties or Project Properties windows Valid range is 0 02 2 55 seconds in 01 increments For example to set the time out rate at 20ms use lt META NAME Amulet Content TimeOut Page 0 02 gt Interbyte Delay The default interbyte delay is dependent upon the activity on the display Unless there is a large and fast animated gif the interbyte delay will usually be around 120us If a longer interbyte delay is required a 2 3ms delay be added by using a META tag in the Page Properties or Project Properties windows Example META NAME Amulet Content UARTDelay Project gt Termination Character By de
219. lor Depth Transitions Miscellaneous LCD Choice LCD Size 480 x 272 LCD Manufacturer Amulet LCD Part Number STK 480272C_Serial No ends with L Board Name MK 480272C Cancel Figure 2 Project Properties LCD Tab The LCD Board Chooser provides the user with multiple LCD and Board choices as shown in Figure 2 and Figure 3 For LCD choices the options includ LCD Size LCD Manufacturer and LCD Part Number For the Board choices select a board name If the board profile is not available please go to Board Profile Editor to make a new board profile lt gt LCD Board Chooser LCD Size 480 x 272 LCD Manufacturer Amulet LCD Part Number STK 480272C Serial No ends with L Board Board Name MK 480272C Figure 3 LCD Board Chooser Window Board Profile Editor Board Profile Editor enabl the user to customize the components and board programming on the user s board The editor has two sections supported components and miscellaneous To name the board click Save at the bottom of the window Board Profile Editor File Edit Board Name Untitled Components Amulet Chip AGB7SLCO4 BG E Flash AT45DB08 8 MBit SDRAM 1542532200 64 MBit SPI Init File AGB75L default Miscellaneous SPI Port Used For LCD Initialization Slow USB Clock While Programming Cancel Components e Amulet
220. lowing META META HTTP EQUIV Refresh CONTENTz 0 0 02 URL Amulet UART word OxFF setValue 0x20 Following the Flash Index is the File Size in comments in hexadecimal format The file size is included for informational purposes only Image Files All image files are saved in the serial data flash and as thus are included in the inc file Do NOT try to use Amulet fileNumber x where x is the Flash Index to an image file The Amulet will crash and could potentially trash the OS the serial data flash requiring a reloading of the Amulet OS files Any image which is not compressed will also have the first 11 bytes of the Flash Header stored in the map file The Flash Header bytes are needed when using the Dynamic Image Widget Any image used as a Dynamic Image canvas will not be compressed Images can be sent to the Amulet via xmodem crc protocol which will overwrite the canvas image of a Dynamic Image Widget located in the serial data flash Only images which are the exact same dimensions as the canvas image can be sent to the Dynamic Image Widget to avoid overwriting other files in the serial data flash The 11 byte Flash Header for any image sent to the Dynamic Image Widget must be the same as the original image used for the Dynamic Image canvas The first 6 bytes are created by the GEMcompiler and cannot be derived thus the need for inclusion in the link map The last 5 bytes are part of the Amulet Bitmap Format and can be derived b
221. mber specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to updateFreq number Optional Bar Graph Parameter Attributes Parameter waitForlnit valuez CHECKED or UNCHECKED Specifies if the Bar Graph will wait for valid data before being displayed If CHECKED the Bar Graph will not display until the data from the href function is received If UNCHECKED or the attribute is not present the Bar Graph momentarily starts at the min location until the href function receives its data If waitForlnit not specified the default is UNCHECKED Dynamic Image Dynamic Image Widget DynamicImage class The Dynamic Image Widget is an uncompressed image which provides a space holder to display images which can be loaded serially at runtime The size of the image to be uploaded must be the exact same size as the canvas image Images are uploaded via xmodem crc protocol The image must be in the Amulet bitmap format The first 24 bytes of any image being uploaded known as the header bytes must be the same as the header bytes of the canvas image The first six bytes are the flash header bytes and the next five bytes the image header bytes These first 24 bytes Dynamic Image found in the link map file which will b ted after savi i ject Widget e found
222. ment given to the href function s If FromlnitHref is selected the function specified by the InitHref attribute is called Whichever option has the same intrinsic value as the returned value from the initHref function will be initially highlighted Parameter options value see image below Specifies the list strings and their values value be number from 0 65535 0x00 OxFFFF or a STRING which must be in single quotes See note regarding Control Widget intrinsic values The first option displays at the top of the list and each subsequent option displays directly below the previous To add more options hit the plus button in the lower left Parameter selectionColor value See color entry conventions Specifies the color of the highlighted entry in the list box See section on colors for more information If no selection color is specified the default color is black If the alpha is FF then the selectionColor is fully opaque Parameter selectionFontColor value See color entry conventions Specifies the color of the font within the highlighted entry in the list box See section on colors for more information If no selection color is specified the default color is white Optional List Parameter Attributes Parameter downArrow value image Specifies the page down arrow image to use when the list has more items than can be viewed If this attribute is not present then a default image
223. message starts with a byte for byte echo of the command message The echo is then followed by any optional response data in ASCII format Upon receiving the last byte of a valid message from the master the slave then has by default 200ms to respond to the message before the master times out After 200ms if there is no response the master will continue to repeat the message until a response is received After 10 unsuccessful attempts the Amulet will flush its transmit buffer and reset all UART variables Other time out durations are set by using a META tag Example lt META NAME Amulet Content timeOut Project 0 5 gt NOTE The external processor slave must respond to every valid Amulet master command It is okay to respond with a single byte of acknowledgement OxFO without transmitting data but all Amulet commands should be responded to When commands are not responded to a time out will occur and that message will be repeated 10 more times before flushing the transmit buffer and resetting all UART variables Amulet as Slave Amulet communication protocol is half duplex meaning the slave should not respond until the master is done sending its message The external processor master can send fourteen different types of messages to the Amulet LCD module slave The external processor can read from and write to all the Amulet Internal RAM variables The external processor can also force the Amulet to jump to a specific page Yo
224. mponent then it will be completely opaque which will result in a colored rectangle appearing in place of the Touch Area while it is touched Parameter gestureDelay value number Time to delay from when Touch Area initially senses a gesture until it starts to act upon the gesture i e launch the function s tied to the gesture event This delay helps filter out false gestures prior to sensing the true gesture being performed Specified in seconds with a single floating point number A gestureDelay of 0 00 results in the gesture never being seen The range is 0 00 655 35 Default is 0 05 if the parameter is not specified Parameter gestureRate value number The gesture function call frequency while Touch Area is sensing gesture after the initial delay determined by gestureDelay This rate helps throttle the frequency of gesture functions that will be launched If a gesture is not being sensed this gestureRate has no effect Specified in seconds with a single floating point number A gestureRate of 0 00 results in the gesture function s being launched once after the given gestureDelay time and then not repeated The range is 0 00 655 35 Default is 0 25 if the parameter is not specified Parameter noSDRAM valuez CHECKED or UNCHECKED Specifies if the area under the Touch Area is to be copied into the SDRAM in order to facilitate the alphaColor if visualFeedback is set to Alpha If noSDRAM is CHECKED then Alpha w
225. mulet would either send out erroneous data or potentially even lock up as far as the serial communication is concerned Fixed bug with Radio Buttons and Check Boxes if they are located on a page such that they are the 256th object or greater on the page Amulet now responds to external master messages on the same communication port as the incoming master message Prior to this release the Amulet always responded on the Communication UART regardless of which port it received the master message GEMstudio now gives a proper error message if attempting to reprogram an OS file if the serial data flash on the module is different than the size specified in the LCD Configuration menu Custom Button widgets now default to a clear border instead of a black one Function Button widgets now handle initHref correctly Function Button now handles horizontal and vertical label alignment Fixed SDRAM allocation issue with numericField widgets Could have resulted in corrupted images in the next widget located in SDRAM as well as visual anomalies in the numericField Fixed potential problem with multiple THEN statements within an IF THEN ELSE meta tag Indeterminate behavior could be exhibited depending upon how many THEN statements and how often the page is compiled Fixed bug in the SDRAM configuration dialog box The changes entered did not always get saved correctly Enhancements The file formerly known as the map file is now referred to as the inc f
226. n e setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Custom Slider href uses byte y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function e setX x Sets the x coordinate of the topleft corner of the Custom Slider to the coordinate specified by the Word x e setY x Sets the y coordinate of the topleft corner of the Custom Slider to the coordinate specified by the word x e value Sends the intrinsic value of the Custom Slider to the calling widget The calling object then uses that value as its input This allows a Control object to provide the input to a View Widget This method is called from a View Widget href Dynamic Image e clearCanvas Clears the display where the canvas image resided Essentially does an erase of the Dynamic Image Widget This only affects what is displayed on the LCD it does not affect the actual canvas image stored in flash disappear Makes the Dynamic Image not visible on the LCD reappear Makes the Dynamic Image visible on the LCD Counteracts the disappear method reset Makes the Dynamic Image redraw its image Should be called after loading a new image using the Amulet loadFlash reset function setX x Sets the x coordinate of the topleft corner of the Dynamic Image to the coordinate specified by
227. n 0x40 Blue OxFF Pre multiplied colors Alpha OxAO XOR OxFF Ox5F Red 0x80 OxAO OxFF 0x50 Green 0x40 OxAO OxFF 0x28 Blue OxFF OxAO OxFF OxAO Examples Draw a Line To draw a line from 0x05 0x07 to 0x65 0x67 using the color fully opaque alpha 0x00 blue 0x00 0 00 red 0x22 and a line weight of 4 the following would be sent to the Amulet First send the set graphic primitive 32 bit color command 0x01 0x40 0x00 0x00 0x00 0x22 0x80 0x1C fa b g r H CRC ID set color color opcode Then send the set graphic primitive line weight command 0x01 0x43 0x04 0x10 0x43 CRC ID set line line weight weight Then send the draw graphic primitive line command 0x01 0x45 0x00 0x05 0x00 0x07 0x00 0x65 0x00 0x67 0x9E 0x64 x amp yofpoint1 x amp yofpoint2 CRC ID draw line Draw a Rectangle To draw a rectangle that is 0 10 pixels wide 0x82 pixels tall has a topleft point at 0x0A 0x05 a line weight of 2 and using line color blue OxFF 0 00 red 0x00 and fully opaque the following would be sent to the Amulet First send the set graphic primitive 32 bit color command 0x01 0x40 0x00 0xFF 0x00 0x00 0x30 0x35 fa b r ID set color color opcode Then send the set graphic primitive line weight command 0x01 0x43 0x02 0x90 0xF 1 CRC ID set line line weight weight Then send the draw graphic pr
228. n state the function calls will repeat at the frequency specified by the repeatRate attribute The third exception is in the case of Custom Function Buttons which are set up to call thier HREF upon pen down AND pen up using either the depricated DualAction attribute set to True or the newer ExecuteOn attribute set to Both Immediatly after this type of button is hit it will execute its HREF It will execute the HREF again or the next HREF in the case of sequenced function calls upon either a successful pen up within the button or when leaving the button This allows you to create a button that performs different actions upon pen down and pen up without worrying about getting out of sequence if the user scrolls off of the button before lifting Control Objects Widgets cannot call functions that return a value See Appendix B for a comprehensive list of all valid control functions Multiple Function Calls Control Objects Widgets can call multiple functions at one time by separating the functions by a comma There is a limit of 36 multiple functions that can be attached to a single Control Widget Object href To illustrate how to use multiple functions see the following example To create a function button that invokes an external RPC 5 and then links to page2 use the following href commands Amulet UART invokeRPC 5 page2 open Multiple function calls are performed in the order they are entered on the line from left to right In the
229. n the case of plain which must stand alone Font Style Bit Location Italic 0x02 Strikethrough 0x04 Bold 0x20 Underline 0x40 Plain 0x80 For example to initialize InternalRAM string 80 with a string that is formatted to look like this this is bold you would use the following InternalRAM string 0 this is s 0x20 bold Line feeds are entered in the initInternalRAM file as n For example to initialize InternalRAM string 1 with a string that is formatted to look like this this is the break You would use the following InternalRAM string 0 this is nthe break Upper ASCII characters can be entered similar to font styles Use the raw byte escape sequence r xxx where is the value of the raw byte to include in the string For example to initialize InternalRAM string 2 with a string that is formatted to look like this this isa you would use the following InternalRAM string 0 this is a r 0xA9 Reloading the initialized InternalRAM variables on a per page basis By default the InternalRAM variables are loaded from the serial data flash into the internal SRAM of the Amulet GEM compliant Chip only once upon power up If it is desired to reload the internal SRAM with the InternalRAM variables that are stored in the serial data flash on a per page basis you can use an Amulet META tag with the ReloadInternalRAM attribute to specify this There are three dot modifiers that will specify the scope of the reloading
230. n widget will allocate space in the SDRAM equivalent to the size of the button within the frame buffer UNCHECKED is the default Parameter repeatDelay value number Time to delay from when button is initially pressed until it starts to auto repeat Specified in seconds with a single floating point number The range is 0 00 655 35 Parameter repeatRate value number The href function call frequency while button is being pressed after the initial delay determined by repeatDelay Specified in seconds with a single floating point number The range is 0 00 655 35 0 00 means do not repeat Parameter verticalAlign valuez TOP or MIDDLE or BOTTOM Specifies the vertical alignment of the string associated with the label attribute within the Function Button dimensions Only one value is allowed you cannot mix vertical alignments Default is MIDDLE List List Widget List class Use the List Widget to create a list of selectable text objects that share a common function set of functions and that are vertically aligned in a box Selecting a list object highlights that object on the display and invokes the href function s with the value of the list item being the argument The values associated with each list entry are specified similar to C s enum specifier where the first object in the list will have List value of 00 the second item 01 etc unless an explicit value is given If not all values are specified
231. nce this is an ASCII protocol two bytes must be sent out for every byte of data to be transmitted All messages will start with a command character followed by the ASCII representation of all data For example if the page being compiled has a view widget with an href of Amulet UART byte 0x1A value which will send out the Get Byte Variable 0x1A request the message to be transmitted would consist of three bytes The first byte is the command byte for Get Byte Variable OxDO The second byte is 0x31 which is the ASCII representation of the high nibble 1 The third and final byte is Ox41 which is the ASCII representation of the low nibble A NOTE The slave must respond to every valid Amulet command even if it s only an acknowledge OxFO When commands are not responded to a time out will occur after 200ms by default and that message will be repeated until either a response is received or after a total of eleven attempts After eleven attempts all UART or USB variables are reset in an attempt to resync with the slave processor Message Byte1 Byte2 Byte3 Byte4 5 Byte6 Byte Byte Byte Byte Byte Byte 7 8 9 10 11 112 Byte Amulet OxDO Variable Variable None None None None None None None None None Get Byte Hi Lo Variable Nibble Nibble Server OxEO Variable Variable Value Value None None None None None None None Response Hi Lo Hi Lo Nibble Nibble Nibble Nibble Amulet Get Word Variable Server Response Amulet Get
232. nction Custom Buttons should use x The range for x is 0 255 0x00 Oxff for a BYTE 0 65535 0x00 Oxffff for a WORD and strings in double quotes for STRINGs Regarding m When setMethod setOnVarMethod setOnVarUARTMethod or setUARTMethod is the IWC method the argument should be the name of the method you want to set i e disappear or byte value Notice when dealing with a method that relies a type byte word string you need to include the type separated by a dot and then the method i e word value instead of just the method by itself Regarding f For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out Anchors META Refresh Tags Area Maps and Function Custom Buttons should use f Like the regular updateRate use the floating point number to specify the update rate in seconds The range for f is 0 655 35 Restore Amulet OS The Amulet OS needs to be restored when the following occurs 1 When there is an OS mismatch between the display and the compiler or GEMstudio 2 When the flash is corrupted 3 When OS related settings are modified such as touch panel init file or LCD setttings To restore Amulet OS 1 Flip dip respective switch shown in the list below to off position Part Number 035 2 EVK VX COG T350MCQV 03 EVK TA TM043NBHO2 EVK TA TM047NBHO1 EVK HX HDA570ST
233. nd Vista The Converter may be invoked by any standard Windows method e From the Main GEMstudio window click on the Launch GEM Font Converter button as highlighted in the figure below lt GEMstudio DOR iren QY Back teen Create New GEMstudio Project Open Existing GEMstudio Project Launch LCD Profile Editor Launch GEMcompiler Launch G GEM Font Converter Launch Using the Converter To convert a Windows font into an Amulet Unicode Font auf load and save the font with the Amulet GEM Font Converter Instructions follow detailing this process To load the font click on Load Font from the File menu and then choose the Font Font style and size Amulet GEM Font Converter ver 1 1 DER Load Font Save AmuletFont Options EN Amulet GEM Font Converter ver 1 1 Once you load the font you ll notice the display of the program now contains the character set of the font you are about to save File amp 012345678 ABCDEF GH PQRSTUVWX abcdef gh pqrstuvwx 22724 268 2 To save the font click Save AmuletFont from the File menu You ll notice that you can only save the file as an Amulet Font file auf You should save the resultant auf file in the Configuration Fonts folder in the Amulet sub directory If the auf file is not located in that directory the compiler will throw a compilation error stating th
234. nd allowed GEMstudio to compile for 8 bit when hitting Run previously Run was hard coded to full color regardless of project setting e Added a Strict Modbus Timing feature in the Project Comm options which guarantees a minimum 3 5 character delay between receiving and sending messages e Improved the Program Flash dialog by adding a Program OS button and changed the Begin button to Program Project for clarity e Scribble widget no longer requires a canvas image The Page Function editor can now handle Alt code input e Increased each widget s memory address from 16 bit to 24 bit This allows many more objects to exist on a page e Added a global transparent color in 8 bit mode regardless of palette The color must be set to exactly 00000000 e Soft Reset no longer asserts the reset line e Suppressed some errors when no Communication port is available for the GEMplayer e Improved PWM to better handle the special cases of Width gt Period and Width 0 Bug Fixes Cleaned up transitions from single frame buffer Loading screen to first page of project Fixed a problem while using NumericFields with non opaque colors Fixed bug in project title if New chosen from File menu but then hit Cancel Fixed a page function lockup that occurs when the end comment block tag was not found possibly because it was filtered out by another style of comment Fixed some WYSIWYG issues with the StringField and NumericField widgets in GEMs
235. nd out an equals sign use the following Amulet UART byteOut or Amulet USB byteOut Note that both Amulet UART byteOut Ox3D or Amulet USB byteOut 0x3D and Amulet UART byteOut or Amulet USB byteOut will send out the same Ox3D since the ASCII representation of the equals sign is Ox3D When the byteOut command is used it is not part of the Amulet protocol which means there are no header bytes and the data is not ASCII ized for you The byte you want to be sent out is what will be transmitted nothing more and nothing less This is a unidirectional message meaning that the byte will be sent out but it will not be expecting nor accepting any responses Sending A Stream Of Bytes Without A Response To send a stream of raw bytes out the UART or USB can be accomplished by calling multiple Amulet UART byteOut or Amulet USB byteOut functions separated by commas but that is not the most efficient way The href command Amulet UART streamOut x1 x2 xn or Amulet USB streamOut x1 x2 xn will send out the stream of bytes without any formatting Notice that each byte is separated by a plus sign Like the byteOut command it is not part of the Amulet protocol so the message will be sent out but it will not be expecting nor accepting any responses The bytes to be sent out are by default decimal If hexadecimal numbers are desired precede the numbers with Ox For instance to send out a stream consisting of 0x01 0x11 0x22
236. ng counter clockwise the Jog Backward gesture will be sensed Use gestureRate to specify the maximum rate the onJogBackward function s will be called See Appendix B for all available functions for the onJogBackward event Jog Backward Gesture only available on select capacitive touch panels Parameter onJogForward value function s The function or multiple sequenced functions invoked after the Touch Area senses a Jog Forward gesture To be considered a Jog Forward gesture the Touch Area needs to be touched by a single finger and then rotated in a clockwise manner As long as the finger stays rotating clockwise the Jog Forward gesture will be sensed Use gestureRate to specify the maximum rate the onJogForward function s will be called See Appendix B for all available functions for the onJogForward event Jog Forward Gesture only available on select capacitive touch panels Parameter onMultiTouchDoubleTap value function s the function or multiple sequenced functions invoked after the Touch Area is tapped twice in a row using two or more fingers To be considered a Multi Touch Double Tap the Touch Area needs to be touched by two or more fingers for 150ms or less twice in a row with the time between the two taps at 75ms or less It is possible to adjust the time required to be considered a multi touch double tap by contacting Amulet Technologies See Appendix B for all available functions for the onMultiTouchDoubleTap event Mul
237. ng messages incorrectly assuming that the ACK was in response to the last individual message of the stream This could result in the master starting to send another large stream of bytes That might or might not be a problem If the Amulet was able to finish parsing the final message of the stream then the receive buffer counters will be reset and the next stream will fit in the receive buffer assuming the stream is less than 256 bytes But there could be a race condition where the Amulet doesn t quite finish parsing the final message of the stream before the master starts sending the new stream This could result in entire streams being lost Once again that is not acceptable in most applications Therefore if you are sending large streams to the Amulet it is highly suggested that you use the SlaveNoRsp Meta attribute and also send an XOFF command at the conclusion of your stream Do not send your next stream until the Amulet returns an XON command This will close any race condition windows Note About Sending Master Messages Between Amulet Page Changes When the Amulet changes from one page to another all UART or USB buffers are flushed so if you are in the middle of sending the Amulet a Master Message while it is changing pages it is possible that the Amulet will not fully receive your message Another thing to keep in mind is that when first loading a page the transmission of messages is halted until the page is fully rendered The Amulet is
238. ng that it s ready to receive data in CRC mode The sender then sends a 133 byte packet the receiver validates it and responds with an ACK or a NAK at which time the sender will either send the next packet or re send the last packet This process is continued until an EOT is received at the receiver side and is properly ACKed to the sender After the initial handshake the receiver controls the flow of data through ACKing and NAKing the sender Table 1 XmodemCRC Packet Format Byte 1 Byte 2 Byte 3 Bytes 4 131 Bytes 132 133 Start of Header Packet Number Packet Number Packet Data 16 bit CRC NOTE Bytes 0 5 of each binary file are the flash header bytes The Amulet uses these bytes to determine where to store the file within the flash You can send the files in any order the Amulet won t mind Definitions The following defines are used for protocol flow control Symbol Description Value SOH Start of Header 0x01 for 128 byte protocol 0x02 for 1K protocol EOT End of Transmission 0x04 ACK Acknowledge 0x06 NAK Not Acknowledge 0x15 EOTCRC End of Transmission CRC Amulet 0x16 Chip will recalcualte the CRC based off of hte data in the flash ETB End of Transmission Block 0x17 Return to Amulet OS mode CAN Cancel Force receiver to start sending C s 0x18 C ASCII C 0x43 Byte 1 of the XmodemCRC packet can only have a value of SOH EOT CAN or ETB anything else is error Bytes 2 and 3 form a packet number with checksum
239. not the functionality buttonUp Sets the Custom Function Button Widget to look like it is in the up state This method does NOT invoke the href functions it only affects the looks of the button not the functionality disappear forceHit forceUpdate inverseRegionColor inverseStringColor nextEntry normalRegionColor normalStringColor previousEntry reappear reset saveCanvas setLineWeight x setMethod m Object not visible on LCD Counteracts the reappear method Object performs its hit method without user input The hit method will invoke all href functions of that object View Object performs its href method which is normally performed based upon the updateFreq parameter Object will display in reverse video Counteracts the normalRegionColor method Object s text string will display in reverse video Counteracts the normalStringColor method Highlighted box of a list box widget moves to next entry in the list Effectively moves the highlighted box down one entry Object will display in normal video Counteracts the inverseRegionColor method Object s text string will display in normal video Counteracts the inverseStringColor method Highlighted box of a list box widget moves to previous entry in the list Effectively moves the highlighted box up one entry Object visible on LCD Counteracts the disappear method Clears the line plot screen
240. now draw the slider correctly e Fixed bug GEMplayer that caused a crash if the current page size was greater than 0 8000 Enhancements Visual objects in GEMstudio layout mode can be resized while keeping the same aspect ratio by holding the shift key down while dragging one of the four corners of the object Added BMP TIFF and PICT image support within GEMstudio Hardware related attributes i e flash size SDRAM size etc are now stored in Board Profiles which are separate from LCD Profiles Auto complete added to the Page Function editor Find and replace added to the Page Function editor Keyword highlighting added to the Href and Page Function editors C style comments supported in both the Href and Page Function editors Page Functions editor remembers the cursor position and folded lines between sessions Macro and InitInternalRAM now supported within the GEMstudio GUI Slider and List Box widgets now use the argument intrinsicValue to specify the argument to use is the current intrinsic value of the widget In earlier versions the argument was left blank to specify to use the intrinsic value SDRAM starts out in low power mode saving approximately 15mA SDRAM be set back to high performance mode through Amulet lowPower sdram HIGH PERFORMANCE Greatly improved dual frame buffer performance Most noticable when dealing with Custom Slider widgets that have a handle image with transparency All view wi
241. nt Swipe North Gesture only available on select capacitive touch panels Parameter onSwipeNorthEast value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe North East gesture To be considered a Swipe North East gesture the Touch Area needs to be touched by one finger and then swiped to the top and the right As long as the finger continues swiping to the top and the right the Swipe North East gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeNorthEast function s will be called See Appendix B for all available functions for the onSwipeNorthEast event Swipe North East Gesture only available on select capacitive touch panels Parameter onSwipeNorthWest value function s The function or multiple sequenced functions invoked after the Touch Area senses a Swipe North West gesture To be considered a Swipe North West gesture the Touch Area needs to be touched by one finger and then swiped to the top and the left As long as the finger continues swiping to the top and the left the Swipe North West gesture will be sensed Use gestureRate to specify the maximum rate the onSwipeNorthWest function s will be called See Appendix B for all available functions for the onSwipeNorthWest event Swipe North West Gesture only available on select capacitive touch panels Parameter onSwipeSouth value function s The function or multiple sequenced functions
242. nt number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the value of updateFreq Parameter xSamples value number Number of samples along the horizontal x axis The range is 2 638 0 02 0 27 NOTE value must be less than the value specified the WIDTH attribute of the tag Parameter yMax value number Maximum value returned from the href function must be greater than yMin If the function returns byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 0xFFFF Parameter yMin value number Minimum value returned from the href function must be less than yMax If the function returns a byte the range is 0 254 0x00 0xFE If the function returns a word the range is 0 65534 0x00 OxFFFE Optional Line Plot Parameter Attributes Parameter noAxis value CHECKED or UNCHECKED Specifies if the Line Plot is to have an x and y axis If the attribute is not present then by default the Line Plot has an x and y axis Linear Guage Linear Gauge Widget LinearGauge class The Linear Gauge Widget uses two images a background image and a pointer image to create a custom linear gauge A byte or word returned from a function call is the input The pointer travels linearly on the background image and is positioned based upon the value of the byte or word returned from an gt href function ca
243. o Nibble Byte 17 Delta Y Lo Byte Lo Nibble Byte 8 Pnt 1Y Lo Byte Hi Nibble Byte 18 Blue Hi Nibble Byte 8 Pnt 1Y Lo Byte Hi Nibble Byte 18 Blue Hi Nibble Byte 9 Pnt 1Y Lo Byte Lo Nibble Byte 19 Blue Lo Nibble Byte 9 Pnt 1Y Lo Byte Lo Nibble Byte 19 Blue Lo Nibble Nibble Message Amulet Response Byte 10 Delta X Hi Byte Hi Nibble Byte 20 Green Hi Nibble Message Draw Fill Rectangle Primitive Byte 10 Delta X Hi Byte Green Lo Nibble Byte 1 OxEA Byte 11 Delta X Hi Byte Lo Nibble Byte 21 Green Lo Nibble Byte 1 OxDB Byte 11 Delta X Hi Byte Red Hi Nibble Byte 2 Pnt 1X Hi Byte Hi Nibble Byte 12 Delta X Lo Byte Hi Nibble Byte 22 Red Hi Nibble Byte 2 Pnt 1X Hi Byte Hi Nibble Byte 12 Delta X Lo Byte Red Lo Nibble Byte 3 Pnt 1X Hi Byte Lo Nibble Byte 13 Delta X Lo Byte Lo Nibble Byte 23 Red Lo Nibble Byte 3 Pnt 1X Hi Byte Lo Nibble Byte 13 Delta X Lo Byte Line Weight Byte 4 Pnt 1 X Lo Byte Hi Nibble Byte 14 Delta Y Hi Byte Hi Nibble Byte 24 Line Weight Byte 4 Pnt 1 X Lo Byte Hi Nibble Byte 14 Delta Y Hi Byte Byte 5 Pnt 1 X Lo Byte Lo Nibble Byte 15 Delta Y Hi Byte Lo Nibble Byte 5 Pnt 1 X Lo Byte Lo Nibble Byte 15 Delta Y Hi Byte Byte 6 Pnt
244. o Nibble Hi Nibble Hi Nibble Lo Nibble Lo Nibble None None None None None None Amulet OxD8 RPC RPC None None None Invoke Hi Lo Remote Nibble Nibble Procedure Call RPC Server OxE8 RPC RPC None None None None None None None None None Response Hi Lo Nibble Nibble Amulet OxDD Variable Variable None None None None None None None None None Get Byte Hi Lo Variable Nibble Nibble Array Server OxED Variable Variable Value Value None None None None None None Response Hi Lo Hi 0x00 Nibble Nibble Nibble Lo Nibble Amulet OxDE Variable Variable None None None None None None None None None Get Word Hi Lo Variable Nibble Nibble Array Server 5 LS Byte Response Variable Variable Value Lo Value Lo 0x00 Hi Lo Value Hi Nibble Lo Nibble Nibble Nibble Hi Value Hi Hi Nibble Lo Nibble Amulet OxDF Variable Variable Value Value None None None None None None Set Byte Hi Lo Hi 0x00 Variable Nibble Nibble Nibble Lo Array Nibble Server OxEF Variable Variable Array Array None None None None None None None Response Hi Lo Cnt Cnt Nibble Nibble Lo Nibble Nibble Amulet 5 LS Byte Set Word OxF2 Variable Variable Byte Value Lo Value Lo 0x00 Variable Hi Lo Value Hi Nibble Lo Nibble Array Nibble Nibble Hi Value Hi Hi Nibble Lo Nibble Server Variable Variable Array A
245. o keep slider handles from teleporting from the minimum location to the maximum location if the touchpanel is touched in the far left section on a horizontal slider or touched in the farthest bottom section on a vertical slider Enhancements GEMstudio can now handle multiple plots and graphs Added a new OS page that says Loading upon powering up during the stage where the OS and any cached images are loaded in the SDRAM Custom Button images can now be cached Added the ability to disable the watchdog timer The attribute is tpWatchdogEnable in the touch panel ini file found in the Global Configuration TouchPanel folder Changes for GEMstudio version 1 2 0 0 New Features Bug Fixes Added new CRC Communication Protocol which is now the default Amulet serial protocol Added ability to save and open Amulet Production files pdb and gem When saving to Amulet Production files the current OS is always stored with the project automatically thus preventing any issues of a project being loaded into a module with an incompatible OS The GEMcompiler can now be launched right from the main GEMstudio page Even after the 30 day trial has expired the launching of the GEMcompiler is still available Fixed bug in set word array in communications protocol Was only setting the LSB prior to this release While in GEMstudio Project gt Set To Home Page is now grayed out while current home page is highlighted Used to cause an e
246. of the dynamic string at compile time The font styles available are plain bold italic underline and strikethrough If it is desired to change the font style at runtime that can be done by using the font style escape character 0x02 The byte following the font style escape character determines the font style of the characters that follow It is not sent as ASCII character but rather a raw byte determined by the font style or styles chosen Each font style is represented by a single bit within the font style byte Multiple font styles be specified at one time except in the case of plain which must stand alone Font Style Bit Location Bold 0x01 Italic 0x02 Strikethrough 0x04 Underline 0x08 Plain 0x80 For example to set InternalRAM string 1 to a string which looks like this Bold and italic and plain You would send the following message to the Amulet 0xD7 0x30 0x31 0x02 0x01 0x42 0x6F 0x6C 0x64 0x20 0x61 0x6E 0x64 0x20 0x02 0x03 0x69 0x74 0x61 0x6C 0x69 0x63 0x20 0x61 0x6E 0x64 0x20 0x02 0x80 0x70 0x6C 0x61 0x69 0x6E 0x2E 0x00 Alternatively written with ASCII characters written out as ASCII characters it would look like this 0xD7 0x30 0x31 0x02 0x01 Bold and 0x02 0x03 italic and 0x02 0x80 plain 0x00 Flow Diagram Example The flow diagram of Table 3 depicts a sample communications session between the Amulet LCD module and an external processor This sample is set
247. ol folder Copy origcommands ini into your projects main directory and use the initCommands META with origCommands ini as your SRC file Summary of Amulet protocol command opcodes Command Response Description Command Can Be Command Can Opcode Opcode Sent by Amulet Be Sent by External Processor OxDO OxEO Get byte variable X X OxD1 OxE1 Get word variable X X 0 02 2 Get string variable X X OxD3 OxE3 Get label variable X OxD4 OxE4 Get RPC buffer X 0xD5 OxE5 Set byte variable X X OxD6 OxE6 Set word variable X X 0 07 OxE7 Set string variable X X OxD8 OxE8 Invoke RPC X 0xD9 OxE9 Draw Line X OxDA OxEA Draw Rectangle X OxDB OxEB Draw Filled Rectangle X OxDC OxEC Draw Pixel X OxDD OxED Get byte variable array X OxDE OxEE Get word variable array X OxDF OxEF Set byte variable array X OxFO Acknowledgment ACK X X 1 Negative Acknowledgment 2 Set word variable array Table 4 Listing of all Amulet protocol command opcodes and response opcodes ASCII Based Graphic Primitives Using GEMstudio to create your projects at compile time allows you to make rich user interfaces quickly and easily Sometimes though the ability to draw graphic primitives like lines rectangles and filled rectangles at runtime is needed GEMstudio does not inherently give you the ability to do this With the addition of a new communications protocol that allows the external processor to be the master and the Amulet to be the
248. olor entry conventions Specifies the desired list fill color See section on colors for more information If no fill color is specified the default color is the current background color If the alpha is FF then the fill is fully opaque Parameter font value font font size Specifies the font used for the option names within the list box See Amulet GEM Font Converter for more information regarding the creation of auf font files Default is Bitstream Vera Sans Default font size is 12pt Parameter fontColor valuez See color entry conventions Specifies the desired font color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value PLAIN or BOLD or ITALIC Specifies the style associated with the list box font If BOLD or ITALIC is not selected PLAIN is the default fontStyle The available font styles are e PLAIN The option text uses the standard font e BOLD The option text is bold i e text e ITALIC The option text is italicized i e text Parameter href value function s The function or multiple sequenced functions invoked when a list item is hit See Appendix B for all available functions for the List widget Parameter initialCondition value string or FromlnitHref Specifies which option string is highlighted when the page is loaded The value associated with the highlighted option string is the argu
249. on a hit or not By default hrefOnHitOnly is UNCHECKED which means the slider will launch its href upon loading the page The href is also launched after a forceUpdate call By setting hrefOnHitOnly to CHECKED the href will only be launched upon the slider physically being selected or upon a forceHit call Parameter initHref value function Only valid if FromlnitHref is used as the initialCondition Specifies the function called when the page is loaded The value returned from this function call will be used as the initial condition of the Slider handle See Appendix B for all available functions Parameter orientation value HORIZONTAL or VERTICAL Specifies if the handle is to travel horizontally or vertically The orientation parameter will override the orientation determined by the height and width dimensions Parameter tickLength value number The length size of each tick mark in pixels The range is 1 255 0x01 OxFF If tickLength is not given the default is 9 pixels Parameter tickPosition value CENTER or TOP or BOTTOM or LEFT or RIGHT The position of the tick marks in relation to the channel The range for a horizontal slider is CENTER TOP or BOTTOM The range for a vertical slider is CENTER LEFT or RIGHT If tickPosition is not given the default is CENTER inside the channel Parameter waitForlnit valuez CHECKED or UNCHECKED Only valid if FromlnitHref is used as the initi
250. on calls that control widgets can launch Page functions use a syntax similar to META Refresh Object Page functions can be launched either by a timer or by being invoked by another function or widget Page functions can also perform an if then else logic allowing for more complex pages Click here for more in depth documentation on META Refresh Objects and the different ways they can be used as Amulet page functions For further instructions and tips on the Page Functions Editor please click here Below are a couple of templates that can be used to copy and paste into the Page Functions window To create an unconditionally launched function use the following template meta http equiv Refresh content 0 0 01 url Amulet InternalRAM byte 0 setValue OxFF name initMeta gt To create a conditionally launched function use the following template meta http equiv Refresh content 0 2 if Amulet InternalRAM byte 0 value eq OxFF thenzAmulet InternalRAM byte 0 setValue 0 Page 2 open else Amulet InternalRAM byte 0 increment name testerMeta gt For a list of all available functions see Appendix B lt EMBED gt For including a text file into the GEMstudio project the lt EMBED gt function is used All text within the included file will be treated as if it were part of the page and located within the page at the same location as the lt EMBED gt tag This function can be used anywhere within the page It is especially useful f
251. ontal slider only TOP The slider value increases from top to bottom vertical slider only BOTTOM The slider value increases from bottom to top vertical slider only Parameter tickColor value See color entry conventions Specifies the color of the ticks drawn on the channel See section on colors for more information If no tick color is specified the default color is black If the alpha is FF then the tick color is fully opaque Parameter tickCount value number The total number of tick marks along the slider channel If 0 no tick marks are visible If tickCount is not given the default is 0 The range is 0 255 0x00 OxFF Optional Slider Parameter Attributes Parameter handleOffset value number Specifies the number of pixels from the center of the channel the handle is located If a vertical slider positive numbers shift the handle to the right and negative numbers shift it to the left If a horizontal slider positive numbers shift the handle to the bottom and negative numbers shift it to the top The range is 100 through 100 Parameter handleThickness valuez number width in pixels of the handle if a horizontal slider or the height of the handle if a vertical slider If handleThickness is not given the default is 11 pixels The range is 4 255 0x04 OxFF Parameterz hrefOnHitOnly valuez CHECKED or UNCHECKED Specifies if the slider href function s is launched only up
252. or on any page and the Amulet will become the slave for that message If the Amulet has any further master messages it will once again become the master until the external processor chooses to be the master When the Amulet is the slave the external processor can read and write to virtual dual port RAM which resides on the Amulet side The Amulet has 256 byte variables 256 word variables 256 26 character string variables and a 6 byte deep RPC buffer Amulet Widgets can have href commands that start with Amulet InternalRAM to access these virtual dual port RAM variables The command opcodes are the same regardless of who is the master or who is the slave This means that a Get byte variable command sent to the Amulet looks exactly like a Get byte variable command sent to the external processor The one difference is the slave ID which is the first byte of every message If the host is sending a master message to the Amulet processor the message will start with the Amulet ID If the Amulet is sending a master message to the host processor the message will start with the Host ID Responses start with the same ID as the original message so if the Amulet sends a master message to the host the message from the Amulet processor will start with the Host ID and the response from the host will also start with the Host ID Conversely if the external processor sends a master message to the Amulet processor the message will start with the Amulet ID
253. or replacing a number of META Refresh tags that exists in multiple pages URL filename where filename is the name of the text file to include at that specific location within the page Example EMBED URL examplefilename gt Amulet Internal RAM Amulet has over 1 KiB of onboard RAM which we have turned into virtual dual port RAM There are 256 different byte variables 256 different word 16 bit variables 256 different Color 32 bit variables and 256 different 25 character null terminated string variables 25 1 26 bytes allocated per string variable Amulet Widgets can read or write to these Internal RAM variables The Internal RAM variables can also be saved in flash thus giving the variables permanence In addition an external processor can read and write to these Internal RAM variables as well The external processor can send an unsolicited serial message to the Amulet to read or write to the Internal RAM variables This means that the external processor is not required to be the Amulet s slave Follow this link to learn more about the communication protocol You can setup your pages to a have the Amulet always be the master b have your processor always be the master or c have a dual master system Some of the main features of InternalRAM 1 Internal RAM variables can survive from page to page of your GUI project 2 Internal RAM can be saved back to the flash so the variable can persist even after powering down 3 Internal
254. ore information If no alphaColor is specified the default color is a transparent gray If the color specified does not have an alpha component then it will be completely opaque which will result in a colored rectangle appearing in place of the button while it is touched Parameter executeOn value HIT or RELEASE or BOTH Specifies when the href function is launched either when the button is hit when the button is released or when the button is both hit and released If nothing is specified the default is to RELEASE Parameter horizontalAlign value LEFT or CENTER or RIGHT Specifies the horizontal alignment of the string associated with the label attribute within the Function Button dimensions Only one value is allowed you cannot mix horizontal alignments Default is CENTER Parameter initHref value function Specifies the function called when the page is loaded Use this attribute only when FromlnitHref is used as the label The string value returned from the function call will be used as the button label Only available function is of type Amulet UART label x value See note regarding the use of InternalRAM label variables as button labels Parameter noSdram value CHECKED or UNCHECKED Specifies if the background of the Function Button is stored in SDRAM or not If noSdram CHECKED then applying the disappear IWC method could result in strange behavior If the parameter is UNCHECKED the butto
255. ors for more information If no fill color is specified the default color is the current background color If the alpha is FF then the fill color is fully opaque Parameter font value font font size Specifies the font and font size used for the String Field text The corresponding auf file must be included in the Amulet Color Configuration Fonts folder the root folder or the root Fonts folder See Amulet GEM Font Converter for more information regarding the creation of auf files Default is Bitstream Vera Sans The default font size for the String Field text is 12pt Parameter fontColor value See color entry conventions Specifies the desired String Field text color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value BOLD or ITALIC or PLAIN Specifies the style associated with the string field font The available font styles are e BOLD The option text is bold i e text e ITALIC The option text is italicized i e text e PLAIN The option text is standard font i e text This attribute defines the default font style of both the static text defined in the printf attribute as well as the dynamic string returned from the href function If it is desired to change the dynamic string s font style at run time see the UART Protocol documentation regarding the font style escape byte Parameter horizontalAlign value
256. ows and a small window will pop up listing the different blocks of code as shown in the Figure below Select a block and the block will be highlighted in the Page Functions Editor Page Functions aog src 480x272DemolinternalRAM ini gt ent 0 05 lt meta http equiv refresh content 0 URL Amulet document Logo setX 192 Amulet document Logo reappear name meta3 gt lt meta http equiv refresh content 0 if Amulet InternalRAM Word 0 value eq 1 then ViewWidgetsHome open eq 0 then Thankyou open name Thankyou gt 1 Auto complete is activated with the TAB key If the cursor is not at the end of a line auto complete will not show visual gray The user must hit TAB to show the available options If the cursor is at the end of a line and there are multiple options available the user must hit TAB to show options However if there is only one option available hitting TAB will auto complete the visually grayed function 2 Cstyle comments are supported as shown in the Figure below Auto complete is not available inside comments Page Functions Edt Foldings Tools 2 0 lt meta lt meta name InitInternalRAM src 460x272DemoljinternalRAM ini gt lt meta http equiv refresh content 0 05 4 URL Amulet document FireAnim oneFramed 5 Amulet document meta3 forceUpdate name meta2 lt meta http equiv refresh content 0 3 URL Am
257. ppendChar y Append the single UTF 8 character y to the Internal RAM string variable z Result is stored in Internal RAM string variable z Amulet InternalRAM string z appendString y Append the string y to the Internal RAM string variable z Result is stored in Internal RAM string variable z 1 lt 2 the string stored at Internal RAM string variable z to the Internal RAM string variable x Result is stored in the Internal RAM string variable pointed to by the Internal RAM byte variable x It might be easier to visualize it as InternalRAM string InternalRAM byte x Note the above is for visualization purposes only do not attempt to use the above syntax Amulet InternalRAM string z appendViaByteVarFxppend the string stored at Internal RAM Amulet InternalRAM string z backspace Amulet InternalRAM string z clear string variable z into the Internal RAM string variable whose index is the byte value stored at Internal RAM byte x Result is stored in the Internal RAM string variable pointed to by the Internal RAM byte variable x It might be easier to visualize it as InternalRAM string InternalRAM byte x Note the above is for visualization purposes only do not attempt to use the above syntax Delete last character from the Internal RAM string variable z Clear out the Internal RAM string variable z Amulet InternalRAM strin
258. probably be set to CHECKED Animated Image Animated Images have internal methods that can be invoked by other Control Widgets Objects See the Inter Widget Communications document for the list of available methods for each object widget Animated Image Parameter Attributes Parameter file value image Specifies the image to use Images be GIF Parameter invisible value CHECKED or UNCHECKED Specifies if the Image is to start out invisible or not If the attribute is not present then by default the Image is visible If the Image starts out invisible the only way to make it visible again is via the IWC method reappear Parameter cachelmage value CHECKED or UNCHECKED A checkbox that specifies to GEMstudio to store this image in the SDRAM in an uncompressed format for immediate use Since the image is written to the SDRAM only once per project it is not suitable for images that contain transparencies Images can be either GIF JPG or PNG Parameter noSdram value CHECKED or UNCHECKED Specifies if the image is loaded into page specific SDRAM or not Loading the image into the SDRAM allows the disappear and or reappear methods to transition faster If the image will not be made to disappear or reappear there is nothing to be gained by using the SDRAM so noSdram should probably be set to CHECKED Static Text Static Text is an object that enables the user to write text on the display Unlike String
259. product under warranty claim at Buyer or distributor s location of business SELLER HEREBY DISCLAIMS ALL OTHER REPRESENTATIONS AND WARRANTIES EXPRESSED OR IMPLIED EXCEPT THOSE EXPRESSLY SET FORTH IN THIS ARTICLE 7 AS TO THE PRODUCT INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF MERCHANTABILITY OF FITNESS FOR A PARTICULAR PURPOSE SELLER WILL NOT BE LIABLE FOR ANY DAMAGE LOSS COST OR EXPENSE OR BREACH OF WARRANTY EXCEPT AS AND TO THE EXTENT EXPRESSLY SET FORTH IN THIS ARTICLE 7 BUYER HEREBY WAIVES ALL CLAIMS FOR GENERAL CONSEQUENTIAL INCIDENTAL OR SPECIAL DAMAGES AND AGREES THAT SELLER S LIABILITY TO BUYER AND BUYER S EXCLUSIVE REMEDY ARE EXPRESSLY LIMITED TO THE REPAIR OR REPLACEMENT OF MATERIALS PURSUANT TO THE WARRANTY SET FORTH HEREIN AND SUCH LIABILITY SHALL IN NO EVENT EXCEED THE PURCHASE PRICE FOR SUCH PRODUCT IN NO EVENT SHALL SELLER BE LIABLE FOR TRANSPORTATION LABOR OR OTHER CHARGES FOR ADJUSTMENTS REPAIRS REPLACEMENT OF PARTS INSTALLATION OR OTHER WORK WHICH MAY BE DONE UPON OR IN CONNECTION WITH SUCH PRODUCTS BY BUYER OR OTHERS
260. ptional background image and border The background image if specified is the first image that is shown upon entering the page unless the initBackground attribute is set to FALSE An InterWidget Communications method uploadImage allows for another widget object to make the Scribble Widget transfer the raw image data to an external processor via an xmodem protocol The raw image the Amulet bitmap format Scribble Widget Ifthe Scribble canvas is saved using the IWC method saveCanvas the current state of the visible canvas is saved to the serial data flash overwriting the current image specified by the canvas attribute If it is desired to keep an initial image to be displayed upon page loading and you are using the saveCanvas you must use the background attribute to specify a separate initial image that will not get overwritten Scribble Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Scribble Widget is to start out invisible or not If the attribute is not CHECKED then by default the Scribble Widget is visible If the Scribble Widget starts out invisible the only way to make it visible again is via the method reappear Parameter canvas value image Specifies the image used for the canvas of the Scribble Widget This is a required parameter The canvas can contain a background image or it can be a completely blank image but the dimensions of the canvas MUST be ex
261. r The final byte is the checksum byte which when added to the first four bytes should result with the LSByte of the sum being equal to 0x00 Examples To jump to page 0x25 0xA0 0x02 0x00 0x25 0x39 Notice that OxA0 0x02 0x00 0x25 0x39 0x0100 LSByte of sum is 0x00 To jump to page 0 103 0xA0 0x02 0x01 0x03 0x5A Notice that 0 02 0 01 0 03 0 5 0x100 LSByte of sum is 0 00 Sending a Soft Reset Command It is possible to send a Master Message to the Amulet which will force it to perform a soft reset It will react exactly as if the reset button was pressed The message structure is similar to the Jump To Page command This message is NOT in ASCII The first four bytes are 0 02 OxFF OxFF The final byte is the checksum byte which when added to the first four bytes should result with the LSByte of the sum being equal to 0x00 Given that the entire five byte string is OxAO 0x02 OxFF OxFF 0x60 Example To cause a soft reset 0xAO0 0x02 0xFF OxFF Ox60 Notice that 0XA0 0x02 0xFF 0xFF 0x60 0x0300 LSByte of sum is 0x00 Sending strings to the Amulet which contain characters above Ox7F using UTF 8 The Amulet protocol uses the UTF 8 standard to deal with string characters above the normal ASCII range of 0x20 0x7F UTF 8 8 bit UCS Unicode Transformation Format is a variable length character encoding for Unicode It is able to represent any character in the Unicode standard yet is backwards compatib
262. rameter groupName value text Specifies the radio button group this radio button is a part of Parameter href value function s The function or multiple sequenced functions invoked when a radio button is set Unlike checkboxes radio buttons within a group can call different href function s See Appendix B for all available functions for the Radio Button widget Parameter initialCondition value ON or OFF or FromlnitHref Specifies the initial condition of the radio button when the page is loaded If FromlnitHref is selected the function specified by the InitHref attribute is called The returned byte value determines which single button if any within the group is selected the returned value must exactly match one of the button s internalNumber Parameter label value text Specifies the name that appears to the right or left of the radio button Parameter cachelmage valuez CHECKED or UNCHECKED A checkbox that specifies to GEMstudio to store this image in the SDRAM in an uncompressed format for immediate use Since the image is written to the SDRAM only once per project it is not suitable for images that contain transparencies Images can be either GIF JPG or PNG Optional Radio Button Parameter Attributes Parameter emptylmage value image Specifies the image to use when the radio button is in the not set state If this attribute is not present then a default image the Amulet logo is
263. range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the value in updateFreq Parameter verticalAlign value TOP or MIDDLE or BOTTOM Specifies the vertical alignment of the string associated with the printf attribute within the String Field dimensions Only one value is allowed you cannot mix vertical alignments Default is TOP Parameter waitForInit value CHECKED or UNCHECKED Specifies if the String Field will wait for valid data before being displayed on the LCD If CHECKED the String Field will not display any text static or dynamic until the first packet of data is received If UNCHECKED or the attribute is not present the String Field starts out displaying only the static text if any specified until the first packet of data is received Optional String Field Parameter Attributes Parameter initialCondition value string Specifies which options string is initially used when the page is loaded It is acceptable to use the options and initialCondition attributes even when requesting the Amulet UART string x value The default string will be used until a valid string is received Parameter options value see image below
264. raphic primitive InternalRAM color opcode is 0x42 The payload is a single 8 bit index making for a total of 5 bytes in the command When setting the graphic primitive line weight only a single byte is used to set the width of the graphic primitive line The graphic primitive line weight opcode is 0x43 The payload is a single byte making for a total of 5 bytes in the command There are four graphic primitive drawing commands All four commands assume that the color and line weight have already been set prior to sending the drawing commands Draw pixel Draw line Draw rectangle Draw filled rectangle Bow pixel primitive opcode 0x44 draws a pixel at point1 x coordinates coordinates are specified by a 16 bit number which are in the order of MSByte then LSByte The payload is made up of the x and y coordinates so there are a total of 4 bytes in the payload making for a total of 8 bytes in the command The color is determined by the most recently sent set graphic primitive color command and is the size specified by the most recently sent set graphic primitive line weight command The line primitive opcode 0x45 draws a line from point 1 x and y coordinates to point 2 x and y coordinates The payload is made up of two sets of x and y coordinates so there are a total of 8 bytes in the payload making for a total of 12 bytes in the command The color is determined by the most recently sent set graphi
265. raws the background image from flash Redraws the canvas image from flash Allows freehand drawing to continue after a disappear method was called 1 Saves the current state of the canvas to the flash Writes over the original canvas specified at compile time The named Scribble widget will set its active freehand drawing line weight to x range 1 15 Scribble widget uploads its raw image data via the connection and protocol described in the href parameter either paintCanvas paintBackground should be called immediately afterwards because the reappear method for the scribble widget only allows redrawing it does NOT redraw either the canvas or the background image If it is desired to display exactly what was on the screen at the time of the disappear they should first saveCanvas then call disappear Then when calling reappear also call paintCanvas Table 5 Control Widget href functions for inter widget communications with Pulse Width Modulation Sidgets Amulet document pwmName start Amulet document pwmName stop Amulet document pwmName setPeriod x Amulet document pwmName setPulseWidth x The PWM port defined in the widget pwmName starts oscillating at the current period and pulse width The PWM port defined in the widget pwmName stops oscillating and returns to a logic low state Sets the period in milliseconds of the PWM port defined by the widget called pwmName Range i
266. rd 2 bytes Get Internal RAM color array request color 4 bytes A Get Internal RAM RPC buffer request A Set Internal RAM byte variable command A Set Internal RAM word variable command word 2 bytes A Set Internal RAM string variable command A Set Internal RAM color variable command color 4 bytes A Set Internal RAM byte variable array command A Set Internal RAM word variable array command word 2 bytes A Set Internal RAM color variable array command color 4 bytes A Set Graphic Primitive color 8 bit command A Set Graphic Primitive color 32 bit command A Set Graphic Primitive color InternalRAM color index command A Set Graphic Primitive pen weight command A Draw pixel command A Draw line command A Draw rectangle command A Draw filled rectangle command A Jump to specific page command If the message is valid the Amulet LCD module slave will either return the requested data if a Get request or confirm the message if a Draw or Set command If there is a CRC error the Amulet will not respond at all If the opcode is not a valid Amulet opcode the Amulet will respond with a and the Illegal Function error code 1 The protocol is the same regardless of who is the master So if an external processor is requesting the value of a byte variable on the Amulet which would be an Internal RAM byte variable the command opcode would be the same as i
267. rd variable 3 Return word of word var 3 Get byte variable 4 no such variable on server Error ACK Move on Get Internal RAM byte var 4 0 01 0 20 OxF4 OxA8 0 47 OxC6 0x01 0x31 OxC1 OxF4 0 01 0 27 0 01 0 52 0 31 gt gt lt lt gt gt lt lt gt gt Return value of IR byte var 0xF4 0 01 0 31 0 76 0 02 0 9 0 37 OxDO Set IR word var 0x76 gt 0x02C9 Ack set IR word var 0x76 0x01 0x27 0x40 Ox3A Get Internal RAM RPCs Return IR RPC buffer NOTE If master requests an invalid variable the slave should at least respond with an ACK error code It will allow the communications to continue on without displaying bogus data This really should never happen since you have control of both the GEMstudio page and your processor s variables Table 3 Data flow diagram depicting several messages transmitted between the Amulet and a fictitious external processor Summary of Amulet CRC protocol command opcodes Command Description Command Can Be Command Can Opcode Sent by Amulet Be Sent by External Processor 0x20 Get byte variable X X 0x21 Get word variable X X 0x22 Get string variable X X 0x23 Get color variable X 0x24 Get byte variable array X X 0x25 Get word variable array X X 0x26 Get color variable array X 0x27 Get RPC buffer X 0x28 Get label variable X 0 30 Set byte variable X 0x31 Set word variable X 0x32 Set string variable X 0x33 Set color variable
268. rd variable z Amulet lnternalRAM word z calArrayS fk the calibration constants into successive Internal RAM word variables starting with z InternalRAM word z mx128 InternalRAM word z 1 bx InternalRAM word z 2 my128 InternalRAM word z 3 by Used to determine the calibration constants to enter into a touch panel configuration file The values can be read quickly by using this command in a test page s meta tag that launches upon startup and then have four Numeric Field widgets on the test page that displays these four Internal RAM word variables If tpCalibration 0x00 and the four constants added to a touch panel configuration file touch panel calibration will not be required upon loading a new OS The four variables are referenced in the touch panel configuration file as tpMx128 tpBx tpMy128 tpBy See STK CY 043 ini touch panel configuration file in PROGRAMDATA AmuletTech Global Configuration TouchPanel for usage example of Internal RAM word variable z into Internal RAM word Amulet InternalRAM word z dec Amulet InternalRAM word z div x Amulet InternalRAM word z inc variable y Decrement the value of Internal RAM word variable z Divide the Internal RAM word variable z by the word value x Result is stored in Internal RAM word variable z Increment the value of Internal RAM word variable z Amulet InternalR
269. request messages could potentially go out prior to set messages even if the set message was scheduled to go out first Beta releases now have their own update mechanism Notification message shows up if creating a 32 bit color project on any display larger than 480x272 Gives suggestion to use 8 bit color GEMplayer now handles both ASCII and CRC protocols Only supported ASCII protocol in the earlier beta IcdOff can now be called prior to the LCD controller ever starting Needs to be called in the LCD Configuration s Init file Can now use up to 255 fonts per project instead of only 15 Added zoom in and zoom out to the GEMstudio layout canvas GEMplayer now supports UART and USB communication Added ability to save Production Files with or without the bundled OS Options menu for List StringField and ImageSequence widgets can all now be resized New Features Added capacitive touchpanel support Added TouchArea widget which is similar to an HTML Area Map Capacitive touchpanel gestures supported within the new TouchArea widget Changes for GEMstudio version 1 3 0 1 Bug Fixes Fixed 480 272 Demo to include missing custom button images e Put the Calendar Demo in the root Documents GEMstudio directory Changes for GEMstudio version 1 3 0 0 New Features e Low Power SDRAM modes added e Low Power Sleep modes added e Amulet Calendar object and Real Time Timer added Bug Fixes e Fixed bug regarding invisible imageB
270. requested Returns OxEOxxNN to client where NN HEX data of variable pORCKCKCKCkCkCkCk k k k k k k k k K k k K K K K K K K KUK K K KOK K K KOK R O KOK K K KOK K KOK KO KOK OK K KOK UK K K K KOK KOK KOK handleG rcall getByte Read both nibbles of xx and assemble into a byte Return in buffer try again If carry cleared then invalid value over mov which buffer ldi buffer GetResponse reall putch Acknowledge valid command mov buffer which Swap buffer Rotate MSNibble into LSNibble position rcall nib2ascii Convert LSNibble of buffer to ASC recall putch Echo back MSNibble of variable xx mov buffer which rcall nib2ascii Convert LSNibble of buffer to an ASC rcall putch Echo back LSNibble of variable xx rcall get varH Go get data msn for variable xx rcal putch Transfer data to the client recall get_varL get data lsn for variable xx rcal putch Transfer data to the client rjmp try again Done with Get command so start over Handle String command to tx a string back Format of request string 0xD2xx where xx index of string variable Returns 0xE2xxString Null to host k K k k lt lt lt lt k x lt lt ck lt k k ck lt ck lt k ck ck lt ck ck ck k ck ck ck ck ck ck ck ck ck ck k ck ck lt ck x ck k lt x x x lt handleString recall getByte Read both nibbles of xx and assemb
271. riable z by the byte value x Result is stored in Internal RAM byte variable z Amulet lnternalRAM byte z inc Increment the value of Internal RAM byte variable 2 Amulet InternalRAM byte z maskedValue x Return the value of Internal RAM byte variable z ANDed with the mask x Amulet InternalRAM byte z mul x Multiply the Internal RAM byte variable z by the byte value x Result is stored in Internal RAM byte variable z Amulet InternalRAM byte z or x Logically OR the Internal RAM byte variable z with the byte value x Result is stored in Internal RAM byte variable z Amulet InternalRAM byte z setValue x Set the value of Internal RAM byte variable z to the byte value x Amulet InternalRAM byte z sub x Subtract the byte value x from the Internal RAM byte variable z Result is stored in Internal RAM byte variable z Amulet InternalRAM byte z value Return the value of Internal RAM byte variable z Amulet InternalRAM byte z xor x Logically EXCLUSIVE OR the Internal RAM byte variable z with the byte value x Result is stored in Internal RAM byte variable z Table 2 InternalRAM word method descriptions InternalRAM Word Methods Descriptions Amulet InternalRAM word z add x Add the word value x to the Internal RAM word variable z Result is stored in Internal RAM word variable z Amulet InternalRAM word z and x Logically AND the Internal RAM word variable z with the word value x Result is stored in Internal RAM wo
272. rnal RAM RPC buffer request OxD4 followed by the RPC buffer flag byte which is ASCII ized like all data within the Amulet protocol The RPC buffer flag byte options are 0x00 send all RPCs from buffer then flush OxFF flush RPC buffer When the Amulet is the master and an RPC is invoked the Amulet will immediately send out the RPC command If the Amulet is setup to use the Internal RAM RPC buffer instead then the Amulet will send the RPC to an RPC buffer The RPC buffer can only be read by an external processor by sending a Get Internal RAM RPC buffer request 0xD4 The Amulet will respond with all the RPCs up to six stored in the RPC buffer and then a null termination character to signify the end of the buffer After sending out the contents of the RPC buffer the Amulet will flush the buffer Dual Master Collisions In a dual master system it is possible that both masters will choose to send a message out at the same time If the Amulet sees an incoming master message coming from the external processor while it is in the process of sending a master message of its own it will finish sending its master message and then immediately respond to the incoming message assuming it is a valid message with a valid CRC After completely responding to the master message the Amulet will then wait for a response to its own master message If the host does not respond to the Amulet message the Amulet will timeout and resend its own master message again
273. rray None None None None None None None Response Hi Lo Cnt Cnt Nibble Nibble Hi Lo Nibble Nibble Denotes command is only applicable when Amulet is set as Slave Table 1 Thirteen types of messages can be sent between the master and the slave not counting the graphic primitives Synchronization The master initiates all communications by sending a message to the slave All valid messages from the Amulet to the external processor start with one of eight command bytes 0xDO 0xD1 0xD2 OxD3 OxD5 0 06 0 07 or OxD8 these are considered the Master Start Of Message MSOM characters NOTE These eight MSOM bytes ALWAYS signify the start of a message and they are not allowed in the body of any message The only valid characters in the body of a message are ASCII 0 9 0x31 0x39 and A F 0x41 0x46 except in the body of the Get string response where all ASCII characters from 0x20 Ox7E are valid as well as the line feed character OxOA See Widgets for more line feed info If the slave receives any character other than those specified the message should be considered errant and the slave should start over hunting for a new MSOM character All slave responses must start with the counterpart of the MSOM character that began the message that is being responded to The valid Slave Start Of Message SSOM bytes OxEO OxE1 OxE2 OxE3 OxE5 OxE6 OxE7 or OxE8 The body of the response
274. rrides any other style The available font styles are e PLAIN The option text uses the standard font i e text e BOLD The option text is bold i e text ITALIC The option text is italicized i e text Parameter href value function The function called to retrieve the widget input See Appendix B for all available functions for the Numeric Field Widget The function is called at an update rate specified by the updateFreq attribute Parameter horizontalAlign valuez LEFT or CENTER or RIGHT Specifies the horizontal alignment of the string associated with the printf attribute within the Numeric Field dimensions Only one value is allowed you cannot mix horizontal alignments Default is LEFT Parameter max value number Maximum value returned from the href function must be greater than min If the function returns a byte the range is 1 255 0x01 OxFF If the function returns a word the range is 1 65535 0x01 0xFFFF Parameter maxFld value number Specifies what the numeric field displays when the maximum value is returned from the href function call When using hexadecimal you must precede the minFld number with Ox By default the Ox will NOT be displayed unless the flag is used in the printf field The maxFld value does NOT have to be greater than the minFld value Range is 65535 to 65535 when using integers and floating point numbers and 0 to Oxffff when using hex numbers See no
275. s 0 01 to 104 00 Sets the pulse width in milliseconds of the PWM port defined by the widget called pwmName Range is 0 01 to 103 99 1 Regarding x For static numbers x is defined in milliseconds but if the value is passed from a widget s intrinsic value for example passed from a Slider widget or from InternalRAM variables this becomes microseconds Valid View Widget except StringField href functions Table 6 View Widget href functions except StringField widget Amulet document widgetName value Amulet document widgetName maskedValue y Amulet internal fileNumber value Amulet internal lostCommByte value Amulet internalRAM byte x value Amulet internalRAM byte x maskedValue y Amulet internalRAM word x value Amulet internalRAM word x maskedValue y Amulet math randomByte value Amulet math randomByte maskedValue y Amulet math randomFilteredByte value Amulet math randomFilteredByte maskedValue y Amulet NOP Amulet UART byte x value Amulet UART byte x maskedValue y Returns the intrinsic value byte or word of the named Control Widget Returns the intrinsic value byte or word of the named Control Widget ANDed with the mask y Returns the internal flash index number of the current page See Amulet link map file documentation for more information Returns the count of consecutive communication time outs Returns the value of internalRAM byte variable x Ret
276. s higher up the list than the current selection The list did not scroll itself up to show the new list choice e Fixed bug in List Box Widget regarding attempting to read the current value of a list box that did not have any choice selected GEMplayer would crash and the actual module would have indeterminate effects e Fixed bug when attempting to disappear an already disappeared object that had just moved When the second disappear was called the background where the object was prior to the move would then show up in the rectangular region where the object had been moved to e fromlnitHref x where x is the precision is now supported by Function and Custom Buttons within GEMstudio e Fixed bug when a multi href object and a sequenced href object were on the same page and with the same signature If one was separated by commas and the other by semi colons but the functions were the same only the first object would be created but erroneously used in both cases e GEMplayer s 10ms timer is much more accurate e Fixed bug in static text layout Formatting would only be correct when first entered Upon reloading a saved gemp file all static text formatting would be lost e When entering color names as an argument it was required to use single quotes Now single or double quotes can be used e If Slider Widget s optional orientation attribute is set such that the the handle travels along the shorter axis the GEMstudio WYSIWYG layout pane will
277. s see the following example To create a toggle type custom button that invokes an external RPC 5 when toggled down and invokes an external RPC 6 when toggled up use the following href commands Amulet UART invokeRPC 5 Amulet UART invokeRPC 6 Sequenced function calls can also be made up of multiple function calls There is a limit of 36 different sequences per Control Widget Object href and each sequence can have a maximum of 36 multiple function calls To help illustrate this use the previous example but instead of invoking RPC 5 for one sequence and then RPC 6 for another sequence let s assume we would like the first sequence to invoke RPC 4 and RPC 5 and the second sequence to invoke RPC 6 and RPC 7 To accomplish this use Amulet UART invokeRPC 4 Amulet UART invokeRPC 5 Amulet UART invokeRPC 6 Amulet UART invokeRPC 7 notice the sequences are separated by the semi colon and the multiple function calls are separated by the commas Using Commas and Semi colons within Strings stored in Function Calls Since commas and semi colons are used to distinguish Multiple Function Calls and Sequenced Function Calls in order to use commas and semi colons within strings that are used in function calls you must use the escape character V prior to the comma or semi colon For example to set InternalRAM string variable 5 to the string To use a comma use the escape character same for the semi colon the href would look like this
278. s not enough room to wrap the string will be truncated User defined wraps can be specified by entering n within the static text or by sending a in the dynamic text at the spot you would like the wrap to occur There is a maximum of 20 wrapped lines per String Field Ifan upper ASCII character 0x80 0xFF is to be sent as a dynamic string to the stringField over the UART you must use the DLE 0x10 escape character See the UART Protocol document for more specifics String Field Widget String Field Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the String Field is to start out invisible or not If the attribute is not CHECKED then by default the String Field is visible If the String Field starts out invisible the only way to make it visible again is via the IWC method reappear Parameter border value number Specifies width in pixels of the border around the dimensions of the String Field Default is 0 meaning no border Parameter borderColor value See color entry conventions Specifies the desired String Field border color See section on colors for more information If no border color is specified the default color is black Only applicable if border has a value of 1 or greater If the alpha is FF then the border color is fully opaque Parameter fillColor value See color entry conventions Specifies the desired String Field fill color See section on col
279. s to precede or follow the literal variable name with a amp 03 which puts in a space holder that the Amulet doesn t display Because the preprocessor scans all the text in your project it is advised to use macro names that will not show up normally We suggest starting all of your macro names with an uncommon character like or Another common practice is to bracket the macro name with such as macro This will serve two purposes One it makes it easy to see your macros when looking at your code Two you won t have to worry about having the preprocessor do a text substitution when you didn t really mean it The Amulet macro preprocessor is very flexible though so you are not required to use any special characters but care should be taken in the naming of macros Enabling the GEM Compiler Preprocessor By default the Amulet GEM Compiler preprocessor is not enabled You can enable the preprocessor by specifying an include file To do so open the project settings choose on the Miscellaneous tab and select Browse highlighted in the picture below The open file dialog will appear Navigate to your macro file and select Open gt Project Properties LCD Communication Color Depth Transitions Miscellaneous Misc Options Frame Buffer Double JPEG Compression Native Touch Priority From Top to Bottom Macro Definitions Macro File None Browse k emove InternalR AM Initiailization Ini
280. se in your GUI pages will need to be converted into an Amulet Unicode Font file auf using the Amulet GEM Font Converter and the subsequent auf file should be placed one of three acceptable folders Either the root directory of the project you are compiling the root Fonts directory or the Amulet Configuration Fonts folder The GEM Compiler first looks in the root directory then the root Fonts directory and finally the Amulet Configuration Fonts directory You will then need to place Arial 4 auf which is generated by the Amulet GEM Font Converter into either the Amulet Configuration Fonts folder or in the root directory of the file you are compiling If you save Arial_4 auf in the Amulet Configuration Fonts folder then you can use Arial size 4 in any other Amulet project If you save it in your root or root Fonts folder Arial size 4 can be used in any page or project used within the root directory To use a font generated by the Amulet GEM Font Converter in an Amulet Widget please restart GEMstudio If the font is missing the default will be the Amulet Sans Serif size 12pt If the fontSize is missing the default is 12pt It is HIGHLY recommended in situations which non regular font styles are used to use the Amulet GEM Font Converter to convert the font in the Regular style and let the Amulet software modify the style of the font Starting the Amulet GEM Font Converter The Amulet GEM Font Converter runs on Windows 2000 XP a
281. should use f Like the regular updateFreq use a floating point number to specify the update rate in seconds Range for f is 0 655 35 4 forceHit for checkBox widget When imparting a forceHit on a single checkBox that checkBox will toggle You can also forceHit an entire checkBox group which will perform the href function s but will not toggle any checkboxes To forceHit a checkbox group use the groupName as the widgetName rather than an individual checkBox name 4a forceUpdate for checkBox widget You can only impart a forceUpdate on an entire checkBox group even if the checkBox is a lone box which will perform the initHref function To forceUpdate a checkbox group use the groupName as the widgetName rather than an individual checkBox name 5 forceHit for radioButton widget You can only impart a forceHit to an individual radio button not a radio button group 6 setValue for META REFRESH setValue cannot be invoked if the ONVAR attribute is present 7 setMethod and setUpdateRate When using the setMethod or setUpdateRate methods multiple functions are not allowed within a single href However you can invoke a forceHit on another object that will launch setMethod or setUpdateRate which then allows you to use multiple functions since there is no such limitation on the forceHit method 8 setMethod for checkBox widget To change the method for a checkbox group or an ungrouped checkbox use the groupName as
282. signed internal number 1 with the internal numbers incrementing with each subsequent radio button found which is part of the same radio button groupName Radio Button Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Radio Button is to start out invisible or not If the attribute is not checked then by default the radio button is visible If the Radio Button starts out invisible the only way to make it visible again is via the IWC method reappear Parameter buttonAlign value LEFT or RIGHT Specifies the location of the radio button in relation to the label text Parameter font value font Specifies the font and font size used for the radio button label See Amulet GEM Font Converter for more information regarding the creation of auf font files Default is Bitstream Vera Sans The default font size for the radio button label is 12pt Parameter fontColor value See color entry conventions Specifies the font color used for the radio button label See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value BOLD or ITALIC or PLAIN Specifies the style associated with the radio button label font The available font styles are e BOLD The option text is bold i e text e ITALIC The option text is italicized i e text e PLAIN The option text is the standard font i e text Pa
283. sition from left to right RIGHT The full and empty images transition from right to left TOP The full and empty images transition from top to bottom BOTTOM The full and empty images transition from bottom to top Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The range is 0 00 655 35 A value of 0 00 means update never Parameter updateDelay value number Specifies the delay time from when the page is loaded until the first href function call specified in seconds with a single floating point number The range is 0 00 655 35 If this number is not specified then the delay time defaults to the updateFreq number Optional Image Bar Parameter Attributes Parameter waitForlnit value CHECKED or UNCHECKED Only valid if href is used Specifies if the Image Bar will wait for valid data before displaying an image on the channel If CHECKED the Image Bar will not display until the data from the href function is received If UNCHECKED or the attribute is not present the Image Bar momentarily starts at the min location until the href function receives its data If waitForlnit not specified the default is UNCHECKED ImageSequence Image Sequence Widget ImageSeq class timer event the transition between images is linked to a byte or word returned from an href function call The displayed image is det
284. slave comes a way to send unsolicited graphic primitives to the Amulet The drawing of these graphic primitives is independent of the uHTML that is currently being run on the Amulet You do need to keep in mind that the UHTML will still be running so any widgets or objects that write to the LCD might write over the graphics primitive you send to the LCD If using the older ASCII based protocol the Amulet will respond to all graphic primitive commands with a response opcode OxE9 OxEB and an echo of all other bytes If it is desired to have the Amulet respond with an or no response at all a META tag using SlaveAckRsp or Slave NoRsp can be used on the home page of the project One thing to keep in mind is that the Amulet will use that attribute for all Set or Draw commands coming from your external processor The line primitive draws a line from point 1 x and y coordinates to point 2 x and y coordinates a 24 bit color and that has a line weight of 1 15 The line primitive is drawn by sending out the Draw line primitive opcode OxD9 followed by the x coordinate of point 1 the y coordinate of point 1 the x coordinate of point 2 the y coordinate of point 2 the line color and finally the line weight The x and y coordinates are 16 bit numbers The line color is made up of three 8 bit numbers one blue one green and one red The line weight is a 4 bit number Because Amulet uses an ASCII protocol each coordinate that is sent to
285. ss a change in either color or line weight is desired 1 Set the graphic primitive 8 bit color only applicable if the color density for the project is set for 8 bit color Set the graphic primitive 32 bit color only applicable if the color density for the project is set for 32 bit color 3 Set the graphic primitive InternalRAM color index if wanting the graphic primitive color to be based on the color stored in an InternalRAM color variable 4 Set the graphic primitive line weight N All graphic primitive commands follow the Amulet CRC based protocol convention so the first byte of every command will be the Amulet ID followed by the graphic primitive opcode a payload of data dependent upon the opcode and finally a 16 bit CRC When setting the graphic primitive 8 bit color only a single byte is used as the index into the 8 bit color palette currently defined in the project properties The graphic primitive 8 bit color opcode is 0x40 The payload is a single 8 bit index into the palette making for a total of 5 bytes in the command When setting the graphic primitive 32 bit color the order of each 8 bit color component is Alpha Blue Green Red The graphic primitive 32 bit color opcode is 0x41 The payload is made up of four 8 bit color components making for a total of 8 bytes in the command When setting the graphic primitive InternalRAM color index only a single byte is used as the index into the InternalRAM color array The g
286. string By default the precision length is 25 If a dynamic string longer than 25 characters is desired set the precision to the maximum length of the string The maximum precision size is 500 NOTE ON WRAPPING If the width of the String Field widget is less than required and the height of the string field widget is tall enough the string will wrap automatically If there is not enough room to wrap the string will be truncated User defined wraps can be specified by entering An within the static text or by sending a OxOA in the dynamic text at the spot you would like the wrap to occur There is a maximum of 20 wrapped lines per String Field The following table shows the effect of a variety of specifications in printing hello world 12 characters We have put colons around each field so you can see its extent 96s hello world 106 hello world 10s hello wor 10s hello world 15s hello world 15s hello world 15 105 hello wor 15 105 hello wor NOTE display a literal symbol in the string field use double percent command the string e g 5 at 100 displays your string at 100 96 To display a literal N symbol the string field use a double backslash command in the string e g s NN 100 displays your string X 100 Parameter updateFreq value number Specifies the href function call frequency specified in seconds with a single floating point number The
287. t File None Cancel Defining macros All macros must start with define followed by white space then the macro name more white space then the textual substitution Neither the macro name nor the textual substitution are allowed to have any white space within it White space is considered either spaces or tabs Inside the include file any text to the right of the comment characters is treated as a comment It is okay to have a comment on the same line as the macro definition As an example the syntax is as follows define macroName textSubstitution Where define specifies the creation of a macro macroName is the name of the macro textSubstitution is the text which will replace the macro name Examples hour Amulet UART byte 0 Comment goes here getHour hour value expands to Amulet UART byte 0 value Hdefine year word 3 define counter 7 Comment goes here As you can see from the examples above it is legal to use macros to define other macros Forward references are allowed For example both of the following are legal Hdefine getCnt cnt value forward reference to cnt is okay Hdefine cnt Amulet InternalRAM byte as well as Hdefine cnt Amulet lnternalRAM byte define getCnt cnt value Using macros to initialize InternalRAM A powerful feature of the Amulet GEM Compiler preprocessor is that it enables you to use defined macros anywhere in the HTM
288. t exist the opcode used to request a byte is 0x20 If an error existed the slave would respond with Ox80 0x20 with the following byte being the error code List of error codes Error Code Name Explanation Amulet Action Will Amulet if Error Sent Send By Host 01 Illegal Function Opcode used was invalid ignore yes 02 Illegal Data Variable number ignore no Address used was invalid 03 Illegal Data Value Implied length of array is ignore yes incorrect array overflow 04 Slave Device Fail Slave Device in ignore no failure mode 05 Ack Positive Acknowledgement ignore no 06 Slave Busy Slave currently too busy resend last no to process command message 07 Nak Negative resend last no Acknowledgement message 08 Memory Not currently used ignore no Parity Error Note About Sending Master Messages Between Amulet Page Changes When the Amulet changes from one page to another all UART buffers are flushed so if you are in the middle of sending the Amulet a Master Message while it is changing pages it is possible that the Amulet will not fully receive your message Another thing to keep in mind is that when first loading a page the transmission of messages is halted until the page is fully rendered The Amulet is capable of buffering incoming messages but it will not process or respond to any incoming messages until the page is fully rendered It can take up to 500ms for some complex pages to be fully rendered so if you were to sen
289. t extend below the bottom of the screen InvokeRPC calls now follow the same path as SetValue commands meaning they will go out in the order expected Starting with version 1 3 0 0 the InvokeRPC command could potentially be sent out prior to SetValue commands that were actually called before the InvokeRPC command in the code Dual master communication collisions handled better closing window that could resulted losing sync USB communication packets that are a multiple of 64 now work correctly GEMstudio now supports Turkish version of MS Windows The Flashing pages within the Amulet OS files now wait 20ms before calling Amulet loadFlash reset instead of calling it immediately This allows Please wait while programming flash to always show on dual frame buffer projects Within the GEMstudio layout window Custom Button Widget labels now handle user defined wraps An Amulet OS files now includes the 4th digit of the version Fixed bug in GEMplayer that caused a crash when an Amulet UART invokeRPC x was called GEMplayer no longer crashes if attempting to launch to a page that does not exist PWM widgets get launched immediately upon opening a page instead of after all objects have been drawn on the page Following the touchpanel calibration screen the Loading page now appears instead of being stuck on the third target until after the cached images are loaded Fixed bug in Animated Bitmaps StringFiel
290. t specified the default is On Change Parameter initialCondition value number or FromlnitHref Specifies handle position when the page is loaded The position value becomes the argument given to the href function s If FromlnitHref is selected the function specified by the InitHref attribute is called The returned value determines the handle position The range is 0 65535 0x00 OxFFFF Parameterz value number The maximum value used as the argument given to the function s specified in href Maximum value is achieved when handle is full right on a horizontal slider or full top on a vertical slider The range is 1 65535 0x01 OxFFFF Parameter min value number The minimum value used as the argument given to the function s specified href Minimum value is achieved when handle is full left on a horizontal slider or full bottom on a vertical slider The range is 0 65534 0 00 OxFFFE Parameter minAt value LEFT or RIGHT or TOP or BOTTOM Determines where the minimum value of the slider is located As the handle sweeps from the minAt location the value increases until the maximum value is reached at the opposite extreme of the minAt location Default values are LEFT for horizontal sliders and BOTTOM for vertical sliders The options are LEFT The slider value increases from left to right horizontal slider only RIGHT The slider value increases from right to left horiz
291. t widgets stored in the data flash on the Amulet Controller Board See Widgets Document for more information For more detail on the Amulet communication protocol click on the following topics Serial Port Pinouts Communication Format Communication Modifications Amulet Protocol Overview Amulet As Master Amulet As Slave InternalRAM RPC Buffer Dual Master Collisions Software Handshaking Using a Modified XON XOFF Protocol Note About Sending Master Messages During Amulet Page Changes Sending A Single Byte Without A Response Sending A Stream of Bytes Without A Response Sending A String of Bytes Without A Response Graphic Primitives Sending Jump To Specific Page Command Sending A Soft Reset Command Sending Strings To The Amulet Which Contain ASCII Characters Above 0x7F Using UTF 8 Sending Strings To The Amulet Which Contain The Font Style Escape Byte Flow Diagram Example Customizing The Amulet Protocol Command Opcodes Summary Of Amulet Protocol Command Opcodes Serial Port Pinouts Physical interface Serial cable connections standard RS 232 SIGNAL DB9 DESCRIPTION MALE DOUT Pin 2 Pin2 Amulet output your processor s input DIN Pin 3 Pin3 Amuletinput your processor s output GND Pin 5 Pin5 Signal Ground Jumpered Pin 4 Pin 6 Jumpered Pin 7 Pin8 Communication Format Communications between the Amulet LCD module and an external processor are asynchronous serial transmissions with the fo
292. te Byte 11 Draw 0x01 0x46 Pnt1X Pnt1X Pnt1Y Pnt1Y DeltaX DeltaX DeltaY Delta Y CRC Rectangle MSByte LSByte MSByte LSByte MSByte LSByte MSByte LSByte LSByt Primitive Amulet 0 01 0x46 CRC CRC Response ACK LSByte 5 Message Byte 1 Byte Byte Byte Byte Byte Byte Byte Byte Byte Byte 2 3 4 5 6 7 8 9 10 11 Draw Fill 0x01 0x47 Pnt1X 1 Pnt1Y Pnt1Y ODeltaX DeltaX DeltaY Delta Y CRC Rectangle MSByte LSByte MSByte LSByte MSByte LSByte MSByte LSByte LSByte Primitive Amulet 0 01 0x47 CRC CRC Response ACK LSByte 5 Table 2 Eight types of messages to draw graphics primitives can be sent between an external processor master and the Amulet LCD module slave Sending Jump to specific page Command It is possible to send a Master Message to the Amulet which will force it to jump to a specific page within the project The page number is an internal 16 bit number that the Amulet HTMLCompiler generates All pages and images are assigned an internal number which can be determined by looking at the Amulet link map When this message is received by the Amulet it will react as if the Amulet fileNumber x was launched meaning the Amulet will jump directly to the page specified by the 16 bit internal number The Amulet will respond with a standard ACK message complete with the 16 bit CRC You must NOT jump directly to an image file number it must be a valid page If you do errantly jump to a non valid
293. te below regarding the span between minFld and maxFld Note regarding the span between minFld and maxFld When using integers and floating point numbers the value stored by the Amulet OS is a 16 bit number When using a floating point number the decimal point is removed and the digits to the right of the decimal point are concatenated with those to the left of the decimal point So 655 35 is stored as 65535 the maximum 16 bit number In addition the span between minFld and maxFld is limited to a 16 bit number For example if the min is 65535 then the largest max be is 0 which would result in a span of 65535 Therefore even though 65535 is a valid min and 65535 is a valid max the span is larger than a 16 bit number causing an Amulet compiler error Parameter min value number Minimum value returned from the href function must be less than max If the function returns a byte the range is O 254 0 00 OxFE If the function returns a word the range is 0 65534 0x00 OxFFFE Parameter minFld value number Specifies what the numeric field displays when the minimum value is returned from the href function call When using hexadecimal you must precede the minFld number with Ox By default the Ox will NOT be displayed unless the flag is used in the printf field The minFld value does NOT have to be less than the maxFld value Negative slope is permissible Range is 65535 to 65535 when using integers and flo
294. ted until either a response is received or after a total of eleven attempts After eleven attempts all UART variables are reset in an attempt to resync with the slave processor Message Byte Byte Byte3 Byte 4 Byte5 Byte6 Byte7 Byte n 2 Byte Byten 1 2 n 1 Amulet Get 0x02 0x20 Variable CRC CRC None None None None None Byte Variable Index LSByte MSByte Server 0x02 0x20 Variable Value CRC CRC None None None None Response Index LSByte MSByte Amulet Get 0x02 0x21 Variable CRC CRC None None None None None Word Variable Index LSByte MSByte Server 0x02 0x21 Variable Value Value CRC CRC None None None Response Index MSByte LSByte LSByte 5 Amulet Get 0x02 0x22 Variable CRC CRC None None None None None String Variable Index LSByte MSByte Server 0x02 0x22 Variable UTF 8 UTF 8 UTF 8 UTF 8 0x00 Null CRC CRC Response Index Char Char Char Char Terminator LSByte MSByte Amulet 0 02 0 23 Variable Get Color Index LSByte MSByte Variable Server 0x02 0 23 Variable Value Value Value Value CRC CRC None Response Index Bits Bits Bits Bits 7 0 LSByte MSByte 3124 23 6 15 8 Alpha Blue Green Get Byte Variable Array Server Response Amulet Get Word Variable Array Server Response Amulet Get Color Variable Array Server Response Amulet Get RAM Remote Procedure Calls RPC Server Response Amulet Get Label Variable Server Respons
295. ter determines the font style of the characters that follow Each font style is represented by a single bit within the font style byte Multiple font styles can be specified at one time except in the case of plain which must stand alone Font Style Bit Location Bold 0 01 Italic 0x02 Strikethrough 0x04 Underline 0x08 Plain 0x80 For example to set InternalRAM string 1 to a string which looks like this Bold and italic and plain You would send the following message to the Amulet 0 01 0x32 0 01 0 02 0 01 0 42 Ox6F Ox6C 0 64 0 20 0 61 0 64 0 20 0 02 0x03 0 69 0 74 0 61 Ox6C 0 69 0 63 0 20 0 61 0 64 0 20 0 02 0 80 0 70 Ox6C 0 61 0 69 Ox2E 0 00 OxFC Alternatively written with ASCII characters written out as ASCII characters it would look like this 0x01 0x32 0x01 0x02 0x01 Bold and 0x02 0x03 italic and Ox02 Ox80 plain OxOO OxFC OxEA Flow Diagram Example The flow diagram of Table 3 depicts a sample communications session between the Amulet LCD module and an external processor This sample is setup as a dual master system with both the Amulet and the external processor sharing the responsibility of being the master It is possible to have a system where only the Amulet is the master only the external processor is the master or as in this case a dual master setup The variables used in this example have the following values External processor s byte vari
296. ternally to halt all current activity and await flash programming commands from the Amulet GEM Compiler Performs Amulet back upon exit Used internally to halt all current activity and await flash programming commands from the Amulet GEM Compiler Performs software reset upon exit Amulet loadFlash return Amulet lowPower sdram mode Amulet lowPower sleep mode Amulet NOP Amulet screenDump Amulet SPI z byteOut x Amulet SPI z streamOut x1 x2 xn Used to halt all current activity and await flash programming commands Stays in same gem page upon exit The sdram can be put into one of the three modes below e HIGH PERFORMANCE highest performance full power usage e LOW POWER slightly slower performace about 15 mA savings e LOWEST POWER slower performance about 20 mA savings The low power sleep mode puts the Amulet into a mode where page objects are no longer being updated and the OS stays in a tight loop updating the calendar object and looking for a touch wake up or a wake up on the negative edge on Comm UART Rx line Where mode can be one of the three modes below savings based on 4 3 MK480272 module e LCD OFF SLOW CLK savings of about 148mA e LCD OFF FAST CLK savings of about 108mA e LCD ON FAST CLK savings of about 20 NOTE FAST is the 80 MHz clock SLOW CLK is the 32KHz clock Non operational function does nothing Causes Amulet to jump to the scre
297. that can be invoked by other Control Widgets Objects See the Inter Widget Communications document for the list of available methods for each object widget Image Parameter Attributes Parameter file value image Specifies the image to use Images can be either GIF JPG or PNG Parameter invisible value CHECKED or UNCHECKED Specifies if the Image is to start out invisible or not If the attribute is UNCHECKED then by default the Image is visible If the Image starts out invisible the only way to make it visible again is via the IWC method reappear Parameter cachelmage value CHECKED or UNCHECKED A checkbox that specifies to GEMstudio to store this image in the SDRAM in an uncompressed format for immediate use from any page within the project All cached images are loaded into SDRAM prior to the first page being displayed so the more images that are cached the longer it will take for the initial page to be displayed Since the image is written to the SDRAM only once per project it is not suitable for images that contain transparencies Images can be either GIF JPG or PNG Parameter noSdram value CHECKED or UNCHECKED Specifies if the image is loaded into page specific SDRAM or not Loading the image into the SDRAM allows the disappear and or reappear methods to transition faster If the image will not be made to disappear or reappear there is nothing to be gained by using the SDRAM so noSdram should
298. the Amulet is comprised of four different bytes For example if the x coordinate of point 1 is 0 0020 the 4 bytes that would be sent to the Amulet for that particular coordinate would be 0x30 0x30 0x32 0x30 The line color is comprised of six different bytes two bytes for the blue component two bytes for the green component and two bytes for the red component For example if the desired line color is purple bluez0x80 0 00 red 0x7E the 6 bytes sent to the Amulet would be 0x38 0x30 0x30 0x30 0x37 0x45 Line weight when sent to the Amulet is only one byte The line weight specifies the thickness of the line range of 1 15 The entire line primitive message sent to the Amulet is a total of 24 bytes The rectangle primitive draws a rectangle with a given starting top left point x and y coordinates and a delta x and delta y the line color and finally the line weight The rectangle primitive is drawn by sending out the Draw rectangle primitive opcode OxDA followed by four bytes specifying the x coordinate of the topleft point four bytes specifying the y coordinate of the topleft point four bytes specifying the delta x four bytes specifying the delta y six bytes specifying the line color and finally one byte specifying the line weight The x and y coordinates and the delta x and delta y are all 16 bit numbers The line color is comprised of three 8 bit color components a blue component a green component and a red component The l
299. the argument is determined by the unCheckedvalue parameter If the checkbox is part of a group the argument is the cumulative value of all checked boxes logical ORing All checkboxes within a group must call the same href function s See Appendix B for all available href functions for the checkbox widget Parameter initialCondition value ON or OFF or FromlnitHref Specifies the initial condition of a checkbox when the page is loaded ON specifies a checked box OFF an unchecked box If FromlnitHref is selected the function specified by the initHref attribute is called The returned value determines the initial condition of all checkboxes within the group If part of a group box is checked when its checkedValue corresponds to set bit in the returned byte logical ANDing If a lone checkbox the box is checked when its internalNumber equals the returned initHref value Parameter label value text Specifies the name that appears to the right or left of the checkbox Parameter cachelmage value CHECKED or UNCHECKED A checkbox that specifies to GEMstudio to store this image in the SDRAM in an uncompressed format for immediate use Since the image is written to the SDRAM only once per project it is not suitable for images that contain transparencies Images be either GIF JPG or PNG Optional Checkbox Parameter Attributes Parameter noSdram value CHECKED or UNCHECKED Specifies if the backgroun
300. the home page of your project The syntax to include the file is META NAME initCommands SRC filename ini gt The customization file filename must have a ini extension and it must be located in the same directory as your gemp file Inside the customization file any line preceded with is treated as a comment All customizations must be located in the far left column so do not tab over The GEMcompiler recognizes both decimal and hexadecimal numbers The default file called defaultCommands ini is located in the AllUsersProfile AmuletTech Global Configuration Protocol folder If the above META tag is not specified defaultCommands ini is used as the opcode definition file If you are going to make a customization file you should copy the defaultCommands ini and place it in the same directory as your gemp file The file can be renamed as long as it retains the ini extension The values of the opcodes can be changed to practically any single byte value between 1 254 All the names of the opcodes can be cross referenced with the list below The opcode names are self documenting FO There are three opcodes that are off limits They are 0x00 OxAO OxFF These must not be used to customize any of the Command or Response Opcodes Note For users who don t want to change the opcodes from an earlier version of Amulet software we have included origCommands ini in the AllUsersProfile AmuletTech Global Configuration Protoc
301. the widgetName rather than an individual checkBox name You cannot change the method for an individual checkBox within a group 9 regarding x in setX and setY When setX or setY is the IWC method the argument needs to be a word value with the range being the viewable area of the given LCD Table 4 Matrix of supported IWC methods for Animated Image Object IWC methods Animated Image Object disappear x fastSpeed x oneFrame x pause x playBackwards x playForward x reappear regularSpeed slowSpeed superFastSpeed superSlowSpeed Refresh Objects META REFRESH lt META HTTP EQUIV REFRESH gt The most powerful and potentially the most confusing object in the Amulet system is the META Refresh object It can be thought of as an object that exists on a page but isn t visible on the LCD There are four different ways to use the META Refresh control object 1 Call a function s based upon a timer event 2 Call a function s when a timer based function returns a specific value if then else function or switch statement 3 Initialize InternalRAM variables with a value returned from a timer based function 4 Be a container object that makes no function calls essentially becoming a variable which other objects widgets can reference 1 Call a function s based upon a timer event lt META HTTP EQUIV REFRESH CONTENT 1st number 2nd number URL function s VALU
302. thod reappear Parameter border value number Specifies width in pixels of the border around the dimensions of the numeric field Default is 0 meaning no border Parameter borderColor value See color entry conventions Specifies the desired Numeric Field border color See section on colors for more information If no border color is specified the default color is black Only applicable if border is set to something other than O If the alpha is FF then the border is fully opaque Parameter fillColor value See color entry conventions Specifies the desired Numeric Field fill color See section on colors for more information If no fill color is specified the default color is the current background color If the alpha is FF then the fillColor is fully opaque Parameter font value font font size Specifies the font and font size used for the static text defined in printf See Amulet GEM Font Converter for more information regarding the creation of auf font files Default is Bitstream Vera Sans The default font size for the static text is 12pt Parameter fontColor value See color entry conventions Specifies the desired static text font color See section on colors for more information If no font color is specified the default color is black Parameter fontStyle value PLAIN or BOLD or ITALIC Specifies the style associated with the font of the static text defined in printf PLAIN ove
303. ti Touch Double Tap Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeEast value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe East gesture To be considered a Multi Touch Swipe East gesture the Touch Area needs to be touched by two or more fingers and then swiped to the right As long as the fingers continue swiping to the right the Multi Touch Swipe East gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeEast function s will be called See Appendix B for all available functions for the onMultiTouchSwipeEast event Multi Touch Swipe East Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeNorth value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe North gesture To be considered a Multi Touch Swipe North gesture the Touch Area needs to be touched by two or more fingers and then swiped to the top As long as the fingers continue swiping to the top the Multi Touch Swipe North gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeNorth function s will be called See Appendix B for all available functions for the onMultiTouchSwipeNorth event Multi Touch Swipe North Gesture only available on select capacitive touch panels Parameterz onMultiTouchSwipeNorthEast
304. to be set Rate Choose which parameter associa values IF incoming 4 0 THEN one IF incoming 4 1 THEN two IF incoming 4 2 THEN five IF incoming 4 3 THEN ten one B20 1 GOTO setByteResp two B20 2 GOTO setByteResp five B20 5 GOTO setByteResp ten B20 10 GOTO setByteResp Variable 6 has been called to be set Time Once again F incoming 4 F incoming t yat n uH 2 choose which THI N parameter is to be set using NN values THE F incoming F incoming tenSeconds B22 10 GOTO setByteResp thirtySeconds B22 30 GOTO setByteResp fortyfiveSeconds 4 4 2 4 zi z tenSeconds thirtySeconds ortyfiveSeconds sixtySeconds 22 45 setByteResp sixtySeconds B22 60 setByteResp setByteResp SEROUT 16 84 ServerRespl VarTypel VarType2 incoming 3 incoming 4 GOTO serial in k k Ck k CK C Ck CC C CK CIC CC Ck CC CC CC Ck CC CC CC Ck CC CC Ck Sk CC CC Sk C Ck C Sk Sk Sk S A A Sk kA ko Sk Sk kx ko X ko koX Handler for a getWord function request Format of request string 0 where xx variable being requested Returns OxEIxxPPNN where PP high byte of variable xx and NN low byte of variable xx 1 k k k k dir di di dir di dir di dio dio dir dir dio dio di di di dio di die
305. ton can be created that will appear to invoke its function s immediately upon being pressed instead of waiting until the button is released By setting the delay very small and the frequency at 0 the button will invoke its function s after the very short delay time and not repeat again NOTE To display a literal symbol in the label use a double backslash in the string e g 25 5 would display 25 5 in the button Cc Function buttons are Amulet anchors that provide either a spring loaded or a toggle button Function Button Parameter Attributes Parameter invisible valuez CHECKED or UNCHECKED Specifies if the Function Button is to start out invisible or not If the attribute is not present then by default the Function Button is visible If the Function Button starts out invisible the only way to make it visible again is via the IWC method reappear Parameter buttonType value TOGGLE or SPRING LOADED Specifies the action of the button when hit TOGGLE causes the button to depress or invert on a pen down event and stay depressed on the ensuing pen up event SPRING LOADED causes the button to depress on a pen down event and return to its original state on the following pen up event SPRING LOADED is the default Parameter onButtonPress value DEPRESS or ALPHA Specifies the look of the button during a pen down condition DEPRESS gives the illusion of the button being pressed ALPHA shades the image of the but
306. ton with a transparent color defined by alphaColor DEPRESS is the default Parameter href value function s The function or multiple sequenced functions invoked when the button is hit See Appendix B for all available functions for the Function Button widget Parameter label value text or FromlnitHref Specifies the text that appears inside the button The button will NOT automatically re size to fit the text If there is enough vertical room text will automatically wrap Any text that will not fit within the confines of the button will be truncated User defined wraps can be specified by entering n within the text at the spot you would like the wrap to occur There is a maximum of 5 lines for a button label The name field can be left blank blank is the default To have the label be dynamically entered at runtime by the server enter FromlnitHref By default the dynamic button label can be a maximum of 25 characters in length To increase the maximum number of characters put the desired number in parentheses after FromlnitHref For example to have a dynamic label up to 50 characters long use FromlnitHref 50 The attribute initHref needs to be of the type Amulet UART label x value It will be called only once upon the loading of the page with the string returned from the server becoming the button label See note regarding the use of InternalRAM label variables as button labels Optional Function Button Parameter Attri
307. ts filled up any further bytes that are sent will not be saved Obviously that is not acceptable in most applications To counter this problem we ve created a modified form of the XON XOFF software handshaking protocol In order to use the Amulet XON XOFF protocol you should probably use the Meta attribute SlaveNoRsp so that the Amulet will not respond to any master messages that do not require a response Whenever the Amulet receives an XOFF command 0x13 it will respond with an XON command 0x11 So to safely use the software handshaking you should send a number of messages which will be less than 256 bytes in length then terminate the stream of bytes with an XOFF command Do not send any further commands until the Amulet has responded with the XON command At that point you can be assured that all the previous commands have been acted upon and the receive buffer is completely empty thus allowing for another large string of bytes up to 256 This raises the question why not just use SlaveAckRsp and wait for the ACK In a perfect world that would work perfectly fine Unfortunately when talking about serial communications it is folly to believe that everything will be perfect If there is a slight delay in between messages it is possible for the Amulet to sneak an ACK out before the entire master stream of bytes is completely done This could result in the master seeing the ACK and depending on how when the code decides to look at the incomi
308. ts that have intrinsic values such as lists and sliders the user can either leave the argument field empty or use intrinsicValue as the argument the intrinsic value of the selection will be sent out META REFRESH tags Function Custom Buttons should use x The range for x is 0 255 0x00 Oxff for a BYTE 0 65535 Ox00 Oxffff for a WORD and 250 character strings in double quotes for STRINGs 2 Regardingm When setMethod setOnVarMethod setOnVarUARTMethod or setUARTMethod is the IWC method the argument should be the name of the method you want to set i e disappear or byte value Notice when dealing with a method that relies on a type byte word or string you need to include the type separated by a dot and then the method i e word value instead of just the method by itself 3 Regarding f For Control Widgets that have intrinsic values such as lists and sliders leave the argument field empty since the intrinsic value of the selection will be sent out META REFRESH tags and Function Custom Buttons should use f Like the regular updateRate use a floating point number to specify the update rate in seconds Range for f is 0 655 35 4 Regarding setX and setY These methods should most always be preceded by a disappear method and followed by a reappear method The setting of the x and y coordinates are independent of the removal of the widget in the old coordinates and the displaying in the new coordinates Table 3
309. ts the y coordinate of the topleft corner of the Line Plot to the coordinate specified by the word x startUpdating Line Plot starts plotting based upon its input data Counteracts the stopUpdating method stopUpdating Line Plot stops plotting toggleUpdating Changes current state of Line Plot either starts or stops plotting Linear Gauge disappear Makes the Linear Gauge not visible on the LCD forceUpdate Forces the Linear Gauge to call its href function immediately regardless of the updateRate reappear Makes the Linear Gauge visible on the LCD Counteracts the disappear method reset Clears the Linear Gauge setMethod m Changes the method originally specified by the Linear Gauge s href parameter setUARTMethod m Changes the UART method originally specified by the Linear Gauge s href parameter setUpdateRate f Changes the update rate originally specified by the Linear Gauge the argument being a floating point number specifying time in seconds setValue x Linear Gauge uses x as its input This allows a Control Widget to provide the input to a Linear Gauge setVariableNumber x Changes the variable number originally specified by a Linear Gauge Can be used only if the Linear Gauge href is byte y value or word y value In either case the y gets changed to the argument specified in setVariableNumber x setX x Sets the x coordinate of the topleft corner of the Linear Gauge to the coordinate
310. tudio Fixed a bug with palette files generated by Photoshop Fixed problem in 8 bit color mode with stringField colors specified with InternalRAM variables Fixed issues with erroneous tap gestures seen on capacitive modules The Macro preprocessor will now detect a Tab character as a Macro delimiter A single line Meta tag is no longer collapsable altFillColor and altFontColor in StringFields will now initialize properly when not specified StringFields now clipping properly when starting in or after being moved outside the viewable display The toggleStringColor and inverseStringColor IWC s of the StringField widget now call their proper method instead of calling toggle inverseRegionColor Resolved an exception that occured upon opening a gemp file when an image referred to by the project didn t exist at the specified location Stretched GIF images now display properly All images within an imageSequence are now properly optimized like every other image Anti bricking mode is no longer entered when trying to program a new image into a Dynamiclmage A linePlot widget with multiple plots now redraws properly Fixed an issue where UTF 8 characters were getting corrupted if their 2nd or 3rd byte was equal to OxAO Changes for GEMstudio version 1 4 0 3 Bug Fixes e Fixed calibration issue with some STK CY 043 touchpanels that sometimes lacked the ability to recognize a touch on the lower third of the display e Fixed bug with resized
311. tudio Pro is used to compile your GUI to a small binary file which is then downloaded into the Amulet module 3 The Amulet module displays the GUI and handles all touchpanel interaction 4 The Amulet module receives input data from your host microprocessor via the serial link and also sends command messages to your micro based upon timer based or touchpanel events There are two types of variables in the Amulet system External variables byte word and string which reside on your micro s side and InternalRAM variables byte word color and string which reside on the Amulet module InternalRAM is quasi dual port RAM that can be read from and written to by the Amulet chip through commands inserted in the GEMstudio Pro code Your micro interfaces to InternalRAM through the serial link There are specific UART and USB commands that can read from and write to InternalRAM There are four major types of serial messages that will be sent between the Amulet module and your micro 1 A request of a variable byte word color or string 2 A setting of a variable byte word color or string 3 A Remote Procedure Call which is a completely generic message which allows the Amulet module to inform your micro of a certain event You can have up to 256 unique RPC s What those RPC s signify is entirely up to you 4 A raw byte or group of bytes can be sent from the Amulet module to your micro This option is not part of the Amulet serial protocol but r
312. u can substitute Amulet UART port with Amulet USB if you are using USB A Get Internal RAM byte variable request A Get Internal RAM word variable request word 2 bytes A Get Internal RAM string variable request A Get Internal RAM RPC buffer request A Set Internal RAM byte variable command Set Internal RAM word variable command A Set Internal RAM string variable command A Set Internal RAM byte variable array command A Set Internal RAM word variable array command A Draw line command A Draw rectangle command A Draw filled rectangle command A Draw pixel command A Jump to specific page command If the message is valid the Amulet LCD module slave will either return the requested data if a Get request or confirm the message if a Draw or Set command If the message is not a valid Amulet message the Amulet will not respond The protocol is the same regardless of who is the master So if an external processor is requesting the value of a byte variable on the Amulet which would be an Internal RAM byte variable the command opcode would be the same as if the Amulet was requesting the value of a byte variable that resides on the external processor RPC buffer If a setup where the Amulet is always the slave is needed or desired then up to six RPCs can be buffered in the Amulet s Internal RAM The external processor can request the contents of the RPC buffer by sending a Get Inte
313. udio to store this image in the SDRAM in an uncompressed format for immediate use Since the image is written to the SDRAM only once per project it is not suitable for images that contain transparencies Images be either GIF JPG or PNG Optional Custom Button Parameter Attributes Parameter alphaColor value See color entry conventions If onButtonPress equals ALPHA this attribute specifies the alpha color mask used to notify the user the Custom Button has been depressed See section on colors for more information If no alpha color is specified the default color is a transparent gray If the color specified does not have an alpha component then it will be completely opaque which will result in a colored rectangle appearing in place of the button while it is touched Parameter executeOn value HIT or RELEASE or BOTH Specifies when the href function is launched either when the button is hit when the button is released or when the button is both hit and released If nothing is specified the default is to RELEASE Parameter horizontalAlign value LEFT or CENTER or RIGHT Specifies the horizontal alignment of the string associated with the label attribute within the Custom Button dimensions Only one value is allowed you cannot mix horizontal alignments Default is CENTER Parameter initHref value function Specifies the function called when the page is loaded Use this attribute only when Fromln
314. ulet See Palm htm which explains how to do this 3 Those binary files are sent to the Amulet using a slightly modified 128 byte or 1K Xmodem with 16 bit CRC protocol For 1k Xmodem the SOH byte is 0x02 and for 128 byte it is 0x01 See XMODEM Protocol regarding the protocol used and review the notes below Here are the details you need to know 1 Bytes 0 5 of each binary file are the flash header bytes The Amulet uses these bytes to determine where to store the file within the flash You can send the files in any order the Amulet won t mind 2 In standard Xmodem protocol the slave sends out a C character once per second In Amulet s color chip we will instead output a character that indicates the size of the serial dataflash connected to first chip select CS0 of the SPI bus This character is reffered to as the Flash Size Notifier or FSN The flash size to character mapping is as follows a 1Mbit b 2Mbit 4Mbit d 8Mbit 16Mbit f 32Mbit standard starter kit size g 64Mbit GCC 2 size Z None Detected 3 There is basically no time limit between packets or files The chip will wait about 2 seconds and if get no response then just send out the same thing again whether its an ACK or the FSN 4 You can set the Amulet up to program either by flipping the Program Mode pin 26 to HIGH and asserting the reset or the much cleaner way of sending a wake message 0xA0 0x02 0x00 0x16 0x48 which
315. ulet document Logo setX 192 Amulet document Logo reappear name meta3 gt 7 Thank you Function 5 A lt meta http equiv refresh content 0 6 if Amulet InternalRAM Word 0 value eq 1 then ViewWidgetsHome open eq 0 then Thankyou open 3 name Thankyou gt 21 1 4 1 1 1 1 1 1 1 1 1 4 1 user fold unfold blocks of code for easier reading navigation user access these commands from the Folding drop down menu Arrows shown in the left gutter of the editor can also be used to collapse or expand blocks of code An example is shown below Page Functions x Edt Foldings Tools 3 0 E meta lt meta name IntInternalRAM src 480x272DemolinternalRAM int gt 3 meta http equiv refresh content 0 05 name meta2 gt lt meta http equiv refresh content 0 URL Amulet document Logo setX 192 Amulet document Logo reappear lt meta http equiv refresh content 0 if Amulet InternalRAM Word 0 value eq 1 then ViewWidgetsHome open eq 0 then Thankyou open name Thankyou gt For more information on the usage of page functions please go to Amulet Function Calls and META Refresh Object For the available functions please check Appendix B NOTE If at any time you need further explanation on widget or parameter in your project select the widget or parameter and click on the button
316. ultiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe South West gesture To be considered a Multi Touch Swipe South West gesture the Touch Area needs to be touched by two or more fingers and then swiped to the bottom and the left As long as the fingers continue swiping to the bottom and the left the Multi Touch Swipe South West gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeSouthWest function s will be called See Appendix B for all available functions for the onMultiTouchSwipeSouthWest event Multi Touch Swipe South West Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeWest value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe West gesture To be considered a Multi Touch Swipe West gesture the Touch Area needs to be touched by two or more fingers and then swiped to the left As long as the fingers continue swiping to the left the Multi Touch Swipe West gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeWest function s will be called See Appendix B for all available functions for the onMultiTouchSwipeWest event Multi Touch Swipe West Gesture only available on select capacitive touch panels Parameter onMultiTouchTap value function s the function or multiple sequenced functions invoked after the Touch Area is tapped
317. umericField class The Numeric Field Widget uses a byte or word returned from an href function call to display a 58 Seconds 7 Mut mixture of static text a live number string is input using the standard C printf format lea The Numeric Field Widget display integer hexadecimal and floating point formats Like s printf the variable is entered using the character The first digit following the specifies the number of character spaces allocated to the live numeric field including a decimal point and plus or minus symbols You can also have static text preceding and following the live numeric field For example to create a numeric field that displays Output 2 25 Volts the printf field would read Output 5 2f Volts In this example 5 specifies the number of character spaces 2 specifies the number of digits to the right of the decimal and f specifies floating point numbers If the width of the numeric field widget is less than required the string will be truncated Make sure your dimensions are large enough to hold all your text and numbers Field Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Numeric Field is to start out invisible or not If the attribute is not present then by default the Numeric Field is visible If the Numeric Field starts out invisible the only way to make it visible again is via the IWC me
318. underline Strings customize the color from a color picker that pops up when you click the color selection and font style bold italic and or underline Numbers customize the color from a color picker that pops up when you click on the color selection and font style bold italic and or underline Other Code Editor Options 1 Autocomplete Applies Standard Case CHECKED or UNCHECKED If CHECKED then GEMstudio will autocomplete the METAs using the font case from the GEMstudio libraries If UNCHECKED then GEMstudio will autocomplete using the same case font the user was typing with Auto Close Brackets CHECKED or UNCHECKED If CHECKED GEMstudio will automatically provide a closing bracket Auto Indent New Lines CHECKED or UNCHECKED If CHECKED GEMstudio will automatically indent new lines of code Highlight Block When Hovering Mouse Over Gutter If CHECKED GEMstudio will highlight a block of code when the mouse hovers over the gutter as shown in the figure below Page Functions 1 Circle Matching Brackets CHECKED or UNCHECKED If CHECKED GEMstudio will circle the matching brackets as the user closes the bracket 2 Display Line Numbers CHECKED or UNCHECKED If CHECKED GEMstudio will display line number in a gutter on the left of the Page Functions Editor Page Functions Tips 1 Block navigation is available on the top of the Page Functions Editor window Click on the up down arr
319. up as a dual master system with both the Amulet and the external processor sharing the responsibility of being the master It is possible to have a system where only the Amulet is the master only the external processor is the master or as in this case a dual master setup The variables used in this example have the following values External processor s byte variable 01 0x38 External processor s string variable 01 Abc External processor s word variable 03 0x10E8 Amulet Internal RAM byte variable 0xF4 0xA8 Amulet Internal RAM word variable 0x76 0x0000 Amulet Internal RAM RPC buffer 0x52 only Following the communication session the following has occurred External processor s byte variable 01 External processor performs user defined RPC 02 There are no reserved RPC s so all 256 RPC s can perform any desired function on your processor Amulet Internal RAM word variable 0x76 0x02c9 Amulet Internal RAM RPC buffer empty Amulet LCD Module OxDO 0 30 0 31 1 OxD2 0 30 0 31 0 4 OxD5 0x30 0x31 0 46 0 45 Q 4 F E OxD8 0 30 0 32 0 2 OxD1 0x30 0x33 Q OxDO 0 30 0 34 4 Dir gt gt lt lt gt gt lt lt gt gt lt lt gt gt lt lt gt gt lt lt gt gt lt lt External Processor OxEO 0x30 0x31 0x33 0x38 4 2 OxE2 0 30 0 31 0 41 0x62 0x63 0x00 4 A b Ic OxE5 0x30 0
320. ur micro is also sending unsolicited data to the Amulet GEMstudio Topical Guide Overview GEMstudio is used to create the Graphical User Interface GUI and program the Amulet module GEMstudio is a complete package which includes authoring tools simulator and programming Amulet has created a number of I O objects referred to as Amulet Widgets which be added into your GEMstudio project There are two types of Amulet Widgets Control Widgets and View Widgets Control Widgets are input objects like function buttons sliders radio buttons etc Control Widgets have a function or a set of functions that can be applied to them View Widgets are output objects like bargraphs numeric fields string fields etc View Widgets call a function which returns the data used as the input for that particular widget Amulet Font Converter The Amulet GEM Font Converter allows users to convert any installed Windows font into an Amulet font file that can be used in any Amulet project This simple program allows the user to utilize ANY font in the user interface thus giving the interface a much more customized look and feel For more detail on using the Amulet GEM Font Converter click on the following topics Fonts and the Amulet GEM Font Converter Starting the Amulet GEM Font Converter Using the Converter Selecting Range of Characters to Convert File Menu Disclaimer Fonts and the Amulet GEM Font Converter Any font that you u
321. ur project by selecting the file in the Project Options under the Miscelaneous tab Project Properties LCD Communication Color Depth Transitions Miscellaneous Misc Options Frame Buffer Double JPEG Compression Native Touch Priority From Top to Bottom Macro Definitions Macro File None InternalRAM Initiailization Init File None Browse Remove Inside the initialization file any line preceded with is treated as a comment All initializations must be located in the far left column so do not tab over The GEMcompiler recognizes both decimal and hexadecimal numbers Initializing single Internal RAM variables The syntax within the include file to initialize a single Internal RAM variable is as follows InternalRAM variableType variableNumber value Where variableType is the type of variable either byte word color or string variableNumber is the variable index within the variable type 0 255 for bytes 0 255 for words and 0 255 for strings value is the initialization value of the Internal RAM variable range if byte O OxFF if word O OxFFFF if color O OxFFFFFFFF if string 1 250 character string Examples InternalRAM byte OxFE Ox7F InternalRAM word 32 4000 InternalRAM color 0 0 000000 InternalRAM string 0 First String There is an important thing to note regarding the 256 25 character plus 1 byte Null strings It is acceptable to have strings
322. urned from an href function call The x and y axis are drawn based on the width and height The line plots from left to right continuously wrapping and does not get erased upon the wrap The plot is updated at each new x sample and the current location is kept via a vertical cursor that is the same height as the Line Plot Widget y axis The plot is scaled in the y direction based on yMin and yMax Line Plot Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Line Plot is to start out invisible or not If the attribute is not present then by default the Line Plot is visible If the Line Plot starts out invisible the only way to make it visible again is via the IWC method reappear Parameter axisColor value See color entry conventions Specifies the desired lineplot axis color See section on colors for more information If no axis color is specified the default color is black If the alpha is FF then the axis color is fully opaque Parameter backgroundlmage value image Image used as the Line Plot background image Image dimensions should be the same as the dimensions of the Line Plot Widget Image file must be of type GIF JPG or PNG If no image specified the default background will be the color specified in fillColor Parameter cursorColor value See color entry conventions Specifies the desired lineplot cursor color See section on colors for more information If no
323. urns the value of internalRAM byte variable x ANDed with the mask y Returns the value of internalRAM word variable x Returns the value of internalRAM word variable x ANDed with the mask y Returns a pseudo random byte Returns a pseudo random byte ANDed with the mask y Returns a pseudo random byte that is filtered Returns a pseudo random byte that is filtered ANDed with the mask y Returns nothing Sends a getByte request over the UART where x is the byte variable number returns the value of the byte variable x Sends a getByte request over the UART where x is the byte variable number returns the value of the variable x ANDed with the mask y Amulet UART bytes x array y Sends a getByteArray request over the UART where x is the starting byte variable number y is the number of bytes in the array returns the array of byte variables from x to x y Only valid when used in a META Refresh tag to load InternalRAM variables Amulet UART word x value Sends a getWord request over the UART where x is the word variable number returns the value of the word variable x Amulet UART word x maskedValue y Sends a getWord request over the UART where x is the word variable number returns the value of the word variable x ANDed with the mask y Amulet UART words x array y Sends a getWordArray request over the UART where x is the starting word variable number y is the number of words
324. ustomize the color from a color picker that pops up when you click on the color selection and font style bold italic and or underline Strings customize the color from a color picker that pops up when you click on the color selection and font style bold italic and or underline Numbers customize the color from a color picker that pops up when you click on the color selection and font style bold italic and or underline Other Code Editor Options 1 Autocomplete Applies Standard Case CHECKED or UNCHECKED If CHECKED then GEMstudio will autocomplete the METAs using the font case from the GEMstudio libraries If UNCHECKED then GEMstudio will autocomplete using the same case font the user was typing with Auto Close Brackets CHECKED or UNCHECKED If CHECKED GEMstudio will automatically provide a closing bracket Auto Indent New Lines CHECKED or UNCHECKED If CHECKED GEMstudio will automatically indent new lines of code Highlight Block When Hovering Mouse Over Gutter If CHECKED GEMstudio will highlight a block of code when the mouse hovers over the gutter as shown in the figure below lt gt Event Method List Edit Foldings Tools 9 15 this is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very
325. ut are included in the link map for cross checking purposes The Flash Header bytes are all hexadecimal numbers The Ox was left off for the sake of brevity Macro Preprocessor The Amulet macro preprocessor allows you to create macros which are used to make textual substitution throughout the project The macros are defined in a text file with a macro extention which is included in your project by choosing a macro file within the Misc tab in the Project Settings dialog Almost all text within the project will be scanned by the Amulet macro preprocessor and text substitutions will be made The only exception is the Amulet defined parameters such as the names of widget parameters like Font Href etc All other text including static text strings will be scanned by the macro preprocessor and substitutions will occur when an exact match to the macro definition is found Macro expansion occurs at compile time within the compiler The Amulet macro preprocessor is case sensitive To be considered an exact match the macro name must be found in the scanned string and must be surrounded by word separators The following are considered word separators start of string end of string and spaces Note amp nbsp is NOT considered a space so if it is desired to use the literal macro name within the project it can be either preceded or followed by a amp nbsp which ends up looking on the Amulet LCD as a regular space Another option i
326. valid if the intrinsic value is a byte or word The mask y can be either a byte or word This allows a CheckBox to provide the input to a View Widget This method is called from a View Widget href e reappear Makes the CheckBox visible and touchable on the LCD Counteracts the disappear method e setValue x The CheckBox intrinsic value is changed to x setMethod m Changes the method originally specified by the CheckBox s href parameter only valid when the originally specified method is a single function To change the method for a CheckBox group or an ungrouped CheckBox use the groupName as the widgetName rather than in individual CheckBox name You cannot change the method for an individual CheckBox within a group e setUARTMethod m Changes the UART method originally specified by the CheckBox s href parameter only valid when the originally specified method is a single function To change the method for a CheckBox group or an ungrouped CheckBox use the groupName as the widgetName rather than in individual CheckBox name You cannot change the method for an individual CheckBox within a group e setVariableNumber x Changes the variable number originally specified in the href function to x Can only be used only if the Check Box href uses byte y word y or string y In all three of the cases the value y is replaced with the value x Only valid when the originally specified method is a single function Can only be used on a C
327. value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe North East gesture To be considered a Multi Touch Swipe North East gesture the Touch Area needs to be touched by two or more fingers and then swiped to the top and the right As long as the fingers continue swiping to the top and the right the Multi Touch Swipe North East gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeNorthEast function s will be called See Appendix B for all available functions for the onMultiTouchSwipeNorthEast event Multi Touch Swipe North East Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeNorthWest value function s The function or multiple sequenced functions invoked after the Touch Area senses a Multi Touch Swipe North West gesture To be considered a Multi Touch Swipe North West gesture the Touch Area needs to be touched by two or more fingers and then swiped to the top and the left As long as the fingers continue swiping to the top and the left the Multi Touch Swipe North West gesture will be sensed Use gestureRate to specify the maximum rate the onMultiTouchSwipeNorthWest function s will be called See Appendix B for all available functions for the onMultiTouchSwipeNorthWest event Multi Touch Swipe North West Gesture only available on select capacitive touch panels Parameter onMultiTouchSwipeSouth valu
328. x setX x Sets the x coordinate of the topleft corner of the BarGraph to the coordinate specified by the word x setY x Sets the y coordinate of the topleft corner of the BarGraph to the coordinate specified by the word x startUpdating BarGraph starts graphing based upon its input data Counteracts the stopUpdating method stopUpdating BarGraph stops graphing toggleUpdating Changes current state of BarGraph either starts or stops graphing CheckBox e disappear Makes the CheckBox not visible or touchable on the LCD e forceHit CheckBox performs its hit method without user input The hit method will invoke all href functions of the CheckBox When imparting a forceHit on a single CheckBox that CheckBox will toggle You can also forceHit an entire CheckBox group which will perform the href function s but will not toggle any checkboxes To forceHit a CheckBox group use the groupName as the widgetName rather than the individual CheckBox name e forceUpdate Forces the CheckBox group to call its initHref function immediately Only valid if initialCondition is FromInitHref Updates the CheckBox group and performs a hit To forceUpdate a CheckBox group use the groupName as the widgetName rather than the individual CheckBox name e maskedValue y Sends the intrinsic value of the CheckBox to the calling widget The calling object then uses that value ANDed with the mask y as its input This method is only
329. x click on the checkbox or Widget label Checkboxes can also be grouped to invoke functions whose argument is the cumulative value of all checked boxes logical ORing Boxes that have the same groupName are considered part of a checkbox group Within a checkbox group any combination of boxes can be checked If none of the boxes are set within a group then 0x00 is the href function call argument Therefore you must give each box a checked value that is different on a binary bit level If one box has a checked value of 0x01 then another box could have a value of 0x02 and the next a value of 0x04 not 0x03 because that would be the ORed value of boxes 1 and 2 when checked Checkbox Parameter Attributes Parameter invisible value CHECKED or UNCHECKED Specifies if the Check Box is to start out invisible or not If the attribute is not CHECKED then by default the Check Box is visible If the Check Box starts out invisible the only way to make it visible again is via the IWC method reappear Parameter boxAlign value LEFT or RIGHT Specifies the location of the checkbox in relation to the label text Parameter checkedValue valuez number Specifies the checked box value If the box is part of a group single bits should be used such as 0x01 0x02 0x04 etc All boxes within a checkbox group must be assigned unique binary numbers That is if one checkbox has a value of OxO1 bit 0 no other checkbox within the group can us
330. x00 and a polynomial of 0x1021 Sample code for the CRC algorithm used on Amulet image files define CRC_SEED 0x0000 define CRC_POLY 0x1021 int calcCRC char ptr int count unsigned short crc CRC SEED initialize CRC int i while count gt 0 crc crc ptr for i 8 i gt 0 i if crc amp 0 0001 crc gt gt 1 CRC_POLY else crc gt gt 1 Amulet Link After any project is either saved or programmed into the flash the GEMstudio generates a link map for the specific project The name of the link map has the same name as the project name except it has a inc extension The inc file is created in the the folder which is created the same directory as the compiled file The inc file is an unformatted text file which can be read by any text editor The inc file includes the name of each file in the given project It is setup so a standard C compiler can use the inc file as an include file because all comments are bracketed by and and the definitions are all preceded by define This was chosen so the inc file could be directly included in a C or Java project If you are using a different programming language you might have to modify or extract the information that you need to appease your compiler Sample inc file The following is from an actual inc file File Name Flash Index define
331. x31 0x46 0x45 4 F E OxE8 0 30 0 32 2 1 0 30 0 33 0 31 0 30 0 45 0 38 3 1 E 8 Descr Get varia Retur of byte Get varia of strin Set variable Confi byte va Invok User d Cor invoke Get varia Retur of wor Get varia not on Ackno no lt lt OxDO 0 46 0 34 Get Ir F var OxEO 0 46 0 34 0 41 0 38 gt gt Return 8 byte lt lt OxD6 0 37 0 36 0 30 0 32 0 43 0 39 Set IF 7 6 7 0 var OxE6 0x37 0 36 0 30 0x32 0x43 0x39 gt gt 7 6 0 2 Ct 9 of IR var lt lt 0 04 0x30 0x30 Get Ir 0 0 RAM OxE4 0 30 0 30 0 35 0 32 0 00 gt gt 0 0 5 2 IR RPC nullter NOTE If master requests an invalid variable or RPC the slave should respond with an acknowledgment 0x Table 3 Data flow diagram depicting several messages transmitted between the Amulet and a fictitious external processor Customizing the Amulet protocol command opcodes By default the Amulet protocol uses the Command and Response Opcodes specified in this document You can customize the Command and Response Opcodes at compile time by including a customization file in your project The customization file must have an ini extension and must reside in the same directory as your GUI project You must include the customization file in a META tag in
332. xception and closed the program if selected while on current home page List widget Options strings can now have spaces in them List widget initHref parameter now works correctly GEMstudio now throws an error if an imageSequence widget contains no images Slider widgets can now use a hex number for the initialCondition When trying to program a project while Amulet module is in Program Mode GEMstudio will give the correct error message telling the user to program the project while in Run Mode Only Amulet OS files are allowed to be programmed while in Program Mode Fixed bug in Image Bar widget when the min attribute was a non zero value Caused GEMplayer to crash and the Amulet OS to display garbage HTML escapes i e amp nbsp are now supported in stringField widget s printf attribute The InternalRAM String method appendChar y now supports all characters including UTF 8 multi byte characters Fixed bug in imageSequence if the image changes while imageSequence was currently invisible and then set to reappear Garbage would be displayed instead of the correct image Added ability to change the Java Max Heap Size On certain machines the default size of 512MB would cause GEMstudio to crash immediately upon booting Enhancements Added the InternalRAM String methods appendString y appendToRamString x appendViaByteVarPtr x Can now Run or Program a page that does not have any objects on the canvas Hex numbers that are ent
333. yte Hi Nibble Lo Hi Nibble Nibble Byte7 Bytes Pnt1Y Pnt1Y Hi Byte Lo Byte Lo Hi Nibble Nibble Byte 17 Byte 18 Delta Y Blue Lo Byte Hi Lo Nibble Nibble Lo Nibble Byte 9 Pnt 1 Y Lo Byte Lo Nibble Byte 19 Blue Lo Nibble Table 2 Three types of messages to draw graphics primitives can be sent between an external processor master and the Amulet LCD module slave Sending Jump to specific page Command It is possible to send a Master Message to the Amulet which will force it to jump to a specific page within the project The page number is an internal 16 bit number that the Amulet GEMcompiler generates All pages and images are assigned an internal number which can be determined by looking at the Amulet link map When this message is received by the Amulet it will react as if the Amulet fileNumber x was launched meaning the Amulet will jump directly to the page specified by the 16 bit internal number You must NOT jump directly to an image file number it must be a valid page If you do errantly jump to non valid page the Amulet OS will respond with a soft reset This will act exactly as if the reset button was pressed The message structure is different than all other Amulet commands This message is NOT in ASCII The first two bytes for jumping to a specific page are always 0x02 The next byte is the MSByte of the internal number and the following byte is the LSByte of the internal numbe
334. yte O value 0 THEN Amulet UART invokeRPC 0 EQ 1 THEN Amulet UART invokeRPC 1 EQ 2 THEN Amulet UART invokeRPC 2 EQ 3 THEN Amulet UART invokeRPC 3 ELSE Amulet UART invokeRPC 0xFF NAME metaRPCLauncher gt 3 Initialize Internal RAM variables with a value returned from a timer based function META HTTP EQUIV REFRESH CONTENT 1st number 2nd number ONVAR function VALUE InternalRAM type x NAME string gt This meta tag does not require a URL function since the META object only exists to initialize an Internal RAM variable value either a BYTE WORD or STRING The most obvious use for this type of META is for initializing an Internal RAM variable to an internal Amulet value For example to set Internal RAM word variable 0 to the current page number you could use the following lt META HTTP EQUIV Refresh CONTENT 0 0 01 ONVAR Amulet internal fileNumber value value InternalRAM word 0 gt Since the value InternalRAM word 0 instead of the META Refresh saving the value in its own memory space it actually saves it directly to Internal RAM word variable 0 Another case where this could be useful is if someone wanted to initialize an Internal RAM variable but wanted to maintain the slave relationship with the Amulet Therefore you could have the META request a variable and store it directly into an Internal RAM variable without ever sending a master message lt META HTTP EQUIV Refresh CONTENT 0 0 01 ONV

Download Pdf Manuals

image

Related Search

Related Contents

MD Building Products 25730 Installation Guide : Free Download, Borrow, and Streaming : Internet Archive    Tripp Lite SmartOnline 100-127V 1.5kVA 1.35kW On-Line Double-Conversion UPS, Extended Run, SNMP, Webcard, Tower, LCD display, USB, DB9 Serial  Moxa EDS-P308-M-SC network switch  Sollevatore manuale SARA  Livrode Fornecimento 88  

Copyright © All rights reserved.
Failed to retrieve file