Skip to content

Commit 9e6e69c

Browse files
committed
Add windowSet/Clear functions
1 parent 18d9b91 commit 9e6e69c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/HyperDisplay_SSD1309.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,31 @@ void SSD1309::hwpixel(hd_hw_extent_t x0, hd_hw_extent_t y0, color_t data, hd_col
187187

188188

189189
// Functions that don't need color arguments, for simplicity.
190+
191+
void SSD1309::windowSet(wind_info_t* pwindow)
192+
{
193+
wind_info_t* ptemp = NULL;
194+
SSD1309_Bite_t pix;
195+
pix.bite = 0xFF;
196+
197+
if(pwindow != NULL){ ptemp = pCurrentWindow; pCurrentWindow = pwindow; } // Store current window and change to the desired window
198+
fillWindow((color_t)&pix);
199+
if(ptemp != NULL){ pCurrentWindow = ptemp; } // Restore the old window, if needed
200+
}
201+
202+
void SSD1309::windowClear(wind_info_t* pwindow)
203+
{
204+
wind_info_t* ptemp = NULL;
205+
SSD1309_Bite_t pix;
206+
pix.bite = 0x00;
207+
208+
if(pwindow != NULL){ ptemp = pCurrentWindow; pCurrentWindow = pwindow; } // Store current window and change to the desired window
209+
fillWindow((color_t)&pix);
210+
if(ptemp != NULL){ pCurrentWindow = ptemp; } // Restore the old window, if needed
211+
}
212+
213+
214+
190215
void SSD1309::pixelSet(hd_extent_t x0, hd_extent_t y0)
191216
{
192217
SSD1309_Bite_t pix;

src/HyperDisplay_SSD1309.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ class SSD1309 : virtual public hyperdisplay{
186186

187187

188188
// Functions that don't need color arguments, for simplicity.
189+
190+
void windowSet(wind_info_t* pwindow = NULL);
191+
void windowClear(wind_info_t* pwindow = NULL);
189192
void pixelSet(hd_extent_t x0, hd_extent_t y0);
190193
void pixelClear(hd_extent_t x0, hd_extent_t y0);
191194
void rectangleSet(hd_extent_t x0, hd_extent_t y0, hd_extent_t x1, hd_extent_t y1, bool filled = false);

0 commit comments

Comments
 (0)