[364] | 1 | #ifndef _ADAFRUIT_GFX_H
|
---|
| 2 | #define _ADAFRUIT_GFX_H
|
---|
| 3 |
|
---|
| 4 | #include <stdint.h>
|
---|
| 5 | #include <stdbool.h>
|
---|
| 6 | #include <time.h>
|
---|
| 7 | #include <mbed_api.h>
|
---|
| 8 | #include "adafruit_ssd1306.h"
|
---|
| 9 |
|
---|
| 10 | extern uint16_t lcd_init_height;
|
---|
| 11 | extern uint16_t lcd_init_width;
|
---|
| 12 |
|
---|
| 13 | void lcd_adafruit_gfx(LCD_Handler_t *lcd, int16_t w, int16_t h);
|
---|
| 14 | void lcd_writeLine(LCD_Handler_t *lcd, int16_t x0, int16_t y0, int16_t x1, int16_t y1,
|
---|
| 15 | uint16_t color);
|
---|
| 16 | void lcd_startWrite(LCD_Handler_t *lcd);
|
---|
| 17 | void lcd_writePixel(LCD_Handler_t *lcd, int16_t x, int16_t y, uint16_t color);
|
---|
| 18 | void lcd_writeFastVLine(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 19 | int16_t h, uint16_t color);
|
---|
| 20 | void lcd_writeFastHLine(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 21 | int16_t w, uint16_t color);
|
---|
| 22 | void lcd_writeFillRect(LCD_Handler_t *lcd, int16_t x, int16_t y, int16_t w, int16_t h,
|
---|
| 23 | uint16_t color);
|
---|
| 24 | void lcd_endWrite(LCD_Handler_t *lcd);
|
---|
| 25 | void lcd_drawFastVLine_(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 26 | int16_t h, uint16_t color);
|
---|
| 27 | void lcd_drawFastHLine_(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 28 | int16_t w, uint16_t color);
|
---|
| 29 | void gfx_fillRect(LCD_Handler_t *lcd, int16_t x, int16_t y, int16_t w, int16_t h,
|
---|
| 30 | uint16_t color);
|
---|
| 31 | void gfx_fillScreen(LCD_Handler_t *lcd, uint16_t color);
|
---|
| 32 | void gfx_drawLine(LCD_Handler_t *lcd, int16_t x0, int16_t y0, int16_t x1, int16_t y1,
|
---|
| 33 | uint16_t color);
|
---|
| 34 | void lcd_drawCircle(LCD_Handler_t *lcd, int16_t x0, int16_t y0, int16_t r,
|
---|
| 35 | uint16_t color);
|
---|
| 36 | void lcd_drawCircleHelper(LCD_Handler_t *lcd, int16_t x0, int16_t y0,
|
---|
| 37 | int16_t r, uint8_t cornername, uint16_t color);
|
---|
| 38 | void lcd_fillCircle(LCD_Handler_t *lcd, int16_t x0, int16_t y0, int16_t r,
|
---|
| 39 | uint16_t color);
|
---|
| 40 | void lcd_fillCircleHelper(LCD_Handler_t *lcd, int16_t x0, int16_t y0, int16_t r,
|
---|
| 41 | uint8_t cornername, int16_t delta, uint16_t color);
|
---|
| 42 | void gfx_drawRect(LCD_Handler_t *lcd, int16_t x, int16_t y, int16_t w, int16_t h,
|
---|
| 43 | uint16_t color);
|
---|
| 44 | void lcd_drawRoundRect(LCD_Handler_t *lcd, int16_t x, int16_t y, int16_t w,
|
---|
| 45 | int16_t h, int16_t r, uint16_t color);
|
---|
| 46 | void lcd_fillRoundRect(LCD_Handler_t *lcd, int16_t x, int16_t y, int16_t w,
|
---|
| 47 | int16_t h, int16_t r, uint16_t color);
|
---|
| 48 | void lcd_drawTriangle(LCD_Handler_t *lcd, int16_t x0, int16_t y0,
|
---|
| 49 | int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
|
---|
| 50 | void lcd_fillTriangle(LCD_Handler_t *lcd, int16_t x0, int16_t y0,
|
---|
| 51 | int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
|
---|
| 52 | void lcd_drawBitmap1(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 53 | const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
|
---|
| 54 | void lcd_drawBitmap2(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 55 | const uint8_t bitmap[], int16_t w, int16_t h,
|
---|
| 56 | uint16_t color, uint16_t bg);
|
---|
| 57 | void lcd_drawBitmap3(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 58 | uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
|
---|
| 59 | void lcd_drawBitmap4(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 60 | uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
|
---|
| 61 | void lcd_drawXBitmap(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 62 | const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
|
---|
| 63 | void lcd_drawGrayscaleBitmap1(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 64 | const uint8_t bitmap[], int16_t w, int16_t h);
|
---|
| 65 | void lcd_drawGrayscaleBitmap2(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 66 | uint8_t *bitmap, int16_t w, int16_t h);
|
---|
| 67 | void lcd_drawGrayscaleBitmap3(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 68 | const uint8_t bitmap[], const uint8_t mask[],
|
---|
| 69 | int16_t w, int16_t h);
|
---|
| 70 | void lcd_drawGrayscaleBitmap4(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 71 | uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h);
|
---|
| 72 | void lcd_drawRGBBitmap1(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 73 | const uint16_t bitmap[], int16_t w, int16_t h);
|
---|
| 74 | void lcd_drawRGBBitmap2(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 75 | uint16_t *bitmap, int16_t w, int16_t h);
|
---|
| 76 | void lcd_drawRGBBitmap3(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 77 | const uint16_t bitmap[], const uint8_t mask[],
|
---|
| 78 | int16_t w, int16_t h);
|
---|
| 79 | void lcd_drawRGBBitmap4(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 80 | uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h);
|
---|
| 81 | void lcd_drawFont_(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 82 | uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
|
---|
| 83 | void lcd_drawChar(LCD_Handler_t *lcd, int16_t x, int16_t y, const char *utf8,
|
---|
| 84 | uint16_t color, uint16_t bg, uint8_t size);
|
---|
| 85 | size_t lcd_write(LCD_Handler_t *lcd, uint8_t c);
|
---|
| 86 | void lcd_drawString_(LCD_Handler_t *lcd, int16_t x, int16_t y,
|
---|
| 87 | const char *string, uint16_t color, uint16_t bg);
|
---|
| 88 | void lcd_setCursor(LCD_Handler_t *lcd, int16_t x, int16_t y);
|
---|
| 89 | int16_t lcd_getCursorX(LCD_Handler_t *lcd);
|
---|
| 90 | int16_t lcd_getCursorY(LCD_Handler_t *lcd);
|
---|
| 91 | void lcd_setTextSize(LCD_Handler_t *lcd, uint8_t s);
|
---|
| 92 | void lcd_setTextColor(LCD_Handler_t *lcd, uint16_t c);
|
---|
| 93 | void lcd_setTextColor2(LCD_Handler_t *lcd, uint16_t c, uint16_t b);
|
---|
| 94 | void lcd_setTextWrap(LCD_Handler_t *lcd, bool w);
|
---|
| 95 | uint8_t lcd_getRotation(LCD_Handler_t *lcd);
|
---|
| 96 | void lcd_setRotation(LCD_Handler_t *lcd, uint8_t x);
|
---|
| 97 | void lcd_setFont(LCD_Handler_t *lcd, const GFXfont *f);
|
---|
| 98 | void lcd_charBounds(LCD_Handler_t *lcd, char c, int16_t *x, int16_t *y,
|
---|
| 99 | int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy);
|
---|
| 100 | void lcd_getTextBounds(LCD_Handler_t *lcd, const char *str, int16_t x, int16_t y,
|
---|
| 101 | int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
|
---|
| 102 | void lcd_getTextBounds2(LCD_Handler_t *lcd, const char *str, int16_t x, int16_t y,
|
---|
| 103 | int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
|
---|
| 104 | void lcd_getTextBounds3(LCD_Handler_t *lcd, const char *str,
|
---|
| 105 | int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
|
---|
| 106 | int16_t lcd_width(LCD_Handler_t *lcd);
|
---|
| 107 | int16_t lcd_height(LCD_Handler_t *lcd);
|
---|
| 108 |
|
---|
| 109 | #endif // _ADAFRUIT_GFX_H
|
---|