---------------------------------------------------------- draws image from flash (PROGMEM)
| 509 | // ---------------------------------------------------------- |
| 510 | // draws image from flash (PROGMEM) |
| 511 | void Arduino_ST7789::drawImageF(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *img16) |
| 512 | { |
| 513 | if(x>=_width || y>=_height || w<=0 || h<=0) return; |
| 514 | setAddrWindow(x, y, x+w-1, y+h-1); |
| 515 | |
| 516 | uint32_t num = (uint32_t)w*h; |
| 517 | uint16_t num16 = num>>3; |
| 518 | uint8_t *img = (uint8_t *)img16; |
| 519 | while(num16--) { |
| 520 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 521 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 522 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 523 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 524 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 525 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 526 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 527 | writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; |
| 528 | } |
| 529 | uint8_t num8 = num & 0x7; |
| 530 | while(num8--) { writeSPI(pgm_read_byte(img+1)); writeSPI(pgm_read_byte(img+0)); img+=2; } |
| 531 | |
| 532 | CS_IDLE; |
| 533 | SPI_END; |
| 534 | } |
| 535 | |
| 536 | // ---------------------------------------------------------- |
| 537 | // Pass 8-bit (each) R,G,B, get back 16-bit packed color |
nothing calls this directly
no outgoing calls
no test coverage detected