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