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