23 void oledc_fillRectPrimative(
int x0,
int y0,
int w,
int h,
unsigned int color)
28 if (x0 >= _width || y0 >= _height || x1 < 0 || y1 < 0 || w <= 0 || h <= 0)
return;
30 if (x1 >= _width) x1 = _width - 1;
31 if (y1 >= _height) y1 = _height - 1;
37 switch (TFTROTATION) {
41 x0 = TFTWIDTH - x0 - 1;
42 x1 = TFTWIDTH - x1 - 1;
48 x0 = TFTWIDTH - x0 - 1;
49 y0 = TFTHEIGHT - y0 - 1;
50 x1 = TFTWIDTH - x1 - 1;
51 y1 = TFTHEIGHT - y1 - 1;
56 y0 = TFTHEIGHT - y0 - 1;
57 y1 = TFTHEIGHT - y1 - 1;
62 oledc_writeCommand(SSD1331_CMD_FILL, 0);
63 oledc_writeCommand(1, 0);
65 oledc_writeCommand(SSD1331_CMD_DRAWRECT, 0);
66 oledc_writeCommand(x0, 0);
67 oledc_writeCommand(y0, 0);
68 oledc_writeCommand(x1, 0);
69 oledc_writeCommand(y1, 0);
71 oledc_writeCommand((color >> 11) << 1, 0);
72 oledc_writeCommand((color >> 5) & 0x3F, 0);
73 oledc_writeCommand((color << 1) & 0x3F, 0);
74 oledc_writeCommand((color >> 11) << 1, 0);
75 oledc_writeCommand((color >> 5) & 0x3F, 0);
76 oledc_writeCommand((color << 1) & 0x3F, 0);
84 void oledc_fillRect(
int x0,
int y0,
int w,
int h,
unsigned int color)
86 while(oledc_screenLock());
87 oledc_screenLockSet();
89 oledc_fillRectPrimative(x0, y0, w, h, color);
91 oledc_screenLockClr();