Caiou
Dependents: LCD_Proj LCD_imagetest LCD_Proj_rtc
Fork of DmTftLibrary by
DmTftRa8875.cpp@17:67d1b918afe2, 2015-12-21 (annotated)
- Committer:
- Nikolas
- Date:
- Mon Dec 21 14:29:20 2015 +0000
- Revision:
- 17:67d1b918afe2
- Parent:
- 14:2db7065edbec
,jggfjlf;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
displaymodule | 11:264e19992620 | 1 | /********************************************************************************************** |
displaymodule | 11:264e19992620 | 2 | Copyright (c) 2014 DisplayModule. All rights reserved. |
displaymodule | 11:264e19992620 | 3 | |
displaymodule | 11:264e19992620 | 4 | Redistribution and use of this source code, part of this source code or any compiled binary |
displaymodule | 11:264e19992620 | 5 | based on this source code is permitted as long as the above copyright notice and following |
displaymodule | 11:264e19992620 | 6 | disclaimer is retained. |
displaymodule | 11:264e19992620 | 7 | |
displaymodule | 11:264e19992620 | 8 | DISCLAIMER: |
displaymodule | 11:264e19992620 | 9 | THIS SOFTWARE IS SUPPLIED "AS IS" WITHOUT ANY WARRANTIES AND SUPPORT. DISPLAYMODULE ASSUMES |
displaymodule | 11:264e19992620 | 10 | NO RESPONSIBILITY OR LIABILITY FOR THE USE OF THE SOFTWARE. |
displaymodule | 11:264e19992620 | 11 | ********************************************************************************************/ |
displaymodule | 11:264e19992620 | 12 | |
displaymodule | 11:264e19992620 | 13 | /* Notice: |
displaymodule | 11:264e19992620 | 14 | The panel resolution should be config in DmTftRa8875::init() function. |
displaymodule | 11:264e19992620 | 15 | RA8875Size size = RA8875_480x272 or RA8875Size size = RA8875_800x480; |
displaymodule | 14:2db7065edbec | 16 | |
displaymodule | 14:2db7065edbec | 17 | Tested on NUCLEO-F401RE, LPCXpresso11U68, LPCXpresso824-MAX platform. |
displaymodule | 11:264e19992620 | 18 | */ |
displaymodule | 11:264e19992620 | 19 | |
displaymodule | 11:264e19992620 | 20 | #include "DmTftRa8875.h" |
displaymodule | 11:264e19992620 | 21 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 22 | DmTftRa8875::DmTftRa8875(uint8_t cs, uint8_t sel) |
displaymodule | 14:2db7065edbec | 23 | : DmTftBase(480, 272) |
displaymodule | 11:264e19992620 | 24 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 14:2db7065edbec | 25 | DmTftRa8875::DmTftRa8875(PinName cs, PinName sel, PinName mosi, PinName miso, PinName clk) |
displaymodule | 14:2db7065edbec | 26 | : DmTftBase(480, 272), spi(mosi, miso, clk) |
displaymodule | 11:264e19992620 | 27 | #endif |
displaymodule | 11:264e19992620 | 28 | { |
displaymodule | 11:264e19992620 | 29 | _cs = cs; |
displaymodule | 11:264e19992620 | 30 | _sel = sel; |
displaymodule | 11:264e19992620 | 31 | } |
displaymodule | 11:264e19992620 | 32 | |
displaymodule | 11:264e19992620 | 33 | DmTftRa8875::~DmTftRa8875() |
displaymodule | 11:264e19992620 | 34 | { |
displaymodule | 11:264e19992620 | 35 | #if defined (DM_TOOLCHAIN_MBED) |
displaymodule | 11:264e19992620 | 36 | delete _pinCS; |
displaymodule | 11:264e19992620 | 37 | delete _pinSEL; |
displaymodule | 11:264e19992620 | 38 | |
displaymodule | 11:264e19992620 | 39 | _pinCS = NULL; |
displaymodule | 11:264e19992620 | 40 | _pinSEL = NULL; |
displaymodule | 11:264e19992620 | 41 | #endif |
displaymodule | 11:264e19992620 | 42 | } |
displaymodule | 11:264e19992620 | 43 | |
displaymodule | 11:264e19992620 | 44 | uint16_t DmTftRa8875::width(void) |
displaymodule | 11:264e19992620 | 45 | { |
displaymodule | 11:264e19992620 | 46 | return _width; |
displaymodule | 11:264e19992620 | 47 | } |
displaymodule | 11:264e19992620 | 48 | |
displaymodule | 11:264e19992620 | 49 | uint16_t DmTftRa8875::height(void) |
displaymodule | 11:264e19992620 | 50 | { |
displaymodule | 11:264e19992620 | 51 | return _height; |
displaymodule | 11:264e19992620 | 52 | } |
displaymodule | 11:264e19992620 | 53 | |
displaymodule | 11:264e19992620 | 54 | void DmTftRa8875::writeBus(uint8_t data) |
displaymodule | 11:264e19992620 | 55 | { |
displaymodule | 11:264e19992620 | 56 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 57 | //SPCR = _spiSettings; // SPI Control Register |
displaymodule | 11:264e19992620 | 58 | SPDR = data; // SPI Data Register |
displaymodule | 11:264e19992620 | 59 | while(!(SPSR & _BV(SPIF))); // SPI Status Register Wait for transmission to finish |
displaymodule | 11:264e19992620 | 60 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 14:2db7065edbec | 61 | spi.write(data); |
displaymodule | 11:264e19992620 | 62 | #endif |
displaymodule | 11:264e19992620 | 63 | } |
displaymodule | 11:264e19992620 | 64 | |
displaymodule | 11:264e19992620 | 65 | uint8_t DmTftRa8875::readBus(void) |
displaymodule | 11:264e19992620 | 66 | { |
displaymodule | 11:264e19992620 | 67 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 68 | //SPCR = _spiSettings; // SPI Control Register |
displaymodule | 11:264e19992620 | 69 | SPDR = 0; // SPI Data Register |
displaymodule | 11:264e19992620 | 70 | while(!(SPSR & _BV(SPIF))); // SPI Status Register Wait for transmission to finish |
displaymodule | 11:264e19992620 | 71 | return SPDR; |
displaymodule | 11:264e19992620 | 72 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 14:2db7065edbec | 73 | return spi.write(0x00); // dummy byte to read |
displaymodule | 11:264e19992620 | 74 | #endif |
displaymodule | 11:264e19992620 | 75 | } |
displaymodule | 11:264e19992620 | 76 | |
displaymodule | 11:264e19992620 | 77 | void DmTftRa8875::sendCommand(uint8_t index) |
displaymodule | 11:264e19992620 | 78 | { |
displaymodule | 11:264e19992620 | 79 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 80 | |
displaymodule | 11:264e19992620 | 81 | writeBus(0x80); |
displaymodule | 11:264e19992620 | 82 | writeBus(index); |
displaymodule | 11:264e19992620 | 83 | |
displaymodule | 11:264e19992620 | 84 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 85 | } |
displaymodule | 11:264e19992620 | 86 | |
displaymodule | 11:264e19992620 | 87 | uint8_t DmTftRa8875::readStatus(void) |
displaymodule | 11:264e19992620 | 88 | { |
displaymodule | 11:264e19992620 | 89 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 90 | |
displaymodule | 11:264e19992620 | 91 | writeBus(0xC0); |
displaymodule | 11:264e19992620 | 92 | uint8_t data = readBus(); |
displaymodule | 11:264e19992620 | 93 | |
displaymodule | 11:264e19992620 | 94 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 95 | |
displaymodule | 11:264e19992620 | 96 | return data; |
displaymodule | 11:264e19992620 | 97 | } |
displaymodule | 11:264e19992620 | 98 | |
displaymodule | 11:264e19992620 | 99 | void DmTftRa8875::sendData(uint16_t data) |
displaymodule | 11:264e19992620 | 100 | { |
displaymodule | 11:264e19992620 | 101 | |
displaymodule | 11:264e19992620 | 102 | uint8_t dh = data>>8; |
displaymodule | 11:264e19992620 | 103 | uint8_t dl = data&0xff; |
displaymodule | 11:264e19992620 | 104 | |
displaymodule | 11:264e19992620 | 105 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 106 | |
displaymodule | 11:264e19992620 | 107 | writeBus(0x00); |
displaymodule | 11:264e19992620 | 108 | writeBus(dh); |
displaymodule | 11:264e19992620 | 109 | writeBus(dl); |
displaymodule | 11:264e19992620 | 110 | |
displaymodule | 11:264e19992620 | 111 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 112 | |
displaymodule | 11:264e19992620 | 113 | } |
displaymodule | 11:264e19992620 | 114 | |
displaymodule | 11:264e19992620 | 115 | void DmTftRa8875::send8BitData(uint8_t data) |
displaymodule | 11:264e19992620 | 116 | { |
displaymodule | 11:264e19992620 | 117 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 118 | |
displaymodule | 11:264e19992620 | 119 | writeBus(0x00); |
displaymodule | 11:264e19992620 | 120 | writeBus(data); |
displaymodule | 11:264e19992620 | 121 | |
displaymodule | 11:264e19992620 | 122 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 123 | } |
displaymodule | 11:264e19992620 | 124 | |
displaymodule | 11:264e19992620 | 125 | uint8_t DmTftRa8875::readData(void) |
displaymodule | 11:264e19992620 | 126 | { |
displaymodule | 11:264e19992620 | 127 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 128 | |
displaymodule | 11:264e19992620 | 129 | writeBus(0x40); |
displaymodule | 11:264e19992620 | 130 | uint8_t data = readBus(); |
displaymodule | 11:264e19992620 | 131 | |
displaymodule | 11:264e19992620 | 132 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 133 | |
displaymodule | 11:264e19992620 | 134 | return data; |
displaymodule | 11:264e19992620 | 135 | } |
displaymodule | 11:264e19992620 | 136 | |
displaymodule | 11:264e19992620 | 137 | void DmTftRa8875::writeReg(uint8_t reg, uint8_t val) |
displaymodule | 11:264e19992620 | 138 | { |
displaymodule | 11:264e19992620 | 139 | sendCommand(reg); |
displaymodule | 11:264e19992620 | 140 | send8BitData(val); |
displaymodule | 11:264e19992620 | 141 | } |
displaymodule | 11:264e19992620 | 142 | |
displaymodule | 11:264e19992620 | 143 | uint8_t DmTftRa8875::readReg(uint8_t reg) |
displaymodule | 11:264e19992620 | 144 | { |
displaymodule | 11:264e19992620 | 145 | sendCommand(reg); |
displaymodule | 11:264e19992620 | 146 | return readData(); |
displaymodule | 11:264e19992620 | 147 | } |
displaymodule | 11:264e19992620 | 148 | |
displaymodule | 11:264e19992620 | 149 | void DmTftRa8875::setAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) |
displaymodule | 11:264e19992620 | 150 | { |
displaymodule | 11:264e19992620 | 151 | /* Set active window X */ |
displaymodule | 11:264e19992620 | 152 | writeReg(0x30, x0); // horizontal start point |
displaymodule | 11:264e19992620 | 153 | writeReg(0x31, x0 >> 8); |
displaymodule | 11:264e19992620 | 154 | writeReg(0x34, (uint16_t)(x1) & 0xFF); // horizontal end point |
displaymodule | 11:264e19992620 | 155 | writeReg(0x35, (uint16_t)(x1) >> 8); |
displaymodule | 11:264e19992620 | 156 | |
displaymodule | 11:264e19992620 | 157 | /* Set active window Y */ |
displaymodule | 11:264e19992620 | 158 | writeReg(0x32, y0); // vertical start point |
displaymodule | 11:264e19992620 | 159 | writeReg(0x33, y0 >> 8); |
displaymodule | 11:264e19992620 | 160 | writeReg(0x36, (uint16_t)(y1) & 0xFF); // vertical end point |
displaymodule | 11:264e19992620 | 161 | writeReg(0x37, (uint16_t)(y1) >> 8); |
displaymodule | 11:264e19992620 | 162 | |
displaymodule | 11:264e19992620 | 163 | writeReg(0x46, x0); |
displaymodule | 11:264e19992620 | 164 | writeReg(0x47, x0 >> 8); |
displaymodule | 11:264e19992620 | 165 | writeReg(0x48, y0); |
displaymodule | 11:264e19992620 | 166 | writeReg(0x49, y0 >> 8); |
displaymodule | 11:264e19992620 | 167 | sendCommand(0x02); |
displaymodule | 11:264e19992620 | 168 | } |
displaymodule | 11:264e19992620 | 169 | |
displaymodule | 11:264e19992620 | 170 | void DmTftRa8875::softReset(void) |
displaymodule | 11:264e19992620 | 171 | { |
displaymodule | 11:264e19992620 | 172 | //softreset |
displaymodule | 11:264e19992620 | 173 | sendCommand(0x01); |
displaymodule | 11:264e19992620 | 174 | send8BitData(0x01); |
displaymodule | 11:264e19992620 | 175 | delay(10); |
displaymodule | 11:264e19992620 | 176 | sendCommand(0x01); |
displaymodule | 11:264e19992620 | 177 | send8BitData(0x00); |
displaymodule | 11:264e19992620 | 178 | delay(100); // This much delay needed?? |
displaymodule | 11:264e19992620 | 179 | } |
displaymodule | 11:264e19992620 | 180 | |
displaymodule | 11:264e19992620 | 181 | void DmTftRa8875::init(void) |
displaymodule | 11:264e19992620 | 182 | { |
displaymodule | 11:264e19992620 | 183 | // DM_TFT43_108 = RA8875_480x272; DM_TFT50_111 = RA8875_800x480 |
displaymodule | 14:2db7065edbec | 184 | RA8875Size size = RA8875_480x272; |
displaymodule | 11:264e19992620 | 185 | |
displaymodule | 11:264e19992620 | 186 | setTextColor(BLACK, WHITE); |
displaymodule | 11:264e19992620 | 187 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 188 | _pinCS = portOutputRegister(digitalPinToPort(_cs)); |
displaymodule | 11:264e19992620 | 189 | _bitmaskCS = digitalPinToBitMask(_cs); |
displaymodule | 11:264e19992620 | 190 | _pinSEL = portOutputRegister(digitalPinToPort(_sel)); |
displaymodule | 11:264e19992620 | 191 | _bitmaskSEL = digitalPinToBitMask(_sel); |
displaymodule | 11:264e19992620 | 192 | pinMode(_cs,OUTPUT); |
displaymodule | 11:264e19992620 | 193 | pinMode(_sel,OUTPUT); |
displaymodule | 11:264e19992620 | 194 | digitalWrite(_sel, LOW); // w25 control by MCU |
displaymodule | 11:264e19992620 | 195 | |
displaymodule | 11:264e19992620 | 196 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 197 | |
displaymodule | 11:264e19992620 | 198 | SPI.begin(); |
displaymodule | 11:264e19992620 | 199 | SPI.setClockDivider(SPI_CLOCK_DIV2); // 8 MHz (full! speed!) |
displaymodule | 11:264e19992620 | 200 | SPI.setBitOrder(MSBFIRST); |
displaymodule | 11:264e19992620 | 201 | SPI.setDataMode(SPI_MODE0); |
displaymodule | 11:264e19992620 | 202 | _spiSettings = SPCR; |
displaymodule | 11:264e19992620 | 203 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 14:2db7065edbec | 204 | _pinCS = new DigitalOut(_cs); |
displaymodule | 14:2db7065edbec | 205 | _pinSEL = new DigitalOut(_sel); |
displaymodule | 11:264e19992620 | 206 | sbi(_pinSEL, _bitmaskSEL); // w25 control by MCU |
displaymodule | 11:264e19992620 | 207 | |
displaymodule | 11:264e19992620 | 208 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 209 | |
displaymodule | 14:2db7065edbec | 210 | |
displaymodule | 14:2db7065edbec | 211 | #ifdef TARGET_LPC824 // for LPCXpresso824-MAX |
displaymodule | 14:2db7065edbec | 212 | spi.format(8,3); |
displaymodule | 14:2db7065edbec | 213 | spi.frequency(8000000); |
displaymodule | 14:2db7065edbec | 214 | #elif TARGET_LPC11U6X // for LPCXpresso11U68 |
displaymodule | 14:2db7065edbec | 215 | spi.format(8,3); |
displaymodule | 14:2db7065edbec | 216 | spi.frequency(2000000); |
displaymodule | 14:2db7065edbec | 217 | #elif TARGET_NUCLEO_F401RE // for NUCLEO-F401RE |
displaymodule | 14:2db7065edbec | 218 | spi.format(8,0); |
displaymodule | 14:2db7065edbec | 219 | spi.frequency(8000000); |
displaymodule | 14:2db7065edbec | 220 | #else |
displaymodule | 14:2db7065edbec | 221 | spi.format(8,3); |
displaymodule | 14:2db7065edbec | 222 | spi.frequency(2000000); // Max SPI speed for display is 10 and for 17 for LPC15xx |
displaymodule | 14:2db7065edbec | 223 | #endif |
displaymodule | 11:264e19992620 | 224 | softReset(); |
displaymodule | 11:264e19992620 | 225 | #endif |
displaymodule | 11:264e19992620 | 226 | |
displaymodule | 11:264e19992620 | 227 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 228 | |
displaymodule | 11:264e19992620 | 229 | /* Timing values */ |
displaymodule | 11:264e19992620 | 230 | uint8_t pixclk; |
displaymodule | 11:264e19992620 | 231 | uint8_t hsync_start; |
displaymodule | 11:264e19992620 | 232 | uint8_t hsync_pw; |
displaymodule | 11:264e19992620 | 233 | uint8_t hsync_finetune; |
displaymodule | 11:264e19992620 | 234 | uint8_t hsync_nondisp; |
displaymodule | 11:264e19992620 | 235 | uint8_t vsync_pw; |
displaymodule | 11:264e19992620 | 236 | uint16_t vsync_nondisp; |
displaymodule | 11:264e19992620 | 237 | uint16_t vsync_start; |
displaymodule | 11:264e19992620 | 238 | |
displaymodule | 11:264e19992620 | 239 | if(size == RA8875_480x272) { |
displaymodule | 11:264e19992620 | 240 | _width = 480; |
displaymodule | 11:264e19992620 | 241 | _height = 272; |
displaymodule | 11:264e19992620 | 242 | setWidth(_width); |
displaymodule | 11:264e19992620 | 243 | setHeight(_height); |
displaymodule | 11:264e19992620 | 244 | // PLL init |
displaymodule | 11:264e19992620 | 245 | // 20MHz*(10+1)/((RA8875_PLLC1_PLLDIV1 +1) * 2^RA8875_PLLC2_DIV4)) |
displaymodule | 11:264e19992620 | 246 | writeReg(0x88, 0x00 + 10); |
displaymodule | 11:264e19992620 | 247 | delay(1); |
displaymodule | 11:264e19992620 | 248 | writeReg(0x89, 0x02); |
displaymodule | 11:264e19992620 | 249 | delay(1); |
displaymodule | 11:264e19992620 | 250 | |
displaymodule | 11:264e19992620 | 251 | pixclk = 0x80 | 0x02; |
displaymodule | 11:264e19992620 | 252 | hsync_nondisp = 10; |
displaymodule | 11:264e19992620 | 253 | hsync_start = 8; |
displaymodule | 11:264e19992620 | 254 | hsync_pw = 48; |
displaymodule | 11:264e19992620 | 255 | hsync_finetune = 0; |
displaymodule | 11:264e19992620 | 256 | vsync_nondisp = 3; |
displaymodule | 11:264e19992620 | 257 | vsync_start = 8; |
displaymodule | 11:264e19992620 | 258 | vsync_pw = 10; |
displaymodule | 11:264e19992620 | 259 | } |
displaymodule | 11:264e19992620 | 260 | |
displaymodule | 11:264e19992620 | 261 | if(size == RA8875_800x480) { |
displaymodule | 11:264e19992620 | 262 | _width = 800; |
displaymodule | 11:264e19992620 | 263 | _height = 480; |
displaymodule | 11:264e19992620 | 264 | setWidth(_width); |
displaymodule | 11:264e19992620 | 265 | setHeight(_height); |
displaymodule | 11:264e19992620 | 266 | // PLL init |
displaymodule | 11:264e19992620 | 267 | // 20MHz*(10+1)/((RA8875_PLLC1_PLLDIV1 +1) * 2^RA8875_PLLC2_DIV4)) |
displaymodule | 11:264e19992620 | 268 | writeReg(0x88, 0x00 + 10); |
displaymodule | 11:264e19992620 | 269 | delay(1); |
displaymodule | 11:264e19992620 | 270 | writeReg(0x89, 0x02); |
displaymodule | 11:264e19992620 | 271 | delay(1); |
displaymodule | 11:264e19992620 | 272 | |
displaymodule | 11:264e19992620 | 273 | pixclk = 0x80 | 0x01; |
displaymodule | 11:264e19992620 | 274 | hsync_nondisp = 26; |
displaymodule | 11:264e19992620 | 275 | hsync_start = 32; |
displaymodule | 11:264e19992620 | 276 | hsync_pw = 96; |
displaymodule | 11:264e19992620 | 277 | hsync_finetune = 0; |
displaymodule | 11:264e19992620 | 278 | vsync_nondisp = 32; |
displaymodule | 11:264e19992620 | 279 | vsync_start = 23; |
displaymodule | 11:264e19992620 | 280 | vsync_pw = 2; |
displaymodule | 11:264e19992620 | 281 | } |
displaymodule | 11:264e19992620 | 282 | |
displaymodule | 11:264e19992620 | 283 | writeReg(0x10, 0x0C | 0x00); |
displaymodule | 11:264e19992620 | 284 | |
displaymodule | 11:264e19992620 | 285 | writeReg(0x04, pixclk); |
displaymodule | 11:264e19992620 | 286 | delay(1); |
displaymodule | 11:264e19992620 | 287 | |
displaymodule | 11:264e19992620 | 288 | /* Horizontal settings registers */ |
displaymodule | 11:264e19992620 | 289 | writeReg(0x14, (_width / 8) - 1); // H width: (HDWR + 1) * 8 = 480 |
displaymodule | 11:264e19992620 | 290 | writeReg(0x15, 0x00 + hsync_finetune); |
displaymodule | 11:264e19992620 | 291 | writeReg(0x16, (hsync_nondisp - hsync_finetune - 2)/8); // H non-display: HNDR * 8 + HNDFTR + 2 = 10 |
displaymodule | 11:264e19992620 | 292 | writeReg(0x17, hsync_start/8 - 1); // Hsync start: (HSTR + 1)*8 |
displaymodule | 11:264e19992620 | 293 | writeReg(0x18, 0x00 + (hsync_pw/8 - 1)); // HSync pulse width = (HPWR+1) * 8 |
displaymodule | 11:264e19992620 | 294 | |
displaymodule | 11:264e19992620 | 295 | /* Vertical settings registers */ |
displaymodule | 11:264e19992620 | 296 | writeReg(0x19, (uint16_t)(_height - 1) & 0xFF); |
displaymodule | 11:264e19992620 | 297 | writeReg(0x1A, (uint16_t)(_height - 1) >> 8); |
displaymodule | 11:264e19992620 | 298 | writeReg(0x1B, vsync_nondisp-1); // V non-display period = VNDR + 1 |
displaymodule | 11:264e19992620 | 299 | writeReg(0x1C, vsync_nondisp >> 8); |
displaymodule | 11:264e19992620 | 300 | writeReg(0x1D, vsync_start-1); // Vsync start position = VSTR + 1 |
displaymodule | 11:264e19992620 | 301 | writeReg(0x1E, vsync_start >> 8); |
displaymodule | 11:264e19992620 | 302 | writeReg(0x1F, 0x00 + vsync_pw - 1); // Vsync pulse width = VPWR + 1 |
displaymodule | 11:264e19992620 | 303 | |
displaymodule | 11:264e19992620 | 304 | /* Set active window X */ |
displaymodule | 11:264e19992620 | 305 | writeReg(0x30, 0); // horizontal start point |
displaymodule | 11:264e19992620 | 306 | writeReg(0x31, 0); |
displaymodule | 11:264e19992620 | 307 | writeReg(0x34, (uint16_t)(_width - 1) & 0xFF); // horizontal end point |
displaymodule | 11:264e19992620 | 308 | writeReg(0x35, (uint16_t)(_width - 1) >> 8); |
displaymodule | 11:264e19992620 | 309 | |
displaymodule | 11:264e19992620 | 310 | /* Set active window Y */ |
displaymodule | 11:264e19992620 | 311 | writeReg(0x32, 0); // vertical start point |
displaymodule | 11:264e19992620 | 312 | writeReg(0x33, 0); |
displaymodule | 11:264e19992620 | 313 | writeReg(0x36, (uint16_t)(_height - 1) & 0xFF); // vertical end point |
displaymodule | 11:264e19992620 | 314 | writeReg(0x37, (uint16_t)(_height - 1) >> 8); |
displaymodule | 11:264e19992620 | 315 | /* Clear the entire window */ |
displaymodule | 11:264e19992620 | 316 | writeReg(0x8E, 0x80 | 0x00); |
displaymodule | 11:264e19992620 | 317 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 318 | while (readReg(0x8E) & 0x80); |
displaymodule | 11:264e19992620 | 319 | //delay(100); |
displaymodule | 11:264e19992620 | 320 | // display on |
displaymodule | 11:264e19992620 | 321 | writeReg(0x01, 0x00 | 0x80); |
displaymodule | 11:264e19992620 | 322 | // GPIOX on |
displaymodule | 11:264e19992620 | 323 | writeReg(0xC7, 1); |
displaymodule | 11:264e19992620 | 324 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 325 | |
displaymodule | 11:264e19992620 | 326 | //clearScreen(); |
displaymodule | 11:264e19992620 | 327 | setFontColor(BLACK, WHITE); |
displaymodule | 11:264e19992620 | 328 | //setFontZoom(0, 0); |
displaymodule | 11:264e19992620 | 329 | |
displaymodule | 11:264e19992620 | 330 | // spi flash control by MCU |
displaymodule | 11:264e19992620 | 331 | w25CtrlByMCU(); |
displaymodule | 11:264e19992620 | 332 | |
displaymodule | 11:264e19992620 | 333 | //backlight on |
displaymodule | 11:264e19992620 | 334 | backlightOn(true); |
displaymodule | 11:264e19992620 | 335 | backlightAdjust(255); // max luminance |
displaymodule | 11:264e19992620 | 336 | |
displaymodule | 11:264e19992620 | 337 | } |
displaymodule | 11:264e19992620 | 338 | |
displaymodule | 11:264e19992620 | 339 | void DmTftRa8875::eableKeyScan(bool on) |
displaymodule | 11:264e19992620 | 340 | { |
displaymodule | 11:264e19992620 | 341 | if(on) { |
displaymodule | 11:264e19992620 | 342 | writeReg(0xC0, (1 << 7) | (0 << 4 ) | 1 ); // enable key scan |
displaymodule | 11:264e19992620 | 343 | } else { |
displaymodule | 11:264e19992620 | 344 | writeReg(0xC0, (0 << 7)); |
displaymodule | 11:264e19992620 | 345 | } |
displaymodule | 11:264e19992620 | 346 | } |
displaymodule | 11:264e19992620 | 347 | |
displaymodule | 11:264e19992620 | 348 | uint8_t DmTftRa8875::getKeyValue(void) |
displaymodule | 11:264e19992620 | 349 | { |
displaymodule | 11:264e19992620 | 350 | uint8_t data = 0xFF; |
displaymodule | 11:264e19992620 | 351 | sendCommand(0xC2); |
displaymodule | 11:264e19992620 | 352 | data = readData(); |
displaymodule | 11:264e19992620 | 353 | |
displaymodule | 11:264e19992620 | 354 | // Clear key interrupt status |
displaymodule | 11:264e19992620 | 355 | writeReg(0xF1,readReg(0xF1) | 0x10); |
displaymodule | 11:264e19992620 | 356 | delay(1); |
displaymodule | 11:264e19992620 | 357 | return data; |
displaymodule | 11:264e19992620 | 358 | |
displaymodule | 11:264e19992620 | 359 | } |
displaymodule | 11:264e19992620 | 360 | |
displaymodule | 11:264e19992620 | 361 | bool DmTftRa8875::isKeyPress(void) |
displaymodule | 11:264e19992620 | 362 | { |
displaymodule | 11:264e19992620 | 363 | uint8_t temp; |
displaymodule | 11:264e19992620 | 364 | temp = readReg(0xF1); |
displaymodule | 11:264e19992620 | 365 | |
displaymodule | 11:264e19992620 | 366 | if(temp & 0x10) { |
displaymodule | 11:264e19992620 | 367 | return true; |
displaymodule | 11:264e19992620 | 368 | } else { |
displaymodule | 11:264e19992620 | 369 | return false; |
displaymodule | 11:264e19992620 | 370 | } |
displaymodule | 11:264e19992620 | 371 | } |
displaymodule | 11:264e19992620 | 372 | |
displaymodule | 11:264e19992620 | 373 | void DmTftRa8875::backlightOn(bool on) |
displaymodule | 11:264e19992620 | 374 | { |
displaymodule | 11:264e19992620 | 375 | if(on) { |
displaymodule | 11:264e19992620 | 376 | writeReg(0x8A, (1 << 7) | (10 << 0 )); // enable PWM1 |
displaymodule | 11:264e19992620 | 377 | } else { |
displaymodule | 11:264e19992620 | 378 | writeReg(0x8A, (0 << 7) | (10 << 0 )); |
displaymodule | 11:264e19992620 | 379 | } |
displaymodule | 11:264e19992620 | 380 | } |
displaymodule | 11:264e19992620 | 381 | |
displaymodule | 11:264e19992620 | 382 | void DmTftRa8875::backlightAdjust(uint8_t value) |
displaymodule | 11:264e19992620 | 383 | { |
displaymodule | 11:264e19992620 | 384 | writeReg(0x8B, value); |
displaymodule | 11:264e19992620 | 385 | } |
displaymodule | 11:264e19992620 | 386 | |
displaymodule | 11:264e19992620 | 387 | void DmTftRa8875::w25CtrlByMCU(void) |
displaymodule | 11:264e19992620 | 388 | { |
displaymodule | 11:264e19992620 | 389 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 390 | digitalWrite(_sel, LOW); |
displaymodule | 11:264e19992620 | 391 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 11:264e19992620 | 392 | cbi(_pinSEL, _bitmaskSEL); |
displaymodule | 11:264e19992620 | 393 | #endif |
displaymodule | 11:264e19992620 | 394 | } |
displaymodule | 11:264e19992620 | 395 | |
displaymodule | 11:264e19992620 | 396 | void DmTftRa8875::w25CtrlByRa8875(void) |
displaymodule | 11:264e19992620 | 397 | { |
displaymodule | 11:264e19992620 | 398 | #if defined (DM_TOOLCHAIN_ARDUINO) |
displaymodule | 11:264e19992620 | 399 | digitalWrite(_sel, HIGH); |
displaymodule | 11:264e19992620 | 400 | #elif defined (DM_TOOLCHAIN_MBED) |
displaymodule | 11:264e19992620 | 401 | sbi(_pinSEL, _bitmaskSEL); |
displaymodule | 11:264e19992620 | 402 | #endif |
displaymodule | 11:264e19992620 | 403 | |
displaymodule | 11:264e19992620 | 404 | } |
displaymodule | 11:264e19992620 | 405 | |
displaymodule | 11:264e19992620 | 406 | void DmTftRa8875::drawImageContinuous(uint32_t startaddress,uint32_t count,uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1) |
displaymodule | 11:264e19992620 | 407 | { |
displaymodule | 11:264e19992620 | 408 | w25CtrlByRa8875(); |
displaymodule | 11:264e19992620 | 409 | |
displaymodule | 11:264e19992620 | 410 | setAddress(x0, y0, x1-1, y1-1); |
displaymodule | 11:264e19992620 | 411 | |
displaymodule | 11:264e19992620 | 412 | writeReg(0xE0, 0x00); |
displaymodule | 11:264e19992620 | 413 | |
displaymodule | 11:264e19992620 | 414 | writeReg(0x05, (0 << 7) | (0 << 6) | (1 << 5) | (0 << 3) | (1 << 2) | (3 << 1)); |
displaymodule | 11:264e19992620 | 415 | writeReg(0x06, (0 << 0)); // set serial flash frequency |
displaymodule | 11:264e19992620 | 416 | |
displaymodule | 11:264e19992620 | 417 | writeReg(0xB0,startaddress & 0xFF); // DMA Source Start Address |
displaymodule | 11:264e19992620 | 418 | writeReg(0xB1,startaddress >> 8); |
displaymodule | 11:264e19992620 | 419 | writeReg(0xB2,startaddress >> 16); |
displaymodule | 11:264e19992620 | 420 | |
displaymodule | 11:264e19992620 | 421 | writeReg(0xB4, count & 0xFF); // DMA Transfer Number |
displaymodule | 11:264e19992620 | 422 | writeReg(0xB6, (count & 0xFF00) >> 8 ); |
displaymodule | 11:264e19992620 | 423 | writeReg(0xB8, (count & 0xFF0000) >> 16); |
displaymodule | 11:264e19992620 | 424 | |
displaymodule | 11:264e19992620 | 425 | |
displaymodule | 11:264e19992620 | 426 | writeReg(0xBF, 0x00); // Continuous mode |
displaymodule | 11:264e19992620 | 427 | writeReg(0xBF, readReg(0xBF) | 0x01); //start DMA |
displaymodule | 11:264e19992620 | 428 | |
displaymodule | 11:264e19992620 | 429 | /* Wait for the DMA Transfer to finish */ |
displaymodule | 11:264e19992620 | 430 | while (readReg(0xBF) & 0x01); |
displaymodule | 11:264e19992620 | 431 | |
displaymodule | 11:264e19992620 | 432 | w25CtrlByMCU(); |
displaymodule | 11:264e19992620 | 433 | |
displaymodule | 11:264e19992620 | 434 | } |
displaymodule | 11:264e19992620 | 435 | |
displaymodule | 11:264e19992620 | 436 | void DmTftRa8875::drawImageBlock(uint32_t startaddress, uint32_t count, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,uint16_t pic_width, uint16_t block_width, uint16_t block_height) |
displaymodule | 11:264e19992620 | 437 | { |
displaymodule | 11:264e19992620 | 438 | w25CtrlByRa8875(); |
displaymodule | 11:264e19992620 | 439 | |
displaymodule | 11:264e19992620 | 440 | setAddress(x0, y0, x1-1, y1-1); |
displaymodule | 11:264e19992620 | 441 | |
displaymodule | 11:264e19992620 | 442 | writeReg(0xE0, 0x00); |
displaymodule | 11:264e19992620 | 443 | |
displaymodule | 11:264e19992620 | 444 | writeReg(0x05, (0 << 7) | (0 << 6) | (1 << 5) | (0 << 3) | (1 << 2) | (3 << 1)); |
displaymodule | 11:264e19992620 | 445 | writeReg(0x06, (0 << 0)); // set serial flash frequency |
displaymodule | 11:264e19992620 | 446 | |
displaymodule | 11:264e19992620 | 447 | writeReg(0xB0,startaddress & 0xFF); // DMA Source Start Address |
displaymodule | 11:264e19992620 | 448 | writeReg(0xB1,startaddress >> 8); |
displaymodule | 11:264e19992620 | 449 | writeReg(0xB2,startaddress >> 16); |
displaymodule | 11:264e19992620 | 450 | |
displaymodule | 11:264e19992620 | 451 | writeReg(0xB4, block_width & 0xFF); // DMA block width |
displaymodule | 11:264e19992620 | 452 | writeReg(0xB5, block_width >> 8 ); |
displaymodule | 11:264e19992620 | 453 | writeReg(0xB6, block_height & 0xFF); // DMA block height |
displaymodule | 11:264e19992620 | 454 | writeReg(0xB7, block_height >> 8 ); |
displaymodule | 11:264e19992620 | 455 | |
displaymodule | 11:264e19992620 | 456 | writeReg(0xB8, pic_width & 0xFF); // DMA soruce picture width |
displaymodule | 11:264e19992620 | 457 | writeReg(0xB9, pic_width >> 8 ); |
displaymodule | 11:264e19992620 | 458 | |
displaymodule | 11:264e19992620 | 459 | writeReg(0xBF, 0x02); // block mode |
displaymodule | 11:264e19992620 | 460 | writeReg(0xBF, readReg(0xBF) | 0x01); //start DMA |
displaymodule | 11:264e19992620 | 461 | |
displaymodule | 11:264e19992620 | 462 | /* Wait for the DMA Transfer to finish */ |
displaymodule | 11:264e19992620 | 463 | while (readReg(0xBF) & 0x01); |
displaymodule | 11:264e19992620 | 464 | |
displaymodule | 11:264e19992620 | 465 | w25CtrlByMCU(); |
displaymodule | 11:264e19992620 | 466 | |
displaymodule | 11:264e19992620 | 467 | } |
displaymodule | 11:264e19992620 | 468 | |
displaymodule | 11:264e19992620 | 469 | void DmTftRa8875::drawPoint(uint16_t x, uint16_t y, uint16_t radius) |
displaymodule | 11:264e19992620 | 470 | { |
displaymodule | 11:264e19992620 | 471 | if (radius == 0) { |
displaymodule | 11:264e19992620 | 472 | cbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 473 | |
displaymodule | 11:264e19992620 | 474 | setAddress(x,y,x,y); |
displaymodule | 11:264e19992620 | 475 | sendData(_fgColor); |
displaymodule | 11:264e19992620 | 476 | |
displaymodule | 11:264e19992620 | 477 | sbi(_pinCS, _bitmaskCS); |
displaymodule | 11:264e19992620 | 478 | } else { |
displaymodule | 11:264e19992620 | 479 | fillRectangle(x-radius,y-radius,x+radius,y+radius, _fgColor); |
displaymodule | 11:264e19992620 | 480 | } |
displaymodule | 11:264e19992620 | 481 | } |
displaymodule | 11:264e19992620 | 482 | |
displaymodule | 11:264e19992620 | 483 | |
displaymodule | 11:264e19992620 | 484 | void DmTftRa8875::setFontColor(uint16_t background,uint16_t foreground) |
displaymodule | 11:264e19992620 | 485 | { |
displaymodule | 11:264e19992620 | 486 | /* Set Background Color */ |
displaymodule | 11:264e19992620 | 487 | _bgColor = background; |
displaymodule | 11:264e19992620 | 488 | writeReg(0x60, (background & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 489 | writeReg(0x61, (background & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 490 | writeReg(0x62, (background & 0x001f)); |
displaymodule | 11:264e19992620 | 491 | |
displaymodule | 11:264e19992620 | 492 | /* Set Fore Color */ |
displaymodule | 11:264e19992620 | 493 | _fgColor = foreground; |
displaymodule | 11:264e19992620 | 494 | writeReg(0x63, (foreground & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 495 | writeReg(0x64, (foreground & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 496 | writeReg(0x65, (foreground & 0x001f)); |
displaymodule | 11:264e19992620 | 497 | } |
displaymodule | 11:264e19992620 | 498 | |
displaymodule | 11:264e19992620 | 499 | |
displaymodule | 11:264e19992620 | 500 | void DmTftRa8875::setFontZoom(uint8_t Hsize,uint8_t Vsize) |
displaymodule | 11:264e19992620 | 501 | { |
displaymodule | 11:264e19992620 | 502 | writeReg(0x22, ((Hsize & 0x03) <<2 | (Vsize & 0x03))); |
displaymodule | 11:264e19992620 | 503 | } |
displaymodule | 11:264e19992620 | 504 | |
displaymodule | 11:264e19992620 | 505 | void DmTftRa8875::int2str(int n, char *str) |
displaymodule | 11:264e19992620 | 506 | { |
displaymodule | 11:264e19992620 | 507 | char buf[10] = ""; |
displaymodule | 11:264e19992620 | 508 | int i = 0; |
displaymodule | 11:264e19992620 | 509 | int len = 0; |
displaymodule | 11:264e19992620 | 510 | int temp = n < 0 ? -n: n; |
displaymodule | 11:264e19992620 | 511 | |
displaymodule | 11:264e19992620 | 512 | if (str == NULL) { |
displaymodule | 11:264e19992620 | 513 | return; |
displaymodule | 11:264e19992620 | 514 | } |
displaymodule | 11:264e19992620 | 515 | while(temp) { |
displaymodule | 11:264e19992620 | 516 | buf[i++] = (temp % 10) + '0'; |
displaymodule | 11:264e19992620 | 517 | temp = temp / 10; |
displaymodule | 11:264e19992620 | 518 | } |
displaymodule | 11:264e19992620 | 519 | |
displaymodule | 11:264e19992620 | 520 | len = n < 0 ? ++i: i; |
displaymodule | 11:264e19992620 | 521 | str[i] = 0; |
displaymodule | 11:264e19992620 | 522 | while(1) { |
displaymodule | 11:264e19992620 | 523 | i--; |
displaymodule | 11:264e19992620 | 524 | if (buf[len-i-1] ==0) { |
displaymodule | 11:264e19992620 | 525 | break; |
displaymodule | 11:264e19992620 | 526 | } |
displaymodule | 11:264e19992620 | 527 | str[i] = buf[len-i-1]; |
displaymodule | 11:264e19992620 | 528 | } |
displaymodule | 11:264e19992620 | 529 | if (i == 0 ) { |
displaymodule | 11:264e19992620 | 530 | str[i] = '-'; |
displaymodule | 11:264e19992620 | 531 | } |
displaymodule | 11:264e19992620 | 532 | } |
displaymodule | 11:264e19992620 | 533 | |
displaymodule | 11:264e19992620 | 534 | void DmTftRa8875::drawNumber(uint16_t x, uint16_t y, int num, int digitsToShow, bool leadingZeros) |
displaymodule | 11:264e19992620 | 535 | { |
displaymodule | 11:264e19992620 | 536 | char p[10]; |
displaymodule | 11:264e19992620 | 537 | int2str(num, p); |
displaymodule | 11:264e19992620 | 538 | |
displaymodule | 11:264e19992620 | 539 | // clear the last number on the screen; default font width is 8. |
displaymodule | 11:264e19992620 | 540 | for(int i=0; i<digitsToShow; i++) |
displaymodule | 11:264e19992620 | 541 | drawString(x+i*8, y," "); |
displaymodule | 11:264e19992620 | 542 | |
displaymodule | 11:264e19992620 | 543 | drawString(x, y, p); |
displaymodule | 11:264e19992620 | 544 | } |
displaymodule | 11:264e19992620 | 545 | |
displaymodule | 11:264e19992620 | 546 | |
displaymodule | 11:264e19992620 | 547 | void DmTftRa8875::drawString(uint16_t x, uint16_t y, const char *p) |
displaymodule | 11:264e19992620 | 548 | { |
displaymodule | 11:264e19992620 | 549 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 550 | |
displaymodule | 11:264e19992620 | 551 | writeReg(0x40, (1 << 7) | (1 << 0)); // enter text mode |
displaymodule | 11:264e19992620 | 552 | writeReg(0x2A, x); |
displaymodule | 11:264e19992620 | 553 | writeReg(0x2B, x >> 8); |
displaymodule | 11:264e19992620 | 554 | writeReg(0x2C, y); |
displaymodule | 11:264e19992620 | 555 | writeReg(0x2D, y >> 8); |
displaymodule | 11:264e19992620 | 556 | |
displaymodule | 11:264e19992620 | 557 | writeReg(0x2F, 0x00); |
displaymodule | 11:264e19992620 | 558 | writeReg(0x21, (0 << 7) | (0 << 5) | (0 << 1) | (0 << 0)); |
displaymodule | 11:264e19992620 | 559 | sendCommand(0x02); |
displaymodule | 11:264e19992620 | 560 | |
displaymodule | 11:264e19992620 | 561 | while (*p != '\0') { |
displaymodule | 11:264e19992620 | 562 | send8BitData(*p); |
displaymodule | 11:264e19992620 | 563 | while ((readStatus() & 0x80) == 0x80); // wait finish |
displaymodule | 11:264e19992620 | 564 | p++; |
displaymodule | 11:264e19992620 | 565 | } |
displaymodule | 11:264e19992620 | 566 | writeReg(0x40, (0 << 7)); // enter graphics mode |
displaymodule | 11:264e19992620 | 567 | } |
displaymodule | 11:264e19992620 | 568 | |
displaymodule | 11:264e19992620 | 569 | void DmTftRa8875::drawStringCentered(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char *p) |
displaymodule | 11:264e19992620 | 570 | { |
displaymodule | 11:264e19992620 | 571 | |
displaymodule | 11:264e19992620 | 572 | int len = strlen(p); |
displaymodule | 11:264e19992620 | 573 | uint16_t tmp = len * 8; |
displaymodule | 11:264e19992620 | 574 | if (tmp <= width) { |
displaymodule | 11:264e19992620 | 575 | x += (width - tmp)/2; |
displaymodule | 11:264e19992620 | 576 | } |
displaymodule | 11:264e19992620 | 577 | if (16 <= height) { |
displaymodule | 11:264e19992620 | 578 | y += (height - 16)/2; |
displaymodule | 11:264e19992620 | 579 | } |
displaymodule | 11:264e19992620 | 580 | |
displaymodule | 11:264e19992620 | 581 | drawString(x, y, p); |
displaymodule | 11:264e19992620 | 582 | } |
displaymodule | 11:264e19992620 | 583 | |
displaymodule | 11:264e19992620 | 584 | void DmTftRa8875::clearScreen(uint16_t color) |
displaymodule | 11:264e19992620 | 585 | { |
displaymodule | 11:264e19992620 | 586 | rectangle(0, 0, _width-1, _height-1, color, true); |
displaymodule | 11:264e19992620 | 587 | } |
displaymodule | 11:264e19992620 | 588 | |
displaymodule | 11:264e19992620 | 589 | void DmTftRa8875::rectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 590 | { |
displaymodule | 11:264e19992620 | 591 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 592 | |
displaymodule | 11:264e19992620 | 593 | /* Set x0 */ |
displaymodule | 11:264e19992620 | 594 | writeReg(0x91, x0); |
displaymodule | 11:264e19992620 | 595 | writeReg(0x92, x0 >> 8); |
displaymodule | 11:264e19992620 | 596 | |
displaymodule | 11:264e19992620 | 597 | /* Set y0 */ |
displaymodule | 11:264e19992620 | 598 | writeReg(0x93, y0); |
displaymodule | 11:264e19992620 | 599 | writeReg(0x94, y0 >> 8); |
displaymodule | 11:264e19992620 | 600 | |
displaymodule | 11:264e19992620 | 601 | /* Set x1 */ |
displaymodule | 11:264e19992620 | 602 | writeReg(0x95, x1); |
displaymodule | 11:264e19992620 | 603 | writeReg(0x96, x1 >> 8); |
displaymodule | 11:264e19992620 | 604 | |
displaymodule | 11:264e19992620 | 605 | /* Set y1 */ |
displaymodule | 11:264e19992620 | 606 | writeReg(0x97, y1); |
displaymodule | 11:264e19992620 | 607 | writeReg(0x98, y1 >> 8); |
displaymodule | 11:264e19992620 | 608 | |
displaymodule | 11:264e19992620 | 609 | /* Set Color */ |
displaymodule | 11:264e19992620 | 610 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 611 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 612 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 613 | |
displaymodule | 11:264e19992620 | 614 | /* Draw! */ |
displaymodule | 11:264e19992620 | 615 | if (filled) { |
displaymodule | 11:264e19992620 | 616 | writeReg(0x90, 0xB0); |
displaymodule | 11:264e19992620 | 617 | } else { |
displaymodule | 11:264e19992620 | 618 | writeReg(0x90, 0x90); |
displaymodule | 11:264e19992620 | 619 | } |
displaymodule | 11:264e19992620 | 620 | |
displaymodule | 11:264e19992620 | 621 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 622 | while (readReg(0x90) & 0x80); |
displaymodule | 11:264e19992620 | 623 | } |
displaymodule | 11:264e19992620 | 624 | |
displaymodule | 11:264e19992620 | 625 | void DmTftRa8875::drawRectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) |
displaymodule | 11:264e19992620 | 626 | { |
displaymodule | 11:264e19992620 | 627 | rectangle(x0, y0, x1, y1, color, false); |
displaymodule | 11:264e19992620 | 628 | } |
displaymodule | 11:264e19992620 | 629 | void DmTftRa8875::fillRectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) |
displaymodule | 11:264e19992620 | 630 | { |
displaymodule | 11:264e19992620 | 631 | rectangle(x0, y0, x1, y1, color, true); |
displaymodule | 11:264e19992620 | 632 | } |
displaymodule | 11:264e19992620 | 633 | |
displaymodule | 11:264e19992620 | 634 | void DmTftRa8875::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) |
displaymodule | 11:264e19992620 | 635 | { |
displaymodule | 11:264e19992620 | 636 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 637 | |
displaymodule | 11:264e19992620 | 638 | /* Set x0 */ |
displaymodule | 11:264e19992620 | 639 | writeReg(0x91, x0); |
displaymodule | 11:264e19992620 | 640 | writeReg(0x92, x0 >> 8); |
displaymodule | 11:264e19992620 | 641 | |
displaymodule | 11:264e19992620 | 642 | /* Set y0 */ |
displaymodule | 11:264e19992620 | 643 | writeReg(0x93, y0); |
displaymodule | 11:264e19992620 | 644 | writeReg(0x94, y0 >> 8); |
displaymodule | 11:264e19992620 | 645 | |
displaymodule | 11:264e19992620 | 646 | /* Set x1 */ |
displaymodule | 11:264e19992620 | 647 | writeReg(0x95, x1); |
displaymodule | 11:264e19992620 | 648 | writeReg(0x96, x1 >> 8); |
displaymodule | 11:264e19992620 | 649 | |
displaymodule | 11:264e19992620 | 650 | /* Set y1 */ |
displaymodule | 11:264e19992620 | 651 | writeReg(0x97, y1); |
displaymodule | 11:264e19992620 | 652 | writeReg(0x98, y1 >> 8); |
displaymodule | 11:264e19992620 | 653 | |
displaymodule | 11:264e19992620 | 654 | /* Set Color */ |
displaymodule | 11:264e19992620 | 655 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 656 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 657 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 658 | |
displaymodule | 11:264e19992620 | 659 | /* Draw! */ |
displaymodule | 11:264e19992620 | 660 | writeReg(0x90, 0x80); |
displaymodule | 11:264e19992620 | 661 | |
displaymodule | 11:264e19992620 | 662 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 663 | while (readReg(0x90) & 0x80); |
displaymodule | 11:264e19992620 | 664 | } |
displaymodule | 11:264e19992620 | 665 | |
displaymodule | 11:264e19992620 | 666 | void DmTftRa8875::drawVerticalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color) |
displaymodule | 11:264e19992620 | 667 | { |
displaymodule | 11:264e19992620 | 668 | drawLine(x, y, x, y+length, color); |
displaymodule | 11:264e19992620 | 669 | } |
displaymodule | 11:264e19992620 | 670 | |
displaymodule | 11:264e19992620 | 671 | void DmTftRa8875::drawHorizontalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color) |
displaymodule | 11:264e19992620 | 672 | { |
displaymodule | 11:264e19992620 | 673 | drawLine(x, y, x+length, y, color); |
displaymodule | 11:264e19992620 | 674 | } |
displaymodule | 11:264e19992620 | 675 | |
displaymodule | 11:264e19992620 | 676 | void DmTftRa8875::circle(int16_t x, int16_t y, int16_t r, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 677 | { |
displaymodule | 11:264e19992620 | 678 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 679 | |
displaymodule | 11:264e19992620 | 680 | /* Set x */ |
displaymodule | 11:264e19992620 | 681 | writeReg(0x99, x); |
displaymodule | 11:264e19992620 | 682 | writeReg(0x9A, x >> 8); |
displaymodule | 11:264e19992620 | 683 | |
displaymodule | 11:264e19992620 | 684 | /* Set y */ |
displaymodule | 11:264e19992620 | 685 | writeReg(0x9B, y); |
displaymodule | 11:264e19992620 | 686 | writeReg(0x9C, y >> 8); |
displaymodule | 11:264e19992620 | 687 | |
displaymodule | 11:264e19992620 | 688 | /* Set Radius */ |
displaymodule | 11:264e19992620 | 689 | writeReg(0x9D, r); |
displaymodule | 11:264e19992620 | 690 | |
displaymodule | 11:264e19992620 | 691 | /* Set Color */ |
displaymodule | 11:264e19992620 | 692 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 693 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 694 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 695 | |
displaymodule | 11:264e19992620 | 696 | /* Draw! */ |
displaymodule | 11:264e19992620 | 697 | if (filled) { |
displaymodule | 11:264e19992620 | 698 | writeReg(0x90, 0x40 | 0x20); |
displaymodule | 11:264e19992620 | 699 | } else { |
displaymodule | 11:264e19992620 | 700 | writeReg(0x90, 0x40 | 0x00); |
displaymodule | 11:264e19992620 | 701 | } |
displaymodule | 11:264e19992620 | 702 | |
displaymodule | 11:264e19992620 | 703 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 704 | while (readReg(0x90) & 0x40); |
displaymodule | 11:264e19992620 | 705 | } |
displaymodule | 11:264e19992620 | 706 | |
displaymodule | 11:264e19992620 | 707 | void DmTftRa8875::drawCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color) |
displaymodule | 11:264e19992620 | 708 | { |
displaymodule | 11:264e19992620 | 709 | circle(x0, y0, r, color, false); |
displaymodule | 11:264e19992620 | 710 | } |
displaymodule | 11:264e19992620 | 711 | void DmTftRa8875::fillCircle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color) |
displaymodule | 11:264e19992620 | 712 | { |
displaymodule | 11:264e19992620 | 713 | circle(x0, y0, r, color, true); |
displaymodule | 11:264e19992620 | 714 | } |
displaymodule | 11:264e19992620 | 715 | |
displaymodule | 11:264e19992620 | 716 | void DmTftRa8875::triangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 717 | { |
displaymodule | 11:264e19992620 | 718 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 719 | |
displaymodule | 11:264e19992620 | 720 | /* Set Point 0 */ |
displaymodule | 11:264e19992620 | 721 | writeReg(0x91, x0); |
displaymodule | 11:264e19992620 | 722 | writeReg(0x92, (x0 >> 8)); |
displaymodule | 11:264e19992620 | 723 | writeReg(0x93, y0); |
displaymodule | 11:264e19992620 | 724 | writeReg(0x94, (y0 >> 8)); |
displaymodule | 11:264e19992620 | 725 | |
displaymodule | 11:264e19992620 | 726 | /* Set Point 1 */ |
displaymodule | 11:264e19992620 | 727 | writeReg(0x95, x1); |
displaymodule | 11:264e19992620 | 728 | writeReg(0x96, (x1 >> 8)); |
displaymodule | 11:264e19992620 | 729 | writeReg(0x97, y1); |
displaymodule | 11:264e19992620 | 730 | writeReg(0x98, (y1 >> 8)); |
displaymodule | 11:264e19992620 | 731 | |
displaymodule | 11:264e19992620 | 732 | /* Set Point 2 */ |
displaymodule | 11:264e19992620 | 733 | writeReg(0xA9, x2); |
displaymodule | 11:264e19992620 | 734 | writeReg(0xAA, (x2 >> 8)); |
displaymodule | 11:264e19992620 | 735 | writeReg(0xAB, y2); |
displaymodule | 11:264e19992620 | 736 | writeReg(0xAC, (y2 >> 8)); |
displaymodule | 11:264e19992620 | 737 | |
displaymodule | 11:264e19992620 | 738 | /* Set Color */ |
displaymodule | 11:264e19992620 | 739 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 740 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 741 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 742 | |
displaymodule | 11:264e19992620 | 743 | /* Draw! */ |
displaymodule | 11:264e19992620 | 744 | if (filled) { |
displaymodule | 11:264e19992620 | 745 | writeReg(0x90, 0xA1); |
displaymodule | 11:264e19992620 | 746 | } else { |
displaymodule | 11:264e19992620 | 747 | writeReg(0x90, 0x81); |
displaymodule | 11:264e19992620 | 748 | } |
displaymodule | 11:264e19992620 | 749 | |
displaymodule | 11:264e19992620 | 750 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 751 | while (readReg(0x90) & 0x80); |
displaymodule | 11:264e19992620 | 752 | } |
displaymodule | 11:264e19992620 | 753 | |
displaymodule | 11:264e19992620 | 754 | void DmTftRa8875::drawTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) |
displaymodule | 11:264e19992620 | 755 | { |
displaymodule | 11:264e19992620 | 756 | triangle(x0, y0, x1, y1, x2, y2, color, false); |
displaymodule | 11:264e19992620 | 757 | } |
displaymodule | 11:264e19992620 | 758 | |
displaymodule | 11:264e19992620 | 759 | void DmTftRa8875::fillTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) |
displaymodule | 11:264e19992620 | 760 | { |
displaymodule | 11:264e19992620 | 761 | triangle(x0, y0, x1, y1, x2, y2, color, true); |
displaymodule | 11:264e19992620 | 762 | } |
displaymodule | 11:264e19992620 | 763 | |
displaymodule | 11:264e19992620 | 764 | void DmTftRa8875::ellipse(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 765 | { |
displaymodule | 11:264e19992620 | 766 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 767 | |
displaymodule | 11:264e19992620 | 768 | /* Set Center Point */ |
displaymodule | 11:264e19992620 | 769 | writeReg(0xA5, x0); |
displaymodule | 11:264e19992620 | 770 | writeReg(0xA6, (x0 >> 8)); |
displaymodule | 11:264e19992620 | 771 | writeReg(0xA7, y0); |
displaymodule | 11:264e19992620 | 772 | writeReg(0xA8, (y0 >> 8)); |
displaymodule | 11:264e19992620 | 773 | |
displaymodule | 11:264e19992620 | 774 | /* Set Long and Short Axis */ |
displaymodule | 11:264e19992620 | 775 | writeReg(0xA1, longAxis); |
displaymodule | 11:264e19992620 | 776 | writeReg(0xA2, (longAxis >> 8)); |
displaymodule | 11:264e19992620 | 777 | writeReg(0xA3, shortAxis); |
displaymodule | 11:264e19992620 | 778 | writeReg(0xA4, (shortAxis >> 8)); |
displaymodule | 11:264e19992620 | 779 | |
displaymodule | 11:264e19992620 | 780 | /* Set Color */ |
displaymodule | 11:264e19992620 | 781 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 782 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 783 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 784 | |
displaymodule | 11:264e19992620 | 785 | /* Draw! */ |
displaymodule | 11:264e19992620 | 786 | if (filled) { |
displaymodule | 11:264e19992620 | 787 | writeReg(0xA0, 0xC0); |
displaymodule | 11:264e19992620 | 788 | } else { |
displaymodule | 11:264e19992620 | 789 | writeReg(0xA0, 0x80); |
displaymodule | 11:264e19992620 | 790 | } |
displaymodule | 11:264e19992620 | 791 | |
displaymodule | 11:264e19992620 | 792 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 793 | while (readReg(0xA0) & 0x80); |
displaymodule | 11:264e19992620 | 794 | |
displaymodule | 11:264e19992620 | 795 | } |
displaymodule | 11:264e19992620 | 796 | |
displaymodule | 11:264e19992620 | 797 | void DmTftRa8875::drawEllipse(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint16_t color) |
displaymodule | 11:264e19992620 | 798 | { |
displaymodule | 11:264e19992620 | 799 | ellipse(x0, y0, longAxis, shortAxis, color, false); |
displaymodule | 11:264e19992620 | 800 | } |
displaymodule | 11:264e19992620 | 801 | |
displaymodule | 11:264e19992620 | 802 | void DmTftRa8875::fillEllipse(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint16_t color) |
displaymodule | 11:264e19992620 | 803 | { |
displaymodule | 11:264e19992620 | 804 | ellipse(x0, y0, longAxis, shortAxis, color, true); |
displaymodule | 11:264e19992620 | 805 | } |
displaymodule | 11:264e19992620 | 806 | |
displaymodule | 11:264e19992620 | 807 | void DmTftRa8875::curve(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 808 | { |
displaymodule | 11:264e19992620 | 809 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 810 | |
displaymodule | 11:264e19992620 | 811 | /* Set Center Point */ |
displaymodule | 11:264e19992620 | 812 | writeReg(0xA5, x0); |
displaymodule | 11:264e19992620 | 813 | writeReg(0xA6, (x0 >> 8)); |
displaymodule | 11:264e19992620 | 814 | writeReg(0xA7, y0); |
displaymodule | 11:264e19992620 | 815 | writeReg(0xA8, (y0 >> 8)); |
displaymodule | 11:264e19992620 | 816 | |
displaymodule | 11:264e19992620 | 817 | /* Set Long and Short Axis */ |
displaymodule | 11:264e19992620 | 818 | writeReg(0xA1, longAxis); |
displaymodule | 11:264e19992620 | 819 | writeReg(0xA2, (longAxis >> 8)); |
displaymodule | 11:264e19992620 | 820 | writeReg(0xA3, shortAxis); |
displaymodule | 11:264e19992620 | 821 | writeReg(0xA4, (shortAxis >> 8)); |
displaymodule | 11:264e19992620 | 822 | |
displaymodule | 11:264e19992620 | 823 | /* Set Color */ |
displaymodule | 11:264e19992620 | 824 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 825 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 826 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 827 | |
displaymodule | 11:264e19992620 | 828 | /* Draw! */ |
displaymodule | 11:264e19992620 | 829 | if (filled) { |
displaymodule | 11:264e19992620 | 830 | writeReg(0xA0, 0xD0 | (curvePart & 0x03)); |
displaymodule | 11:264e19992620 | 831 | } else { |
displaymodule | 11:264e19992620 | 832 | writeReg(0xA0, 0x90 | (curvePart & 0x03)); |
displaymodule | 11:264e19992620 | 833 | } |
displaymodule | 11:264e19992620 | 834 | |
displaymodule | 11:264e19992620 | 835 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 836 | while (readReg(0xA0) & 0x80); |
displaymodule | 11:264e19992620 | 837 | |
displaymodule | 11:264e19992620 | 838 | } |
displaymodule | 11:264e19992620 | 839 | |
displaymodule | 11:264e19992620 | 840 | void DmTftRa8875::drawCurve(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) |
displaymodule | 11:264e19992620 | 841 | { |
displaymodule | 11:264e19992620 | 842 | curve(x0, y0, longAxis, shortAxis, curvePart, color, false); |
displaymodule | 11:264e19992620 | 843 | } |
displaymodule | 11:264e19992620 | 844 | |
displaymodule | 11:264e19992620 | 845 | void DmTftRa8875::fillCurve(int16_t x0, int16_t y0, int16_t longAxis, int16_t shortAxis, uint8_t curvePart, uint16_t color) |
displaymodule | 11:264e19992620 | 846 | { |
displaymodule | 11:264e19992620 | 847 | curve(x0, y0, longAxis, shortAxis, curvePart, color, true); |
displaymodule | 11:264e19992620 | 848 | } |
displaymodule | 11:264e19992620 | 849 | |
displaymodule | 11:264e19992620 | 850 | void DmTftRa8875::roundrectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t r1, uint16_t r2, uint16_t color, bool filled) |
displaymodule | 11:264e19992620 | 851 | { |
displaymodule | 11:264e19992620 | 852 | setAddress(0, 0, _width-1, _height-1); |
displaymodule | 11:264e19992620 | 853 | |
displaymodule | 11:264e19992620 | 854 | /* Set x0 */ |
displaymodule | 11:264e19992620 | 855 | writeReg(0x91, x0); |
displaymodule | 11:264e19992620 | 856 | writeReg(0x92, x0 >> 8); |
displaymodule | 11:264e19992620 | 857 | |
displaymodule | 11:264e19992620 | 858 | /* Set y0 */ |
displaymodule | 11:264e19992620 | 859 | writeReg(0x93, y0); |
displaymodule | 11:264e19992620 | 860 | writeReg(0x94, y0 >> 8); |
displaymodule | 11:264e19992620 | 861 | |
displaymodule | 11:264e19992620 | 862 | /* Set x1 */ |
displaymodule | 11:264e19992620 | 863 | writeReg(0x95, x1); |
displaymodule | 11:264e19992620 | 864 | writeReg(0x96, x1 >> 8); |
displaymodule | 11:264e19992620 | 865 | |
displaymodule | 11:264e19992620 | 866 | /* Set y1 */ |
displaymodule | 11:264e19992620 | 867 | writeReg(0x97, y1); |
displaymodule | 11:264e19992620 | 868 | writeReg(0x98, y1 >> 8); |
displaymodule | 11:264e19992620 | 869 | |
displaymodule | 11:264e19992620 | 870 | /* Set Radius */ |
displaymodule | 11:264e19992620 | 871 | writeReg(0xA1, r1); |
displaymodule | 11:264e19992620 | 872 | writeReg(0xA2, r1 >> 8); |
displaymodule | 11:264e19992620 | 873 | writeReg(0xA3, r2); |
displaymodule | 11:264e19992620 | 874 | writeReg(0xA4, r2 >> 8); |
displaymodule | 11:264e19992620 | 875 | |
displaymodule | 11:264e19992620 | 876 | /* Set Color */ |
displaymodule | 11:264e19992620 | 877 | writeReg(0x63, (color & 0xf800) >> 11); |
displaymodule | 11:264e19992620 | 878 | writeReg(0x64, (color & 0x07e0) >> 5); |
displaymodule | 11:264e19992620 | 879 | writeReg(0x65, (color & 0x001f)); |
displaymodule | 11:264e19992620 | 880 | |
displaymodule | 11:264e19992620 | 881 | /* Draw! */ |
displaymodule | 11:264e19992620 | 882 | if (filled) { |
displaymodule | 11:264e19992620 | 883 | writeReg(0xA0, 0xE0); |
displaymodule | 11:264e19992620 | 884 | } else { |
displaymodule | 11:264e19992620 | 885 | writeReg(0xA0, 0xA0); |
displaymodule | 11:264e19992620 | 886 | } |
displaymodule | 11:264e19992620 | 887 | |
displaymodule | 11:264e19992620 | 888 | /* Wait for the command to finish */ |
displaymodule | 11:264e19992620 | 889 | while (readReg(0xA0) & 0x80); |
displaymodule | 11:264e19992620 | 890 | } |
displaymodule | 11:264e19992620 | 891 | |
displaymodule | 11:264e19992620 | 892 | void DmTftRa8875::drawRoundRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t r1, uint16_t r2, uint16_t color) |
displaymodule | 11:264e19992620 | 893 | { |
displaymodule | 11:264e19992620 | 894 | roundrectangle(x0, y0, x1, y1, r1, r2, color, false); |
displaymodule | 11:264e19992620 | 895 | } |
displaymodule | 11:264e19992620 | 896 | void DmTftRa8875::fillRoundRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t r1, uint16_t r2, uint16_t color) |
displaymodule | 11:264e19992620 | 897 | { |
displaymodule | 11:264e19992620 | 898 | roundrectangle(x0, y0, x1, y1, r1, r2, color, true); |
displaymodule | 11:264e19992620 | 899 | } |
displaymodule | 11:264e19992620 | 900 | /********************************************************************************************************* |
displaymodule | 11:264e19992620 | 901 | END FILE |
displaymodule | 11:264e19992620 | 902 | *********************************************************************************************************/ |