gds.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _GDS_H_
  2. #define _GDS_H_
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. /* NOTE for drivers:
  6. The build-in DrawPixel(Fast), DrawCBR and ClearWindow have optimized for 1 bit
  7. and 4 bits grayscale screen depth and 8, 16, 24 color. For any other type of screen,
  8. DrawCBR and ClearWindow default to use DrawPixel, which is very sub-optimal. For
  9. other depth, you must supply the DrawPixelFast. The built-in 1 bit depth function
  10. are only for screen with vertical framing (1 byte = 8 lines). For example SSD1326 in
  11. monochrome mode is not such type of screen, SH1106 and SSD1306 are
  12. */
  13. // this is an ordered enum, do not change!
  14. enum { GDS_MONO = 0, GDS_GRAYSCALE, GDS_RGB332, GDS_RGB444, GDS_RGB555, GDS_RGB565, GDS_RGB666, GDS_RGB888 };
  15. #define GDS_COLOR_BLACK (0)
  16. #define GDS_COLOR_WHITE (-1)
  17. #define GDS_COLOR_XOR (256)
  18. struct GDS_Device;
  19. struct GDS_FontDef;
  20. typedef struct GDS_Device* GDS_DetectFunc(char *Driver, struct GDS_Device *Device);
  21. struct GDS_Device* GDS_AutoDetect( char *Driver, GDS_DetectFunc* DetectFunc[] );
  22. void GDS_SetContrast( struct GDS_Device* Device, uint8_t Contrast );
  23. void GDS_DisplayOn( struct GDS_Device* Device );
  24. void GDS_DisplayOff( struct GDS_Device* Device );
  25. void GDS_Update( struct GDS_Device* Device );
  26. void GDS_SetHFlip( struct GDS_Device* Device, bool On );
  27. void GDS_SetVFlip( struct GDS_Device* Device, bool On );
  28. void GDS_SetDirty( struct GDS_Device* Device );
  29. int GDS_GetWidth( struct GDS_Device* Device );
  30. int GDS_GetHeight( struct GDS_Device* Device );
  31. int GDS_GetDepth( struct GDS_Device* Device );
  32. int GDS_GetMode( struct GDS_Device* Device );
  33. int GDS_GrayMap( struct GDS_Device* Device, uint8_t Level );
  34. void GDS_ClearExt( struct GDS_Device* Device, bool full, ...);
  35. void GDS_Clear( struct GDS_Device* Device, int Color );
  36. void GDS_ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color );
  37. #endif