19 #include "simplegfx.h" 20 #include "simpletools.h" 32 #define MAGENTA 0xC9D4 40 #define DARKRED 0xA000 44 #define REDORANGE 0xD261 48 #define LIGHTORANGE 0xDDB2 56 #define YELLOWORANGE 0xFCE0 72 #define YELLOWGREEN 0x5600 80 #define DARKGREEN 0x02C0 84 #define GREENBLUE 0x0C75 92 #define LIGHTBLUE 0x857B 96 #define SKYBLUE 0x0E3E 104 #define NAVYBLUE 0x0009 108 #define VIOLET 0x7817 112 #define PURPLE 0xA017 116 #define RASPBERRY 0x902A 124 #define LIGHTBROWN 0xBB44 128 #define BRONZE 0xA440 136 #define DARKBROWN 0x51E7 140 #define LIGHTGRAY 0xBDD7 148 #define DARKGRAY 0x3186 159 #ifndef SSD1331_CMD_DRAWLINE 160 #define SSD1331_CMD_DRAWLINE 0x21 163 #ifndef SSD1331_CMD_DRAWRECT 164 #define SSD1331_CMD_DRAWRECT 0x22 167 #ifndef SSD1331_CMD_COPY 168 #define SSD1331_CMD_COPY 0x23 171 #ifndef SSD1331_CMD_CLEAR 172 #define SSD1331_CMD_CLEAR 0x25 175 #ifndef SSD1331_CMD_FILL 176 #define SSD1331_CMD_FILL 0x26 179 #ifndef SSD1331_CMD_SCROLLSETUP 180 #define SSD1331_CMD_SCROLLSETUP 0x27 183 #ifndef SSD1331_CMD_SCROLLSTOP 184 #define SSD1331_CMD_SCROLLSTOP 0x2E 187 #ifndef SSD1331_CMD_SCROLLSTART 188 #define SSD1331_CMD_SCROLLSTART 0x2F 191 #ifndef SSD1331_CMD_SETCOLUMN 192 #define SSD1331_CMD_SETCOLUMN 0x15 195 #ifndef SSD1331_CMD_SETROW 196 #define SSD1331_CMD_SETROW 0x75 199 #ifndef SSD1331_CMD_CONTRASTA 200 #define SSD1331_CMD_CONTRASTA 0x81 203 #ifndef SSD1331_CMD_CONTRASTB 204 #define SSD1331_CMD_CONTRASTB 0x82 207 #ifndef SSD1331_CMD_CONTRASTC 208 #define SSD1331_CMD_CONTRASTC 0x83 211 #ifndef SSD1331_CMD_MASTERCURRENT 212 #define SSD1331_CMD_MASTERCURRENT 0x87 215 #ifndef SSD1331_CMD_SETREMAP 216 #define SSD1331_CMD_SETREMAP 0xA0 219 #ifndef SSD1331_CMD_STARTLINE 220 #define SSD1331_CMD_STARTLINE 0xA1 223 #ifndef SSD1331_CMD_DISPLAYOFFSET 224 #define SSD1331_CMD_DISPLAYOFFSET 0xA2 227 #ifndef SSD1331_CMD_NORMALDISPLAY 228 #define SSD1331_CMD_NORMALDISPLAY 0xA4 231 #ifndef SSD1331_CMD_DISPLAYALLON 232 #define SSD1331_CMD_DISPLAYALLON 0xA5 235 #ifndef SSD1331_CMD_DISPLAYALLOFF 236 #define SSD1331_CMD_DISPLAYALLOFF 0xA6 239 #ifndef SSD1331_CMD_INVERTDISPLAY 240 #define SSD1331_CMD_INVERTDISPLAY 0xA7 243 #ifndef SSD1331_CMD_SETMULTIPLEX 244 #define SSD1331_CMD_SETMULTIPLEX 0xA8 247 #ifndef SSD1331_CMD_SETMASTER 248 #define SSD1331_CMD_SETMASTER 0xAD 251 #ifndef SSD1331_CMD_DISPLAYOFF 252 #define SSD1331_CMD_DISPLAYOFF 0xAE 255 #ifndef SSD1331_CMD_DISPLAYON 256 #define SSD1331_CMD_DISPLAYON 0xAF 259 #ifndef SSD1331_CMD_POWERMODE 260 #define SSD1331_CMD_POWERMODE 0xB0 263 #ifndef SSD1331_CMD_PRECHARGE 264 #define SSD1331_CMD_PRECHARGE 0xB1 267 #ifndef SSD1331_CMD_CLOCKDIV 268 #define SSD1331_CMD_CLOCKDIV 0xB3 271 #ifndef SSD1331_CMD_PRECHARGEA 272 #define SSD1331_CMD_PRECHARGEA 0x8A 275 #ifndef SSD1331_CMD_PRECHARGEB 276 #define SSD1331_CMD_PRECHARGEB 0x8B 279 #ifndef SSD1331_CMD_PRECHARGEC 280 #define SSD1331_CMD_PRECHARGEC 0x8C 283 #ifndef SSD1331_CMD_PRECHARGELEVEL 284 #define SSD1331_CMD_PRECHARGELEVEL 0xBB 287 #ifndef SSD1331_CMD_VCOMH 288 #define SSD1331_CMD_VCOMH 0xBE 299 screen_t*
ssd1331_init(
char sdi,
char sclk,
char cs,
char rs,
char rst,
int _width,
int _height);
329 void ssd1331_drawLine(screen_t* dev,
int x0,
int y0,
int x1,
int y1,
int color);
376 void ssd1331_fillRect(screen_t* dev,
int x0,
int y0,
int x1,
int y1,
int color);
407 void ssd1331_writeByte(
int mask_cs,
int mask_sdi,
int mask_clk,
int mask_dc,
char c,
char dc);
445 void ssd1331_copy(screen_t* dev,
int x0,
int y0,
int w,
int h,
int x2,
int y2);
void ssd1331_drawFastVLine(screen_t *dev, int x, int y, int w, int color)
Draws a vertical line on the screen in the specified color. No bounds checking (used by other functio...
Definition: ssd1331_drawLine.c:46
void ssd1331_sleepWakeDisplay(screen_t *dev, char i)
Sleeps or Wakes the display.
Definition: ssd1331_sleepWake.c:6
void ssd1331_clearDisplay(screen_t *dev)
Clears the screen by setting the full area of the display to black.
Definition: ssd1331_fillRect.c:53
void ssd1331_invertDisplay(screen_t *dev, char i)
Inverts the screen.
Definition: ssd1331_invertDisplay.c:7
void ssd1331_copy(screen_t *dev, int x0, int y0, int w, int h, int x2, int y2)
Creates a copy a rectangular area of the screen at another position on the screen.
Definition: ssd1331_copy.c:5
char ssd1331_writeLock()
Returns the status of the SPI communication lockout so multiple cogs don't try to write to it at the ...
Definition: ssd1331_spiWrite.c:44
void ssd1331_fillRect(screen_t *dev, int x0, int y0, int x1, int y1, int color)
Draws a filled rectangle on the screen in the specified color.
Definition: ssd1331_fillRect.c:21
void ssd1331_writeByte(int mask_cs, int mask_sdi, int mask_clk, int mask_dc, char c, char dc)
Low level function that transfers bytes to the screen.
void ssd1331_drawPixel(screen_t *dev, int x, int y, int color)
Draws a single pixel on the screen in the specified color. No checking.
Definition: ssd1331_drawPixel.c:21
void ssd1331_scrollDisplay(screen_t *dev, int h, int v)
Starts scrolling the entire image on the screen horizontally, vertically, or both.
Definition: ssd1331_scroll.c:6
void ssd1331_drawFastHLine(screen_t *dev, int x, int y, int h, int color)
Draws a horizontal line on the screen in the specified color. No bounds checking (used by other funct...
Definition: ssd1331_drawLine.c:50
void ssd1331_drawLine(screen_t *dev, int x0, int y0, int x1, int y1, int color)
Draws a line on the screen in the specified color.
Definition: ssd1331_drawLine.c:21
void ssd1331_writeLockSet(char devId)
Sets the SPI communication lockout.
Definition: ssd1331_spiWrite.c:48
screen_t * ssd1331_init(char sdi, char sclk, char cs, char rs, char rst, int _width, int _height)
Definition: ssd1331_init.c:23
void ssd1331_writeLockClear(char devId)
Clears the SPI communication lockout.
Definition: ssd1331_spiWrite.c:53
void ssd1331_resetDisplay(screen_t *dev)
Resets the display.
Definition: ssd1331_init.c:136