added _ssd1306_cursor function

This commit is contained in:
nopnop2002 2024-08-23 09:07:55 +09:00
parent 9ef8c11bb2
commit 98c578572c
2 changed files with 8 additions and 0 deletions

View File

@ -549,6 +549,13 @@ void _ssd1306_circle(SSD1306_t * dev, int x0, int y0, int r, bool invert)
} while(y<0); } while(y<0);
} }
// Draw cursor
void _ssd1306_cursor(SSD1306_t * dev, int x0, int y0, int r, bool invert)
{
_ssd1306_line(dev, x0-r, y0, x0+r, y0, invert);
_ssd1306_line(dev, x0, y0-r, x0, y0+r, invert);
}
void ssd1306_invert(uint8_t *buf, size_t blen) void ssd1306_invert(uint8_t *buf, size_t blen)
{ {
uint8_t wk; uint8_t wk;

View File

@ -127,6 +127,7 @@ void ssd1306_bitmaps(SSD1306_t * dev, int xpos, int ypos, uint8_t * bitmap, int
void _ssd1306_pixel(SSD1306_t * dev, int xpos, int ypos, bool invert); void _ssd1306_pixel(SSD1306_t * dev, int xpos, int ypos, bool invert);
void _ssd1306_line(SSD1306_t * dev, int x1, int y1, int x2, int y2, bool invert); void _ssd1306_line(SSD1306_t * dev, int x1, int y1, int x2, int y2, bool invert);
void _ssd1306_circle(SSD1306_t * dev, int x0, int y0, int r, bool invert); void _ssd1306_circle(SSD1306_t * dev, int x0, int y0, int r, bool invert);
void _ssd1306_cursor(SSD1306_t * dev, int x0, int y0, int r, bool invert);
void ssd1306_invert(uint8_t *buf, size_t blen); void ssd1306_invert(uint8_t *buf, size_t blen);
void ssd1306_flip(uint8_t *buf, size_t blen); void ssd1306_flip(uint8_t *buf, size_t blen);
uint8_t ssd1306_copy_bit(uint8_t src, int srcBits, uint8_t dst, int dstBits); uint8_t ssd1306_copy_bit(uint8_t src, int srcBits, uint8_t dst, int dstBits);