gds.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 are optimized for 1 bit
  7. and 4 bits screen depth. For any other type of screen, DrawCBR and ClearWindow
  8. default to use DrawPixel, which is very sub-optimal. For such other depth, you
  9. must supply the DrawPixelFast. The built-in 1 bit depth function are only for
  10. 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. enum { GDS_COLOR_L0 = 0, GDS_COLOR_L1, GDS_COLOR_L2, GDS_COLOR_L3, GDS_COLOR_L4, GDS_COLOR_L5, GDS_COLOR_L6, GDS_COLOR_L7,
  14. GDS_COLOR_L8, GDS_COLOR_L9, GDS_COLOR_L10, GDS_COLOR_L11, GDS_COLOR_L12, GDS_COLOR_L13, GDS_COLOR_L14, GDS_COLOR_L15,
  15. GDS_COLOR_MAX
  16. };
  17. #define GDS_COLOR_BLACK (0)
  18. #define GDS_COLOR_WHITE (-1)
  19. #define GDS_COLOR_XOR (GDS_COLOR_MAX + 1)
  20. struct GDS_Device;
  21. struct GDS_FontDef;
  22. typedef struct GDS_Device* GDS_DetectFunc(char *Driver, struct GDS_Device *Device);
  23. struct GDS_Device* GDS_AutoDetect( char *Driver, GDS_DetectFunc* DetectFunc[] );
  24. void GDS_SetContrast( struct GDS_Device* Device, uint8_t Contrast );
  25. void GDS_DisplayOn( struct GDS_Device* Device );
  26. void GDS_DisplayOff( struct GDS_Device* Device );
  27. void GDS_Update( struct GDS_Device* Device );
  28. void GDS_SetHFlip( struct GDS_Device* Device, bool On );
  29. void GDS_SetVFlip( struct GDS_Device* Device, bool On );
  30. int GDS_GetWidth( struct GDS_Device* Device );
  31. int GDS_GetHeight( struct GDS_Device* Device );
  32. void GDS_ClearExt( struct GDS_Device* Device, bool full, ...);
  33. void GDS_Clear( struct GDS_Device* Device, int Color );
  34. void GDS_ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color );
  35. #endif