lcd for LPC1768
Fork of C12832 by
C12832.h@0:990d5eec2ef6, 2015-02-26 (annotated)
- Committer:
- askksa12543
- Date:
- Thu Feb 26 14:52:52 2015 +0000
- Revision:
- 0:990d5eec2ef6
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
askksa12543 | 0:990d5eec2ef6 | 1 | /* mbed library for the mbed Lab Board 128*32 pixel LCD |
askksa12543 | 0:990d5eec2ef6 | 2 | * use C12832 controller |
askksa12543 | 0:990d5eec2ef6 | 3 | * Copyright (c) 2012 Peter Drescher - DC2PD |
askksa12543 | 0:990d5eec2ef6 | 4 | * Released under the MIT License: http://mbed.org/license/mit |
askksa12543 | 0:990d5eec2ef6 | 5 | * |
askksa12543 | 0:990d5eec2ef6 | 6 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
askksa12543 | 0:990d5eec2ef6 | 7 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
askksa12543 | 0:990d5eec2ef6 | 8 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
askksa12543 | 0:990d5eec2ef6 | 9 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
askksa12543 | 0:990d5eec2ef6 | 10 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
askksa12543 | 0:990d5eec2ef6 | 11 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
askksa12543 | 0:990d5eec2ef6 | 12 | * THE SOFTWARE. |
askksa12543 | 0:990d5eec2ef6 | 13 | */ |
askksa12543 | 0:990d5eec2ef6 | 14 | |
askksa12543 | 0:990d5eec2ef6 | 15 | #ifndef C12832_H |
askksa12543 | 0:990d5eec2ef6 | 16 | #define C12832_H |
askksa12543 | 0:990d5eec2ef6 | 17 | |
askksa12543 | 0:990d5eec2ef6 | 18 | #include "mbed.h" |
askksa12543 | 0:990d5eec2ef6 | 19 | #include "GraphicsDisplay.h" |
askksa12543 | 0:990d5eec2ef6 | 20 | |
askksa12543 | 0:990d5eec2ef6 | 21 | |
askksa12543 | 0:990d5eec2ef6 | 22 | /** optional Defines : |
askksa12543 | 0:990d5eec2ef6 | 23 | * #define debug_lcd 1 enable infos to PC_USB |
askksa12543 | 0:990d5eec2ef6 | 24 | */ |
askksa12543 | 0:990d5eec2ef6 | 25 | |
askksa12543 | 0:990d5eec2ef6 | 26 | // some defines for the DMA use |
askksa12543 | 0:990d5eec2ef6 | 27 | #define DMA_CHANNEL_ENABLE 1 |
askksa12543 | 0:990d5eec2ef6 | 28 | #define DMA_TRANSFER_TYPE_M2P (1UL << 11) |
askksa12543 | 0:990d5eec2ef6 | 29 | #define DMA_CHANNEL_TCIE (1UL << 31) |
askksa12543 | 0:990d5eec2ef6 | 30 | #define DMA_CHANNEL_SRC_INC (1UL << 26) |
askksa12543 | 0:990d5eec2ef6 | 31 | #define DMA_MASK_IE (1UL << 14) |
askksa12543 | 0:990d5eec2ef6 | 32 | #define DMA_MASK_ITC (1UL << 15) |
askksa12543 | 0:990d5eec2ef6 | 33 | #define DMA_SSP1_TX (1UL << 2) |
askksa12543 | 0:990d5eec2ef6 | 34 | #define DMA_SSP0_TX (0) |
askksa12543 | 0:990d5eec2ef6 | 35 | #define DMA_DEST_SSP1_TX (2UL << 6) |
askksa12543 | 0:990d5eec2ef6 | 36 | #define DMA_DEST_SSP0_TX (0UL << 6) |
askksa12543 | 0:990d5eec2ef6 | 37 | |
askksa12543 | 0:990d5eec2ef6 | 38 | /** Draw mode |
askksa12543 | 0:990d5eec2ef6 | 39 | * NORMAl |
askksa12543 | 0:990d5eec2ef6 | 40 | * XOR set pixel by xor the screen |
askksa12543 | 0:990d5eec2ef6 | 41 | */ |
askksa12543 | 0:990d5eec2ef6 | 42 | enum {NORMAL,XOR}; |
askksa12543 | 0:990d5eec2ef6 | 43 | |
askksa12543 | 0:990d5eec2ef6 | 44 | /** Bitmap |
askksa12543 | 0:990d5eec2ef6 | 45 | */ |
askksa12543 | 0:990d5eec2ef6 | 46 | struct Bitmap{ |
askksa12543 | 0:990d5eec2ef6 | 47 | int xSize; |
askksa12543 | 0:990d5eec2ef6 | 48 | int ySize; |
askksa12543 | 0:990d5eec2ef6 | 49 | int Byte_in_Line; |
askksa12543 | 0:990d5eec2ef6 | 50 | char* data; |
askksa12543 | 0:990d5eec2ef6 | 51 | }; |
askksa12543 | 0:990d5eec2ef6 | 52 | |
askksa12543 | 0:990d5eec2ef6 | 53 | class C12832 : public GraphicsDisplay |
askksa12543 | 0:990d5eec2ef6 | 54 | { |
askksa12543 | 0:990d5eec2ef6 | 55 | public: |
askksa12543 | 0:990d5eec2ef6 | 56 | /** Create a C12832 object connected to SPI1 |
askksa12543 | 0:990d5eec2ef6 | 57 | * |
askksa12543 | 0:990d5eec2ef6 | 58 | */ |
askksa12543 | 0:990d5eec2ef6 | 59 | |
askksa12543 | 0:990d5eec2ef6 | 60 | C12832(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name = "LCD"); |
askksa12543 | 0:990d5eec2ef6 | 61 | |
askksa12543 | 0:990d5eec2ef6 | 62 | |
askksa12543 | 0:990d5eec2ef6 | 63 | /** Get the width of the screen in pixel |
askksa12543 | 0:990d5eec2ef6 | 64 | * |
askksa12543 | 0:990d5eec2ef6 | 65 | * @param |
askksa12543 | 0:990d5eec2ef6 | 66 | * @returns width of screen in pixel |
askksa12543 | 0:990d5eec2ef6 | 67 | * |
askksa12543 | 0:990d5eec2ef6 | 68 | */ |
askksa12543 | 0:990d5eec2ef6 | 69 | virtual int width(); |
askksa12543 | 0:990d5eec2ef6 | 70 | |
askksa12543 | 0:990d5eec2ef6 | 71 | /** Get the height of the screen in pixel |
askksa12543 | 0:990d5eec2ef6 | 72 | * |
askksa12543 | 0:990d5eec2ef6 | 73 | * @returns height of screen in pixel |
askksa12543 | 0:990d5eec2ef6 | 74 | * |
askksa12543 | 0:990d5eec2ef6 | 75 | */ |
askksa12543 | 0:990d5eec2ef6 | 76 | virtual int height(); |
askksa12543 | 0:990d5eec2ef6 | 77 | |
askksa12543 | 0:990d5eec2ef6 | 78 | /** Draw a pixel at x,y black or white |
askksa12543 | 0:990d5eec2ef6 | 79 | * |
askksa12543 | 0:990d5eec2ef6 | 80 | * @param x horizontal position |
askksa12543 | 0:990d5eec2ef6 | 81 | * @param y vertical position |
askksa12543 | 0:990d5eec2ef6 | 82 | * @param colour ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 83 | */ |
askksa12543 | 0:990d5eec2ef6 | 84 | virtual void pixel(int x, int y,int colour); |
askksa12543 | 0:990d5eec2ef6 | 85 | |
askksa12543 | 0:990d5eec2ef6 | 86 | /** draw a circle |
askksa12543 | 0:990d5eec2ef6 | 87 | * |
askksa12543 | 0:990d5eec2ef6 | 88 | * @param x0,y0 center |
askksa12543 | 0:990d5eec2ef6 | 89 | * @param r radius |
askksa12543 | 0:990d5eec2ef6 | 90 | * @param colour ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 91 | * |
askksa12543 | 0:990d5eec2ef6 | 92 | */ |
askksa12543 | 0:990d5eec2ef6 | 93 | void circle(int x, int y, int r, int colour); |
askksa12543 | 0:990d5eec2ef6 | 94 | |
askksa12543 | 0:990d5eec2ef6 | 95 | /** draw a filled circle |
askksa12543 | 0:990d5eec2ef6 | 96 | * |
askksa12543 | 0:990d5eec2ef6 | 97 | * @param x0,y0 center |
askksa12543 | 0:990d5eec2ef6 | 98 | * @param r radius |
askksa12543 | 0:990d5eec2ef6 | 99 | * @param color ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 100 | * |
askksa12543 | 0:990d5eec2ef6 | 101 | * use circle with different radius, |
askksa12543 | 0:990d5eec2ef6 | 102 | * can miss some pixel |
askksa12543 | 0:990d5eec2ef6 | 103 | */ |
askksa12543 | 0:990d5eec2ef6 | 104 | void fillcircle(int x, int y, int r, int colour); |
askksa12543 | 0:990d5eec2ef6 | 105 | |
askksa12543 | 0:990d5eec2ef6 | 106 | /** draw a 1 pixel line |
askksa12543 | 0:990d5eec2ef6 | 107 | * |
askksa12543 | 0:990d5eec2ef6 | 108 | * @param x0,y0 start point |
askksa12543 | 0:990d5eec2ef6 | 109 | * @param x1,y1 stop point |
askksa12543 | 0:990d5eec2ef6 | 110 | * @param color ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 111 | * |
askksa12543 | 0:990d5eec2ef6 | 112 | */ |
askksa12543 | 0:990d5eec2ef6 | 113 | void line(int x0, int y0, int x1, int y1, int colour); |
askksa12543 | 0:990d5eec2ef6 | 114 | |
askksa12543 | 0:990d5eec2ef6 | 115 | /** draw a rect |
askksa12543 | 0:990d5eec2ef6 | 116 | * |
askksa12543 | 0:990d5eec2ef6 | 117 | * @param x0,y0 top left corner |
askksa12543 | 0:990d5eec2ef6 | 118 | * @param x1,y1 down right corner |
askksa12543 | 0:990d5eec2ef6 | 119 | * @param color 1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 120 | * * |
askksa12543 | 0:990d5eec2ef6 | 121 | */ |
askksa12543 | 0:990d5eec2ef6 | 122 | void rect(int x0, int y0, int x1, int y1, int colour); |
askksa12543 | 0:990d5eec2ef6 | 123 | |
askksa12543 | 0:990d5eec2ef6 | 124 | /** draw a filled rect |
askksa12543 | 0:990d5eec2ef6 | 125 | * |
askksa12543 | 0:990d5eec2ef6 | 126 | * @param x0,y0 top left corner |
askksa12543 | 0:990d5eec2ef6 | 127 | * @param x1,y1 down right corner |
askksa12543 | 0:990d5eec2ef6 | 128 | * @param color 1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 129 | * |
askksa12543 | 0:990d5eec2ef6 | 130 | */ |
askksa12543 | 0:990d5eec2ef6 | 131 | void fillrect(int x0, int y0, int x1, int y1, int colour); |
askksa12543 | 0:990d5eec2ef6 | 132 | |
askksa12543 | 0:990d5eec2ef6 | 133 | /** copy display buffer to lcd |
askksa12543 | 0:990d5eec2ef6 | 134 | * |
askksa12543 | 0:990d5eec2ef6 | 135 | */ |
askksa12543 | 0:990d5eec2ef6 | 136 | |
askksa12543 | 0:990d5eec2ef6 | 137 | void copy_to_lcd(void); |
askksa12543 | 0:990d5eec2ef6 | 138 | |
askksa12543 | 0:990d5eec2ef6 | 139 | /** set the orienation of the screen |
askksa12543 | 0:990d5eec2ef6 | 140 | * |
askksa12543 | 0:990d5eec2ef6 | 141 | */ |
askksa12543 | 0:990d5eec2ef6 | 142 | |
askksa12543 | 0:990d5eec2ef6 | 143 | |
askksa12543 | 0:990d5eec2ef6 | 144 | void set_contrast(unsigned int o); |
askksa12543 | 0:990d5eec2ef6 | 145 | |
askksa12543 | 0:990d5eec2ef6 | 146 | /** read the contrast level |
askksa12543 | 0:990d5eec2ef6 | 147 | * |
askksa12543 | 0:990d5eec2ef6 | 148 | */ |
askksa12543 | 0:990d5eec2ef6 | 149 | unsigned int get_contrast(void); |
askksa12543 | 0:990d5eec2ef6 | 150 | |
askksa12543 | 0:990d5eec2ef6 | 151 | |
askksa12543 | 0:990d5eec2ef6 | 152 | /** invert the screen |
askksa12543 | 0:990d5eec2ef6 | 153 | * |
askksa12543 | 0:990d5eec2ef6 | 154 | * @param o = 0 normal, 1 invert |
askksa12543 | 0:990d5eec2ef6 | 155 | */ |
askksa12543 | 0:990d5eec2ef6 | 156 | void invert(unsigned int o); |
askksa12543 | 0:990d5eec2ef6 | 157 | |
askksa12543 | 0:990d5eec2ef6 | 158 | /** clear the screen |
askksa12543 | 0:990d5eec2ef6 | 159 | * |
askksa12543 | 0:990d5eec2ef6 | 160 | */ |
askksa12543 | 0:990d5eec2ef6 | 161 | virtual void cls(void); |
askksa12543 | 0:990d5eec2ef6 | 162 | |
askksa12543 | 0:990d5eec2ef6 | 163 | /** set the drawing mode |
askksa12543 | 0:990d5eec2ef6 | 164 | * |
askksa12543 | 0:990d5eec2ef6 | 165 | * @param mode NORMAl or XOR |
askksa12543 | 0:990d5eec2ef6 | 166 | */ |
askksa12543 | 0:990d5eec2ef6 | 167 | |
askksa12543 | 0:990d5eec2ef6 | 168 | void setmode(int mode); |
askksa12543 | 0:990d5eec2ef6 | 169 | |
askksa12543 | 0:990d5eec2ef6 | 170 | virtual int columns(void); |
askksa12543 | 0:990d5eec2ef6 | 171 | |
askksa12543 | 0:990d5eec2ef6 | 172 | /** calculate the max number of columns |
askksa12543 | 0:990d5eec2ef6 | 173 | * |
askksa12543 | 0:990d5eec2ef6 | 174 | * @returns max column |
askksa12543 | 0:990d5eec2ef6 | 175 | * depends on actual font size |
askksa12543 | 0:990d5eec2ef6 | 176 | * |
askksa12543 | 0:990d5eec2ef6 | 177 | */ |
askksa12543 | 0:990d5eec2ef6 | 178 | virtual int rows(void); |
askksa12543 | 0:990d5eec2ef6 | 179 | |
askksa12543 | 0:990d5eec2ef6 | 180 | /** put a char on the screen |
askksa12543 | 0:990d5eec2ef6 | 181 | * |
askksa12543 | 0:990d5eec2ef6 | 182 | * @param value char to print |
askksa12543 | 0:990d5eec2ef6 | 183 | * @returns printed char |
askksa12543 | 0:990d5eec2ef6 | 184 | * |
askksa12543 | 0:990d5eec2ef6 | 185 | */ |
askksa12543 | 0:990d5eec2ef6 | 186 | virtual int _putc(int value); |
askksa12543 | 0:990d5eec2ef6 | 187 | |
askksa12543 | 0:990d5eec2ef6 | 188 | /** draw a character on given position out of the active font to the LCD |
askksa12543 | 0:990d5eec2ef6 | 189 | * |
askksa12543 | 0:990d5eec2ef6 | 190 | * @param x x-position of char (top left) |
askksa12543 | 0:990d5eec2ef6 | 191 | * @param y y-position |
askksa12543 | 0:990d5eec2ef6 | 192 | * @param c char to print |
askksa12543 | 0:990d5eec2ef6 | 193 | * |
askksa12543 | 0:990d5eec2ef6 | 194 | */ |
askksa12543 | 0:990d5eec2ef6 | 195 | virtual void character(int x, int y, int c); |
askksa12543 | 0:990d5eec2ef6 | 196 | |
askksa12543 | 0:990d5eec2ef6 | 197 | /** setup cursor position |
askksa12543 | 0:990d5eec2ef6 | 198 | * |
askksa12543 | 0:990d5eec2ef6 | 199 | * @param x x-position (top left) |
askksa12543 | 0:990d5eec2ef6 | 200 | * @param y y-position |
askksa12543 | 0:990d5eec2ef6 | 201 | */ |
askksa12543 | 0:990d5eec2ef6 | 202 | virtual void locate(int x, int y); |
askksa12543 | 0:990d5eec2ef6 | 203 | |
askksa12543 | 0:990d5eec2ef6 | 204 | /** setup auto update of screen |
askksa12543 | 0:990d5eec2ef6 | 205 | * |
askksa12543 | 0:990d5eec2ef6 | 206 | * @param up 1 = on , 0 = off |
askksa12543 | 0:990d5eec2ef6 | 207 | * if switched off the program has to call copy_to_lcd() |
askksa12543 | 0:990d5eec2ef6 | 208 | * to update screen from framebuffer |
askksa12543 | 0:990d5eec2ef6 | 209 | */ |
askksa12543 | 0:990d5eec2ef6 | 210 | void set_auto_up(unsigned int up); |
askksa12543 | 0:990d5eec2ef6 | 211 | |
askksa12543 | 0:990d5eec2ef6 | 212 | /** get status of the auto update function |
askksa12543 | 0:990d5eec2ef6 | 213 | * |
askksa12543 | 0:990d5eec2ef6 | 214 | * @returns if auto update is on |
askksa12543 | 0:990d5eec2ef6 | 215 | */ |
askksa12543 | 0:990d5eec2ef6 | 216 | unsigned int get_auto_up(void); |
askksa12543 | 0:990d5eec2ef6 | 217 | |
askksa12543 | 0:990d5eec2ef6 | 218 | /** Vars */ |
askksa12543 | 0:990d5eec2ef6 | 219 | SPI _spi; |
askksa12543 | 0:990d5eec2ef6 | 220 | DigitalOut _reset; |
askksa12543 | 0:990d5eec2ef6 | 221 | DigitalOut _A0; |
askksa12543 | 0:990d5eec2ef6 | 222 | DigitalOut _CS; |
askksa12543 | 0:990d5eec2ef6 | 223 | unsigned char* font; |
askksa12543 | 0:990d5eec2ef6 | 224 | unsigned int draw_mode; |
askksa12543 | 0:990d5eec2ef6 | 225 | |
askksa12543 | 0:990d5eec2ef6 | 226 | |
askksa12543 | 0:990d5eec2ef6 | 227 | /** select the font to use |
askksa12543 | 0:990d5eec2ef6 | 228 | * |
askksa12543 | 0:990d5eec2ef6 | 229 | * @param f pointer to font array |
askksa12543 | 0:990d5eec2ef6 | 230 | * |
askksa12543 | 0:990d5eec2ef6 | 231 | * font array can created with GLCD Font Creator from http://www.mikroe.com |
askksa12543 | 0:990d5eec2ef6 | 232 | * you have to add 4 parameter at the beginning of the font array to use: |
askksa12543 | 0:990d5eec2ef6 | 233 | * - the number of byte / char |
askksa12543 | 0:990d5eec2ef6 | 234 | * - the vertial size in pixel |
askksa12543 | 0:990d5eec2ef6 | 235 | * - the horizontal size in pixel |
askksa12543 | 0:990d5eec2ef6 | 236 | * - the number of byte per vertical line |
askksa12543 | 0:990d5eec2ef6 | 237 | * you also have to change the array to char[] |
askksa12543 | 0:990d5eec2ef6 | 238 | * |
askksa12543 | 0:990d5eec2ef6 | 239 | */ |
askksa12543 | 0:990d5eec2ef6 | 240 | void set_font(unsigned char* f); |
askksa12543 | 0:990d5eec2ef6 | 241 | |
askksa12543 | 0:990d5eec2ef6 | 242 | /** print bitmap to buffer |
askksa12543 | 0:990d5eec2ef6 | 243 | * |
askksa12543 | 0:990d5eec2ef6 | 244 | * @param bm Bitmap in flash |
askksa12543 | 0:990d5eec2ef6 | 245 | * @param x x start |
askksa12543 | 0:990d5eec2ef6 | 246 | * @param y y start |
askksa12543 | 0:990d5eec2ef6 | 247 | * |
askksa12543 | 0:990d5eec2ef6 | 248 | */ |
askksa12543 | 0:990d5eec2ef6 | 249 | |
askksa12543 | 0:990d5eec2ef6 | 250 | void print_bm(Bitmap bm, int x, int y); |
askksa12543 | 0:990d5eec2ef6 | 251 | |
askksa12543 | 0:990d5eec2ef6 | 252 | protected: |
askksa12543 | 0:990d5eec2ef6 | 253 | |
askksa12543 | 0:990d5eec2ef6 | 254 | /** draw a horizontal line |
askksa12543 | 0:990d5eec2ef6 | 255 | * |
askksa12543 | 0:990d5eec2ef6 | 256 | * @param x0 horizontal start |
askksa12543 | 0:990d5eec2ef6 | 257 | * @param x1 horizontal stop |
askksa12543 | 0:990d5eec2ef6 | 258 | * @param y vertical position |
askksa12543 | 0:990d5eec2ef6 | 259 | * @param ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 260 | * |
askksa12543 | 0:990d5eec2ef6 | 261 | */ |
askksa12543 | 0:990d5eec2ef6 | 262 | void hline(int x0, int x1, int y, int colour); |
askksa12543 | 0:990d5eec2ef6 | 263 | |
askksa12543 | 0:990d5eec2ef6 | 264 | /** draw a vertical line |
askksa12543 | 0:990d5eec2ef6 | 265 | * |
askksa12543 | 0:990d5eec2ef6 | 266 | * @param x horizontal position |
askksa12543 | 0:990d5eec2ef6 | 267 | * @param y0 vertical start |
askksa12543 | 0:990d5eec2ef6 | 268 | * @param y1 vertical stop |
askksa12543 | 0:990d5eec2ef6 | 269 | * @param ,1 set pixel ,0 erase pixel |
askksa12543 | 0:990d5eec2ef6 | 270 | */ |
askksa12543 | 0:990d5eec2ef6 | 271 | void vline(int y0, int y1, int x, int colour); |
askksa12543 | 0:990d5eec2ef6 | 272 | |
askksa12543 | 0:990d5eec2ef6 | 273 | /** Init the C12832 LCD controller |
askksa12543 | 0:990d5eec2ef6 | 274 | * |
askksa12543 | 0:990d5eec2ef6 | 275 | */ |
askksa12543 | 0:990d5eec2ef6 | 276 | void lcd_reset(); |
askksa12543 | 0:990d5eec2ef6 | 277 | |
askksa12543 | 0:990d5eec2ef6 | 278 | /** Write data to the LCD controller |
askksa12543 | 0:990d5eec2ef6 | 279 | * |
askksa12543 | 0:990d5eec2ef6 | 280 | * @param dat data written to LCD controller |
askksa12543 | 0:990d5eec2ef6 | 281 | * |
askksa12543 | 0:990d5eec2ef6 | 282 | */ |
askksa12543 | 0:990d5eec2ef6 | 283 | void wr_dat(unsigned char value); |
askksa12543 | 0:990d5eec2ef6 | 284 | |
askksa12543 | 0:990d5eec2ef6 | 285 | /** Write a command the LCD controller |
askksa12543 | 0:990d5eec2ef6 | 286 | * |
askksa12543 | 0:990d5eec2ef6 | 287 | * @param cmd: command to be written |
askksa12543 | 0:990d5eec2ef6 | 288 | * |
askksa12543 | 0:990d5eec2ef6 | 289 | */ |
askksa12543 | 0:990d5eec2ef6 | 290 | void wr_cmd(unsigned char value); |
askksa12543 | 0:990d5eec2ef6 | 291 | |
askksa12543 | 0:990d5eec2ef6 | 292 | void wr_cnt(unsigned char cmd); |
askksa12543 | 0:990d5eec2ef6 | 293 | |
askksa12543 | 0:990d5eec2ef6 | 294 | unsigned int orientation; |
askksa12543 | 0:990d5eec2ef6 | 295 | unsigned int char_x; |
askksa12543 | 0:990d5eec2ef6 | 296 | unsigned int char_y; |
askksa12543 | 0:990d5eec2ef6 | 297 | unsigned char buffer[512]; |
askksa12543 | 0:990d5eec2ef6 | 298 | unsigned int contrast; |
askksa12543 | 0:990d5eec2ef6 | 299 | unsigned int auto_up; |
askksa12543 | 0:990d5eec2ef6 | 300 | |
askksa12543 | 0:990d5eec2ef6 | 301 | }; |
askksa12543 | 0:990d5eec2ef6 | 302 | |
askksa12543 | 0:990d5eec2ef6 | 303 | |
askksa12543 | 0:990d5eec2ef6 | 304 | |
askksa12543 | 0:990d5eec2ef6 | 305 | |
askksa12543 | 0:990d5eec2ef6 | 306 | #endif |