background image

e z L C D -­‐ 4 0 5

   |   

83   

   

   

Rev.   

©  2016    Earth  Computers  Tech.  Inc.

   

1.7.24   PRINT_CHAR_BG   

   

Description:      

Prints   a   character   at   Current   Position   on   the   background   specified   by   the   

SET_BG_COLORH   

command.   

Code:          

3C

hex,   

60

dec   

7   

6   

5   

4   

3   

2   

1   

0   

   

   

   

   

   

   

   

   

   

Byte         0:      Command   

   

   

   

   

   

   

   

   

Byte         1:      ASCII   Character   

   

See   Also:   

SELECT_FONT

,   

SET_BG_COLORH

,   

PRINT_STRING_BG   

Example:   

Example:

   

  

   

The   following   sequence   will   print   the   character   'M'   in   white   on   a   black   background   using   Font   

2.   

   

SELECT_FONT         

2B      

   

hex   

2      

   

   

2      

   

dec   

SET_BG_COLORH      

94   

   

hex   

BLACK_LSB          

000

00000      

bin   

BLACK_MSB          

00000

000      

bin   

SET_COLORH          

84      

   

hex   

WHITE_LSB          

111

11111      

bin   

WHITE_MSB          

11111

111      

bin   

PRINT_CHAR_BG      

3C      

   

hex   

'M'          

   

4D      

   

hex

   

   

   

   

   

   

   

   

   

PRINT_CHAR_BG   

ASCII   

Summary of Contents for ezLCD-405

Page 1: ......

Page 2: ...1 4 Firmware 29 1 4 1 Firmware Upgrade 29 1 4 2 Firmware Customization 29 1 5 Touch Screen 31 1 5 1 Introduction 31 1 5 2 Calibration Error Bookmark not defined 1 5 3 Data Protocols 33 1 6 SD Card Ope...

Page 3: ...9 1 7 21 PLOT 80 1 7 22 PLOT_XHY 81 1 7 23 PRINT_CHAR 82 1 7 24 PRINT_CHAR_BG 83 1 7 25 PRINT_STRING 84 1 7 26 PRINT_STRING_BG 85 1 7 27 PUT_BITMAPH 87 1 7 28 PUT_SF_ICON 89 1 7 29 RESTORE_POSITION 90...

Page 4: ...7 48 SD_PUT_ICON 129 1 7 49 SD_RAW_READ 130 1 7 50 SD_RAW_WRITE 132 1 7 51 SD_SCREEN_CAPTURE 134 1 7 52 SD_SIZE 136 1 7 53 SD_SPACE_INFO 138 1 7 54 SELECT_FONT 140 1 7 55 SET_BG_COLORH 141 1 7 56 SET_...

Page 5: ...Change the line TestMode True to TestMode False 2 Save the file put it back in the ezLCD 405 and then reset it by pressing the reset button STEP 1 INSTALL DRIVER a Download all ezLCD 405 files from ht...

Page 6: ...evice These updates help fix bugs and problems that may occur with the device a Install Unzip the Test Platform and run it b Before Updating set the ezLCD 405 to DFU Mode firmware upgrade mode by firs...

Page 7: ...the latest firmware ex ezLCD405 Firmware x xx dfu which you have already downloaded from the website e Now click Update and it will say done parsing DfuSe file when finished f Now you are done with up...

Page 8: ...s a Get Connected 1 Under the Serial Port select the COM__ port the ezLCD 405 is connected at You can check this by looking at Device Manager Ports 2 Then click Open Make sure you have Open the device...

Page 9: ...ere you can specify the colors you want to use 1 Click Color Selector and choose a color 2 When you choose a color specify the intensity of the color on the right side by dragging the cursor the inten...

Page 10: ...ed to the screen you must upload it to the microSD card 1 If you are not using a font already on the computer download and install one 2 Open the Font Editor and Select the font you want to use 3 Clic...

Page 11: ...zf as well as one for reference 7 In the Test Platform go to the Fonts tab and Add the font the font ID will be displayed on the left side 8 Now you will need to generate the Config txt following thes...

Page 12: ...tring you want to print and then click Print String d Images 1 Convert a 320x240 pixel image to a 24 bit bitmap with extension bmp 2 Connect your microSD card and load the image into the Images folder...

Page 13: ...D card back into your ezLCD 405 8 Make sure the serial port is open as shown here 9 Go to Position Commands on the top left and type in the X and Y coordinates you want the image to start displaying a...

Page 14: ...y default it is set to Serial which is used when the device is connected via USB 2 Backlight you can control the brightness of the screen or you can just turn off the light which makes the screen blac...

Page 15: ...and images You can do this by either using the Test Platform program or creating a text file and then saving it on the microSD card 1 Using the Test Platform Program Make sure to have the microSD card...

Page 16: ...e z L C D 4 0 5 16 Rev 2016 Earth Computers Tech Inc Eject the microSD card and put it back into the ezLCD 405 Then RESET the device 2 Creating a text file txt...

Page 17: ...ers Tech Inc g FOR UNEXPECTED PROBLEMS BUGS ERRORS 1 Not Recognizing the Device If your computer is not recognizing the device and showing error in the Device Manager manually Update the driver Right...

Page 18: ...in the directory names of the file path to dfu file Make sure the ezLCD 405 is in bootloader mode before open uploading a dfu file 3 ezLCD 405 If images are not displaying properly make sure the image...

