2
0

gds.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. struct GDS_BacklightPWM {
  21. int Channel, Timer, Max;
  22. bool Init;
  23. };
  24. typedef struct GDS_Device* GDS_DetectFunc(char *Driver, struct GDS_Device *Device);
  25. struct GDS_Device* GDS_AutoDetect( char *Driver, GDS_DetectFunc* DetectFunc[], struct GDS_BacklightPWM *PWM );
  26. void GDS_SetContrast( struct GDS_Device* Device, uint8_t Contrast );
  27. void GDS_DisplayOn( struct GDS_Device* Device );
  28. void GDS_DisplayOff( struct GDS_Device* Device );
  29. void GDS_Update( struct GDS_Device* Device );
  30. void GDS_SetLayout( struct GDS_Device* Device, bool HFlip, bool VFlip, bool Rotate );
  31. void GDS_SetDirty( struct GDS_Device* Device );
  32. int GDS_GetWidth( struct GDS_Device* Device );
  33. int GDS_GetHeight( struct GDS_Device* Device );
  34. int GDS_GetDepth( struct GDS_Device* Device );
  35. int GDS_GetMode( struct GDS_Device* Device );
  36. int GDS_GrayMap( struct GDS_Device* Device, uint8_t Level );
  37. void GDS_ClearExt( struct GDS_Device* Device, bool full, ...);
  38. void GDS_Clear( struct GDS_Device* Device, int Color );
  39. void GDS_ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color );
  40. #endif