Rihards Balass / 4DGL-mbed-32PTU
Committer:
CaptainR
Date:
Mon Sep 26 10:51:02 2016 +0000
Revision:
20:88e137b9ea46
Parent:
19:a259bc128867
Child:
21:ea68a8a3cea4
started on file system

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 18:829f3e2c064c 103 #define MEDIA_READ_WORD 0xFF8E
CaptainR 19:a259bc128867 104 #define MEDIA_WRITE_BYTE 0xFF8D
CaptainR 20:88e137b9ea46 105 #define MEDIA_WRITE_WORD 0xFF8C
CaptainR 20:88e137b9ea46 106 #define MEDIA_FLUSH 0xFF8A
CaptainR 20:88e137b9ea46 107
CaptainR 20:88e137b9ea46 108 // FAT16 file system commands
CaptainR 20:88e137b9ea46 109 #define FILE_MOUNT 0xFF03
CaptainR 0:a5ef6bc3c2e8 110
CaptainR 0:a5ef6bc3c2e8 111
CaptainR 0:a5ef6bc3c2e8 112 // Screen answers
CaptainR 0:a5ef6bc3c2e8 113 #define ACK 0x06
CaptainR 8:b634ac9c92f8 114 #define NACK 0x15
CaptainR 0:a5ef6bc3c2e8 115
CaptainR 0:a5ef6bc3c2e8 116 // Predefined Fonts
CaptainR 2:81eaaa491a02 117 #define FONT1 0x0000
CaptainR 2:81eaaa491a02 118 #define FONT2 0x0001
CaptainR 2:81eaaa491a02 119 #define FONT3 0x0002
CaptainR 0:a5ef6bc3c2e8 120
CaptainR 0:a5ef6bc3c2e8 121 // Line and column values depending on orientation and font F1LL = font1 landscape line
CaptainR 0:a5ef6bc3c2e8 122 #define F1LL 29
CaptainR 0:a5ef6bc3c2e8 123 #define F1LC 44
CaptainR 0:a5ef6bc3c2e8 124 #define F1PL 39
CaptainR 0:a5ef6bc3c2e8 125 #define F1PC 33
CaptainR 0:a5ef6bc3c2e8 126
CaptainR 0:a5ef6bc3c2e8 127 #define F2LL 29
CaptainR 0:a5ef6bc3c2e8 128 #define F2LC 39
CaptainR 0:a5ef6bc3c2e8 129 #define F2PL 39
CaptainR 0:a5ef6bc3c2e8 130 #define F2PC 29
CaptainR 0:a5ef6bc3c2e8 131
CaptainR 0:a5ef6bc3c2e8 132 #define F3LL 19
CaptainR 0:a5ef6bc3c2e8 133 #define F3LC 39
CaptainR 0:a5ef6bc3c2e8 134 #define F3PL 26
CaptainR 0:a5ef6bc3c2e8 135 #define F3PC 29
CaptainR 0:a5ef6bc3c2e8 136
CaptainR 0:a5ef6bc3c2e8 137 // Data speed
CaptainR 2:81eaaa491a02 138 #define BAUD_300 0x0001
CaptainR 2:81eaaa491a02 139 #define BAUD_600 0x0002
CaptainR 2:81eaaa491a02 140 #define BAUD_1200 0x0003
CaptainR 2:81eaaa491a02 141 #define BAUD_2400 0x0004
CaptainR 2:81eaaa491a02 142 #define BAUD_4800 0x0005
CaptainR 2:81eaaa491a02 143 #define BAUD_9600 0x0006
CaptainR 2:81eaaa491a02 144 #define BAUD_14400 0x0007
CaptainR 2:81eaaa491a02 145 #define BAUD_19200 0x0008
CaptainR 2:81eaaa491a02 146 #define BAUD_31250 0x0009
CaptainR 2:81eaaa491a02 147 #define BAUD_38400 0x000A
CaptainR 2:81eaaa491a02 148 #define BAUD_56000 0x000B
CaptainR 2:81eaaa491a02 149 #define BAUD_57600 0x000C
CaptainR 2:81eaaa491a02 150 #define BAUD_115200 0x000D
CaptainR 2:81eaaa491a02 151 #define BAUD_128000 0x000E
CaptainR 2:81eaaa491a02 152 #define BAUD_256000 0x000F
CaptainR 2:81eaaa491a02 153 #define BAUD_300000 0x0010
CaptainR 2:81eaaa491a02 154 #define BAUD_375000 0x0011
CaptainR 2:81eaaa491a02 155 #define BAUD_500000 0x0012
CaptainR 2:81eaaa491a02 156 #define BAUD_600000 0x0013
CaptainR 0:a5ef6bc3c2e8 157
CaptainR 3:dcfbceb81fef 158 // Defined colors
CaptainR 2:81eaaa491a02 159 #define Black 0x0000
CaptainR 2:81eaaa491a02 160 #define Navy 0x000F
CaptainR 2:81eaaa491a02 161 #define DGreen 0x03E0
CaptainR 2:81eaaa491a02 162 #define DCyan 0x03EF
CaptainR 2:81eaaa491a02 163 #define Purple 0x780F
CaptainR 2:81eaaa491a02 164 #define Olive 0x7BE0
CaptainR 2:81eaaa491a02 165 #define Grey 0x8410
CaptainR 2:81eaaa491a02 166 #define Blue 0x001F
CaptainR 2:81eaaa491a02 167 #define Green 0x07E0
CaptainR 2:81eaaa491a02 168 #define Red 0xF800
CaptainR 2:81eaaa491a02 169 #define Yellow 0xFFE0
CaptainR 2:81eaaa491a02 170 #define White 0xFFFF
CaptainR 2:81eaaa491a02 171 #define Orange 0xFD20
CaptainR 2:81eaaa491a02 172 #define GYellow 0xAFE5
CaptainR 2:81eaaa491a02 173 #define Pink 0xF81F
CaptainR 2:81eaaa491a02 174 #define Violet 0x901A
CaptainR 2:81eaaa491a02 175 #define Aqua 0x07FF
CaptainR 2:81eaaa491a02 176 #define Cream 0xFFDE
CaptainR 0:a5ef6bc3c2e8 177
CaptainR 0:a5ef6bc3c2e8 178 // Screen orientation
CaptainR 2:81eaaa491a02 179 #define LANDSCAPE 0x0000
CaptainR 2:81eaaa491a02 180 #define LANDSCAPE_R 0x0001
CaptainR 2:81eaaa491a02 181 #define PORTRAIT 0x0002
CaptainR 2:81eaaa491a02 182 #define PORTRAIT_R 0x0003
CaptainR 0:a5ef6bc3c2e8 183
CaptainR 0:a5ef6bc3c2e8 184 // Parameters
CaptainR 2:81eaaa491a02 185 #define ENABLE 1
CaptainR 2:81eaaa491a02 186 #define DISABLE 0
CaptainR 10:b959bb206e6b 187 // orientation
CaptainR 2:81eaaa491a02 188 #define landscape 1
CaptainR 2:81eaaa491a02 189 #define landscapeRew 2
CaptainR 2:81eaaa491a02 190 #define portrait 3
CaptainR 2:81eaaa491a02 191 #define portraitRew 4
CaptainR 10:b959bb206e6b 192 // text attributes
CaptainR 2:81eaaa491a02 193 #define bold 16
CaptainR 2:81eaaa491a02 194 #define italic 32
CaptainR 2:81eaaa491a02 195 #define inverse 64
CaptainR 2:81eaaa491a02 196 #define underline 128
CaptainR 10:b959bb206e6b 197 // Fonts
CaptainR 2:81eaaa491a02 198 #define font1 1
CaptainR 2:81eaaa491a02 199 #define font2 2
CaptainR 2:81eaaa491a02 200 #define font3 3
CaptainR 10:b959bb206e6b 201 // Receive buffer length
CaptainR 13:1a0800957412 202 #define RXBUFLEN 1024
CaptainR 12:29f5ad896382 203 #define BUFFER_SIZE 512
CaptainR 10:b959bb206e6b 204 // 3D states
CaptainR 10:b959bb206e6b 205 #define DEPRESSED 0
CaptainR 12:29f5ad896382 206 #define RECESSED 0
CaptainR 10:b959bb206e6b 207 #define INDENTED 0
CaptainR 10:b959bb206e6b 208 #define RAISED 1
CaptainR 10:b959bb206e6b 209 #define HIDDEN 2
CaptainR 11:3ebd2263f3e9 210 // set graphic parameters
CaptainR 11:3ebd2263f3e9 211 #define objColor 18
CaptainR 11:3ebd2263f3e9 212 #define scrResolution 32
CaptainR 11:3ebd2263f3e9 213 #define pageDisplay 33
CaptainR 11:3ebd2263f3e9 214 #define pageRead 34
CaptainR 11:3ebd2263f3e9 215 #define pageWrite 35
CaptainR 11:3ebd2263f3e9 216 // get graphic parameters
CaptainR 11:3ebd2263f3e9 217 #define currentXMax 0
CaptainR 11:3ebd2263f3e9 218 #define currentYMax 1
CaptainR 11:3ebd2263f3e9 219 #define lastObjLeft 2
CaptainR 11:3ebd2263f3e9 220 #define lastObjTop 3
CaptainR 11:3ebd2263f3e9 221 #define lastObjRight 4
CaptainR 11:3ebd2263f3e9 222 #define lastObjBot 5
CaptainR 11:3ebd2263f3e9 223 // Screen resolution
CaptainR 11:3ebd2263f3e9 224 #define res320x240 0
CaptainR 11:3ebd2263f3e9 225 #define res640x480 1
CaptainR 11:3ebd2263f3e9 226 #define res800x480 2
CaptainR 0:a5ef6bc3c2e8 227
CaptainR 0:a5ef6bc3c2e8 228 //**************************************************************************
CaptainR 3:dcfbceb81fef 229 class PICASO_4DGL {
CaptainR 0:a5ef6bc3c2e8 230
CaptainR 0:a5ef6bc3c2e8 231 public :
CaptainR 0:a5ef6bc3c2e8 232
CaptainR 0:a5ef6bc3c2e8 233 Serial pc; // serial variable for debug information
CaptainR 3:dcfbceb81fef 234 PICASO_4DGL(PinName tx, PinName rx, PinName rst); // LCD serial construnctor
CaptainR 5:890ddd974624 235 int index; // received response from screen
CaptainR 6:a1a85f2bc04b 236 short Xdest, Ydest;
CaptainR 13:1a0800957412 237 char buffer[BUFFER_SIZE];
CaptainR 13:1a0800957412 238 char rxBuf[RXBUFLEN];
CaptainR 14:561cb06a2739 239 char sendBlock[BUFFER_SIZE];
CaptainR 12:29f5ad896382 240 char currentFont; // stores current used font
CaptainR 12:29f5ad896382 241 char currentMode; // stores current orientation
CaptainR 0:a5ef6bc3c2e8 242
CaptainR 0:a5ef6bc3c2e8 243 // General Commands
CaptainR 5:890ddd974624 244 void rxCallback();
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 20:88e137b9ea46 251 void fileSystemDemo(); // play FAT16 demo
CaptainR 0:a5ef6bc3c2e8 252
CaptainR 0:a5ef6bc3c2e8 253 // Graphics Commands
CaptainR 0:a5ef6bc3c2e8 254 void cls(); // clear screen
CaptainR 2:81eaaa491a02 255 void changeColor(short, short); // change one color to another
CaptainR 2:81eaaa491a02 256 void drawCircle(short, short, short, short); // draw a circle (x, y, radius, color)
CaptainR 3:dcfbceb81fef 257 void drawFilledCircle(short, short, short, short); // draw a filled circle (x, y, radius, color)
CaptainR 3:dcfbceb81fef 258 void drawLine(short, short, short, short, short); // draw a line (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 259 void drawRectangle(short, short, short, short, short); // draw a rectangle (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 260 void drawFilledRectangle(short, short, short, short, short); // draw a solid rectangle (x1, y1, x2, y2, color)
CaptainR 3:dcfbceb81fef 261 void drawPolyline(short, short *, short *, short); // draw multiple lines (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 262 void drawPolygon(short, short *, short *, short); // draw a polygon (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 263 void drawFilledPolygon(short, short *, short *, short); // draw a solid polygon (n, vx1…vxN, vy1…vyN, color)
CaptainR 3:dcfbceb81fef 264 void drawTriangle(short, short, short, short, short, short, short); // draw a triangle (x1, y1, x2, y2, x3, y3, color)
CaptainR 3:dcfbceb81fef 265 void drawFilledTriangle(short, short, short, short, short, short, short); // draw a solid triangle (x1, y1, x2, y2, x3, y3, color)
CaptainR 10:b959bb206e6b 266 void drawElipse(short, short, short, short, short); // draw elipse (x1, y1, xrad, yrad, color)
CaptainR 10:b959bb206e6b 267 void drawFilledElipse(short, short, short, short, short); // draw a solid elipse (x1, y1, xrad, yrad, color)
CaptainR 4:50511ed54ab4 268 void calculateOrbit(short, short); // calculate distant point coordinates (angle, distance)
CaptainR 6:a1a85f2bc04b 269 void putPixel(short, short, short); // draw a pixel (x, y, color)
CaptainR 6:a1a85f2bc04b 270 void moveOrigin(short, short); // change origin point (x, y)
CaptainR 8:b634ac9c92f8 271 void lineTo(short, short); // draw a line from current origin to set point (x, y)
CaptainR 9:32eb75c01e9d 272 void setClipWindow(short, short, short, short); // set a clipping window
CaptainR 9:32eb75c01e9d 273 void clipping(short); // enable / disable clipping
CaptainR 9:32eb75c01e9d 274 void extendClipRegion(); // extend clipping region to the last text or image shown
CaptainR 10:b959bb206e6b 275 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 276 bool bevelShadow(short); // change the drawButton bevel shadow depth
CaptainR 11:3ebd2263f3e9 277 bool bevelWidth(short); // change the drawButton bevel width
CaptainR 10:b959bb206e6b 278 void drawPanel(short, short, short, short, short, short); // draw a 3D panel (state, x, y, width, height, color)
CaptainR 10:b959bb206e6b 279 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 280 void screenCopyPaste(short, short, short, short, short, short); // copy a portion of screen (xs, ys, xd, yd, width, height)
CaptainR 11:3ebd2263f3e9 281 void bgColor(short); // change background color
CaptainR 11:3ebd2263f3e9 282 void outlineColor(short); // change outline color
CaptainR 11:3ebd2263f3e9 283 void contrast(short); // change display contrast
CaptainR 11:3ebd2263f3e9 284 bool frameDelay(short); // set inter frame delay for media video command
CaptainR 11:3ebd2263f3e9 285 void linePatern(short); // set the line draw pattern for line drawing
CaptainR 11:3ebd2263f3e9 286 void screenMode(char); // set desired orientation of a screen
CaptainR 11:3ebd2263f3e9 287 void transparency(short); // turn on or off transparency
CaptainR 11:3ebd2263f3e9 288 void transparentColor(short); // change transparent to color
CaptainR 11:3ebd2263f3e9 289 void setGraphics(short, short); // set graphics parameters
CaptainR 11:3ebd2263f3e9 290 short getGraphics(short); // get graphics parameters
CaptainR 2:81eaaa491a02 291
CaptainR 12:29f5ad896382 292 // Media Commands
CaptainR 12:29f5ad896382 293 short media_Init(); // initialise memory card
CaptainR 12:29f5ad896382 294 bool media_SetAdd(int); // set byte address
CaptainR 12:29f5ad896382 295 bool media_SetSector(int); // set sector address
CaptainR 13:1a0800957412 296 bool media_RdSector(); // read sector
CaptainR 13:1a0800957412 297 bool media_WrSector(char *); // write sector
CaptainR 14:561cb06a2739 298 bool media_WrData(char *, int); // write sector
CaptainR 16:cb072eea16e9 299 bool media_ReadByte(); // read byte
CaptainR 19:a259bc128867 300 bool media_ReadWord(); // read word
CaptainR 19:a259bc128867 301 bool media_WriteByte(short); // write byte
CaptainR 20:88e137b9ea46 302 bool media_WriteWord(short); // write word
CaptainR 20:88e137b9ea46 303 bool media_Flush(); // flush written bytes or words
CaptainR 12:29f5ad896382 304
CaptainR 0:a5ef6bc3c2e8 305 // Texts Commands
CaptainR 0:a5ef6bc3c2e8 306 void setFont(char); // set desired font from embedded fonts
CaptainR 0:a5ef6bc3c2e8 307 char moveCursor(short, short); // move cursot to a specific location
CaptainR 0:a5ef6bc3c2e8 308 char validateMoveCursor(short, short); // check if requested values are not out of range, based on font and orientation
CaptainR 2:81eaaa491a02 309 void textBgColor(short); // set background color of next text messages
CaptainR 0:a5ef6bc3c2e8 310 void putc(char); // send a single character to LCD
CaptainR 0:a5ef6bc3c2e8 311 void puts(char *); // send a string to LCD
CaptainR 2:81eaaa491a02 312 void textFgColor(short); // set text color
CaptainR 2:81eaaa491a02 313 int textWidth(short); // set width of a text
CaptainR 2:81eaaa491a02 314 int textHeight(short); // set text height
CaptainR 2:81eaaa491a02 315 int textXGap(short); // set gap between characters in pixels (X axis)
CaptainR 2:81eaaa491a02 316 int textYGap(short); // set gap between characters in pixels (Y axis)
CaptainR 2:81eaaa491a02 317 void textBold(short); // set text to bold
CaptainR 2:81eaaa491a02 318 void textInverse(short); // invert text BG and FG colors
CaptainR 2:81eaaa491a02 319 void textItalic(short); // set text to italic
CaptainR 2:81eaaa491a02 320 void textOpacity(short); // set text opacity
CaptainR 2:81eaaa491a02 321 void textUnderline(short); // set text to underline
CaptainR 2:81eaaa491a02 322 void textAttributes(short); // set 4 attributes (bold, italic, inverse, underline)
CaptainR 0:a5ef6bc3c2e8 323
CaptainR 18:829f3e2c064c 324 // Response commands
CaptainR 18:829f3e2c064c 325 bool getResponse(int); // wait for LCD response
CaptainR 18:829f3e2c064c 326 bool calculateOrbitResponse(); // wait for LCD response
CaptainR 18:829f3e2c064c 327 short getGraphicsResponse(); // wait for LCD response
CaptainR 18:829f3e2c064c 328 short mediaInitResponse(); // response from mediaInit command
CaptainR 18:829f3e2c064c 329 bool readSectorResponse(int); // response from read sector command
CaptainR 18:829f3e2c064c 330 bool writeSectorResponse(int); // response from write sector command
CaptainR 18:829f3e2c064c 331 bool readResponse(); // response from read byte or read word commands
CaptainR 19:a259bc128867 332 bool writeByteResponse(); // response from write sector command
CaptainR 20:88e137b9ea46 333 bool fileMountResponse(); // response from write sector command
CaptainR 0:a5ef6bc3c2e8 334
CaptainR 20:88e137b9ea46 335 // File system commands
CaptainR 20:88e137b9ea46 336 bool file_Mount(); // mount file system
CaptainR 20:88e137b9ea46 337
CaptainR 0:a5ef6bc3c2e8 338 protected :
CaptainR 0:a5ef6bc3c2e8 339
CaptainR 2:81eaaa491a02 340 Serial _cmd; // serial variable, to comunicate with screen
CaptainR 2:81eaaa491a02 341 DigitalOut _rst; // screen reset pin
CaptainR 4:50511ed54ab4 342
CaptainR 4:50511ed54ab4 343
CaptainR 0:a5ef6bc3c2e8 344 void freeBUFFER (void);
CaptainR 0:a5ef6bc3c2e8 345 void writeBYTE (char);
CaptainR 2:81eaaa491a02 346 void writeCOMMAND(char *, int); // send command to screen
CaptainR 15:86bdf382e6f7 347 void writeCOMMAND_2(char *, int); // send command to screen
CaptainR 0:a5ef6bc3c2e8 348 };