Page 19: ...by the logic and the display itself Touch screen Interface drivers and other circuitry The ezLCD 405 communicates with the outside world through several interfaces RS232 TTL USB SPI The ezLCD 405 is...

Page 20: ...ontroller with the corresponding set of signals and instructions The commands are processed on a First In First Out principle Example The following commands will draw a green circle with a radius of 6...

Page 21: ...0 TBD A Vcc 5V Hi Level Logical Input Voltage VIH 2 2 3 3 3 6 V Some pins are 5V tolerant Please refer to Pin Configuration Lo Level Logical Input Voltage VIL 0 3 0 1 V Operating Temperature Topa 0 60...

Page 22: ...e z L C D 4 0 5 22 Rev 2016 Earth Computers Tech Inc Figure 2 ezLCD 405 Schematic...

Page 23: ...e z L C D 4 0 5 23 Rev 2016 Earth Computers Tech Inc 1 3 2 Pin Configuration Figure 3 ezLCD 405 Connectors...

Page 24: ...ignal The same function as SW1 ON switch 3 6 to 7V turns ON the ezLCD 405 power 0 to 1V turns OFF the ezLCD 405 power Rin 10 kOhm PROG CN1 input Firmware download signal The same function as SW2 PROG...

Page 25: ...ent USB Cable so it will supply both power and USB signals to the ezLCD 405 Connect 5V from the USB cable to the following ezLCD pins 5V ext VBUS Connect GND from the USB cable to the following ezLCD...

Page 26: ...ters Tech Inc 1 3 4 RS232 TTL Default Communication Parameters Baud rate 115200 bps No of Data Bits 8 No of Stop Bits 1 Parity Off Handshake None Pin Name Connector Type Description RS2323 TTL TX CN1...

Page 27: ...CD 405 sends EZLCD_READY byte EA hex 234dec The EZLCD_READY byte is sent one time only upon the power up when the ezLCD 405 RS232 TTL interface is ready to receive the commands The Default Transmitter...

Page 28: ...SPI interface have to be initiated by the Master it is the user responsibility to query the ezLCD for any new data like for example touch screen coordinates Each time the byte is send through the SPI...

Page 29: ...ange in the future The latest pre release version of the ezLCDconfig utility is available for download at http www ezlcd com As it is shown on the picture above the ezLCDconfig allows the user to 1 Re...

Page 30: ...mand Execution in Progress When it is selected for the particular pin that pin outputs Hi 2 3 to 3 3V when the command is executed and Lo 0 to 1V between commands The pin switches to Hi on the first b...

Page 31: ...ate on the powered plane For example in case of the X coordinate measurement the X plane is powered as shown on the drawing below The Y plane is used to sense where the pen is located on the powered p...

Page 32: ...e z L C D 4 0 5 32 Rev 2016 Earth Computers Tech Inc...

Page 33: ...imes per second 3 CalibratedXY ezLCD sends TOUCH_X and TOUCH_Y packets X and Y coordinates when the screen is pressed ezLCD sends PEN_UP packets when the touch screen is not pressed Multi byte packed...

Page 34: ...the buttons using BUTTON_DEF command Send BUTTON_DEF command for each of the buttons that you want to use The BUTTON_DEF command specifies Button Number ID Initial state of the button Bitmaps for eac...

Page 35: ...e cuButton protocol instead The button cannot be pressed just by sliding the finger onto the button touch zone The ezLCD sends the Button Down Event only if the button is directly pressed When the but...

Page 36: ...ezLCD 405 Sends Nothing because no button has been pressed 7 Touch Screen Not pressed ezLCD 405 Sends 44hex only 1 time in the moment when the button 4 become pressed 8 Touch Screen Not pressed ezLCD...

Page 37: ...uttons using BUTTON_DEF command Send BUTTON_DEF command for each of the buttons that you want to use The BUTTON_DEF command specifies Button Number ID Initial state of the button Bitmaps for each of t...

Page 38: ...the button state only once per event please use the ezButton protocol instead The button cannot be pressed just by sliding the finger onto the button touch zone The ezLCD sends the Button Down state o...

Page 39: ...ch zone ezLCD 405 Sends FFhex continuously 5 to 20 times per second 6 Touch Screen Finger is removed from the touch screen ezLCD 405 Sends FFhex continuously 5 to 20 times per second 7 Touch Screen Pr...

Page 40: ...OL 64 to the ezLCD Sending of the touch screen coordinates by the ezLCD The touch screen coordinates are sent by the ezLCD only when the CalibratedXY protocol is selected For ezLCD 405 Xmax 319 Ymax 2...

Page 41: ...It is sent only if the touch screen pressed Length 3 bytes including the Packet ID Code 81hex 129dec TOUCH_Y Packet Description The TOUCH_Y packet represents the touch screen X coordinate It is sent...

Page 42: ...e z L C D 4 0 5 42 Rev 2016 Earth Computers Tech Inc Example The drawing below shows an example of the data sent by the ezLCD when the CalibratedXY protocol is selected...

Page 43: ...nores the position of the SD CardWrite Protect Switch The SD Card Size can be read by using the SD_SIZE command The ezLCD firmware supports 2 types of SD Card operations 1 File Operations The SD card...

