Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added drawBitmap and demos to display bitmaps. #26

Merged
merged 2 commits into from
Mar 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added drawBitmap and demos to display bitmaps.
  • Loading branch information
marcmerlin committed Mar 23, 2017
commit 63e77c01dcebb927c7ba681a4b62e6514a81ee04
9 changes: 9 additions & 0 deletions Adafruit_ILI9341.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,12 @@ void Adafruit_ILI9341::fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
writeFillRect(x,y,w,h,color);
endWrite();
}

// This code was ported/adapted from https://github.com/PaulStoffregen/ILI9341_t3
// by Marc MERLIN. See examples/pictureEmbed to use this.
void Adafruit_ILI9341::drawBitmap(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *pcolors) {
startWrite();
setAddrWindow(x, y, w, h);
writePixels((uint16_t*) pcolors, w*h);
endWrite();
}
1 change: 1 addition & 0 deletions Adafruit_ILI9341.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Adafruit_ILI9341 : public Adafruit_GFX {
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
void drawBitmap(int16_t x, int16_t y, int16_t w, int16_t h, const uint16_t *pcolors);

uint8_t readcommand8(uint8_t reg, uint8_t index = 0);

Expand Down
Loading