smartgpu version 1

Dependents:   4dofRoboticArmAX12

Committer:
aimen
Date:
Fri Aug 31 06:32:17 2012 +0000
Revision:
0:d2c9ddbc2cda
initial set up

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aimen 0:d2c9ddbc2cda 1
aimen 0:d2c9ddbc2cda 2 #ifndef SMARTGPU_H
aimen 0:d2c9ddbc2cda 3 #define SMARTGPU_H
aimen 0:d2c9ddbc2cda 4
aimen 0:d2c9ddbc2cda 5 #include <mbed.h>
aimen 0:d2c9ddbc2cda 6
aimen 0:d2c9ddbc2cda 7 //****USER DEFINED PINS (modify to select another serial port of MBED*****//
aimen 0:d2c9ddbc2cda 8 // Definitions of Pin out for MBED
aimen 0:d2c9ddbc2cda 9 //#define TXpin p13
aimen 0:d2c9ddbc2cda 10 //#define RXpin p14
aimen 0:d2c9ddbc2cda 11 //#define resetPin p15
aimen 0:d2c9ddbc2cda 12 //**********************END OF USER DEFINED PINS**************************//
aimen 0:d2c9ddbc2cda 13
aimen 0:d2c9ddbc2cda 14
aimen 0:d2c9ddbc2cda 15 //******************LIBRARY DEFINED PINS (don't modify)*******************//
aimen 0:d2c9ddbc2cda 16 //General definitions
aimen 0:d2c9ddbc2cda 17 #define RESET 13
aimen 0:d2c9ddbc2cda 18 #define TX 1
aimen 0:d2c9ddbc2cda 19 #define RX 0
aimen 0:d2c9ddbc2cda 20 #define OFF 0
aimen 0:d2c9ddbc2cda 21 #define ON 1
aimen 0:d2c9ddbc2cda 22 #define FULL 127
aimen 0:d2c9ddbc2cda 23 #define UNFILL 0
aimen 0:d2c9ddbc2cda 24 #define FILL 1
aimen 0:d2c9ddbc2cda 25 #define TRANS 0
aimen 0:d2c9ddbc2cda 26 #define COLOUR 1
aimen 0:d2c9ddbc2cda 27 #define BEGINNING 0
aimen 0:d2c9ddbc2cda 28 #define ALLCONTENTS 0
aimen 0:d2c9ddbc2cda 29 #define LANDSCAPEL 0x00 //left
aimen 0:d2c9ddbc2cda 30 #define PORTRAITL 0x01 //low
aimen 0:d2c9ddbc2cda 31 #define LANDSCAPER 0x02 //right
aimen 0:d2c9ddbc2cda 32 #define PORTRAITT 0x03 //top
aimen 0:d2c9ddbc2cda 33 #define DOUT0 0
aimen 0:d2c9ddbc2cda 34 #define DOUT1 1
aimen 0:d2c9ddbc2cda 35 #define GND 0
aimen 0:d2c9ddbc2cda 36 #define VCC 1
aimen 0:d2c9ddbc2cda 37 #define XCOORD 0
aimen 0:d2c9ddbc2cda 38 #define YCOORD 1
aimen 0:d2c9ddbc2cda 39 #define WIDTH 320
aimen 0:d2c9ddbc2cda 40 #define HEIGHT 240
aimen 0:d2c9ddbc2cda 41
aimen 0:d2c9ddbc2cda 42 //basic colours definition
aimen 0:d2c9ddbc2cda 43 #define BLACK 0x0000
aimen 0:d2c9ddbc2cda 44 #define WHITE 0xFFFF
aimen 0:d2c9ddbc2cda 45 #define RED 0xF800
aimen 0:d2c9ddbc2cda 46 #define GREEN 0x07E0
aimen 0:d2c9ddbc2cda 47 #define BLUE 0x001F
aimen 0:d2c9ddbc2cda 48 #define YELLOW 0xFFE0
aimen 0:d2c9ddbc2cda 49 #define CYAN 0x07FF
aimen 0:d2c9ddbc2cda 50 #define MAGENTA 0xF81F
aimen 0:d2c9ddbc2cda 51
aimen 0:d2c9ddbc2cda 52 //fonts definition
aimen 0:d2c9ddbc2cda 53 #define FONT0 0x00
aimen 0:d2c9ddbc2cda 54 #define FONT1 0x01
aimen 0:d2c9ddbc2cda 55 #define FONT2 0x02
aimen 0:d2c9ddbc2cda 56 #define FONT3 0x03
aimen 0:d2c9ddbc2cda 57 #define FONT4 0x04
aimen 0:d2c9ddbc2cda 58 #define FONT5 0x05
aimen 0:d2c9ddbc2cda 59 #define FONT6 0x06
aimen 0:d2c9ddbc2cda 60 #define FONT7 0x07
aimen 0:d2c9ddbc2cda 61
aimen 0:d2c9ddbc2cda 62 //**************************************************************************
aimen 0:d2c9ddbc2cda 63 // class SMARTGPU SMARTGPU.h
aimen 0:d2c9ddbc2cda 64 // This is the main class. It shoud be used like this : SMARTGPU lcd(p13,p14,p15);
aimen 0:d2c9ddbc2cda 65
aimen 0:d2c9ddbc2cda 66 class SMARTGPU{
aimen 0:d2c9ddbc2cda 67
aimen 0:d2c9ddbc2cda 68 public:
aimen 0:d2c9ddbc2cda 69
aimen 0:d2c9ddbc2cda 70 SMARTGPU(PinName TXPin, PinName RXPin, PinName resetPin);
aimen 0:d2c9ddbc2cda 71
aimen 0:d2c9ddbc2cda 72 void init();
aimen 0:d2c9ddbc2cda 73
aimen 0:d2c9ddbc2cda 74 void reset();
aimen 0:d2c9ddbc2cda 75
aimen 0:d2c9ddbc2cda 76 unsigned char start();
aimen 0:d2c9ddbc2cda 77
aimen 0:d2c9ddbc2cda 78 unsigned char erase();
aimen 0:d2c9ddbc2cda 79
aimen 0:d2c9ddbc2cda 80 unsigned char sleep(unsigned char);
aimen 0:d2c9ddbc2cda 81
aimen 0:d2c9ddbc2cda 82 unsigned char orientation(unsigned char);
aimen 0:d2c9ddbc2cda 83
aimen 0:d2c9ddbc2cda 84 unsigned char bright(unsigned char);
aimen 0:d2c9ddbc2cda 85
aimen 0:d2c9ddbc2cda 86 unsigned char baudChange(unsigned long val);
aimen 0:d2c9ddbc2cda 87
aimen 0:d2c9ddbc2cda 88 unsigned char digitalOut(unsigned char, unsigned char);
aimen 0:d2c9ddbc2cda 89
aimen 0:d2c9ddbc2cda 90 unsigned char setScreenBackground(int);
aimen 0:d2c9ddbc2cda 91
aimen 0:d2c9ddbc2cda 92 unsigned char setTextBackground(int);
aimen 0:d2c9ddbc2cda 93
aimen 0:d2c9ddbc2cda 94 unsigned char memoryRead(int, int, int, int, char[]);
aimen 0:d2c9ddbc2cda 95
aimen 0:d2c9ddbc2cda 96 unsigned char putPixel(int, int, int);
aimen 0:d2c9ddbc2cda 97
aimen 0:d2c9ddbc2cda 98 unsigned char drawLine(int, int, int, int, int);
aimen 0:d2c9ddbc2cda 99
aimen 0:d2c9ddbc2cda 100 unsigned char drawRectangle(int, int, int, int, int, unsigned char);
aimen 0:d2c9ddbc2cda 101
aimen 0:d2c9ddbc2cda 102 unsigned char drawTriangle(int, int, int, int, int, int, int, unsigned char);
aimen 0:d2c9ddbc2cda 103
aimen 0:d2c9ddbc2cda 104 unsigned char drawCircle(int, int, int, int, unsigned char);
aimen 0:d2c9ddbc2cda 105
aimen 0:d2c9ddbc2cda 106 unsigned char putLetter(int, int, int, unsigned char, unsigned char, unsigned char);
aimen 0:d2c9ddbc2cda 107
aimen 0:d2c9ddbc2cda 108 unsigned char string(int, int, int, int, int, unsigned char, unsigned char, char[]);
aimen 0:d2c9ddbc2cda 109
aimen 0:d2c9ddbc2cda 110 unsigned char stringSD(int, int, int, int, int, unsigned char, unsigned char, int, int, char[]);
aimen 0:d2c9ddbc2cda 111
aimen 0:d2c9ddbc2cda 112 unsigned char icon(int, int, int, int, char[]);
aimen 0:d2c9ddbc2cda 113
aimen 0:d2c9ddbc2cda 114 unsigned char imageSD(int , int , char[]);
aimen 0:d2c9ddbc2cda 115
aimen 0:d2c9ddbc2cda 116 unsigned char touchScreen(int[]);
aimen 0:d2c9ddbc2cda 117
aimen 0:d2c9ddbc2cda 118 unsigned char touchIcon(char[]);
aimen 0:d2c9ddbc2cda 119
aimen 0:d2c9ddbc2cda 120 protected :
aimen 0:d2c9ddbc2cda 121
aimen 0:d2c9ddbc2cda 122 Serial _serialSMARTGPU;
aimen 0:d2c9ddbc2cda 123 DigitalOut _resetPin;
aimen 0:d2c9ddbc2cda 124
aimen 0:d2c9ddbc2cda 125 };
aimen 0:d2c9ddbc2cda 126 typedef unsigned char BYTE;
aimen 0:d2c9ddbc2cda 127
aimen 0:d2c9ddbc2cda 128 #endif