Page 44: ...upported file systems FAT12 FAT16 FAT16 Full Name File Allocation Table 12 bit version 16 bit version 32 bit version Introduced 1977 July 1988 August 1996 Max file size 32 MB 2 GB 4 GB Max number of f...

Page 45: ...ened SD Flash file SD_FILE_DELETE Deletes the SD file SD_FOLDER_CREATE Creates a new folder directory on the SD SD_FOLDER_DELETE Deletes an empty folder directory on the SD SD_SPACE_INFO Gets the info...

Page 46: ...e sensitive The drive and root directory do not have to be indicated for example A Cat Jumped Over CAT juMped OvEr and cat jumped over specify the same Long directory names are supported however the D...

Page 47: ...dressed memory locations Obviously the SD Card does not have to be formatted Summary of the SD Raw Operations commands SD_SIZE Gets the physical size in bytes of the SD Card SD_RAW_READ Reads the data...

Page 48: ...rer com cpp Directories Exe build executables Sources C sources VisualC MS Visual C 6 0 projects Borland Borland C Builder 6 0 projects Common Files ezLCDdll c This file is used to dynamically load th...

Page 49: ...om formatted SD card fsize c ezLCDio c ezLCDdll c mytypes h ezLCDio h ezLCDdll h CmdCodes h SDfget Copies the file from SD Card to the PC fget c ezLCDio c ezLCDdll c mytypes h ezLCDio h ezLCDdll h Cmd...

Page 50: ...XHY SET_Y iii Backlight LIGHT_BRIGHT LIGHT_ON LIGHT_OFF iv Points PLOT PLOT_XHY v Lines H_LINH V_LINE LINE_TO_XHY vi Figures ARCH PIEH CIRCLE_RH CIRCLE_FH_FILL BOXH BOXH_FILL vii Bitmaps PUT_BITMAP PU...

Page 51: ...ZE SD_FILE_LIST SD_FILE_OPEN SD_FILE_READ SD_FILE_REWIND SD_FILE_SEEK SD_FILE_TELL SD_FILE_WRITE SD_FIND_FIRST and SD_FIND_NEXT SD_FOLDER_CREATE SD_FOLDER_DELETE SD_FORMAT SD_INSERTED SD_PUT_ICON SD_S...

Page 52: ...e z L C D 4 0 5 52 Rev 2016 Earth Computers Tech Inc SET_COLOR SET_XY...

Page 53: ...Byte 3 Arc Begin Angle MSB Byte 4 Arc Begin Angle LSB Byte 5 Arc End Angle MSB Byte 6 Arc End Angle LSB See Also PIEH SET_XHY SET_COLORH CIRCLE_RH Angle Coding The full angle 360 is equal to 4000hex...

Page 54: ...green arc from 45 to 225 degrees with the center positioned at 160 117 and a radius of 80 225 x 2048 45 10240 2800hex SET_COLORH 84 hex GREEN_LSB 11100000 bin GREEN_MSB 00000111 bin SET_XHY 85 hex 0...

Page 55: ...x10 x9 x8 Byte 1 x2 MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x2 LSB y15 y14 y13 y12 y11 y10 y9 y8 Byte 3 y2 MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y2 LSB See Also SET_XHY BOXH_FILL Example Example The following...

Page 56: ...D 4 0 5 56 Rev 2016 Earth Computers Tech Inc RED_MSB 11111000 bin SET_XHY 85 hex 0 0 dec x MSB 95 95 dec x LSB 0 0 dec y MSB 10 10 dec y LSB BOXH A2 hex 180 0 dec X_2 MSB 180 180 dec X_2 LSB 120 120...

Page 57: ...e 1 x2 MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x2 LSB y15 y14 y13 y12 y11 y10 y9 y8 Byte 3 y2 MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y2 LSB See Also SET_XHY BOXH Exam Example The following sequence will draw a...

Page 58: ...e z L C D 4 0 5 58 Rev 2016 Earth Computers Tech Inc 95 95 dec x LSB 0 0 dec y MSB 10 10 dec y LSB BOXH_FILL A3 hex 180 0 dec X_2 MSB 180 180 dec X_2 LSB 120 0 dec Y_2 MSB 120 120 dec Y_2...

Page 59: ...e 7 Button upper left corner x coordinate LSB y15 y14 y13 y12 y11 y10 y9 y8 Byte 8 Button upper left corner y coordinate MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 9 Button upper left corner x coordinate LSB By...

Page 60: ...The following sequence will define the Button No 4 with the following bitmaps Button Up Icon in serial flash 8 Button Down Icon in serial flash 9 No Icon for Button Disabled state The button will be...

Page 61: ...9 9 dec Button Down Icon No in the serial flash 255 255 dec No Icon for Button Disabled 1 1 dec Upper left corner X MSB 4 4 dec Upper left corner X LSB 170 170 dec Upper left corner Y 40 40 dec Width...

Page 62: ...ed button events Changing the button state to Non Visible Byte 2 4 will also not erase the button image from the screen The Non Visible Byte 2 4 state should mainly be used with the BUTTON_DEF command...

Page 63: ...utton will be automatically redrawn if the icon for the Button Up has been defined by the BUTTON_DEF command See Also BUTTON_DEF BUTTON_STATE BUTTONS_DELETE_ALL TOUCH_PROTOCOL Important Before using t...

Page 64: ...ttons will not erase their image from the screen The ezLCD will just stop reacting to the button events See Also BUTTON_DEF BUTTON_STATE BUTTONS_ALL_UP TOUCH_PROTOCOL Important Before using this comma...

Page 65: ...r11 r10 r9 r8 Byte 1 radius MSB r7 r6 r5 r4 r3 r2 r1 r0 Byte 2 radius LSB See Also SET_XHY SET_COLORH Example The following sequence will draw a green circle with the center positioned at 160 117 SET...

Page 66: ...13 r12 r11 r10 r9 r8 Byte 1 radius MSB r7 r6 r5 r4 r3 r2 r1 r0 Byte 2 radius LSB See Also SET_XHY SET_COLORH Example Example The following sequence will draw a red filled circle with the center positi...

Page 67: ...s the screen by filling it with the Current Color Code 21hex 33dec 7 6 5 4 3 2 1 0 Byte 0 Command See Also SET_COLORH Example Example The following sequence will clear the screen and fill it with whit...

Page 68: ...is command is ineffective when the buzzer has already been turned on by the EZNOW_BUZZER_ON command About the ezNow Board The ezNow is a bare printed circuit board which expands the capabilities of th...

Page 69: ...ilities of the ezLCD 405 It is user configurable When assembled it can be attached to the back of the ezLCD 405 and used for the development purposes or as a finished product The ezNow board is availa...

Page 70: ...ware Customization About the ezNow Board The ezNow is a bare printed circuit board which expands the capabilities of the ezLCD 405 It is user configurable When assembled it can be attached to the back...

Page 71: ...160dec 7 6 5 4 3 2 1 0 Byte 0 Command x15 x14 x13 x12 x11 x10 x9 x8 Byte 1 x MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x LSB See Also V_LINE SET_XHY Example The following sequence will draw a green horizonta...

Page 72: ...the brightness of the screen backlight Code 80hex 128dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 brightness 0 to 255 Note The default brightness is 255 See Also LIGHT_ON LIGHT_OFF E Example ample The fo...

Page 73: ...ch Inc 1 7 16 LIGHT_OFF Description Turns off the screen backlight Code 23hex 35dec 7 6 5 4 3 2 1 0 Byte 0 Command See Also LIGHT_ON LIGHT_BRIGHT Example Example The following sequence will turn off t...

Page 74: ...Tech Inc 1 7 17 LIGHT_ON Description Turns on the screen backlight Code 22hex 34dec 7 6 5 4 3 2 1 0 Byte 0 Command See Also LIGHT_OFF LIGHT_BRIGHT Example Example The following sequence will turn on t...

Page 75: ...e 0 Command x15 x14 x13 x12 x11 x10 x9 x8 Byte 1 x MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x LSB y15 y14 y13 y12 y11 y10 y9 y8 Byte 3 y MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y LSB See Also SET_XHY SET_COLORH...

Page 76: ...e z L C D 4 0 5 76 Rev 2016 Earth Computers Tech Inc 0 0 dec x0 MSB 0 0 dec y0 LSB LINE_TO_XHY 88 hex 1 1 dec x1 MSB 63 63 dec x1 LSB 1 1 dec y1 MSB 233 233 dec y1 LSB...

Page 77: ...Pie End Angle MSB Byte 6 Pie End Angle LSB See Also ARCH SET_XHY SET_COLORH CIRCLE_RH Angle Coding The full angle 360 is equal to 4000hex 16384dec To transform degrees to ARC angle units Angle_lcd An...

Page 78: ...d at 160 117 and a radius of 80 225 x 2048 45 10240 2800hex SET_COLORH 84 hex GREEN_LSB 11100000 bin GREEN_MSB 00000111 bin SET_XHY 85 hex 0 0 dec x MSB 160 160 dec x LSB 0 0 dec y MSB 117 117 dec y L...

Page 79: ...sponse After receiving the PING command the ezLCD responds with the PONG 38hex 56dec byte 7 6 5 4 3 2 1 0 0 0 1 1 1 0 0 0 Byte 0 38hex 56dec PONG The ezLCD response is sent through the same interface...

Page 80: ...Current Color Code 26hex 38dec 7 6 5 4 3 2 1 0 Byte 0 Command See Also SET_XHY SET_COLORH Example The following sequence will put a blue point at 160 117 SET_COLORH 84 hex BLUE_LSB 00011111 bin BLUE_...

Page 81: ...x10 x9 x8 Byte 1 x MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x LSB y15 y14 y13 y12 y11 y10 y9 y8 Byte 3 y MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y LSB See Also SET_XHY SET_COLORH PLOT Example Example The follow...

Page 82: ...Code 2Chex 44dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 ASCII Character See Also SELECT_FONT PRINT_STRING Example Example The following sequence will print a black character M using Font 2 SELECT_FONT...

Page 83: ...1 0 Byte 0 Command Byte 1 ASCII Character See Also SELECT_FONT SET_BG_COLORH PRINT_STRING_BG Example Example The following sequence will print the character M in white on a black background using Font...

Page 84: ...st Character See Also SELECT_FONT PRINT_CHAR Example le The following sequence will print LCD in purple using Font 1 at 160 117 SELECT_FONT 2B hex 1 1 dec SET_COLORH 84 hex PURPLE_LSB 00010000 bin PUR...

Page 85: ...First Character Byte n Last Character Byte n 1 NULL See Also SELECT_FONT SET_BG_COLORH PRINT_CHAR_BG Example Example The following sequence print LCD in yellow on a navy background in the middle of t...

Page 86: ...e z L C D 4 0 5 86 Rev 2016 Earth Computers Tech Inc PRINT_STRING_BG 3D hex L 4C hex C 43 hex D 44 hex NULL 0 hex...

Page 87: ...red when Byte 4 is not 0 R4 R3 R2 R1 R0 G5 G4 G3 Byte 7 Transparent Color MSB ignored when Byte 4 is not 0 G2 G1 G0 B4 B3 B2 B1 B0 Byte 8 Pixel1 at X Y R4 R3 R2 R1 R0 G5 G4 G3 Byte 9 Pixel1 at X Y G2...

Page 88: ...es 1 The total number of bytes is 2 x width x height 7 2 When Byte 4 0 Bytes 5 and 6 specify the Transparent Color Pixels equal to the Transparent Color are ignored during bitmap drawing All pixels ar...

Page 89: ...Serial Flash Use the ezLCD flash utility to store icons in the ezLCD Serial Flash Code 58hex 88dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 ICON ID 0 to 254 Note Maximum number of icons is 255 IDs 0 to...

Page 90: ...e Also SAVE_POSITION SET_XHY Example Example The following sequence will draw 3 lines with the common starting point 160 117 SET_XHY 85 hex 0 0 dec x MSB 160 160 dec x LSB 0 0 dec y MSB 117 117 dec y...

Page 91: ...e z L C D 4 0 5 91 Rev 2016 Earth Computers Tech Inc RESTORE_POSITION 36 hex 12 12 dec Position ID V_LINE 41 hex 217 217 dec...

Page 92: ...Example The following sequence will draw 3 lines with the common starting point 160 117 SET_XHY 85 hex 0 0 dec x MSB 160 160 dec x LSB 0 0 dec y MSB 117 117 dec y LSB SAVE_POSITION 35 hex 12 12 dec P...

Page 93: ...be formatted in the supported file system See Also SD_FILE_OPEN SD_FILE_CREATE SD_FILE_CLOSE_ALL About the File ID File ID is returned in the response to the SD_FILE_OPEN command It identifies the fi...

Page 94: ...een Supported file systems FAT12 FAT16 FAT32 Code 73hex 115dec 7 6 5 4 3 2 1 0 Byte 0 Command Notes SD card has to be formatted in the supported file system See Also SD_FILE_OPEN SD_FILE_CREATE SD_FIL...

Page 95: ...d Since maximum 2 files may be concurrently opened the File ID should be 1 or 2 Values higher than 2 are interpreted as 2 and 0 is interpreted as 1 About the File Path File Path specifies the full pat...

Page 96: ...sables the touch screen The touch screen will be automatically re enabled when all files are closed This can be done by issuing the SD_FILE_CLOSE or SD_FILE_CLOSE_ALL command Note The touch screen is...

Page 97: ...7 Rev 2016 Earth Computers Tech Inc If the file has successfully been created the ezLCD responds with the following sequence 3F hex 1 dec In case of the failure the following sequence will be sent by...

Page 98: ...l path to the file on SD including directory filename and extension Directories should be separated by not by like in Windows and DOS File Path is not case sensitive The drive and root directory do no...

Page 99: ...e interface which received the SD_FILE_DELETE command Example Example The following sequence will delete file MyFile dat SD_FILE_DELETE 7D hex M 4D hex y 79 hex F 46 hex i 69 hex l 6C hex e 65 hex 2E...

Page 100: ...LE_CLOSE SD_FILE_CLOSE_ALL About the File ID File ID is returned in the response to the SD_FILE_OPEN command It identifies the file after it has been opened Since maximum 2 files may be concurrently o...

Page 101: ...n error The ezLCD response is sent through the same interface which received the SD_FILE_GET_SIZE command Example The following flow chart on the next page shows an example of getting the size of the...

Page 102: ...e z L C D 4 0 5 102 Rev 2016 Earth Computers Tech Inc...

Page 103: ...o the SD directory SD file or group of files and sub directories Wildcards and are supported Directories should be separated by not by like in Windows and DOS Directory Path is not case sensitive The...

Page 104: ...heir last character For example 3Ahex Start whatever txt file Pictures directory Cat doc file ezLCD bin file SOURCES directory 0 End NULL In case of an error 7 6 5 4 3 2 1 0 0 0 1 1 1 1 1 0 Byte 0 3Eh...

Page 105: ...About the File ID File ID identifies the file after it has been opened Since maximum 2 files may be concurrently opened the File ID should be 1 or 2 Values higher than 2 are interpreted as 2 and 0 is...

Page 106: ...porary disables the touch screen The touch screen will be automatically re enabled when all files are closed This can be done by issuing the SD_FILE_CLOSE or SD_FILE_CLOSE_ALL command Note The touch s...

Page 107: ...d however it will not exceed file_size 1 Supported file systems FAT12 FAT16 FAT32 Code 75hex 117dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 File ID Byte 2 Number of Bytes to Read 0 LSB Byte 3 Number of...

Page 108: ...ase of the success 7 6 5 4 3 2 1 0 Byte 0 Command Byte 2 First Character of the file path Byte 3 Second Character of the file path Byte n 1 Data Byte n Note If the Number of Bytes to Read is greater t...

