4D systems Picaso uLCD 32PTU touch display library
Picaso_4DGL-32PTU.h@27:dbf79d116497, 2016-09-29 (annotated)
- Committer:
- CaptainR
- Date:
- Thu Sep 29 19:40:53 2016 +0000
- Revision:
- 27:dbf79d116497
- Parent:
- 26:c6a803706a42
get word and get string
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
CaptainR | 0:a5ef6bc3c2e8 | 1 | // |
CaptainR | 2:81eaaa491a02 | 2 | // Picaso_4DGL-32PTU is a class to drive 4D Systems TFT touch screens with PICASO processor |
CaptainR | 2:81eaaa491a02 | 3 | // Tested with NUCLEO L152RE development board |
CaptainR | 2:81eaaa491a02 | 4 | // Copyright (C) <2016> Rihards Balass <rihards.balass@gmail.com> |
CaptainR | 0:a5ef6bc3c2e8 | 5 | // |
CaptainR | 2:81eaaa491a02 | 6 | // Picaso_4DGL-32PTU is free software: you can redistribute it and/or modify |
CaptainR | 2:81eaaa491a02 | 7 | // it under the terms of the GNU General Public License as published by |
CaptainR | 2:81eaaa491a02 | 8 | // the Free Software Foundation, either version 3 of the License, or |
CaptainR | 2:81eaaa491a02 | 9 | // (at your option) any later version. |
CaptainR | 2:81eaaa491a02 | 10 | // |
CaptainR | 2:81eaaa491a02 | 11 | // Picaso_4DGL-32PTU is distributed in the hope that it will be useful, |
CaptainR | 2:81eaaa491a02 | 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
CaptainR | 2:81eaaa491a02 | 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
CaptainR | 2:81eaaa491a02 | 14 | // GNU General Public License for more details. |
CaptainR | 2:81eaaa491a02 | 15 | // |
CaptainR | 2:81eaaa491a02 | 16 | // You can see GNU General Public License at <http://www.gnu.org/licenses/>. |
CaptainR | 0:a5ef6bc3c2e8 | 17 | // |
CaptainR | 0:a5ef6bc3c2e8 | 18 | |
CaptainR | 26:c6a803706a42 | 19 | #ifndef PICASO_H |
CaptainR | 26:c6a803706a42 | 20 | #define PICASO_H |
CaptainR | 26:c6a803706a42 | 21 | |
CaptainR | 0:a5ef6bc3c2e8 | 22 | #include "mbed.h" |
CaptainR | 21:ea68a8a3cea4 | 23 | #include "Picaso_4DGL-32PTU_CONSTANTS.h" |
CaptainR | 21:ea68a8a3cea4 | 24 | #include <string> |
CaptainR | 12:29f5ad896382 | 25 | |
CaptainR | 0:a5ef6bc3c2e8 | 26 | // functions |
CaptainR | 2:81eaaa491a02 | 27 | #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) // to check if required bit is set |
CaptainR | 0:a5ef6bc3c2e8 | 28 | |
CaptainR | 0:a5ef6bc3c2e8 | 29 | |
CaptainR | 12:29f5ad896382 | 30 | // Main commands |
CaptainR | 3:dcfbceb81fef | 31 | #define BAUDRATE 0x0026 |
CaptainR | 3:dcfbceb81fef | 32 | #define ORIENTATION 0xFF9E |
CaptainR | 0:a5ef6bc3c2e8 | 33 | |
CaptainR | 12:29f5ad896382 | 34 | // text commands |
CaptainR | 5:890ddd974624 | 35 | #define TEXT_BG_COLOR 0xFFE6 |
CaptainR | 3:dcfbceb81fef | 36 | #define SET_FONT 0xFFE5 |
CaptainR | 3:dcfbceb81fef | 37 | #define PUT_CHAR 0xFFFE |
CaptainR | 3:dcfbceb81fef | 38 | #define PUT_STRING 0x0018 |
CaptainR | 3:dcfbceb81fef | 39 | #define MOVE_CURSOR 0xFFE9 |
CaptainR | 3:dcfbceb81fef | 40 | #define TEXT_FG_COLOR 0xFFE7 |
CaptainR | 3:dcfbceb81fef | 41 | #define TEXT_WIDTH 0xFFE4 |
CaptainR | 3:dcfbceb81fef | 42 | #define TEXT_HEIGHT 0xFFE3 |
CaptainR | 3:dcfbceb81fef | 43 | #define TEXT_X_GAP 0xFFE2 |
CaptainR | 3:dcfbceb81fef | 44 | #define TEXT_Y_GAP 0xFFE1 |
CaptainR | 3:dcfbceb81fef | 45 | #define TEXT_BOLD 0xFFDE |
CaptainR | 3:dcfbceb81fef | 46 | #define TEXT_INVERSE 0xFFDC |
CaptainR | 3:dcfbceb81fef | 47 | #define TEXT_ITALIC 0xFFDD |
CaptainR | 3:dcfbceb81fef | 48 | #define TEXT_OPACITY 0xFFDF |
CaptainR | 3:dcfbceb81fef | 49 | #define TEXT_UNDERLINE 0xFFDB |
CaptainR | 3:dcfbceb81fef | 50 | #define TEXT_ATTRIBUTES 0xFFDA |
CaptainR | 0:a5ef6bc3c2e8 | 51 | |
CaptainR | 12:29f5ad896382 | 52 | // graphics commands |
CaptainR | 5:890ddd974624 | 53 | #define CHANGE_COLOR 0xFFB4 |
CaptainR | 3:dcfbceb81fef | 54 | #define DRAW_CIRCLE 0xFFC3 |
CaptainR | 3:dcfbceb81fef | 55 | #define CIRCLE_FILLED 0xFFC2 |
CaptainR | 3:dcfbceb81fef | 56 | #define DRAW_LINE 0xFFC8 |
CaptainR | 3:dcfbceb81fef | 57 | #define DRAW_RECTANGLE 0xFFC5 |
CaptainR | 3:dcfbceb81fef | 58 | #define RECTANGLE_FILLED 0xFFC4 |
CaptainR | 3:dcfbceb81fef | 59 | #define DRAW_POLYLINE 0x0015 |
CaptainR | 3:dcfbceb81fef | 60 | #define DRAW_POLYGON 0x0013 |
CaptainR | 3:dcfbceb81fef | 61 | #define POLYGON_FILLED 0x0014 |
CaptainR | 3:dcfbceb81fef | 62 | #define DRAW_TRIANGLE 0xFFBF |
CaptainR | 3:dcfbceb81fef | 63 | #define TRIANGLE_FILLED 0xFFA9 |
CaptainR | 4:50511ed54ab4 | 64 | #define CALCULATE_ORBIT 0x0012 |
CaptainR | 6:a1a85f2bc04b | 65 | #define PUT_PIXEL 0xFFC1 |
CaptainR | 6:a1a85f2bc04b | 66 | #define MOVE_ORIGIN 0xFFCC |
CaptainR | 8:b634ac9c92f8 | 67 | #define LINE_TO 0xFFCA |
CaptainR | 9:32eb75c01e9d | 68 | #define SET_CLIP_WINDOW 0xFFB5 |
CaptainR | 9:32eb75c01e9d | 69 | #define CLIPPING 0xFFA2 |
CaptainR | 9:32eb75c01e9d | 70 | #define EXTEND_CLIP 0xFFB3 |
CaptainR | 10:b959bb206e6b | 71 | #define DRAW_ELIPSE 0xFFB2 |
CaptainR | 10:b959bb206e6b | 72 | #define ELIPSE_FILLED 0xFFB1 |
CaptainR | 10:b959bb206e6b | 73 | #define DRAW_BUTTON 0x0011 |
CaptainR | 10:b959bb206e6b | 74 | #define BEVEL_SHADOW 0xFF98 |
CaptainR | 11:3ebd2263f3e9 | 75 | #define BEVEL_WIDTH 0xFF99 |
CaptainR | 10:b959bb206e6b | 76 | #define DRAW_PANEL 0xFFAF |
CaptainR | 10:b959bb206e6b | 77 | #define DRAW_SLIDER 0xFFAE |
CaptainR | 10:b959bb206e6b | 78 | #define SCREEN_CP 0xFFAD |
CaptainR | 11:3ebd2263f3e9 | 79 | #define BG_COLOR 0xFFA4 |
CaptainR | 11:3ebd2263f3e9 | 80 | #define OUTLINE_COLOR 0xFF9D |
CaptainR | 11:3ebd2263f3e9 | 81 | #define CONTRAST 0xFF9C |
CaptainR | 11:3ebd2263f3e9 | 82 | #define FRAME_DELAY 0xFF9F |
CaptainR | 11:3ebd2263f3e9 | 83 | #define LINE_PATERN 0xFF9B |
CaptainR | 11:3ebd2263f3e9 | 84 | #define TRANSPARENCY 0xFFA0 |
CaptainR | 11:3ebd2263f3e9 | 85 | #define TRANSPARENT_COLOR 0xFFA1 |
CaptainR | 11:3ebd2263f3e9 | 86 | #define SET_GRAPHICS 0xFFCE |
CaptainR | 11:3ebd2263f3e9 | 87 | #define GET_GRAPHICS 0xFFA6 |
CaptainR | 12:29f5ad896382 | 88 | #define CLS 0xFFCD |
CaptainR | 8:b634ac9c92f8 | 89 | |
CaptainR | 12:29f5ad896382 | 90 | // media commands |
CaptainR | 12:29f5ad896382 | 91 | #define MEDIA_INIT 0xFF89 |
CaptainR | 12:29f5ad896382 | 92 | #define MEDIA_SET_ADD 0xFF93 |
CaptainR | 12:29f5ad896382 | 93 | #define MEDIA_SET_SECTOR 0xFF92 |
CaptainR | 12:29f5ad896382 | 94 | #define MEDIA_READ_SECTOR 0x0016 |
CaptainR | 12:29f5ad896382 | 95 | #define MEDIA_WRITE_SECTOR 0x0017 |
CaptainR | 16:cb072eea16e9 | 96 | #define MEDIA_READ_BYTE 0xFF8F |
CaptainR | 18:829f3e2c064c | 97 | #define MEDIA_READ_WORD 0xFF8E |
CaptainR | 19:a259bc128867 | 98 | #define MEDIA_WRITE_BYTE 0xFF8D |
CaptainR | 20:88e137b9ea46 | 99 | #define MEDIA_WRITE_WORD 0xFF8C |
CaptainR | 20:88e137b9ea46 | 100 | #define MEDIA_FLUSH 0xFF8A |
CaptainR | 20:88e137b9ea46 | 101 | |
CaptainR | 20:88e137b9ea46 | 102 | // FAT16 file system commands |
CaptainR | 20:88e137b9ea46 | 103 | #define FILE_MOUNT 0xFF03 |
CaptainR | 21:ea68a8a3cea4 | 104 | #define FILE_ERROR 0xFF1F |
CaptainR | 22:cea582ea74c1 | 105 | #define FILE_COUNT 0x0001 |
CaptainR | 22:cea582ea74c1 | 106 | #define FILE_DIR 0x0002 |
CaptainR | 22:cea582ea74c1 | 107 | #define FILE_FIRST 0x0006 |
CaptainR | 22:cea582ea74c1 | 108 | #define FILE_FIRST_RET 0x0024 |
CaptainR | 24:19c77967674e | 109 | #define FILE_NEXT 0xFF1B |
CaptainR | 24:19c77967674e | 110 | #define FILE_NEXT_RET 0x0025 |
CaptainR | 25:015631f9e875 | 111 | #define FILE_EXISTS 0x0005 |
CaptainR | 26:c6a803706a42 | 112 | #define FILE_OPEN 0x000A |
CaptainR | 26:c6a803706a42 | 113 | #define FILE_CLOSE 0xFF18 |
CaptainR | 26:c6a803706a42 | 114 | #define FILE_READ 0x000C |
CaptainR | 26:c6a803706a42 | 115 | #define FILE_SEEK 0xFF16 |
CaptainR | 26:c6a803706a42 | 116 | #define FILE_INDEX 0xFF15 |
CaptainR | 26:c6a803706a42 | 117 | #define FILE_TELL 0x000F |
CaptainR | 26:c6a803706a42 | 118 | #define FILE_WRITE 0x0010 |
CaptainR | 26:c6a803706a42 | 119 | #define FILE_SIZE 0x000E |
CaptainR | 26:c6a803706a42 | 120 | #define FILE_IMAGE 0xFF11 |
CaptainR | 26:c6a803706a42 | 121 | #define FILE_S_CAPTURE 0xFF10 |
CaptainR | 27:dbf79d116497 | 122 | #define FILE_PUT_C 0x |
CaptainR | 27:dbf79d116497 | 123 | #define FILE_GET_C 0x |
CaptainR | 27:dbf79d116497 | 124 | #define FILE_PUT_W 0x |
CaptainR | 27:dbf79d116497 | 125 | #define FILE_GET_W 0xFF0C |
CaptainR | 27:dbf79d116497 | 126 | #define FILE_PUT_S 0x |
CaptainR | 27:dbf79d116497 | 127 | #define FILE_GET_S 0x0007 |
CaptainR | 22:cea582ea74c1 | 128 | #define FILE_ERASE 0x |
CaptainR | 22:cea582ea74c1 | 129 | #define FILE_REWIND 0x |
CaptainR | 22:cea582ea74c1 | 130 | #define FILE_LOAD_F 0x |
CaptainR | 22:cea582ea74c1 | 131 | #define FILE_CALL_F 0x |
CaptainR | 22:cea582ea74c1 | 132 | #define FILE_RUN 0x |
CaptainR | 22:cea582ea74c1 | 133 | #define FILE_EXECUTE 0x |
CaptainR | 22:cea582ea74c1 | 134 | #define FILE_IMAGE_CTRL 0x |
CaptainR | 22:cea582ea74c1 | 135 | #define FILE_UNMOUNT 0x |
CaptainR | 22:cea582ea74c1 | 136 | #define FILE_WAV 0x |
CaptainR | 0:a5ef6bc3c2e8 | 137 | |
CaptainR | 0:a5ef6bc3c2e8 | 138 | |
CaptainR | 0:a5ef6bc3c2e8 | 139 | |
CaptainR | 0:a5ef6bc3c2e8 | 140 | //************************************************************************** |
CaptainR | 3:dcfbceb81fef | 141 | class PICASO_4DGL { |
CaptainR | 0:a5ef6bc3c2e8 | 142 | |
CaptainR | 0:a5ef6bc3c2e8 | 143 | public : |
CaptainR | 0:a5ef6bc3c2e8 | 144 | |
CaptainR | 0:a5ef6bc3c2e8 | 145 | Serial pc; // serial variable for debug information |
CaptainR | 3:dcfbceb81fef | 146 | PICASO_4DGL(PinName tx, PinName rx, PinName rst); // LCD serial construnctor |
CaptainR | 5:890ddd974624 | 147 | int index; // received response from screen |
CaptainR | 6:a1a85f2bc04b | 148 | short Xdest, Ydest; |
CaptainR | 13:1a0800957412 | 149 | char buffer[BUFFER_SIZE]; |
CaptainR | 26:c6a803706a42 | 150 | char fileReadBuf[BUFFER_SIZE]; |
CaptainR | 13:1a0800957412 | 151 | char rxBuf[RXBUFLEN]; |
CaptainR | 14:561cb06a2739 | 152 | char sendBlock[BUFFER_SIZE]; |
CaptainR | 12:29f5ad896382 | 153 | char currentFont; // stores current used font |
CaptainR | 12:29f5ad896382 | 154 | char currentMode; // stores current orientation |
CaptainR | 0:a5ef6bc3c2e8 | 155 | |
CaptainR | 0:a5ef6bc3c2e8 | 156 | // General Commands |
CaptainR | 5:890ddd974624 | 157 | void rxCallback(); |
CaptainR | 0:a5ef6bc3c2e8 | 158 | void reset(); // reset screen |
CaptainR | 0:a5ef6bc3c2e8 | 159 | void baudrate(long); // set baudrate |
CaptainR | 12:29f5ad896382 | 160 | void mainDemo(); // play demo with main functions |
CaptainR | 0:a5ef6bc3c2e8 | 161 | void textDemo(); // play demo with text based functions |
CaptainR | 12:29f5ad896382 | 162 | void graphicsDemo(); // play demo with graphics based functions |
CaptainR | 12:29f5ad896382 | 163 | void mediaDemo(); // play demo with media based functions |
CaptainR | 20:88e137b9ea46 | 164 | void fileSystemDemo(); // play FAT16 demo |
CaptainR | 0:a5ef6bc3c2e8 | 165 | |
CaptainR | 0:a5ef6bc3c2e8 | 166 | // Graphics Commands |
CaptainR | 0:a5ef6bc3c2e8 | 167 | void cls(); // clear screen |
CaptainR | 2:81eaaa491a02 | 168 | void changeColor(short, short); // change one color to another |
CaptainR | 2:81eaaa491a02 | 169 | void drawCircle(short, short, short, short); // draw a circle (x, y, radius, color) |
CaptainR | 3:dcfbceb81fef | 170 | void drawFilledCircle(short, short, short, short); // draw a filled circle (x, y, radius, color) |
CaptainR | 3:dcfbceb81fef | 171 | void drawLine(short, short, short, short, short); // draw a line (x1, y1, x2, y2, color) |
CaptainR | 3:dcfbceb81fef | 172 | void drawRectangle(short, short, short, short, short); // draw a rectangle (x1, y1, x2, y2, color) |
CaptainR | 3:dcfbceb81fef | 173 | void drawFilledRectangle(short, short, short, short, short); // draw a solid rectangle (x1, y1, x2, y2, color) |
CaptainR | 3:dcfbceb81fef | 174 | void drawPolyline(short, short *, short *, short); // draw multiple lines (n, vx1…vxN, vy1…vyN, color) |
CaptainR | 3:dcfbceb81fef | 175 | void drawPolygon(short, short *, short *, short); // draw a polygon (n, vx1…vxN, vy1…vyN, color) |
CaptainR | 3:dcfbceb81fef | 176 | void drawFilledPolygon(short, short *, short *, short); // draw a solid polygon (n, vx1…vxN, vy1…vyN, color) |
CaptainR | 3:dcfbceb81fef | 177 | void drawTriangle(short, short, short, short, short, short, short); // draw a triangle (x1, y1, x2, y2, x3, y3, color) |
CaptainR | 3:dcfbceb81fef | 178 | void drawFilledTriangle(short, short, short, short, short, short, short); // draw a solid triangle (x1, y1, x2, y2, x3, y3, color) |
CaptainR | 10:b959bb206e6b | 179 | void drawElipse(short, short, short, short, short); // draw elipse (x1, y1, xrad, yrad, color) |
CaptainR | 10:b959bb206e6b | 180 | void drawFilledElipse(short, short, short, short, short); // draw a solid elipse (x1, y1, xrad, yrad, color) |
CaptainR | 4:50511ed54ab4 | 181 | void calculateOrbit(short, short); // calculate distant point coordinates (angle, distance) |
CaptainR | 6:a1a85f2bc04b | 182 | void putPixel(short, short, short); // draw a pixel (x, y, color) |
CaptainR | 6:a1a85f2bc04b | 183 | void moveOrigin(short, short); // change origin point (x, y) |
CaptainR | 8:b634ac9c92f8 | 184 | void lineTo(short, short); // draw a line from current origin to set point (x, y) |
CaptainR | 9:32eb75c01e9d | 185 | void setClipWindow(short, short, short, short); // set a clipping window |
CaptainR | 9:32eb75c01e9d | 186 | void clipping(short); // enable / disable clipping |
CaptainR | 9:32eb75c01e9d | 187 | void extendClipRegion(); // extend clipping region to the last text or image shown |
CaptainR | 10:b959bb206e6b | 188 | void drawButton(short, short, short, short, short, short, short, short, char *); // draw a 3D button (state, x, y, btnColor, txtColor, font, txtWidth, txtHeight, string) |
CaptainR | 11:3ebd2263f3e9 | 189 | bool bevelShadow(short); // change the drawButton bevel shadow depth |
CaptainR | 11:3ebd2263f3e9 | 190 | bool bevelWidth(short); // change the drawButton bevel width |
CaptainR | 10:b959bb206e6b | 191 | void drawPanel(short, short, short, short, short, short); // draw a 3D panel (state, x, y, width, height, color) |
CaptainR | 10:b959bb206e6b | 192 | void drawSlider(short, short, short, short, short, short, short, short); // draw a slider bar (mode, x1, y1, x2, y2, color, scale, value) |
CaptainR | 10:b959bb206e6b | 193 | void screenCopyPaste(short, short, short, short, short, short); // copy a portion of screen (xs, ys, xd, yd, width, height) |
CaptainR | 11:3ebd2263f3e9 | 194 | void bgColor(short); // change background color |
CaptainR | 11:3ebd2263f3e9 | 195 | void outlineColor(short); // change outline color |
CaptainR | 11:3ebd2263f3e9 | 196 | void contrast(short); // change display contrast |
CaptainR | 11:3ebd2263f3e9 | 197 | bool frameDelay(short); // set inter frame delay for media video command |
CaptainR | 11:3ebd2263f3e9 | 198 | void linePatern(short); // set the line draw pattern for line drawing |
CaptainR | 11:3ebd2263f3e9 | 199 | void screenMode(char); // set desired orientation of a screen |
CaptainR | 11:3ebd2263f3e9 | 200 | void transparency(short); // turn on or off transparency |
CaptainR | 11:3ebd2263f3e9 | 201 | void transparentColor(short); // change transparent to color |
CaptainR | 11:3ebd2263f3e9 | 202 | void setGraphics(short, short); // set graphics parameters |
CaptainR | 11:3ebd2263f3e9 | 203 | short getGraphics(short); // get graphics parameters |
CaptainR | 2:81eaaa491a02 | 204 | |
CaptainR | 12:29f5ad896382 | 205 | // Media Commands |
CaptainR | 12:29f5ad896382 | 206 | short media_Init(); // initialise memory card |
CaptainR | 12:29f5ad896382 | 207 | bool media_SetAdd(int); // set byte address |
CaptainR | 12:29f5ad896382 | 208 | bool media_SetSector(int); // set sector address |
CaptainR | 13:1a0800957412 | 209 | bool media_RdSector(); // read sector |
CaptainR | 13:1a0800957412 | 210 | bool media_WrSector(char *); // write sector |
CaptainR | 14:561cb06a2739 | 211 | bool media_WrData(char *, int); // write sector |
CaptainR | 16:cb072eea16e9 | 212 | bool media_ReadByte(); // read byte |
CaptainR | 19:a259bc128867 | 213 | bool media_ReadWord(); // read word |
CaptainR | 19:a259bc128867 | 214 | bool media_WriteByte(short); // write byte |
CaptainR | 20:88e137b9ea46 | 215 | bool media_WriteWord(short); // write word |
CaptainR | 20:88e137b9ea46 | 216 | bool media_Flush(); // flush written bytes or words |
CaptainR | 12:29f5ad896382 | 217 | |
CaptainR | 0:a5ef6bc3c2e8 | 218 | // Texts Commands |
CaptainR | 0:a5ef6bc3c2e8 | 219 | void setFont(char); // set desired font from embedded fonts |
CaptainR | 0:a5ef6bc3c2e8 | 220 | char moveCursor(short, short); // move cursot to a specific location |
CaptainR | 0:a5ef6bc3c2e8 | 221 | char validateMoveCursor(short, short); // check if requested values are not out of range, based on font and orientation |
CaptainR | 2:81eaaa491a02 | 222 | void textBgColor(short); // set background color of next text messages |
CaptainR | 0:a5ef6bc3c2e8 | 223 | void putc(char); // send a single character to LCD |
CaptainR | 0:a5ef6bc3c2e8 | 224 | void puts(char *); // send a string to LCD |
CaptainR | 2:81eaaa491a02 | 225 | void textFgColor(short); // set text color |
CaptainR | 2:81eaaa491a02 | 226 | int textWidth(short); // set width of a text |
CaptainR | 2:81eaaa491a02 | 227 | int textHeight(short); // set text height |
CaptainR | 2:81eaaa491a02 | 228 | int textXGap(short); // set gap between characters in pixels (X axis) |
CaptainR | 2:81eaaa491a02 | 229 | int textYGap(short); // set gap between characters in pixels (Y axis) |
CaptainR | 2:81eaaa491a02 | 230 | void textBold(short); // set text to bold |
CaptainR | 2:81eaaa491a02 | 231 | void textInverse(short); // invert text BG and FG colors |
CaptainR | 2:81eaaa491a02 | 232 | void textItalic(short); // set text to italic |
CaptainR | 2:81eaaa491a02 | 233 | void textOpacity(short); // set text opacity |
CaptainR | 2:81eaaa491a02 | 234 | void textUnderline(short); // set text to underline |
CaptainR | 2:81eaaa491a02 | 235 | void textAttributes(short); // set 4 attributes (bold, italic, inverse, underline) |
CaptainR | 0:a5ef6bc3c2e8 | 236 | |
CaptainR | 18:829f3e2c064c | 237 | // Response commands |
CaptainR | 18:829f3e2c064c | 238 | bool getResponse(int); // wait for LCD response |
CaptainR | 18:829f3e2c064c | 239 | bool calculateOrbitResponse(); // wait for LCD response |
CaptainR | 18:829f3e2c064c | 240 | short getGraphicsResponse(); // wait for LCD response |
CaptainR | 18:829f3e2c064c | 241 | short mediaInitResponse(); // response from mediaInit command |
CaptainR | 18:829f3e2c064c | 242 | bool readSectorResponse(int); // response from read sector command |
CaptainR | 18:829f3e2c064c | 243 | bool writeSectorResponse(int); // response from write sector command |
CaptainR | 18:829f3e2c064c | 244 | bool readResponse(); // response from read byte or read word commands |
CaptainR | 19:a259bc128867 | 245 | bool writeByteResponse(); // response from write sector command |
CaptainR | 21:ea68a8a3cea4 | 246 | bool fileMountResponse(); // response from file mount |
CaptainR | 21:ea68a8a3cea4 | 247 | short fileErrorResponse(); // returns error code |
CaptainR | 22:cea582ea74c1 | 248 | short fileCountResponse(); // returns searched file count |
CaptainR | 23:dd2c28fa4dfd | 249 | short getFilenameResponse(char*); // returns searched filename and length |
CaptainR | 26:c6a803706a42 | 250 | short readFileResponse(short); // returns count of bytes and stores read data in buffer |
CaptainR | 26:c6a803706a42 | 251 | int fileTellResponse(); // returns current pointer |
CaptainR | 0:a5ef6bc3c2e8 | 252 | |
CaptainR | 20:88e137b9ea46 | 253 | // File system commands |
CaptainR | 20:88e137b9ea46 | 254 | bool file_Mount(); // mount file system |
CaptainR | 21:ea68a8a3cea4 | 255 | short file_Error(); // get latest error code |
CaptainR | 22:cea582ea74c1 | 256 | short file_Count(char*); // get file count by given name |
CaptainR | 22:cea582ea74c1 | 257 | short file_Dir(char*); // list the stream of filenames by given name and return count |
CaptainR | 22:cea582ea74c1 | 258 | void file_FindFirst(char*); // list the stream of filenames by given name |
CaptainR | 23:dd2c28fa4dfd | 259 | short file_FindFirstRet(char*, char*); // list the stream of filenames by given name |
CaptainR | 24:19c77967674e | 260 | void file_FindNext(); // list the stream of filenames by given name |
CaptainR | 24:19c77967674e | 261 | short file_FindNextRet(char*); // list the stream of filenames by given name |
CaptainR | 25:015631f9e875 | 262 | bool file_Exists(char*); // search for file |
CaptainR | 26:c6a803706a42 | 263 | short file_Open(char*, char); // open a file if exists |
CaptainR | 26:c6a803706a42 | 264 | bool file_Close(short); // closes a file |
CaptainR | 26:c6a803706a42 | 265 | short file_Read(short, short); // read specified bytes from file and return count (size, handle) |
CaptainR | 26:c6a803706a42 | 266 | bool file_Seek(short, short, short); // set pointer in file |
CaptainR | 26:c6a803706a42 | 267 | bool file_Index(short, short, short, short); // set pointer in file |
CaptainR | 26:c6a803706a42 | 268 | int file_Tell(short); // returns current pointer position |
CaptainR | 26:c6a803706a42 | 269 | short file_Write(short, char*, short); // write data to file (count of bytes, string of data, handle) |
CaptainR | 26:c6a803706a42 | 270 | int file_Size(short); // returns file size in bytes (useful not to get EOF error |
CaptainR | 26:c6a803706a42 | 271 | bool file_Image(short, short, short); // display an image |
CaptainR | 26:c6a803706a42 | 272 | bool file_ScreenCapture(short, short, short, short, short); // make a screenshot |
CaptainR | 26:c6a803706a42 | 273 | |
CaptainR | 27:dbf79d116497 | 274 | short file_GetW(short); // read 2 bytes from a file |
CaptainR | 27:dbf79d116497 | 275 | short file_GetS(short, short, char*); // read specified set of bytes from a file (size, handle, stringTo) |
CaptainR | 27:dbf79d116497 | 276 | |
CaptainR | 0:a5ef6bc3c2e8 | 277 | protected : |
CaptainR | 0:a5ef6bc3c2e8 | 278 | |
CaptainR | 2:81eaaa491a02 | 279 | Serial _cmd; // serial variable, to comunicate with screen |
CaptainR | 2:81eaaa491a02 | 280 | DigitalOut _rst; // screen reset pin |
CaptainR | 4:50511ed54ab4 | 281 | |
CaptainR | 4:50511ed54ab4 | 282 | |
CaptainR | 0:a5ef6bc3c2e8 | 283 | void freeBUFFER (void); |
CaptainR | 0:a5ef6bc3c2e8 | 284 | void writeBYTE (char); |
CaptainR | 2:81eaaa491a02 | 285 | void writeCOMMAND(char *, int); // send command to screen |
CaptainR | 15:86bdf382e6f7 | 286 | void writeCOMMAND_2(char *, int); // send command to screen |
CaptainR | 0:a5ef6bc3c2e8 | 287 | }; |
CaptainR | 26:c6a803706a42 | 288 | |
CaptainR | 26:c6a803706a42 | 289 | #endif |