Mini SmartGPU Intelligent Graphics Processor. Mbed library Rev1.0 Vizic Technologies 2012 http://vizictechnologies.com/#/mini-smart-gpu/4566376187
Dependents: BounceBallMSG BouncingBallsMSG HouseMSG NiceClockMSG ... more
MINISMARTGPU.h@1:83a75a056cfa, 2012-08-29 (annotated)
- Committer:
- emmanuelchio
- Date:
- Wed Aug 29 22:31:40 2012 +0000
- Revision:
- 1:83a75a056cfa
- Parent:
- 0:1c3989d263f4
MiniSMARTGPU Mbed Library R2 - Vizic Technologies
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emmanuelchio | 0:1c3989d263f4 | 1 | /********************************************************* |
emmanuelchio | 0:1c3989d263f4 | 2 | VIZIC TECHNOLOGIES. COPYRIGHT 2012. |
emmanuelchio | 0:1c3989d263f4 | 3 | THE DATASHEETS, SOFTWARE AND LIBRARIES ARE PROVIDED "AS IS." |
emmanuelchio | 0:1c3989d263f4 | 4 | VIZIC EXPRESSLY DISCLAIM ANY WARRANTY OF ANY KIND, WHETHER |
emmanuelchio | 0:1c3989d263f4 | 5 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED |
emmanuelchio | 0:1c3989d263f4 | 6 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, |
emmanuelchio | 0:1c3989d263f4 | 7 | OR NONINFRINGEMENT. IN NO EVENT SHALL VIZIC BE LIABLE FOR |
emmanuelchio | 0:1c3989d263f4 | 8 | ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, |
emmanuelchio | 0:1c3989d263f4 | 9 | LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF |
emmanuelchio | 0:1c3989d263f4 | 10 | PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, |
emmanuelchio | 0:1c3989d263f4 | 11 | ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO |
emmanuelchio | 0:1c3989d263f4 | 12 | ANY DEFENCE THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, |
emmanuelchio | 0:1c3989d263f4 | 13 | OR OTHER SIMILAR COSTS. |
emmanuelchio | 0:1c3989d263f4 | 14 | *********************************************************/ |
emmanuelchio | 0:1c3989d263f4 | 15 | |
emmanuelchio | 0:1c3989d263f4 | 16 | #ifndef MINISMARTGPU_H |
emmanuelchio | 0:1c3989d263f4 | 17 | #define MINISMARTGPU_H |
emmanuelchio | 0:1c3989d263f4 | 18 | |
emmanuelchio | 0:1c3989d263f4 | 19 | #include <mbed.h> |
emmanuelchio | 0:1c3989d263f4 | 20 | |
emmanuelchio | 0:1c3989d263f4 | 21 | //******************LIBRARY DEFINED PINS (don't modify)*******************// |
emmanuelchio | 0:1c3989d263f4 | 22 | //General definitions |
emmanuelchio | 0:1c3989d263f4 | 23 | #define RESET 13 |
emmanuelchio | 0:1c3989d263f4 | 24 | #define TX 1 |
emmanuelchio | 0:1c3989d263f4 | 25 | #define RX 0 |
emmanuelchio | 0:1c3989d263f4 | 26 | #define OFF 0 |
emmanuelchio | 0:1c3989d263f4 | 27 | #define ON 1 |
emmanuelchio | 0:1c3989d263f4 | 28 | #define FULL 127 |
emmanuelchio | 0:1c3989d263f4 | 29 | #define UNFILL 0 |
emmanuelchio | 0:1c3989d263f4 | 30 | #define FILL 1 |
emmanuelchio | 0:1c3989d263f4 | 31 | #define TRANS 0 |
emmanuelchio | 0:1c3989d263f4 | 32 | #define COLOUR 1 |
emmanuelchio | 0:1c3989d263f4 | 33 | #define BEGINNING 0 |
emmanuelchio | 0:1c3989d263f4 | 34 | #define ALLCONTENTS 0 |
emmanuelchio | 0:1c3989d263f4 | 35 | #define LANDSCAPEL 0x00 //left |
emmanuelchio | 0:1c3989d263f4 | 36 | #define PORTRAITL 0x01 //low |
emmanuelchio | 0:1c3989d263f4 | 37 | #define LANDSCAPER 0x02 //right |
emmanuelchio | 0:1c3989d263f4 | 38 | #define PORTRAITT 0x03 //top |
emmanuelchio | 0:1c3989d263f4 | 39 | #define GND 0 |
emmanuelchio | 0:1c3989d263f4 | 40 | #define VCC 1 |
emmanuelchio | 0:1c3989d263f4 | 41 | #define XCOORD 0 |
emmanuelchio | 0:1c3989d263f4 | 42 | #define YCOORD 1 |
emmanuelchio | 0:1c3989d263f4 | 43 | #define WIDTHLANDSCAPE 160 |
emmanuelchio | 0:1c3989d263f4 | 44 | #define HEIGHTLANDSCAPE 128 |
emmanuelchio | 0:1c3989d263f4 | 45 | #define WIDTHPORTRAIT 128 |
emmanuelchio | 0:1c3989d263f4 | 46 | #define HEIGHTLANDPORTRAIT 160 |
emmanuelchio | 0:1c3989d263f4 | 47 | |
emmanuelchio | 0:1c3989d263f4 | 48 | //basic colours definition |
emmanuelchio | 0:1c3989d263f4 | 49 | #define BLACK 0x0000 |
emmanuelchio | 0:1c3989d263f4 | 50 | #define WHITE 0xFFFF |
emmanuelchio | 0:1c3989d263f4 | 51 | #define RED 0xF800 |
emmanuelchio | 0:1c3989d263f4 | 52 | #define GREEN 0x07E0 |
emmanuelchio | 0:1c3989d263f4 | 53 | #define BLUE 0x001F |
emmanuelchio | 0:1c3989d263f4 | 54 | #define YELLOW 0xFFE0 |
emmanuelchio | 0:1c3989d263f4 | 55 | #define CYAN 0x07FF |
emmanuelchio | 0:1c3989d263f4 | 56 | #define MAGENTA 0xF81F |
emmanuelchio | 0:1c3989d263f4 | 57 | |
emmanuelchio | 0:1c3989d263f4 | 58 | //File access definitions |
emmanuelchio | 0:1c3989d263f4 | 59 | #define READONLY 0x01 |
emmanuelchio | 0:1c3989d263f4 | 60 | #define WRITEONLY 0x02 |
emmanuelchio | 0:1c3989d263f4 | 61 | #define READWRITE 0x03 |
emmanuelchio | 0:1c3989d263f4 | 62 | #define CREATENEW 0x04 |
emmanuelchio | 0:1c3989d263f4 | 63 | #define OPENALWAYS 0x10 |
emmanuelchio | 0:1c3989d263f4 | 64 | #define CREATEALWAYS 0x08 |
emmanuelchio | 0:1c3989d263f4 | 65 | //fonts definition |
emmanuelchio | 0:1c3989d263f4 | 66 | #define FONT0 0x00 |
emmanuelchio | 0:1c3989d263f4 | 67 | #define FONT1 0x01 |
emmanuelchio | 0:1c3989d263f4 | 68 | #define FONT2 0x02 |
emmanuelchio | 0:1c3989d263f4 | 69 | #define FONT3 0x03 |
emmanuelchio | 0:1c3989d263f4 | 70 | #define FONT4 0x04 |
emmanuelchio | 0:1c3989d263f4 | 71 | #define FONT5 0x05 |
emmanuelchio | 0:1c3989d263f4 | 72 | #define FONT6 0x06 |
emmanuelchio | 0:1c3989d263f4 | 73 | #define FONT7 0x07 |
emmanuelchio | 0:1c3989d263f4 | 74 | |
emmanuelchio | 0:1c3989d263f4 | 75 | //************************************************************************** |
emmanuelchio | 0:1c3989d263f4 | 76 | // class MINISMARTGPU MINISMARTGPU.h |
emmanuelchio | 0:1c3989d263f4 | 77 | // This is the main class. It shoud be used like this : SMARTGPU lcd(p13,p14,p15); |
emmanuelchio | 0:1c3989d263f4 | 78 | |
emmanuelchio | 0:1c3989d263f4 | 79 | class MINISMARTGPU{ |
emmanuelchio | 0:1c3989d263f4 | 80 | |
emmanuelchio | 0:1c3989d263f4 | 81 | public: |
emmanuelchio | 0:1c3989d263f4 | 82 | |
emmanuelchio | 0:1c3989d263f4 | 83 | MINISMARTGPU(PinName TXPin, PinName RXPin, PinName resetPin); |
emmanuelchio | 0:1c3989d263f4 | 84 | |
emmanuelchio | 0:1c3989d263f4 | 85 | void init(); |
emmanuelchio | 0:1c3989d263f4 | 86 | |
emmanuelchio | 0:1c3989d263f4 | 87 | void reset(); |
emmanuelchio | 0:1c3989d263f4 | 88 | |
emmanuelchio | 0:1c3989d263f4 | 89 | unsigned char start(); |
emmanuelchio | 0:1c3989d263f4 | 90 | |
emmanuelchio | 0:1c3989d263f4 | 91 | unsigned char erase(); |
emmanuelchio | 0:1c3989d263f4 | 92 | |
emmanuelchio | 0:1c3989d263f4 | 93 | unsigned char sleep(unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 94 | |
emmanuelchio | 0:1c3989d263f4 | 95 | unsigned char orientation(unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 96 | |
emmanuelchio | 0:1c3989d263f4 | 97 | unsigned char bright(unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 98 | |
emmanuelchio | 0:1c3989d263f4 | 99 | unsigned char baudChange(unsigned long val); |
emmanuelchio | 0:1c3989d263f4 | 100 | |
emmanuelchio | 0:1c3989d263f4 | 101 | unsigned char digitalOut(unsigned char, unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 102 | |
emmanuelchio | 0:1c3989d263f4 | 103 | unsigned char setScreenBackground(int); |
emmanuelchio | 0:1c3989d263f4 | 104 | |
emmanuelchio | 0:1c3989d263f4 | 105 | unsigned char setTextBackground(int); |
emmanuelchio | 0:1c3989d263f4 | 106 | |
emmanuelchio | 0:1c3989d263f4 | 107 | unsigned char memoryRead(unsigned char, unsigned char, unsigned char, unsigned char, char[]); |
emmanuelchio | 0:1c3989d263f4 | 108 | |
emmanuelchio | 0:1c3989d263f4 | 109 | unsigned char putPixel(unsigned char, unsigned char, int); |
emmanuelchio | 0:1c3989d263f4 | 110 | |
emmanuelchio | 0:1c3989d263f4 | 111 | unsigned char drawLine(unsigned char, unsigned char, unsigned char, unsigned char, int); |
emmanuelchio | 0:1c3989d263f4 | 112 | |
emmanuelchio | 0:1c3989d263f4 | 113 | unsigned char drawRectangle(unsigned char, unsigned char, unsigned char, unsigned char, int, unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 114 | |
emmanuelchio | 0:1c3989d263f4 | 115 | unsigned char drawTriangle(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, int, unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 116 | |
emmanuelchio | 0:1c3989d263f4 | 117 | unsigned char drawCircle(unsigned char, unsigned char, unsigned char, int, unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 118 | |
emmanuelchio | 0:1c3989d263f4 | 119 | unsigned char putLetter(unsigned char, unsigned char, int, unsigned char, unsigned char, unsigned char); |
emmanuelchio | 0:1c3989d263f4 | 120 | |
emmanuelchio | 0:1c3989d263f4 | 121 | unsigned char string(unsigned char, unsigned char, unsigned char, unsigned char, int, unsigned char, unsigned char, char[]); |
emmanuelchio | 0:1c3989d263f4 | 122 | |
emmanuelchio | 0:1c3989d263f4 | 123 | unsigned char stringSD(unsigned char, unsigned char, unsigned char, unsigned char, int, unsigned char, unsigned char, int, int, char[]); |
emmanuelchio | 0:1c3989d263f4 | 124 | |
emmanuelchio | 0:1c3989d263f4 | 125 | unsigned char icon(unsigned char, unsigned char, unsigned char, unsigned char, char[]); |
emmanuelchio | 0:1c3989d263f4 | 126 | |
emmanuelchio | 0:1c3989d263f4 | 127 | unsigned char imageSD(unsigned char , unsigned char , char[]); |
emmanuelchio | 0:1c3989d263f4 | 128 | |
emmanuelchio | 0:1c3989d263f4 | 129 | /****************************************************************/ |
emmanuelchio | 0:1c3989d263f4 | 130 | //Those next functions return file execution status instead of ACK 'O' or NAK 'F' |
emmanuelchio | 0:1c3989d263f4 | 131 | /****************************************************************/ |
emmanuelchio | 0:1c3989d263f4 | 132 | unsigned char SDfopen(unsigned char, char[]); |
emmanuelchio | 0:1c3989d263f4 | 133 | |
emmanuelchio | 0:1c3989d263f4 | 134 | unsigned char SDfclose(); |
emmanuelchio | 0:1c3989d263f4 | 135 | |
emmanuelchio | 0:1c3989d263f4 | 136 | unsigned char SDfsync(); |
emmanuelchio | 0:1c3989d263f4 | 137 | |
emmanuelchio | 0:1c3989d263f4 | 138 | unsigned char SDfpointer(unsigned long); |
emmanuelchio | 0:1c3989d263f4 | 139 | |
emmanuelchio | 0:1c3989d263f4 | 140 | unsigned char SDfread(unsigned int, char[], unsigned int*); |
emmanuelchio | 0:1c3989d263f4 | 141 | |
emmanuelchio | 0:1c3989d263f4 | 142 | unsigned char SDfwrite(unsigned int, char[], unsigned int*); |
emmanuelchio | 0:1c3989d263f4 | 143 | |
emmanuelchio | 0:1c3989d263f4 | 144 | protected : |
emmanuelchio | 0:1c3989d263f4 | 145 | |
emmanuelchio | 0:1c3989d263f4 | 146 | Serial _serialMINISMARTGPU; |
emmanuelchio | 0:1c3989d263f4 | 147 | DigitalOut _resetPin; |
emmanuelchio | 0:1c3989d263f4 | 148 | |
emmanuelchio | 0:1c3989d263f4 | 149 | }; |
emmanuelchio | 0:1c3989d263f4 | 150 | typedef unsigned char BYTE; |
emmanuelchio | 0:1c3989d263f4 | 151 | |
emmanuelchio | 0:1c3989d263f4 | 152 | #endif |