Page 109: ...e z L C D 4 0 5 109 Rev 2016 Earth Computers Tech Inc...

Page 110: ...e ID File ID is returned in the response to the SD_FILE_OPEN command It identifies the file after it has been opened Since maximum 2 files may be concurrently opened the File ID should be 1 or 2 Value...

Page 111: ...ple Example The following sequence will set the File Position Index at the beginning of the file SD_FILE_REWIND 7A hex 1 1 dec File ID If the File Position Index has successfully been moved the ezLCD...

Page 112: ...rted file system This command works only if the file is already opened by the SD_FILE_OPEN command or created and opened by the SD_FILE_CREATE command See Also SD_FILE_OPEN SD_FILE_REWIND SD_FILE_READ...

Page 113: ...case of the success In case of an error The ezLCD response is sent through the same interface which received the SD_FILE_SEEK command Example The following sequence will advance the File Position Ind...

Page 114: ...L About the File ID File ID is returned in the response to the SD_FILE_OPEN command It identifies the file after it has been opened Since maximum 2 files may be concurrently opened the File ID should...

Page 115: ...te 4 File Position Index 3 MSB In case of an error 7 6 5 4 3 2 1 0 0 0 1 1 1 1 1 0 Byte 0 3Ehex 62dec The ezLCD response is sent through the same interface which received the SD_FILE_TELL command Exam...

Page 116: ...acter of the file path Byte 3 Second Character of the file path Byte n 1 Data Byte n Notes SD card has to be formatted in the supported file system This command works only if the file is already opene...

Page 117: ...reted as 2 and 0 is interpreted as 1 ezLCD Response After receiving the SD_FILE_WRITE command the ezLCD responds with either of the following sequences In case of the success 7 6 5 4 3 2 1 0 0 0 1 1 1...

Page 118: ...e z L C D 4 0 5 118 Rev 2016 Earth Computers Tech Inc...

Page 119: ...Byte 0 Command SD_FIND_FIRST gets only the first found file or directory which matches the search pattern Each time the SD_FIND_NEXT is issued it finds the next file or directory which matches the se...

Page 120: ...xceed 64 bytes See Also SD_FILE_LIST ezLCD Response After receiving any of the described commands the ezLCD responds with either of the following sequences In case of the success 3Ahex 58dec followed...

Page 121: ...e z L C D 4 0 5 121 Rev 2016 Earth Computers Tech Inc Example The following flow chart shows an example of reading the file list from the directory My Pictures...

Page 122: ...otes SD card has to be formatted in the supported file system Parent directory folder has to exist About the Folder Path Folder Path specifies the full path to the directory on the SD Directories fold...

Page 123: ...h received the SD_FOLDER_CREATE command Example Example The following sequence will create folder MyDir in the root directory SD_FOLDER_CREATE 46 hex M 4D hex y 79 hex D 44 hex i 69 hex r 72 hex NULL...

Page 124: ...ard has to be formatted in the supported file system Folder directory has to be empty About the Folder Path Folder Path specifies the full path to the directory on the SD Directories folders should be...

Page 125: ...hich received the SD_FOLDER_DELETE command Example The following sequence will delete folder MyDir from the root directory SD_FOLDER_DELETE 4D hex M 4D hex y 79 hex D 44 hex i 69 hex r 72 hex NULL 0 h...

Page 126: ...This command will erase all files on the SD About the File System Specification Sets the file system in which the SD will be formatted 5 ASCII characters ASCII characters only For example the code of...

Page 127: ...The ezLCD response is sent through the same interface which received the SD_FORMAT command Example The following sequence will format the SD in FAT16 SD_FORMAT 4F hex F 46 hex A 41 hex T 54 hex 1 31...

Page 128: ...d in the SD slot If there is no card inserted in the SD slot 7 6 5 4 3 2 1 0 0 0 1 1 1 1 1 0 Byte 0 3Ehex 62dec SD not inserted error The ezLCD response is sent through the same interface which receiv...

Page 129: ...ve The drive and root directory do not have to be indicated for example both A Cat Jumped Over txt and cat jumped over TXT specify the same file Long file names are supported however the File Path dir...

Page 130: ...ddress 1 Byte 4 Address 2 Byte 5 Address 3 MSB Byte 6 Number of Bytes to Read 0 LSB Byte 7 Number of Bytes to Read 1 Byte 8 Number of Bytes to Read 2 Byte 9 Number of Bytes to Read 3 MSB See Also SD_R...

Page 131: ...command Example The following flow chart shows an example of reading 34 bytes starting from the SD address 000001BEhex 7 6 5 4 3 2 1 0 0 0 1 1 1 1 0 0 Byte 0 Command Byte 1 Data Byte 0 Byte 2 Data By...

Page 132: ...SB Byte 7 Number of Bytes to Write Byte 8 Number of Bytes to Write Byte 9 Number of Bytes to Write LSB Byte 10 Data Byte 0 Byte 11 Data Byte 1 Byte n 1 Data Byte n n Number of Bytes to Write 1 Warning...

Page 133: ...equences In case of the success 7 6 5 4 3 2 1 0 0 0 1 1 1 0 1 1 Byte 0 3Bhex 59dec In case of an error 7 6 5 4 3 2 1 0 0 0 1 1 1 1 1 0 Byte 0 3Ehex 62dec The ezLCD response is sent through the same in...

