ssd13x6_draw.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _SSD13x6_DRAW_H_
  2. #define _SSD13x6_DRAW_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "sdkconfig.h"
  7. #define SSD13x6_CLIPDEBUG_NONE 0
  8. #define SSD13x6_CLIPDEBUG_WARNING 1
  9. #define SSD13x6_CLIPDEBUG_ERROR 2
  10. #if CONFIG_SSD13x6_CLIPDEBUG == SSD13x6_CLIPDEBUG_NONE
  11. /*
  12. * Clip silently with no console output.
  13. */
  14. #define ClipDebug( x, y )
  15. #elif CONFIG_SSD13x6_CLIPDEBUG == SSD13x6_CLIPDEBUG_WARNING
  16. /*
  17. * Log clipping to the console as a warning.
  18. */
  19. #define ClipDebug( x, y ) { \
  20. ESP_LOGW( __FUNCTION__, "Line %d: Pixel at %d, %d CLIPPED", __LINE__, x, y ); \
  21. }
  22. #elif CONFIG_SSD13x6_CLIPDEBUG == SSD13x6_CLIPDEBUG_ERROR
  23. /*
  24. * Log clipping as an error to the console.
  25. * Also invokes an abort with stack trace.
  26. */
  27. #define ClipDebug( x, y ) { \
  28. ESP_LOGE( __FUNCTION__, "Line %d: Pixel at %d, %d CLIPPED, ABORT", __LINE__, x, y ); \
  29. abort( ); \
  30. }
  31. #endif
  32. #define SSD_COLOR_BLACK 0
  33. #define SSD_COLOR_WHITE 1
  34. #define SSD_COLOR_XOR 2
  35. void SSD13x6_Clear( struct SSD13x6_Device* DeviceHandle, int Color );
  36. void SSD13x6_ClearWindow( struct SSD13x6_Device* DeviceHandle, int x1, int y1, int x2, int y2, int Color );
  37. void SSD13x6_DrawPixel( struct SSD13x6_Device* DeviceHandle, int X, int Y, int Color );
  38. void SSD13x6_DrawPixelFast( struct SSD13x6_Device* DeviceHandle, int X, int Y, int Color );
  39. void SSD13x6_DrawHLine( struct SSD13x6_Device* DeviceHandle, int x, int y, int Width, int Color );
  40. void SSD13x6_DrawVLine( struct SSD13x6_Device* DeviceHandle, int x, int y, int Height, int Color );
  41. void SSD13x6_DrawLine( struct SSD13x6_Device* DeviceHandle, int x0, int y0, int x1, int y1, int Color );
  42. void SSD13x6_DrawBox( struct SSD13x6_Device* DeviceHandle, int x1, int y1, int x2, int y2, int Color, bool Fill );
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif