Added custom fonts. Added triangle drawing function

Dependents:   sc100016x4lcd REVO_Updated_Steering Driving_game Arkanoid_v1 ... more

Committer:
DimiterK
Date:
Wed Jan 05 00:01:45 2011 +0000
Revision:
1:a368f2688222
Parent:
0:135b9a0a816e
Child:
2:03d27b3fce6e
Improved documentation.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DimiterK 1:a368f2688222 1 /*************************************************************************
DimiterK 1:a368f2688222 2 Copyright (c) 2010 Dimiter Kentri
DimiterK 1:a368f2688222 3
DimiterK 1:a368f2688222 4 Permission is hereby granted, free of charge, to any person obtaining a copy
DimiterK 1:a368f2688222 5 of this software and associated documentation files (the "Software"), to deal
DimiterK 1:a368f2688222 6 in the Software without restriction, including without limitation the rights
DimiterK 1:a368f2688222 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
DimiterK 1:a368f2688222 8 copies of the Software, and to permit persons to whom the Software is
DimiterK 1:a368f2688222 9 furnished to do so, subject to the following conditions:
DimiterK 1:a368f2688222 10
DimiterK 1:a368f2688222 11 The above copyright notice and this permission notice shall be included in
DimiterK 1:a368f2688222 12 all copies or substantial portions of the Software.
DimiterK 1:a368f2688222 13
DimiterK 1:a368f2688222 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
DimiterK 1:a368f2688222 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
DimiterK 1:a368f2688222 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DimiterK 1:a368f2688222 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
DimiterK 1:a368f2688222 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
DimiterK 1:a368f2688222 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
DimiterK 1:a368f2688222 20 THE SOFTWARE.
DimiterK 1:a368f2688222 21 *******************************************************************************/
DimiterK 1:a368f2688222 22
DimiterK 0:135b9a0a816e 23 #ifndef KS0108_H
DimiterK 0:135b9a0a816e 24 #define KS0108_H
DimiterK 0:135b9a0a816e 25
DimiterK 0:135b9a0a816e 26 #define VERSION 1
DimiterK 0:135b9a0a816e 27
DimiterK 0:135b9a0a816e 28 #include "mbed.h"
DimiterK 1:a368f2688222 29 #include "SystemFont5x7.h"
DimiterK 0:135b9a0a816e 30
DimiterK 0:135b9a0a816e 31 /************************************************************************************/
DimiterK 0:135b9a0a816e 32 // Commands
DimiterK 1:a368f2688222 33 #define LCD_ON 0x3F
DimiterK 1:a368f2688222 34 #define LCD_OFF 0x3E
DimiterK 1:a368f2688222 35 #define LCD_SET_ADD 0x40
DimiterK 1:a368f2688222 36 #define LCD_SET_PAGE 0xB8
DimiterK 1:a368f2688222 37 #define LCD_DISP_START 0xC0
DimiterK 0:135b9a0a816e 38
DimiterK 0:135b9a0a816e 39 //Controller directives
DimiterK 1:a368f2688222 40 #define LEFT 1
DimiterK 1:a368f2688222 41 #define RIGHT 2
DimiterK 1:a368f2688222 42 #define BOTH 3
DimiterK 1:a368f2688222 43 #define NONE 4
DimiterK 0:135b9a0a816e 44
DimiterK 0:135b9a0a816e 45 // Colors
DimiterK 1:a368f2688222 46 #define BLACK 0xFF
DimiterK 1:a368f2688222 47 #define WHITE 0x00
DimiterK 0:135b9a0a816e 48
DimiterK 0:135b9a0a816e 49 //Screen dimensions
DimiterK 1:a368f2688222 50 #define SCREEN_HEIGHT 64
DimiterK 1:a368f2688222 51 #define SCREEN_WIDTH 128
DimiterK 0:135b9a0a816e 52
DimiterK 0:135b9a0a816e 53 /***********************************************************************************/
DimiterK 0:135b9a0a816e 54
DimiterK 0:135b9a0a816e 55 #define absDiff(x,y) ((x>y) ? (x-y) : (y-x))
DimiterK 0:135b9a0a816e 56 #define swap(a,b) \
DimiterK 0:135b9a0a816e 57 do\
DimiterK 0:135b9a0a816e 58 {\
DimiterK 0:135b9a0a816e 59 uint8_t t;\
DimiterK 1:a368f2688222 60 t=a;\
DimiterK 1:a368f2688222 61 a=b;\
DimiterK 1:a368f2688222 62 b=t;\
DimiterK 0:135b9a0a816e 63 } while(0)
DimiterK 0:135b9a0a816e 64
DimiterK 0:135b9a0a816e 65
DimiterK 0:135b9a0a816e 66 /**************************************************************************************/
DimiterK 0:135b9a0a816e 67
DimiterK 0:135b9a0a816e 68 // Font Indices
DimiterK 1:a368f2688222 69 #define FONT_LENGTH 0
DimiterK 1:a368f2688222 70 #define FONT_FIXED_WIDTH 2
DimiterK 1:a368f2688222 71 #define FONT_HEIGHT 3
DimiterK 1:a368f2688222 72 #define FONT_FIRST_CHAR 4
DimiterK 1:a368f2688222 73 #define FONT_CHAR_COUNT 5
DimiterK 1:a368f2688222 74 #define FONT_WIDTH_TABLE 6
DimiterK 0:135b9a0a816e 75
DimiterK 0:135b9a0a816e 76
DimiterK 0:135b9a0a816e 77 typedef struct {
DimiterK 1:a368f2688222 78 unsigned int x;
DimiterK 1:a368f2688222 79 unsigned int y;
DimiterK 1:a368f2688222 80 unsigned int page;
DimiterK 0:135b9a0a816e 81 } LCDCoord;
DimiterK 0:135b9a0a816e 82
DimiterK 0:135b9a0a816e 83
DimiterK 0:135b9a0a816e 84 /****************************************************************************************/
DimiterK 0:135b9a0a816e 85
DimiterK 0:135b9a0a816e 86
DimiterK 0:135b9a0a816e 87 class KS0108 {
DimiterK 1:a368f2688222 88 public:
DimiterK 1:a368f2688222 89 /*Constructor, initializes the lcd on the respective pins.
DimiterK 1:a368f2688222 90 *
DimiterK 1:a368f2688222 91 *@param pins
DimiterK 1:a368f2688222 92 *@param databus
DimiterK 1:a368f2688222 93 */
DimiterK 1:a368f2688222 94
DimiterK 1:a368f2688222 95 KS0108 (PinName _RST,PinName _DI, PinName _RW, PinName _E, PinName _CS1, PinName _CS2, PinName DB0, PinName DB1, PinName DB2, PinName DB3, PinName DB4, PinName DB5, PinName DB6, PinName DB7);
DimiterK 1:a368f2688222 96
DimiterK 1:a368f2688222 97 /*Write instruction to the specific controller.
DimiterK 1:a368f2688222 98 *
DimiterK 1:a368f2688222 99 *@param Command command to send
DimiterK 1:a368f2688222 100 *@param side controller side can be LEFT or RIGHT
DimiterK 1:a368f2688222 101 *@return none
DimiterK 1:a368f2688222 102 *
DimiterK 1:a368f2688222 103 */
DimiterK 1:a368f2688222 104 void WriteInstruction(unsigned int Command,unsigned int side);
DimiterK 1:a368f2688222 105
DimiterK 1:a368f2688222 106 /*Write data to the controller.
DimiterK 1:a368f2688222 107 *
DimiterK 1:a368f2688222 108 *@param data data to send
DimiterK 1:a368f2688222 109 *@param side controller side can be LEFT or RIGHT
DimiterK 1:a368f2688222 110 *
DimiterK 1:a368f2688222 111 *@return none
DimiterK 1:a368f2688222 112 */
DimiterK 1:a368f2688222 113 void WriteData(unsigned int data ,unsigned char side);
DimiterK 1:a368f2688222 114
DimiterK 1:a368f2688222 115 /*Write data to the screen on specific page and column
DimiterK 1:a368f2688222 116 *
DimiterK 1:a368f2688222 117 *@param page page varies from0-7 for each side
DimiterK 1:a368f2688222 118 *@param col col varies from 0-64 for each side
DimiterK 1:a368f2688222 119 *@param data info to be written on given coordinates
DimiterK 1:a368f2688222 120 *@return none
DimiterK 1:a368f2688222 121 *
DimiterK 1:a368f2688222 122 */
DimiterK 1:a368f2688222 123 void WriteDataColPag(unsigned int page, unsigned int col, unsigned int data);
DimiterK 1:a368f2688222 124
DimiterK 1:a368f2688222 125
DimiterK 1:a368f2688222 126 /*Read data from diplay
DimiterK 1:a368f2688222 127 *
DimiterK 1:a368f2688222 128 *@param none
DimiterK 1:a368f2688222 129 *@return data
DimiterK 1:a368f2688222 130 *
DimiterK 1:a368f2688222 131 */
DimiterK 1:a368f2688222 132 unsigned int ReadData();
DimiterK 1:a368f2688222 133
DimiterK 1:a368f2688222 134 /*Read status of display , and check if it's busy
DimiterK 1:a368f2688222 135 *
DimiterK 1:a368f2688222 136 *@param none
DimiterK 1:a368f2688222 137 *@return status status of display
DimiterK 1:a368f2688222 138 *
DimiterK 1:a368f2688222 139 */
DimiterK 1:a368f2688222 140 unsigned int ReadStatus();
DimiterK 1:a368f2688222 141
DimiterK 1:a368f2688222 142 /*Select controller
DimiterK 1:a368f2688222 143 *
DimiterK 1:a368f2688222 144 *@param side controller side can be LEFT or RIGHT
DimiterK 1:a368f2688222 145 *@return none
DimiterK 1:a368f2688222 146 *
DimiterK 1:a368f2688222 147 */
DimiterK 1:a368f2688222 148 void SelectSide(unsigned char side);
DimiterK 0:135b9a0a816e 149
DimiterK 1:a368f2688222 150 /*Clears display
DimiterK 1:a368f2688222 151 *
DimiterK 1:a368f2688222 152 *@param none
DimiterK 1:a368f2688222 153 *@return none
DimiterK 1:a368f2688222 154 *
DimiterK 1:a368f2688222 155 */
DimiterK 1:a368f2688222 156 void ClearScreen();
DimiterK 1:a368f2688222 157
DimiterK 1:a368f2688222 158 /*******************************Graphic functions************************************************/
DimiterK 1:a368f2688222 159
DimiterK 1:a368f2688222 160 /*Set pixel to specific location on the screen.
DimiterK 1:a368f2688222 161 *@param x page varies from 0-128
DimiterK 1:a368f2688222 162 *@param y col varies from 0-64
DimiterK 1:a368f2688222 163 *@param color color of pixel, can be BLACK or WHITE
DimiterK 1:a368f2688222 164 *@return none
DimiterK 1:a368f2688222 165 *
DimiterK 1:a368f2688222 166 */
DimiterK 1:a368f2688222 167 void SetPixel( unsigned int x, unsigned int y, unsigned int color);
DimiterK 1:a368f2688222 168
DimiterK 1:a368f2688222 169
DimiterK 1:a368f2688222 170 /*Draw a horizontal line
DimiterK 1:a368f2688222 171 *@param Xaxis1
DimiterK 1:a368f2688222 172 *@param Xaxis2
DimiterK 1:a368f2688222 173 *@param Yaxis
DimiterK 1:a368f2688222 174 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 175 *@return none
DimiterK 1:a368f2688222 176 *
DimiterK 1:a368f2688222 177 */
DimiterK 1:a368f2688222 178 void HLine(unsigned int Xaxis1, unsigned int Xaxis2 ,unsigned int Yaxis,unsigned int color);
DimiterK 0:135b9a0a816e 179
DimiterK 1:a368f2688222 180 /*Draw a horizontal line
DimiterK 1:a368f2688222 181 *@param Xaxis1
DimiterK 1:a368f2688222 182 *@param Xaxis2
DimiterK 1:a368f2688222 183 *@param Yaxis
DimiterK 1:a368f2688222 184 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 185 *@return none
DimiterK 1:a368f2688222 186 *
DimiterK 1:a368f2688222 187 */
DimiterK 1:a368f2688222 188 void HLineShort(unsigned int Xaxis, unsigned int Yaxis,unsigned int width ,unsigned int color);
DimiterK 1:a368f2688222 189
DimiterK 1:a368f2688222 190 /*Draw a vertical line
DimiterK 1:a368f2688222 191 *@param Xaxis1
DimiterK 1:a368f2688222 192 *@param Xaxis2
DimiterK 1:a368f2688222 193 *@param Yaxis
DimiterK 1:a368f2688222 194 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 195 *@return none
DimiterK 1:a368f2688222 196 *
DimiterK 1:a368f2688222 197 */
DimiterK 1:a368f2688222 198 void VLine(unsigned int Xaxis, unsigned int Yaxis1 ,unsigned int Yaxis2,unsigned int color);
DimiterK 1:a368f2688222 199
DimiterK 1:a368f2688222 200 /*Draw a vertical line
DimiterK 1:a368f2688222 201 *@param Xaxis1
DimiterK 1:a368f2688222 202 *@param Xaxis2
DimiterK 1:a368f2688222 203 *@param Yaxis
DimiterK 1:a368f2688222 204 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 205 *@return none
DimiterK 1:a368f2688222 206 *
DimiterK 1:a368f2688222 207 */
DimiterK 1:a368f2688222 208 void VLineShort(unsigned int Xaxis,unsigned int Yaxis, unsigned int height ,unsigned int color);
DimiterK 1:a368f2688222 209
DimiterK 1:a368f2688222 210
DimiterK 1:a368f2688222 211 /*
DimiterK 1:a368f2688222 212 *Draws a line from x1,y1 to x2,y2
DimiterK 1:a368f2688222 213 *@param lX1 x coordinate of one side
DimiterK 1:a368f2688222 214 *@param lY1 y coordinate of one side
DimiterK 1:a368f2688222 215 *@param lX2 x coordinate of other side
DimiterK 1:a368f2688222 216 *@param lY2 y coordinate of other side
DimiterK 1:a368f2688222 217 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 218 *@return none
DimiterK 1:a368f2688222 219 *
DimiterK 1:a368f2688222 220 */
DimiterK 1:a368f2688222 221 void Line(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2, unsigned int color);
DimiterK 0:135b9a0a816e 222
DimiterK 0:135b9a0a816e 223
DimiterK 1:a368f2688222 224 /*
DimiterK 1:a368f2688222 225 *Draws a slanty line .
DimiterK 1:a368f2688222 226 *@param lX1 x coordinate of one side
DimiterK 1:a368f2688222 227 *@param lY1 y coordinate of one side
DimiterK 1:a368f2688222 228 *@param lX2 x coordinate of other side
DimiterK 1:a368f2688222 229 *@param lY2 y coordinate of other side
DimiterK 1:a368f2688222 230 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 231 *@return none
DimiterK 1:a368f2688222 232 *
DimiterK 1:a368f2688222 233 */
DimiterK 1:a368f2688222 234 void SlantyLine(unsigned int lX1, unsigned int lY1, unsigned int lX2,unsigned int lY2,unsigned int color);
DimiterK 1:a368f2688222 235
DimiterK 1:a368f2688222 236 /*
DimiterK 1:a368f2688222 237 *Draws a line from x,y at given degree from inner_radius to outer_radius.
DimiterK 1:a368f2688222 238 *@param Xaxis1
DimiterK 1:a368f2688222 239 *@param Xaxis2
DimiterK 1:a368f2688222 240 *@param Yaxis
DimiterK 1:a368f2688222 241 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 242 *@return none
DimiterK 1:a368f2688222 243 *
DimiterK 1:a368f2688222 244 */
DimiterK 1:a368f2688222 245 void DegreeLine(unsigned int x, int y,unsigned int degree,unsigned int inner_radius,unsigned int outer_radius, unsigned int color);
DimiterK 1:a368f2688222 246
DimiterK 1:a368f2688222 247 /*Draw a filled reactangle
DimiterK 1:a368f2688222 248 *
DimiterK 1:a368f2688222 249 *@param Xaxis1
DimiterK 1:a368f2688222 250 *@param Yaxis1
DimiterK 1:a368f2688222 251 *@param Xaxis2
DimiterK 1:a368f2688222 252 *@param Yaxis2
DimiterK 1:a368f2688222 253 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 254 *@return none
DimiterK 1:a368f2688222 255 *
DimiterK 1:a368f2688222 256 */
DimiterK 1:a368f2688222 257 void FullRectangle(unsigned int Xaxis1, unsigned int Yaxis1, unsigned int Xaxis2 ,unsigned int Yaxis2,unsigned int color);
DimiterK 1:a368f2688222 258
DimiterK 1:a368f2688222 259 /*Draw an empty rectangle
DimiterK 1:a368f2688222 260 *@param Xaxis1
DimiterK 1:a368f2688222 261 *@param Yaxis1
DimiterK 1:a368f2688222 262 *@param Xaxis2
DimiterK 1:a368f2688222 263 *@param Yaxis2
DimiterK 1:a368f2688222 264 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 265 *@return none
DimiterK 1:a368f2688222 266 *
DimiterK 1:a368f2688222 267 */
DimiterK 1:a368f2688222 268 void EmptyRectangle(unsigned int Xaxis1,unsigned int Yaxis1, unsigned int Xaxis2,unsigned int Yaxis2,unsigned int color);
DimiterK 1:a368f2688222 269
DimiterK 1:a368f2688222 270
DimiterK 1:a368f2688222 271 /*Draw a rectangle with round corners
DimiterK 1:a368f2688222 272 *@param Xaxis1
DimiterK 1:a368f2688222 273 *@param Yaxis1
DimiterK 1:a368f2688222 274 *@param Xaxis2
DimiterK 1:a368f2688222 275 *@param Yaxis2
DimiterK 1:a368f2688222 276 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 277 *@return none
DimiterK 1:a368f2688222 278 *
DimiterK 1:a368f2688222 279 */
DimiterK 1:a368f2688222 280 void RoundRectangle(unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int radius, unsigned int color);
DimiterK 1:a368f2688222 281
DimiterK 1:a368f2688222 282
DimiterK 1:a368f2688222 283 /*
DimiterK 1:a368f2688222 284 *Draws an empty circle centered a x,y with radius R and specific color.
DimiterK 1:a368f2688222 285 *@param lX1 x coordinate of one side
DimiterK 1:a368f2688222 286 *@param lY1 y coordinate of one side
DimiterK 1:a368f2688222 287 *@param lX2 x coordinate of other side
DimiterK 1:a368f2688222 288 *@param lY2 y coordinate of other side
DimiterK 1:a368f2688222 289 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 290 *@return none
DimiterK 1:a368f2688222 291 *
DimiterK 1:a368f2688222 292 */
DimiterK 1:a368f2688222 293 void EmptyCircle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius,unsigned int color);
DimiterK 1:a368f2688222 294
DimiterK 1:a368f2688222 295 /*
DimiterK 1:a368f2688222 296 * Circle fill Code is merely a modification of the midpoint
DimiterK 1:a368f2688222 297 * circle algorithem which is an adaption of Bresenham's line algorithm
DimiterK 1:a368f2688222 298 * http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
DimiterK 1:a368f2688222 299 * http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
DimiterK 1:a368f2688222 300 * Adapted from arduino lib
DimiterK 1:a368f2688222 301 *
DimiterK 1:a368f2688222 302 *@param CenterX
DimiterK 1:a368f2688222 303 *@param CenterY
DimiterK 1:a368f2688222 304 *@param Radius
DimiterK 1:a368f2688222 305 *@param color
DimiterK 1:a368f2688222 306 */
DimiterK 1:a368f2688222 307 void FullCircle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius,unsigned int color);
DimiterK 1:a368f2688222 308
DimiterK 1:a368f2688222 309 /*
DimiterK 1:a368f2688222 310 *Draws an ellipse.
DimiterK 1:a368f2688222 311 *@param lX1 x coordinate of one side
DimiterK 1:a368f2688222 312 *@param lY1 y coordinate of one side
DimiterK 1:a368f2688222 313 *@param lX2 x coordinate of other side
DimiterK 1:a368f2688222 314 *@param lY2 y coordinate of other side
DimiterK 1:a368f2688222 315 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 316 *@return none
DimiterK 1:a368f2688222 317 *
DimiterK 1:a368f2688222 318 * Ported the algorithm found at http://homepage.smc.edu/kennedy_john/belipse.pdf
DimiterK 1:a368f2688222 319 *
DimiterK 1:a368f2688222 320 */
DimiterK 1:a368f2688222 321 void PlotEllipse(long CX, long CY, long XRadius,long YRadius, int color);
DimiterK 0:135b9a0a816e 322
DimiterK 1:a368f2688222 323 /*
DimiterK 1:a368f2688222 324 *Helper function for drawing an ellipse.
DimiterK 1:a368f2688222 325 *@param CX x coordinate of one side
DimiterK 1:a368f2688222 326 *@param CY y coordinate of one side
DimiterK 1:a368f2688222 327 *@param X x coordinate of other side
DimiterK 1:a368f2688222 328 *@param Y y coordinate of other side
DimiterK 1:a368f2688222 329 *@param color can be BLACK or WHITE
DimiterK 1:a368f2688222 330 *@return none
DimiterK 1:a368f2688222 331 *
DimiterK 1:a368f2688222 332 * Portted the algorithm found at http://homepage.smc.edu/kennedy_john/belipse.pdf
DimiterK 1:a368f2688222 333 *
DimiterK 1:a368f2688222 334 */
DimiterK 1:a368f2688222 335 void Plot4EllipsePoints(long CX,long CY, long X, long Y, int color);
DimiterK 1:a368f2688222 336
DimiterK 1:a368f2688222 337 /*
DimiterK 1:a368f2688222 338 *Draws an image on screen.
DimiterK 1:a368f2688222 339 *@param PictureData 128x64 image array
DimiterK 1:a368f2688222 340 *@return none
DimiterK 1:a368f2688222 341 *
DimiterK 1:a368f2688222 342 *
DimiterK 1:a368f2688222 343 */
DimiterK 1:a368f2688222 344 void FullScreenBMP (unsigned char *PictureData);
DimiterK 1:a368f2688222 345
DimiterK 1:a368f2688222 346 /*
DimiterK 1:a368f2688222 347 *Round a double
DimiterK 1:a368f2688222 348 *@param double
DimiterK 1:a368f2688222 349 *@return value
DimiterK 1:a368f2688222 350 *
DimiterK 1:a368f2688222 351 */
DimiterK 1:a368f2688222 352 double dfloor( double value );
DimiterK 1:a368f2688222 353
DimiterK 1:a368f2688222 354
DimiterK 1:a368f2688222 355 /*
DimiterK 1:a368f2688222 356 *Print a char on the specified coordinates
DimiterK 1:a368f2688222 357 *@param page row coordinate
DimiterK 1:a368f2688222 358 *@param col y coordinate
DimiterK 1:a368f2688222 359 *@param c character from systemfont
DimiterK 1:a368f2688222 360 *@return none
DimiterK 1:a368f2688222 361 *
DimiterK 1:a368f2688222 362 *
DimiterK 1:a368f2688222 363 */
DimiterK 1:a368f2688222 364 void Putc (int page, int col,unsigned char c);
DimiterK 0:135b9a0a816e 365
DimiterK 1:a368f2688222 366 /*
DimiterK 1:a368f2688222 367 *Print a string on the specified coordinates.
DimiterK 1:a368f2688222 368 *@param x row coordinate
DimiterK 1:a368f2688222 369 *@param y y coordinate
DimiterK 1:a368f2688222 370 *@param str character string
DimiterK 1:a368f2688222 371 *@return none
DimiterK 1:a368f2688222 372 *
DimiterK 1:a368f2688222 373 *
DimiterK 1:a368f2688222 374 */
DimiterK 1:a368f2688222 375 void PutString(unsigned int x, unsigned int y,char* str);
DimiterK 1:a368f2688222 376
DimiterK 1:a368f2688222 377 /*
DimiterK 1:a368f2688222 378 *Print a float on the specified coordiantes.
DimiterK 1:a368f2688222 379 *@param val float number
DimiterK 1:a368f2688222 380 *@param x row coordinate
DimiterK 1:a368f2688222 381 *@param y y coordinate
DimiterK 1:a368f2688222 382 *@return none
DimiterK 1:a368f2688222 383 *
DimiterK 1:a368f2688222 384 *
DimiterK 1:a368f2688222 385 */
DimiterK 1:a368f2688222 386 void PrintFloat(float val, unsigned int x,unsigned int y);
DimiterK 1:a368f2688222 387
DimiterK 1:a368f2688222 388 /*
DimiterK 1:a368f2688222 389 *Print an integer on th specified coordinates.
DimiterK 1:a368f2688222 390 *@param val integer number
DimiterK 1:a368f2688222 391 *@param x row coordinate
DimiterK 1:a368f2688222 392 *@param y column coordinate
DimiterK 1:a368f2688222 393 *@return none
DimiterK 1:a368f2688222 394 *
DimiterK 1:a368f2688222 395 */
DimiterK 1:a368f2688222 396 void PrintInteger(int val,unsigned int x,unsigned int y);
DimiterK 1:a368f2688222 397
DimiterK 1:a368f2688222 398 /*
DimiterK 1:a368f2688222 399 *Moves cursor to x,y.
DimiterK 1:a368f2688222 400 *@param x x coordinate
DimiterK 1:a368f2688222 401 *@param y y coordinate
DimiterK 1:a368f2688222 402 *@return none
DimiterK 1:a368f2688222 403 *
DimiterK 1:a368f2688222 404 */
DimiterK 1:a368f2688222 405 void CursorXY( unsigned int x, unsigned int y);
DimiterK 1:a368f2688222 406
DimiterK 1:a368f2688222 407
DimiterK 1:a368f2688222 408
DimiterK 1:a368f2688222 409 private:
DimiterK 1:a368f2688222 410 BusInOut DB;
DimiterK 1:a368f2688222 411 DigitalOut RST;
DimiterK 1:a368f2688222 412 DigitalOut DI;
DimiterK 1:a368f2688222 413 DigitalOut RW;
DimiterK 1:a368f2688222 414 DigitalOut E;
DimiterK 1:a368f2688222 415 DigitalInOut CS2;
DimiterK 1:a368f2688222 416 DigitalInOut CS1;
DimiterK 1:a368f2688222 417
DimiterK 1:a368f2688222 418 unsigned int color;
DimiterK 1:a368f2688222 419 unsigned int* Font;
DimiterK 1:a368f2688222 420 LCDCoord Coord;
DimiterK 0:135b9a0a816e 421 };
DimiterK 1:a368f2688222 422
DimiterK 0:135b9a0a816e 423
DimiterK 0:135b9a0a816e 424 #endif