Page 134: ...ample Scr_0001 bmp Scr_0002 bmp etc The files are created in the Scr_Cap SD folder If the SD does not have the Scr_Cap folder it will be created automatically Notes SD card has to be formatted in the...

Page 135: ...e following sequence will save the image of the displayed screen to the SD file SD_SCREEN_CAPTURE 44 hex If the screen image has been written to the bmp file the ezLCD responds with 3B hex In case of...

Page 136: ...th either of the following sequences In case of the success 7 6 5 4 3 2 1 0 0 0 1 1 1 1 0 1 Byte 0 Command Byte 1 SD Card Size 0 LSB Byte 2 SD Card Size 1 Byte 3 SD Card Size 2 Byte 4 SD Card Size 3 I...

Page 137: ...e z L C D 4 0 5 137 Rev 2016 Earth Computers Tech Inc Example le The following flow chart shows an example of getting the size of the SD Card...

Page 138: ...Space Any Other No Get Total Formatted Space Notes SD card has to be formatted in the supported file system ezLCD Response After receiving the SD_SPACE_INFO command the ezLCD responds with either of...

Page 139: ...Computers Tech Inc The ezLCD response is sent through the same interface which received the SD_SPACE_INFO command Example The following flow chart shows an example of getting the number of the availa...

Page 140: ...and Byte 1 Font Number Note The following fonts are implemented See Also PRINT_STRING PRINT_CHAR Exam Example ple The following sequence will print a black character M in the middle of the screen usin...

Page 141: ...1 R0 G5 G4 G3 Byte 2 Color MSB See Also PRINT_CHAR_BG PRINT_STRING_BG E Example The following sequence will print LCD in yellow on a navy background using Font 0 SET_BG_COLORH 94 hex NAVY_LSB 00010000...

Page 142: ...de 84hex 132dec 7 6 5 4 3 2 1 0 Byte 0 Command G2 G1 G0 B4 B3 B2 B1 B0 Byte 1 Color LSB R4 R3 R2 R1 R0 G5 G4 G3 Byte 2 Color MSB See Also CLS PLOT Example Example The following sequence will fill the...

Page 143: ...SET_Y SET_XHY Example Example The following sequence will put a 2 blue points in the same row SET_COLORH 84 hex BLUE_LSB 00011111 bin BLUE_MSB 00000000 bin SET_XH 6E hex 0 0 dec x MSB 160 160 dec x LS...

Page 144: ...d x15 x14 x13 x12 x11 x10 x9 x8 Byte 1 x MSB x7 x6 x5 x4 x3 x2 x1 x0 Byte 2 x LSB y15 y14 y13 y12 y11 x10 y9 y8 Byte 3 y MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y LSB See Also PLOT LINE_TO_XHY CIRCLE_RH Ex...

Page 145: ...e z L C D 4 0 5 145 Rev 2016 Earth Computers Tech Inc 0 0 dec x MSB 160 160 dec x LSB 0 0 dec x MSB 117 117 dec y LSB PLOT 26 hex...

Page 146: ...hex 95dec 7 6 5 4 3 2 1 0 Byte 0 Command y15 y14 y13 y12 y11 x10 y9 y8 Byte 3 y MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y LSB See Also SET_XH SET_XHY Example Example The following sequence will put a 2 blu...

Page 147: ...TEXT_NORTH 60hex 96dec TEXT_EAST 61hex 97dec TEXT_SOUTH 62hex 98dec TEXT_WEST 2Fhex 99dec 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0...

Page 148: ...d above SET_XHY 85 hex 0 0 dec x MSB 60 60 dec x LSB 0 0 dec y MSB 10 10 dec y LSB SELECT_FONT 2B hex 0 0 dec TEXT_NORTH 60 hex PRINT_STRING 2D hex Text North NULL 0 hex TEXT_EAST 61 hex PRINT_STRING...

Page 149: ...e TEXT_NORTH 60hex 96dec TEXT_EAST 61hex 97dec TEXT_SOUTH 62hex 98dec TEXT_WEST 2Fhex 99dec 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0...

Page 150: ...ove SET_XHY 85 hex 0 0 dec x MSB 60 60 dec x LSB 0 0 dec y MSB 10 10 dec y LSB SELECT_FONT 2B hex 0 0 dec TEXT_NORTH 60 hex PRINT_STRING 2D hex Text North NULL 0 hex TEXT_EAST 61 hex PRINT_STRING 2D h...

Page 151: ...e TEXT_NORTH 60hex 96dec TEXT_EAST 61hex 97dec TEXT_SOUTH 62hex 98dec TEXT_WEST 2Fhex 99dec 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0...

Page 152: ...d above SET_XHY 85 hex 0 0 dec x MSB 60 60 dec x LSB 0 0 dec y MSB 10 10 dec y LSB SELECT_FONT 2B hex 0 0 dec TEXT_NORTH 60 hex PRINT_STRING 2D hex Text North NULL 0 hex TEXT_EAST 61 hex PRINT_STRING...

Page 153: ...EXT_NORTH 60hex 96dec TEXT_EAST 61hex 97dec TEXT_SOUTH 62hex 98dec TEXT_WEST 2Fhex 99dec 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 Byte 0 Command 7 6 5 4 3 2 1 0 By...

