SSD1963 Initial code & test fill screen.
Dependencies: mbed
SSD1963/SSD1963.h@0:2714fcd95190, 2014-04-18 (annotated)
- Committer:
- techstep
- Date:
- Fri Apr 18 04:16:35 2014 +0000
- Revision:
- 0:2714fcd95190
ST Nucleo F401RE; 7" TFT LCD 800x480 [SSD1963]; Test TFT Init.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
techstep | 0:2714fcd95190 | 1 | /***************************************************************************** |
techstep | 0:2714fcd95190 | 2 | * Project : 7" TFT LCD 800x480 [AT070TN92] |
techstep | 0:2714fcd95190 | 3 | * Compiler : mbed Online |
techstep | 0:2714fcd95190 | 4 | * Type : Libraries |
techstep | 0:2714fcd95190 | 5 | * Comment : Support mbed ST Nucleo Board. |
techstep | 0:2714fcd95190 | 6 | * : Support Chip = SSD1963 |
techstep | 0:2714fcd95190 | 7 | * File : SSD1963.h |
techstep | 0:2714fcd95190 | 8 | * |
techstep | 0:2714fcd95190 | 9 | * Author : Mr.Thongchai Artsamart [Bird Techstep] |
techstep | 0:2714fcd95190 | 10 | * E-Mail : t.artsamart@gmail.com |
techstep | 0:2714fcd95190 | 11 | * : tbird_th@hotmail.com |
techstep | 0:2714fcd95190 | 12 | * Start Date : 20/03/2014 [dd/mm/yyyy] |
techstep | 0:2714fcd95190 | 13 | * Version Date : 20/03/2014 [dd/mm/yyyy] |
techstep | 0:2714fcd95190 | 14 | * Licensed under a Creative Commons Attribution-ShareAlike 3.0 License. |
techstep | 0:2714fcd95190 | 15 | ***************************************************************************** |
techstep | 0:2714fcd95190 | 16 | * Remark : Thank you -. no1wudi [CooCox] |
techstep | 0:2714fcd95190 | 17 | * -. |
techstep | 0:2714fcd95190 | 18 | *****************************************************************************/ |
techstep | 0:2714fcd95190 | 19 | #ifndef __SSD1963_H_ |
techstep | 0:2714fcd95190 | 20 | #define __SSD1963_H_ |
techstep | 0:2714fcd95190 | 21 | //#include "mbed.h" |
techstep | 0:2714fcd95190 | 22 | |
techstep | 0:2714fcd95190 | 23 | /********************************************************************* |
techstep | 0:2714fcd95190 | 24 | * Overview: Image orientation (can be 0, 90, 180, 270 degrees). |
techstep | 0:2714fcd95190 | 25 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 26 | #define DISP_ORIENTATION 0 |
techstep | 0:2714fcd95190 | 27 | /********************************************************************* |
techstep | 0:2714fcd95190 | 28 | * Overview: Panel Data Width (R,G,B) in (6,6,6) |
techstep | 0:2714fcd95190 | 29 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 30 | #define DISP_DATA_WIDTH 18 |
techstep | 0:2714fcd95190 | 31 | /********************************************************************* |
techstep | 0:2714fcd95190 | 32 | * Overview: Horizontal and vertical display resolution |
techstep | 0:2714fcd95190 | 33 | * (from the glass datasheet). |
techstep | 0:2714fcd95190 | 34 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 35 | #define DISP_HOR_RESOLUTION 800 |
techstep | 0:2714fcd95190 | 36 | #define DISP_VER_RESOLUTION 480 |
techstep | 0:2714fcd95190 | 37 | /********************************************************************* |
techstep | 0:2714fcd95190 | 38 | * Overview: Horizontal synchronization timing in pixels |
techstep | 0:2714fcd95190 | 39 | * (from the glass datasheet). |
techstep | 0:2714fcd95190 | 40 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 41 | #define DISP_HOR_PULSE_WIDTH 1 |
techstep | 0:2714fcd95190 | 42 | #define DISP_HOR_BACK_PORCH 210 |
techstep | 0:2714fcd95190 | 43 | #define DISP_HOR_FRONT_PORCH 45 |
techstep | 0:2714fcd95190 | 44 | /********************************************************************* |
techstep | 0:2714fcd95190 | 45 | * Overview: Vertical synchronization timing in lines |
techstep | 0:2714fcd95190 | 46 | * (from the glass datasheet). |
techstep | 0:2714fcd95190 | 47 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 48 | #define DISP_VER_PULSE_WIDTH 1 |
techstep | 0:2714fcd95190 | 49 | #define DISP_VER_BACK_PORCH 34 |
techstep | 0:2714fcd95190 | 50 | #define DISP_VER_FRONT_PORCH 10 |
techstep | 0:2714fcd95190 | 51 | |
techstep | 0:2714fcd95190 | 52 | /********************************************************************* |
techstep | 0:2714fcd95190 | 53 | * Overview: Some basic colors definitions. |
techstep | 0:2714fcd95190 | 54 | *********************************************************************/ |
techstep | 0:2714fcd95190 | 55 | #define BLACK RGB565CONVERT(0, 0, 0) |
techstep | 0:2714fcd95190 | 56 | #define BRIGHTBLUE RGB565CONVERT(0, 0, 255) |
techstep | 0:2714fcd95190 | 57 | #define BRIGHTGREEN RGB565CONVERT(0, 255, 0) |
techstep | 0:2714fcd95190 | 58 | #define BRIGHTCYAN RGB565CONVERT(0, 255, 255) |
techstep | 0:2714fcd95190 | 59 | #define BRIGHTRED RGB565CONVERT(255, 0, 0) |
techstep | 0:2714fcd95190 | 60 | #define BRIGHTMAGENTA RGB565CONVERT(255, 0, 255) |
techstep | 0:2714fcd95190 | 61 | #define BRIGHTYELLOW RGB565CONVERT(255, 255, 0) |
techstep | 0:2714fcd95190 | 62 | #define BLUE RGB565CONVERT(0, 0, 128) |
techstep | 0:2714fcd95190 | 63 | #define GREEN RGB565CONVERT(0, 128, 0) |
techstep | 0:2714fcd95190 | 64 | #define CYAN RGB565CONVERT(0, 128, 128) |
techstep | 0:2714fcd95190 | 65 | #define RED RGB565CONVERT(128, 0, 0) |
techstep | 0:2714fcd95190 | 66 | #define MAGENTA RGB565CONVERT(128, 0, 128) |
techstep | 0:2714fcd95190 | 67 | #define BROWN RGB565CONVERT(255, 128, 0) |
techstep | 0:2714fcd95190 | 68 | #define LIGHTGRAY RGB565CONVERT(128, 128, 128) |
techstep | 0:2714fcd95190 | 69 | #define DARKGRAY RGB565CONVERT(64, 64, 64) |
techstep | 0:2714fcd95190 | 70 | #define LIGHTBLUE RGB565CONVERT(128, 128, 255) |
techstep | 0:2714fcd95190 | 71 | #define LIGHTGREEN RGB565CONVERT(128, 255, 128) |
techstep | 0:2714fcd95190 | 72 | #define LIGHTCYAN RGB565CONVERT(128, 255, 255) |
techstep | 0:2714fcd95190 | 73 | #define LIGHTRED RGB565CONVERT(255, 128, 128) |
techstep | 0:2714fcd95190 | 74 | #define LIGHTMAGENTA RGB565CONVERT(255, 128, 255) |
techstep | 0:2714fcd95190 | 75 | #define YELLOW RGB565CONVERT(255, 255, 128) |
techstep | 0:2714fcd95190 | 76 | #define WHITE RGB565CONVERT(255, 255, 255) |
techstep | 0:2714fcd95190 | 77 | |
techstep | 0:2714fcd95190 | 78 | #define GRAY0 RGB565CONVERT(224, 224, 224) |
techstep | 0:2714fcd95190 | 79 | #define GRAY1 RGB565CONVERT(192, 192, 192) |
techstep | 0:2714fcd95190 | 80 | #define GRAY2 RGB565CONVERT(160, 160, 160) |
techstep | 0:2714fcd95190 | 81 | #define GRAY3 RGB565CONVERT(128, 128, 128) |
techstep | 0:2714fcd95190 | 82 | #define GRAY4 RGB565CONVERT(96, 96, 96) |
techstep | 0:2714fcd95190 | 83 | #define GRAY5 RGB565CONVERT(64, 64, 64) |
techstep | 0:2714fcd95190 | 84 | #define GRAY6 RGB565CONVERT(32, 32, 32) |
techstep | 0:2714fcd95190 | 85 | |
techstep | 0:2714fcd95190 | 86 | // PB0 PB1 PB2 PB6 PB7 |
techstep | 0:2714fcd95190 | 87 | // RST nCS nRD nWR nRS |
techstep | 0:2714fcd95190 | 88 | // - LCD_CS ----------------------------------------------------------------- |
techstep | 0:2714fcd95190 | 89 | #define CS_HIGH {GPIOB->BSRRL = GPIO_BSRR_BS_1;} |
techstep | 0:2714fcd95190 | 90 | #define CS_LOW {GPIOB->BSRRH = GPIO_BSRR_BS_1;} |
techstep | 0:2714fcd95190 | 91 | // - LCD_RS ----------------------------------------------------------------- |
techstep | 0:2714fcd95190 | 92 | #define RS_HIGH {GPIOB->BSRRL = GPIO_BSRR_BS_7;} |
techstep | 0:2714fcd95190 | 93 | #define RS_LOW {GPIOB->BSRRH = GPIO_BSRR_BS_7;} |
techstep | 0:2714fcd95190 | 94 | // - LCD_WR ----------------------------------------------------------------- |
techstep | 0:2714fcd95190 | 95 | #define WR_HIGH {GPIOB->BSRRL = GPIO_BSRR_BS_6;} |
techstep | 0:2714fcd95190 | 96 | #define WR_LOW {GPIOB->BSRRH = GPIO_BSRR_BS_6;} |
techstep | 0:2714fcd95190 | 97 | #define WR_STROBE {WR_LOW; WR_HIGH;} |
techstep | 0:2714fcd95190 | 98 | // - LCD_RD ----------------------------------------------------------------- |
techstep | 0:2714fcd95190 | 99 | #define RD_HIGH {GPIOB->BSRRL = GPIO_BSRR_BS_2;} |
techstep | 0:2714fcd95190 | 100 | #define RD_LOW {GPIOB->BSRRH = GPIO_BSRR_BS_2;} |
techstep | 0:2714fcd95190 | 101 | // - LCD_RST ---------------------------------------------------------------- |
techstep | 0:2714fcd95190 | 102 | #define RST_HIGH {GPIOB->BSRRL = GPIO_BSRR_BS_0;} |
techstep | 0:2714fcd95190 | 103 | #define RST_LOW {GPIOB->BSRRH = GPIO_BSRR_BS_0;} |
techstep | 0:2714fcd95190 | 104 | |
techstep | 0:2714fcd95190 | 105 | /* |
techstep | 0:2714fcd95190 | 106 | // Section : SSD1963 Command -------------------------------------------------- |
techstep | 0:2714fcd95190 | 107 | // - HX83XX Register Names ---------------------------------------------------- |
techstep | 0:2714fcd95190 | 108 | #define COL_ADD_START_HI 0x02 // W/R - SC[15:8] (8'b0000_0000) |
techstep | 0:2714fcd95190 | 109 | #define COL_ADD_START_LO 0x03 // W/R - SC[7:0] (8'b0000_0000) |
techstep | 0:2714fcd95190 | 110 | |
techstep | 0:2714fcd95190 | 111 | #define COL_ADD_END_HI 0x04 // W/R - EC[15:8] (8'b0000_0000) |
techstep | 0:2714fcd95190 | 112 | #define COL_ADD_END_LO 0x05 // W/R - EC[7:0] (8'b1110_1111) |
techstep | 0:2714fcd95190 | 113 | |
techstep | 0:2714fcd95190 | 114 | #define ROW_ADD_START_HI 0x06 // W/R - SP[15:8] (8'b0000_0000) |
techstep | 0:2714fcd95190 | 115 | #define ROW_ADD_START_LO 0x07 // W/R - SP[7:0] (8'b0000_00000) |
techstep | 0:2714fcd95190 | 116 | |
techstep | 0:2714fcd95190 | 117 | #define ROW_ADD_END_HI 0x08 // W/R - EP[15:8] (8'b0000_0001) |
techstep | 0:2714fcd95190 | 118 | #define ROW_ADD_END_LO 0x09 // W/R - EP[7:0] (8'b0011_1111) |
techstep | 0:2714fcd95190 | 119 | |
techstep | 0:2714fcd95190 | 120 | //#define MEM_ACCESS 0x16 // W/R - MY(0) MX(0) MV(0) ML(0) BGR(0) - - - |
techstep | 0:2714fcd95190 | 121 | #define MEM_ACCESS 0x36 |
techstep | 0:2714fcd95190 | 122 | //#define SRAM_WRITE 0x22 // W/R SRAM Write |
techstep | 0:2714fcd95190 | 123 | #define SRAM_WRITE 0x2C |
techstep | 0:2714fcd95190 | 124 | */ |
techstep | 0:2714fcd95190 | 125 | /* |
techstep | 0:2714fcd95190 | 126 | #define Com_NOP 0x00 // brief No opeation |
techstep | 0:2714fcd95190 | 127 | #define Com_Reset 0x01 // brief Software reset |
techstep | 0:2714fcd95190 | 128 | #define Com_GetPowerMode 0x0A // brief Get power mode |
techstep | 0:2714fcd95190 | 129 | #define Com_GetAddressMode 0x0B // brief Get the frame memory t the display panel read order |
techstep | 0:2714fcd95190 | 130 | #define Com_GetPixelFormat 0x0C // brief Get the current pixel format |
techstep | 0:2714fcd95190 | 131 | #define Com_GetDisplayModule 0x0D // brief Get the current display format |
techstep | 0:2714fcd95190 | 132 | #define Com_GetSignalMode 0x0E // brief Get the display mode from peripharel |
techstep | 0:2714fcd95190 | 133 | #define Com_EnterSleepMode 0x10 // brief Enter the sleep mode |
techstep | 0:2714fcd95190 | 134 | #define Com_ExitSleepMode 0x11 // brief Turn on the panel |
techstep | 0:2714fcd95190 | 135 | #define Com_EnterPartialMode 0x12 // brief Enter partial mode |
techstep | 0:2714fcd95190 | 136 | #define Com_EnterNormalMode 0x13 // brief Enter normal mode |
techstep | 0:2714fcd95190 | 137 | #define Com_ExitInvertMode 0x20 // brief Exit the invert mode |
techstep | 0:2714fcd95190 | 138 | #define Com_EnterInvertMode 0x21 |
techstep | 0:2714fcd95190 | 139 | |
techstep | 0:2714fcd95190 | 140 | #define Com_SetGammaCurve 0x26 |
techstep | 0:2714fcd95190 | 141 | |
techstep | 0:2714fcd95190 | 142 | #define Com_SetDisplayOff 0x28 |
techstep | 0:2714fcd95190 | 143 | #define Com_SetDisplayOn 0x29 |
techstep | 0:2714fcd95190 | 144 | |
techstep | 0:2714fcd95190 | 145 | #define Com_SetColumnAddress 0x2A |
techstep | 0:2714fcd95190 | 146 | |
techstep | 0:2714fcd95190 | 147 | #define Com_SetPageAddress 0x2B |
techstep | 0:2714fcd95190 | 148 | |
techstep | 0:2714fcd95190 | 149 | #define Com_WriteMemory 0x2C |
techstep | 0:2714fcd95190 | 150 | |
techstep | 0:2714fcd95190 | 151 | #define Com_ReadMomery 0x2E |
techstep | 0:2714fcd95190 | 152 | |
techstep | 0:2714fcd95190 | 153 | #define Com_SetPartialArea 0x30 |
techstep | 0:2714fcd95190 | 154 | |
techstep | 0:2714fcd95190 | 155 | #define Com_SetScrollArea 0x33 |
techstep | 0:2714fcd95190 | 156 | |
techstep | 0:2714fcd95190 | 157 | #define Com_SetTearOff 0x34 |
techstep | 0:2714fcd95190 | 158 | #define Com_SetTearOn 0x35 |
techstep | 0:2714fcd95190 | 159 | |
techstep | 0:2714fcd95190 | 160 | #define Com_SetAddressMode 0x36 |
techstep | 0:2714fcd95190 | 161 | |
techstep | 0:2714fcd95190 | 162 | #define Com_SetScrollStart 0x37 |
techstep | 0:2714fcd95190 | 163 | |
techstep | 0:2714fcd95190 | 164 | #define Com_ExtiIdleMode 0x38 |
techstep | 0:2714fcd95190 | 165 | #define Com_EnterIdleMode 0x39 |
techstep | 0:2714fcd95190 | 166 | |
techstep | 0:2714fcd95190 | 167 | #define Com_SetPixelFormat 0x3A |
techstep | 0:2714fcd95190 | 168 | |
techstep | 0:2714fcd95190 | 169 | #define Com_WriteMemoryContinue 0x3C |
techstep | 0:2714fcd95190 | 170 | |
techstep | 0:2714fcd95190 | 171 | #define Com_ReadMemoryContinue 0x3E |
techstep | 0:2714fcd95190 | 172 | |
techstep | 0:2714fcd95190 | 173 | #define Com_SetTearScanLine 0x44 |
techstep | 0:2714fcd95190 | 174 | #define Com_GetTearScanLine 0x45 |
techstep | 0:2714fcd95190 | 175 | |
techstep | 0:2714fcd95190 | 176 | #define Com_GetDDB 0xA1 |
techstep | 0:2714fcd95190 | 177 | |
techstep | 0:2714fcd95190 | 178 | #define Com_SetLCDMode 0xB0 |
techstep | 0:2714fcd95190 | 179 | #define Com_GetLCDMode 0xB1 |
techstep | 0:2714fcd95190 | 180 | |
techstep | 0:2714fcd95190 | 181 | #define Com_SetHoriPeriod 0xB4 |
techstep | 0:2714fcd95190 | 182 | #define Com_GetHoriPeriod 0xB5 |
techstep | 0:2714fcd95190 | 183 | |
techstep | 0:2714fcd95190 | 184 | #define Com_SetVertPeriod 0xB6 |
techstep | 0:2714fcd95190 | 185 | #define Com_GetVertPeriod 0xB7 |
techstep | 0:2714fcd95190 | 186 | |
techstep | 0:2714fcd95190 | 187 | #define Com_SetGPIOConf 0xB8 |
techstep | 0:2714fcd95190 | 188 | #define Com_GetGPIOConf 0xB9 |
techstep | 0:2714fcd95190 | 189 | |
techstep | 0:2714fcd95190 | 190 | #define Com_SetGPIOValue 0xBA |
techstep | 0:2714fcd95190 | 191 | |
techstep | 0:2714fcd95190 | 192 | #define Com_GetGPIOStatus 0xBB |
techstep | 0:2714fcd95190 | 193 | |
techstep | 0:2714fcd95190 | 194 | #define Com_SetPostProcessor 0xBC |
techstep | 0:2714fcd95190 | 195 | #define Com_GetPostProcessor 0xBD |
techstep | 0:2714fcd95190 | 196 | |
techstep | 0:2714fcd95190 | 197 | #define Com_SetPWMConf 0xBE |
techstep | 0:2714fcd95190 | 198 | #define Com_GetPWMConf 0xBF |
techstep | 0:2714fcd95190 | 199 | |
techstep | 0:2714fcd95190 | 200 | #define Com_SetLCDGenerator0 0xC0 |
techstep | 0:2714fcd95190 | 201 | #define Com_GetLCDGenerator0 0xC1 |
techstep | 0:2714fcd95190 | 202 | |
techstep | 0:2714fcd95190 | 203 | #define Com_SetLCDGenerator1 0xC2 |
techstep | 0:2714fcd95190 | 204 | #define Com_GetLCDGenerator1 0xC3 |
techstep | 0:2714fcd95190 | 205 | |
techstep | 0:2714fcd95190 | 206 | #define Com_SetLCDGenerator2 0xC4 |
techstep | 0:2714fcd95190 | 207 | #define Com_GetLCDGenerator2 0xC5 |
techstep | 0:2714fcd95190 | 208 | |
techstep | 0:2714fcd95190 | 209 | #define Com_SetLCDGenerator3 0xC6 |
techstep | 0:2714fcd95190 | 210 | #define Com_GetLCDGenerator3 0xC7 |
techstep | 0:2714fcd95190 | 211 | |
techstep | 0:2714fcd95190 | 212 | #define Com_SetDynamicBackLightConf 0xD0 |
techstep | 0:2714fcd95190 | 213 | #define Com_GetDynamicBackLightConf 0xD1 |
techstep | 0:2714fcd95190 | 214 | |
techstep | 0:2714fcd95190 | 215 | #define Com_SetDynamicBackLightThreshold 0xD4 |
techstep | 0:2714fcd95190 | 216 | #define Com_GetDynamicBackLightThreshold 0xD5 |
techstep | 0:2714fcd95190 | 217 | |
techstep | 0:2714fcd95190 | 218 | #define Com_SetPLLStart 0xE0 |
techstep | 0:2714fcd95190 | 219 | |
techstep | 0:2714fcd95190 | 220 | #define Com_SetPLLConfig 0xE2 |
techstep | 0:2714fcd95190 | 221 | #define Com_GetPLLConfig 0xE3 |
techstep | 0:2714fcd95190 | 222 | |
techstep | 0:2714fcd95190 | 223 | #define Com_GetPLLStatus 0xE4 |
techstep | 0:2714fcd95190 | 224 | |
techstep | 0:2714fcd95190 | 225 | #define Com_SetDeepSleepMode 0xE5 |
techstep | 0:2714fcd95190 | 226 | |
techstep | 0:2714fcd95190 | 227 | #define Com_GetPixelClock 0xE7 |
techstep | 0:2714fcd95190 | 228 | #define Com_SetPixelClock 0xE6 |
techstep | 0:2714fcd95190 | 229 | |
techstep | 0:2714fcd95190 | 230 | #define Com_SetPixelInterface 0xF0 |
techstep | 0:2714fcd95190 | 231 | #define Com_GetPixelInterface 0xF1 |
techstep | 0:2714fcd95190 | 232 | */ |
techstep | 0:2714fcd95190 | 233 | // End : SSD1963 Command ------------------------------------------------------ |
techstep | 0:2714fcd95190 | 234 | |
techstep | 0:2714fcd95190 | 235 | #define swap(a, b) { int16_t t = a; a = b; b = t; } |
techstep | 0:2714fcd95190 | 236 | |
techstep | 0:2714fcd95190 | 237 | class SSD1963 { |
techstep | 0:2714fcd95190 | 238 | public: |
techstep | 0:2714fcd95190 | 239 | SSD1963(); |
techstep | 0:2714fcd95190 | 240 | void init(void); |
techstep | 0:2714fcd95190 | 241 | void begin(void); |
techstep | 0:2714fcd95190 | 242 | void reset(void); |
techstep | 0:2714fcd95190 | 243 | |
techstep | 0:2714fcd95190 | 244 | //void drawPixel(uint16_t x, uint16_t y, uint16_t color); |
techstep | 0:2714fcd95190 | 245 | void fillScreen(uint16_t color); |
techstep | 0:2714fcd95190 | 246 | //void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); |
techstep | 0:2714fcd95190 | 247 | //void drawVerticalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color); |
techstep | 0:2714fcd95190 | 248 | //void drawHorizontalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color); |
techstep | 0:2714fcd95190 | 249 | //void drawTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); |
techstep | 0:2714fcd95190 | 250 | //void fillTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color); |
techstep | 0:2714fcd95190 | 251 | //void drawRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color); |
techstep | 0:2714fcd95190 | 252 | //void fillRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t color); |
techstep | 0:2714fcd95190 | 253 | //void drawRoundRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color); |
techstep | 0:2714fcd95190 | 254 | //void fillRoundRect(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color); |
techstep | 0:2714fcd95190 | 255 | //void drawCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color); |
techstep | 0:2714fcd95190 | 256 | //void fillCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color); |
techstep | 0:2714fcd95190 | 257 | |
techstep | 0:2714fcd95190 | 258 | //void setCursor(uint16_t x, uint16_t y); |
techstep | 0:2714fcd95190 | 259 | //void setTextColor(uint16_t c); |
techstep | 0:2714fcd95190 | 260 | //void setTextColor(uint16_t c, uint16_t bg); |
techstep | 0:2714fcd95190 | 261 | //void setTextSize(uint8_t s); |
techstep | 0:2714fcd95190 | 262 | //void setTextWrap(bool w); |
techstep | 0:2714fcd95190 | 263 | //void drawChar(uint16_t x, uint16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size); |
techstep | 0:2714fcd95190 | 264 | //void drawBitmap(uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t w, uint16_t h, uint16_t color); |
techstep | 0:2714fcd95190 | 265 | |
techstep | 0:2714fcd95190 | 266 | //virtual size_t write(uint8_t); |
techstep | 0:2714fcd95190 | 267 | |
techstep | 0:2714fcd95190 | 268 | uint16_t Color565(uint8_t r, uint8_t g, uint8_t b); |
techstep | 0:2714fcd95190 | 269 | //uint8_t readID(void); |
techstep | 0:2714fcd95190 | 270 | |
techstep | 0:2714fcd95190 | 271 | //void setRotation(uint8_t x); |
techstep | 0:2714fcd95190 | 272 | //uint8_t getRotation(); |
techstep | 0:2714fcd95190 | 273 | // These methods are public in order for BMP examples to work: |
techstep | 0:2714fcd95190 | 274 | //void setAddrWindow(int x1, int y1, int x2, int y2); |
techstep | 0:2714fcd95190 | 275 | //void pushColors(uint16_t *data, uint8_t len, bool first); |
techstep | 0:2714fcd95190 | 276 | |
techstep | 0:2714fcd95190 | 277 | // - Low Level ------------------------------------------------------------ |
techstep | 0:2714fcd95190 | 278 | void writeData(uint16_t data); |
techstep | 0:2714fcd95190 | 279 | void writeCommand(uint16_t cmd); |
techstep | 0:2714fcd95190 | 280 | uint16_t readData(void); |
techstep | 0:2714fcd95190 | 281 | void writeRegister(uint16_t addr, uint16_t data); |
techstep | 0:2714fcd95190 | 282 | |
techstep | 0:2714fcd95190 | 283 | //void writeData8(uint8_t d); |
techstep | 0:2714fcd95190 | 284 | //void writeData16(uint16_t d); |
techstep | 0:2714fcd95190 | 285 | //void writeCommand(uint8_t c); |
techstep | 0:2714fcd95190 | 286 | //uint8_t readData8(void); |
techstep | 0:2714fcd95190 | 287 | //uint16_t readData16(void); |
techstep | 0:2714fcd95190 | 288 | //void writeRegister(uint8_t addr, uint8_t data); |
techstep | 0:2714fcd95190 | 289 | //void writeRegisterPair(uint8_t aH, uint8_t aL, uint16_t d); |
techstep | 0:2714fcd95190 | 290 | |
techstep | 0:2714fcd95190 | 291 | //uint16_t width(); |
techstep | 0:2714fcd95190 | 292 | //uint16_t height(); |
techstep | 0:2714fcd95190 | 293 | |
techstep | 0:2714fcd95190 | 294 | static const uint16_t TFTWIDTH = 800; |
techstep | 0:2714fcd95190 | 295 | static const uint16_t TFTHEIGHT = 480; |
techstep | 0:2714fcd95190 | 296 | |
techstep | 0:2714fcd95190 | 297 | //void writeData_unsafe(uint16_t d); |
techstep | 0:2714fcd95190 | 298 | //void setWriteDir(void); |
techstep | 0:2714fcd95190 | 299 | //void setReadDir(void); |
techstep | 0:2714fcd95190 | 300 | |
techstep | 0:2714fcd95190 | 301 | //void write8(uint8_t d); |
techstep | 0:2714fcd95190 | 302 | |
techstep | 0:2714fcd95190 | 303 | private: |
techstep | 0:2714fcd95190 | 304 | //void init(void); |
techstep | 0:2714fcd95190 | 305 | //void flood(uint16_t color, uint32_t len); |
techstep | 0:2714fcd95190 | 306 | |
techstep | 0:2714fcd95190 | 307 | //void drawCircleHelper(uint16_t x0, uint16_t y0, uint16_t r, uint8_t corner, uint16_t color); |
techstep | 0:2714fcd95190 | 308 | //void fillCircleHelper(uint16_t x0, uint16_t y0, uint16_t r, uint8_t corner, uint16_t delta, uint16_t color); |
techstep | 0:2714fcd95190 | 309 | |
techstep | 0:2714fcd95190 | 310 | //uint8_t read8(void); |
techstep | 0:2714fcd95190 | 311 | |
techstep | 0:2714fcd95190 | 312 | protected: |
techstep | 0:2714fcd95190 | 313 | //uint16_t _width, _height; |
techstep | 0:2714fcd95190 | 314 | //uint8_t textsize; |
techstep | 0:2714fcd95190 | 315 | //uint16_t cursor_x, cursor_y; |
techstep | 0:2714fcd95190 | 316 | //uint16_t textcolor; |
techstep | 0:2714fcd95190 | 317 | //uint16_t textbgcolor; |
techstep | 0:2714fcd95190 | 318 | //uint8_t rotation; |
techstep | 0:2714fcd95190 | 319 | //uint8_t driver; |
techstep | 0:2714fcd95190 | 320 | //bool wrap; |
techstep | 0:2714fcd95190 | 321 | }; |
techstep | 0:2714fcd95190 | 322 | |
techstep | 0:2714fcd95190 | 323 | #endif |