Rihards Balass / 4DGL-mbed-32PTU
Committer:
CaptainR
Date:
Thu Sep 15 12:26:58 2016 +0000
Revision:
16:cb072eea16e9
Parent:
15:86bdf382e6f7
Child:
18:829f3e2c064c
read byte

Who changed what in which revision?

UserRevisionLine numberNew 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 0:a5ef6bc3c2e8 19 #include "mbed.h"
CaptainR 0:a5ef6bc3c2e8 20
CaptainR 0:a5ef6bc3c2e8 21 #ifndef DEBUGMODE
CaptainR 0:a5ef6bc3c2e8 22 #define DEBUGMODE 1
CaptainR 0:a5ef6bc3c2e8 23 #endif
CaptainR 0:a5ef6bc3c2e8 24
CaptainR 12:29f5ad896382 25 #ifndef DEMO
CaptainR 12:29f5ad896382 26 #define DEMO 1
CaptainR 12:29f5ad896382 27 #endif
CaptainR 12:29f5ad896382 28
CaptainR 0:a5ef6bc3c2e8 29 // functions
CaptainR 2:81eaaa491a02 30 #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) // to check if required bit is set
CaptainR 0:a5ef6bc3c2e8 31
CaptainR 0:a5ef6bc3c2e8 32 // Common WAIT value in millisecond
CaptainR 12:29f5ad896382 33 #define TEMPO 1
CaptainR 12:29f5ad896382 34 #define MAX_WAIT 10
CaptainR 0:a5ef6bc3c2e8 35
CaptainR 12:29f5ad896382 36 // Main commands
CaptainR 3:dcfbceb81fef 37 #define BAUDRATE 0x0026
CaptainR 3:dcfbceb81fef 38 #define ORIENTATION 0xFF9E
CaptainR 0:a5ef6bc3c2e8 39
CaptainR 12:29f5ad896382 40 // text commands
CaptainR 5:890ddd974624 41 #define TEXT_BG_COLOR 0xFFE6
CaptainR 3:dcfbceb81fef 42 #define SET_FONT 0xFFE5
CaptainR 3:dcfbceb81fef 43 #define PUT_CHAR 0xFFFE
CaptainR 3:dcfbceb81fef 44 #define PUT_STRING 0x0018
CaptainR 3:dcfbceb81fef 45 #define MOVE_CURSOR 0xFFE9
CaptainR 3:dcfbceb81fef 46 #define TEXT_FG_COLOR 0xFFE7
CaptainR 3:dcfbceb81fef 47 #define TEXT_WIDTH 0xFFE4
CaptainR 3:dcfbceb81fef 48 #define TEXT_HEIGHT 0xFFE3
CaptainR 3:dcfbceb81fef 49 #define TEXT_X_GAP 0xFFE2
CaptainR 3:dcfbceb81fef 50 #define TEXT_Y_GAP 0xFFE1
CaptainR 3:dcfbceb81fef 51 #define TEXT_BOLD 0xFFDE
CaptainR 3:dcfbceb81fef 52 #define TEXT_INVERSE 0xFFDC
CaptainR 3:dcfbceb81fef 53 #define TEXT_ITALIC 0xFFDD
CaptainR 3:dcfbceb81fef 54 #define TEXT_OPACITY 0xFFDF
CaptainR 3:dcfbceb81fef 55 #define TEXT_UNDERLINE 0xFFDB
CaptainR 3:dcfbceb81fef 56 #define TEXT_ATTRIBUTES 0xFFDA
CaptainR 0:a5ef6bc3c2e8 57
CaptainR 12:29f5ad896382 58 // graphics commands
CaptainR 5:890ddd974624 59 #define CHANGE_COLOR 0xFFB4
CaptainR 3:dcfbceb81fef 60 #define DRAW_CIRCLE 0xFFC3
CaptainR 3:dcfbceb81fef 61 #define CIRCLE_FILLED 0xFFC2
CaptainR 3:dcfbceb81fef 62 #define DRAW_LINE 0xFFC8
CaptainR 3:dcfbceb81fef 63 #define DRAW_RECTANGLE 0xFFC5
CaptainR 3:dcfbceb81fef 64 #define RECTANGLE_FILLED 0xFFC4
CaptainR 3:dcfbceb81fef 65 #define DRAW_POLYLINE 0x0015
CaptainR 3:dcfbceb81fef 66 #define DRAW_POLYGON 0x0013
CaptainR 3:dcfbceb81fef 67 #define POLYGON_FILLED 0x0014
CaptainR 3:dcfbceb81fef 68 #define DRAW_TRIANGLE 0xFFBF
CaptainR 3:dcfbceb81fef 69 #define TRIANGLE_FILLED 0xFFA9
CaptainR 4:50511ed54ab4 70 #define CALCULATE_ORBIT 0x0012
CaptainR 6:a1a85f2bc04b 71 #define PUT_PIXEL 0xFFC1
CaptainR 6:a1a85f2bc04b 72 #define MOVE_ORIGIN 0xFFCC
CaptainR 8:b634ac9c92f8 73 #define LINE_TO 0xFFCA
CaptainR 9:32eb75c01e9d 74 #define SET_CLIP_WINDOW 0xFFB5
CaptainR 9:32eb75c01e9d 75 #define CLIPPING 0xFFA2
CaptainR 9:32eb75c01e9d 76 #define EXTEND_CLIP 0xFFB3
CaptainR 10:b959bb206e6b 77 #define DRAW_ELIPSE 0xFFB2
CaptainR 10:b959bb206e6b 78 #define ELIPSE_FILLED 0xFFB1
CaptainR 10:b959bb206e6b 79 #define DRAW_BUTTON 0x0011
CaptainR 10:b959bb206e6b 80 #define BEVEL_SHADOW 0xFF98
CaptainR 11:3ebd2263f3e9 81 #define BEVEL_WIDTH 0xFF99
CaptainR 10:b959bb206e6b 82 #define DRAW_PANEL 0xFFAF
CaptainR 10:b959bb206e6b 83 #define DRAW_SLIDER 0xFFAE
CaptainR 10:b959bb206e6b 84 #define SCREEN_CP 0xFFAD
CaptainR 11:3ebd2263f3e9 85 #define BG_COLOR 0xFFA4
CaptainR 11:3ebd2263f3e9 86 #define OUTLINE_COLOR 0xFF9D
CaptainR 11:3ebd2263f3e9 87 #define CONTRAST 0xFF9C
CaptainR 11:3ebd2263f3e9 88 #define FRAME_DELAY 0xFF9F
CaptainR 11:3ebd2263f3e9 89 #define LINE_PATERN 0xFF9B
CaptainR 11:3ebd2263f3e9 90 #define TRANSPARENCY 0xFFA0
CaptainR 11:3ebd2263f3e9 91 #define TRANSPARENT_COLOR 0xFFA1
CaptainR 11:3ebd2263f3e9 92 #define SET_GRAPHICS 0xFFCE
CaptainR 11:3ebd2263f3e9 93 #define GET_GRAPHICS 0xFFA6
CaptainR 12:29f5ad896382 94 #define CLS 0xFFCD
CaptainR 8:b634ac9c92f8 95
CaptainR 12:29f5ad896382 96 // media commands
CaptainR 12:29f5ad896382 97 #define MEDIA_INIT 0xFF89
CaptainR 12:29f5ad896382 98 #define MEDIA_SET_ADD 0xFF93
CaptainR 12:29f5ad896382 99 #define MEDIA_SET_SECTOR 0xFF92
CaptainR 12:29f5ad896382 100 #define MEDIA_READ_SECTOR 0x0016
CaptainR 12:29f5ad896382 101 #define MEDIA_WRITE_SECTOR 0x0017
CaptainR 16:cb072eea16e9 102 #define MEDIA_READ_BYTE 0xFF8F
CaptainR 0:a5ef6bc3c2e8 103
CaptainR 0:a5ef6bc3c2e8 104
CaptainR 0:a5ef6bc3c2e8 105 // Screen answers
CaptainR 0:a5ef6bc3c2e8 106 #define ACK 0x06
CaptainR 8:b634ac9c92f8 107 #define NACK 0x15
CaptainR 0:a5ef6bc3c2e8 108
CaptainR 0:a5ef6bc3c2e8 109 // Predefined Fonts
CaptainR 2:81eaaa491a02 110 #define FONT1 0x0000
CaptainR 2:81eaaa491a02 111 #define FONT2 0x0001
CaptainR 2:81eaaa491a02 112 #define FONT3 0x0002
CaptainR 0:a5ef6bc3c2e8 113
CaptainR 0:a5ef6bc3c2e8 114 // Line and column values depending on orientation and font F1LL = font1 landscape line
CaptainR 0:a5ef6bc3c2e8 115 #define F1LL 29
CaptainR 0:a5ef6bc3c2e8 116 #define F1LC 44
CaptainR 0:a5ef6bc3c2e8 117 #define F1PL 39
CaptainR 0:a5ef6bc3c2e8 118 #define F1PC 33
CaptainR 0:a5ef6bc3c2e8 119
CaptainR 0:a5ef6bc3c2e8 120 #define F2LL 29
CaptainR 0:a5ef6bc3c2e8 121 #define F2LC 39
CaptainR 0:a5ef6bc3c2e8 122 #define F2PL 39
CaptainR 0:a5ef6bc3c2e8 123 #define F2PC 29
CaptainR 0:a5ef6bc3c2e8 124
CaptainR 0:a5ef6bc3c2e8 125 #define F3LL 19
CaptainR 0:a5ef6bc3c2e8 126 #define F3LC 39
CaptainR 0:a5ef6bc3c2e8 127 #define F3PL 26
CaptainR 0:a5ef6bc3c2e8 128 #define F3PC 29
CaptainR 0:a5ef6bc3c2e8 129
CaptainR 0:a5ef6bc3c2e8 130 // Data speed
CaptainR 2:81eaaa491a02 131 #define BAUD_300 0x0001
CaptainR 2:81eaaa491a02 132 #define BAUD_600 0x0002
CaptainR 2:81eaaa491a02 133 #define BAUD_1200 0x0003
CaptainR 2:81eaaa491a02 134 #define BAUD_2400 0x0004
CaptainR 2:81eaaa491a02 135 #define BAUD_4800 0x0005
CaptainR 2:81eaaa491a02 136 #define BAUD_9600 0x0006
CaptainR 2:81eaaa491a02 137 #define BAUD_14400 0x0007
CaptainR 2:81eaaa491a02 138 #define BAUD_19200 0x0008
CaptainR 2:81eaaa491a02 139 #define BAUD_31250 0x0009
CaptainR 2:81eaaa491a02 140 #define BAUD_38400 0x000A
CaptainR 2:81eaaa491a02 141 #define BAUD_56000 0x000B
CaptainR 2:81eaaa491a02 142 #define BAUD_57600 0x000C
CaptainR 2:81eaaa491a02 143 #define BAUD_115200 0x000D
CaptainR 2:81eaaa491a02 144 #define BAUD_128000 0x000E
CaptainR 2:81eaaa491a02 145 #define BAUD_256000 0x000F
CaptainR 2:81eaaa491a02 146 #define BAUD_300000 0x0010
CaptainR 2:81eaaa491a02 147 #define BAUD_375000 0x0011
CaptainR 2:81eaaa491a02 148 #define BAUD_500000 0x0012
CaptainR 2:81eaaa491a02 149 #define BAUD_600000 0x0013
CaptainR 0:a5ef6bc3c2e8 150
CaptainR 3:dcfbceb81fef 151 // Defined colors
CaptainR 2:81eaaa491a02 152 #define Black 0x0000
CaptainR 2:81eaaa491a02 153 #define Navy 0x000F
CaptainR 2:81eaaa491a02 154 #define DGreen 0x03E0
CaptainR 2:81eaaa491a02 155 #define DCyan 0x03EF
CaptainR 2:81eaaa491a02 156 #define Purple 0x780F
CaptainR 2:81eaaa491a02 157 #define Olive 0x7BE0
CaptainR 2:81eaaa491a02 158 #define Grey 0x8410
CaptainR 2:81eaaa491a02 159 #define Blue 0x001F
CaptainR 2:81eaaa491a02 160 #define Green 0x07E0
CaptainR 2:81eaaa491a02 161 #define Red 0xF800
CaptainR 2:81eaaa491a02 162 #define Yellow 0xFFE0
CaptainR 2:81eaaa491a02 163 #define White 0xFFFF
CaptainR 2:81eaaa491a02 164 #define Orange 0xFD20
CaptainR 2:81eaaa491a02 165 #define GYellow 0xAFE5
CaptainR 2:81eaaa491a02 166 #define Pink 0xF81F
CaptainR 2:81eaaa491a02 167 #define Violet 0x901A
CaptainR 2:81eaaa491a02 168 #define Aqua 0x07FF
CaptainR 2:81eaaa491a02 169 #define Cream 0xFFDE
CaptainR 0:a5ef6bc3c2e8 170
CaptainR 0:a5ef6bc3c2e8 171 // Screen orientation
CaptainR 2:81eaaa491a02 172 #define LANDSCAPE 0x0000
CaptainR 2:81eaaa491a02 173 #define LANDSCAPE_R 0x0001
CaptainR 2:81eaaa491a02 174 #define PORTRAIT 0x0002
CaptainR 2:81eaaa491a02 175 #define PORTRAIT_R 0x0003
CaptainR 0:a5ef6bc3c2e8 176
CaptainR 0:a5ef6bc3c2e8 177 // Parameters
CaptainR 2:81eaaa491a02 178 #define ENABLE 1
CaptainR 2:81eaaa491a02 179 #define DISABLE 0
CaptainR 10:b959bb206e6b 180 // orientation
CaptainR 2:81eaaa491a02 181 #define landscape 1
CaptainR 2:81eaaa491a02 182 #define landscapeRew 2
CaptainR 2:81eaaa491a02 183 #define portrait 3
CaptainR 2:81eaaa491a02 184 #define portraitRew 4
CaptainR 10:b959bb206e6b 185 // text attributes
CaptainR 2:81eaaa491a02 186 #define bold 16
CaptainR 2:81eaaa491a02 187 #define italic 32
CaptainR 2:81eaaa491a02 188 #define inverse 64
CaptainR 2:81eaaa491a02 189 #define underline 128
CaptainR 10:b959bb206e6b 190 // Fonts
CaptainR 2:81eaaa491a02 191 #define font1 1
CaptainR 2:81eaaa491a02 192 #define font2 2
CaptainR 2:81eaaa491a02 193 #define font3 3
CaptainR 10:b959bb206e6b 194 // Receive buffer length
CaptainR 13:1a0800957412 195 #define RXBUFLEN 1024
CaptainR 12:29f5ad896382 196 #define BUFFER_SIZE 512
CaptainR 10:b959bb206e6b 197 // 3D states
CaptainR 10:b959bb206e6b 198 #define DEPRESSED 0
CaptainR 12:29f5ad896382 199 #define RECESSED 0
CaptainR 10:b959bb206e6b 200 #define INDENTED 0
CaptainR 10:b959bb206e6b 201 #define RAISED 1
CaptainR 10:b959bb206e6b 202 #define HIDDEN 2
CaptainR 11:3ebd2263f3e9 203 // set graphic parameters
CaptainR 11:3ebd2263f3e9 204 #define objColor 18
CaptainR 11:3ebd2263f3e9 205 #define scrResolution 32
CaptainR 11:3ebd2263f3e9 206 #define pageDisplay 33
CaptainR 11:3ebd2263f3e9 207 #define pageRead 34
CaptainR 11:3ebd2263f3e9 208 #define pageWrite 35
CaptainR 11:3ebd2263f3e9 209 // get graphic parameters
CaptainR 11:3ebd2263f3e9 210 #define currentXMax 0
CaptainR 11:3ebd2263f3e9 211 #define currentYMax 1
CaptainR 11:3ebd2263f3e9 212 #define lastObjLeft 2
CaptainR 11:3ebd2263f3e9 213 #define lastObjTop 3
CaptainR 11:3ebd2263f3e9 214 #define lastObjRight 4
CaptainR 11:3ebd2263f3e9 215 #define lastObjBot 5
CaptainR 11:3ebd2263f3e9 216 // Screen resolution
CaptainR 11:3ebd2263f3e9 217 #define res320x240 0
CaptainR 11:3ebd2263f3e9 218 #define res640x480 1
CaptainR 11:3ebd2263f3e9 219 #define res800x480 2
CaptainR 0:a5ef6bc3c2e8 220
CaptainR 0:a5ef6bc3c2e8 221 //**************************************************************************
CaptainR 3:dcfbceb81fef 222 class PICASO_4DGL {
CaptainR 0:a5ef6bc3c2e8 223
CaptainR 0:a5ef6bc3c2e8 224 public :
CaptainR 0:a5ef6bc3c2e8 225
CaptainR 0:a5ef6bc3c2e8 226 Serial pc; // serial variable for debug information
CaptainR 3:dcfbceb81fef 227 PICASO_4DGL(PinName tx, PinName rx, PinName rst); // LCD serial construnctor
CaptainR 5:890ddd974624 228 int index; // received response from screen
CaptainR 6:a1a85f2bc04b 229 short Xdest, Ydest;
CaptainR 13:1a0800957412 230 char buffer[BUFFER_SIZE];
CaptainR 13:1a0800957412 231 char rxBuf[RXBUFLEN];
CaptainR 14:561cb06a2739 232 char sendBlock[BUFFER_SIZE];
CaptainR 12:29f5ad896382 233 char currentFont; // stores current used font
CaptainR 12:29f5ad896382 234 char currentMode; // stores current orientation
CaptainR 0:a5ef6bc3c2e8 235
CaptainR 0:a5ef6bc3c2e8 236 // General Commands
CaptainR 5:890ddd974624 237 void rxCallback();
CaptainR 12:29f5ad896382 238 bool getResponse(int); // wait for LCD response
CaptainR 12:29f5ad896382 239 bool calculateOrbitResponse(); // wait for LCD response
CaptainR 11:3ebd2263f3e9 240 short getGraphicsResponse(); // wait for LCD response
CaptainR 12:29f5ad896382 241 short mediaInitResponse(); // response from mediaInit command
CaptainR 14:561cb06a2739 242 bool readSectorResponse(int); // response from read sector command
CaptainR 14:561cb06a2739 243 bool writeSectorResponse(int); // response from write sector command
CaptainR 16:cb072eea16e9 244 bool readByteResponse(int); // response from read sector command
CaptainR 0:a5ef6bc3c2e8 245 void reset(); // reset screen
CaptainR 0:a5ef6bc3c2e8 246 void baudrate(long); // set baudrate
CaptainR 12:29f5ad896382 247 void mainDemo(); // play demo with main functions
CaptainR 0:a5ef6bc3c2e8 248 void textDemo(); // play demo with text based functions
CaptainR 12:29f5ad896382 249 void graphicsDemo(); // play demo with graphics based functions
CaptainR 12:29f5ad896382 250 void mediaDemo(); // play demo with media based functions
CaptainR 0:a5ef6bc3c2e8 251
CaptainR 0:a5ef6bc3c2e8 252 // Graphics Commands
CaptainR 0:a5ef6bc3c2e8 253 void cls(); // clear screen
CaptainR 2:81eaaa491a02 254 void changeColor(short, short); // change one color to another
CaptainR 2:81eaaa491a02 255 void drawCircle(short, short, short, short); // draw a circle (x, y, radius, color)
CaptainR 3:dcfbceb81fef 256 void drawFilledCircle(short, short, short, short); // draw a filled circle (x, y, radius, color)
CaptainR 3:dcfbceb81fef 257 void drawLine(short, short, short, short, short); // draw a line (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 258 void drawRectangle(short, short, short, short, short); // draw a rectangle (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 259 void drawFilledRectangle(short, short, short, short, short); // draw a solid rectangle (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 260 void drawPolyline(short, short *, short *, short); // draw multiple lines (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 261 void drawPolygon(short, short *, short *, short); // draw a polygon (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 262 void drawFilledPolygon(short, short *, short *, short); // draw a solid polygon (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 263 void drawTriangle(short, short, short, short, short, short, short); // draw a triangle (x1, y1, x2, y2, x3, y3, color)
CaptainR 3:dcfbceb81fef 264 void drawFilledTriangle(short, short, short, short, short, short, short); // draw a solid triangle (x1, y1, x2, y2, x3, y3, color)
CaptainR 10:b959bb206e6b 265 void drawElipse(short, short, short, short, short); // draw elipse (x1, y1, xrad, yrad, color)
CaptainR 10:b959bb206e6b 266 void drawFilledElipse(short, short, short, short, short); // draw a solid elipse (x1, y1, xrad, yrad, color)
CaptainR 4:50511ed54ab4 267 void calculateOrbit(short, short); // calculate distant point coordinates (angle, distance)
CaptainR 6:a1a85f2bc04b 268 void putPixel(short, short, short); // draw a pixel (x, y, color)
CaptainR 6:a1a85f2bc04b 269 void moveOrigin(short, short); // change origin point (x, y)
CaptainR 8:b634ac9c92f8 270 void lineTo(short, short); // draw a line from current origin to set point (x, y)
CaptainR 9:32eb75c01e9d 271 void setClipWindow(short, short, short, short); // set a clipping window
CaptainR 9:32eb75c01e9d 272 void clipping(short); // enable / disable clipping
CaptainR 9:32eb75c01e9d 273 void extendClipRegion(); // extend clipping region to the last text or image shown
CaptainR 10:b959bb206e6b 274 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 275 bool bevelShadow(short); // change the drawButton bevel shadow depth
CaptainR 11:3ebd2263f3e9 276 bool bevelWidth(short); // change the drawButton bevel width
CaptainR 10:b959bb206e6b 277 void drawPanel(short, short, short, short, short, short); // draw a 3D panel (state, x, y, width, height, color)
CaptainR 10:b959bb206e6b 278 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 279 void screenCopyPaste(short, short, short, short, short, short); // copy a portion of screen (xs, ys, xd, yd, width, height)
CaptainR 11:3ebd2263f3e9 280 void bgColor(short); // change background color
CaptainR 11:3ebd2263f3e9 281 void outlineColor(short); // change outline color
CaptainR 11:3ebd2263f3e9 282 void contrast(short); // change display contrast
CaptainR 11:3ebd2263f3e9 283 bool frameDelay(short); // set inter frame delay for media video command
CaptainR 11:3ebd2263f3e9 284 void linePatern(short); // set the line draw pattern for line drawing
CaptainR 11:3ebd2263f3e9 285 void screenMode(char); // set desired orientation of a screen
CaptainR 11:3ebd2263f3e9 286 void transparency(short); // turn on or off transparency
CaptainR 11:3ebd2263f3e9 287 void transparentColor(short); // change transparent to color
CaptainR 11:3ebd2263f3e9 288 void setGraphics(short, short); // set graphics parameters
CaptainR 11:3ebd2263f3e9 289 short getGraphics(short); // get graphics parameters
CaptainR 2:81eaaa491a02 290
CaptainR 12:29f5ad896382 291 // Media Commands
CaptainR 12:29f5ad896382 292 short media_Init(); // initialise memory card
CaptainR 12:29f5ad896382 293 bool media_SetAdd(int); // set byte address
CaptainR 12:29f5ad896382 294 bool media_SetSector(int); // set sector address
CaptainR 13:1a0800957412 295 bool media_RdSector(); // read sector
CaptainR 13:1a0800957412 296 bool media_WrSector(char *); // write sector
CaptainR 14:561cb06a2739 297 bool media_WrData(char *, int); // write sector
CaptainR 16:cb072eea16e9 298 bool media_ReadByte(); // read byte
CaptainR 16:cb072eea16e9 299 bool media_ReadWord(); // read byte
CaptainR 12:29f5ad896382 300
CaptainR 0:a5ef6bc3c2e8 301 // Texts Commands
CaptainR 0:a5ef6bc3c2e8 302 void setFont(char); // set desired font from embedded fonts
CaptainR 0:a5ef6bc3c2e8 303 char moveCursor(short, short); // move cursot to a specific location
CaptainR 0:a5ef6bc3c2e8 304 char validateMoveCursor(short, short); // check if requested values are not out of range, based on font and orientation
CaptainR 2:81eaaa491a02 305 void textBgColor(short); // set background color of next text messages
CaptainR 0:a5ef6bc3c2e8 306 void putc(char); // send a single character to LCD
CaptainR 0:a5ef6bc3c2e8 307 void puts(char *); // send a string to LCD
CaptainR 2:81eaaa491a02 308 void textFgColor(short); // set text color
CaptainR 2:81eaaa491a02 309 int textWidth(short); // set width of a text
CaptainR 2:81eaaa491a02 310 int textHeight(short); // set text height
CaptainR 2:81eaaa491a02 311 int textXGap(short); // set gap between characters in pixels (X axis)
CaptainR 2:81eaaa491a02 312 int textYGap(short); // set gap between characters in pixels (Y axis)
CaptainR 2:81eaaa491a02 313 void textBold(short); // set text to bold
CaptainR 2:81eaaa491a02 314 void textInverse(short); // invert text BG and FG colors
CaptainR 2:81eaaa491a02 315 void textItalic(short); // set text to italic
CaptainR 2:81eaaa491a02 316 void textOpacity(short); // set text opacity
CaptainR 2:81eaaa491a02 317 void textUnderline(short); // set text to underline
CaptainR 2:81eaaa491a02 318 void textAttributes(short); // set 4 attributes (bold, italic, inverse, underline)
CaptainR 0:a5ef6bc3c2e8 319
CaptainR 0:a5ef6bc3c2e8 320
CaptainR 0:a5ef6bc3c2e8 321 protected :
CaptainR 0:a5ef6bc3c2e8 322
CaptainR 2:81eaaa491a02 323 Serial _cmd; // serial variable, to comunicate with screen
CaptainR 2:81eaaa491a02 324 DigitalOut _rst; // screen reset pin
CaptainR 4:50511ed54ab4 325
CaptainR 4:50511ed54ab4 326
CaptainR 0:a5ef6bc3c2e8 327 void freeBUFFER (void);
CaptainR 0:a5ef6bc3c2e8 328 void writeBYTE (char);
CaptainR 2:81eaaa491a02 329 void writeCOMMAND(char *, int); // send command to screen
CaptainR 15:86bdf382e6f7 330 void writeCOMMAND_2(char *, int); // send command to screen
CaptainR 0:a5ef6bc3c2e8 331 };