Page 154: ...ove SET_XHY 85 hex 0 0 dec x MSB 60 60 dec x LSB 0 0 dec y MSB 10 10 dec y LSB SELECT_FONT 2B hex 0 0 dec TEXT_NORTH 60 hex PRINT_STRING 2D hex Text North NULL 0 hex TEXT_EAST 61 hex PRINT_STRING 2D h...

Page 155: ...s are sent only once per button state change 2 cuButton Similar to the ezButton however the button states are sent continuously 5 to 20 times per second 3 CalibratedXY ezLCD sends TOUCH_X and TOUCH_Y...

Page 156: ...e z L C D 4 0 5 156 Rev 2016 Earth Computers Tech Inc Example The following sequence will change the Touch Protocol to ezButton TOUCH_PROTOCOL B2 hex Command 1 1 dec ezButton Protocol...

Page 157: ...ode 41hex 65dec 7 6 5 4 3 2 1 0 Byte 0 Command y15 y14 y13 y12 y11 x10 y9 y8 Byte 3 y MSB y7 y6 y5 y4 y3 y2 y1 y0 Byte 4 y LSB See Also H_LINEH SET_XHY Example Example The following sequence will draw...

Page 158: ...e z L C D 4 0 5 158 Rev 2016 Earth Computers Tech Inc 10 10 dec y LSB V_LINE 41 hex 110 110 dec...

Page 159: ...can interpret the commands used by the smaller ezLCD displays Those displays ezLCD 001 and ezLCD 002 have maximum resolution of 240x160 and are capable of displaying maximum 256 colors ARC BOX BOX_FIL...

Page 160: ...2 1 0 Byte 0 Command Byte 1 Radius Byte 2 Arc Begin Angle Byte 3 Arc End Angle See Also SET_XY SET_COLOR CIRCLE_R Angle Coding The angle range is from 0 to 255 To transform degrees to ARC angle units...

Page 161: ...wing sequence will draw a green arc from 45 to 225 degrees with the center positioned in the middle of a screen SET_COLOR 24 hex GREEN 00111000 bin SET_XY 25 hex 120 120 dec 80 80 dec ARC 2F hex 60 60...

Page 162: ...de 42hex 66dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Corner Column Byte 2 Corner Row See Also SET_XY BOX_FILL Example Example The following sequence will draw the red rectangle SET_COLOR 24 hex RED 00...

Page 163: ...Code 43hex 67dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Corner Column Byte 2 Corner Row See Also SET_XY BOX Example Example The following sequence will draw the rectangle filled with blue color SET_CO...

Page 164: ...at Current Position Code 29hex 41dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Radius See Also SET_XY SET_COLOR Example Example The following sequence will draw a green circle in the middle of the screen...

Page 165: ...ion filled with Current Color Code 39hex 57dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Radius See Also SET_XY SET_COLOR Example Example The following sequence will draw a red filled circle in the middle...

Page 166: ...fied position Code 28hex 40dec 7 6 5 4 3 2 1 0 Byte 0 Command x7 x6 x5 x4 x3 x2 x1 x0 Byte 1 x y7 y6 y5 y4 y3 y2 y1 y0 Byte 2 y See Also SET_XY SET_COLOR PLOT Example Example The following sequence wi...

Page 167: ...d position Code 27hex 39dec 7 6 5 4 3 2 1 0 Byte 0 Command x7 x6 x5 x4 x3 x2 x1 x0 Byte 1 x y7 y6 y5 y4 y3 y2 y1 y0 Byte 2 y See Also SET_XY SET_COLOR PLOT Example Example The following sequence will...

Page 168: ...en UP and RIGHT Code 2Ehex 46dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Bitmap Width Byte 2 Bitmap Height Byte 3 Pixel at X Y Byte 4 Pixel at X 1 Y Byte width 2 Pixel at X width 1 Y Byte width 3 Pixelw...

Page 169: ...following sequence will put 4x3 bitmap at x 60 y 80 pixel total 4x3 3 15 bytes SET_XY 25 hex x 60 dec y 80 dec PUT_BITMAP 2E hex width 4 dec height 3 dec pixel x 60 y 80 pixel x 61 y 80 pixel x 62 y 8...

Page 170: ...color palette has the following color coding 7 6 5 4 3 2 1 0 b1 b0 g2 g1 g0 r2 r1 r0 See Also PRINT_CHAR_BG PRINT_STRING_BG Example Example The following sequence print Yellow LCD on the Navy backgro...

Page 171: ...or Code 24hex 36dec 7 6 5 4 3 2 1 0 Byte 0 Command Byte 1 Color Code Note The 256 color palette has the following color coding 7 6 5 4 3 2 1 0 b1 b0 g2 g1 g0 r2 r1 r0 See Also CLS PLOT Example The fol...

Page 172: ...remains unchanged Code 5Ehex 94dec 7 6 5 4 3 2 1 0 Byte 0 Command x7 x6 x5 x4 x3 x2 x1 x0 Byte 1 x See Also SET_Y SET_XY Example Example The following sequence will put a 2 blue points in the same row...

Page 173: ...37dec 7 6 5 4 3 2 1 0 Byte 0 Command x7 x6 x5 x4 x3 x2 x1 x0 Byte 1 x y7 y6 y5 y4 y3 y2 y1 y0 Byte 2 y See Also PLOT LINE_TO_XY CIRCLE_R Example Example The following sequence will put the blue point...

Reviews: