GFX_SSD1327.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * GFX_SSD1327.h
  3. *
  4. * The MIT License.
  5. * Created on: 5.08.2020
  6. * Author: Mateusz Salamon
  7. * www.msalamon.pl
  8. * mateusz@msalamon.pl
  9. */
  10. #ifndef GFX_SSD1327_H_
  11. #define GFX_SSD1327_H_
  12. /***************************************************************
  13. *
  14. * SETTINGS
  15. *
  16. * Please set what functionality you want to use.
  17. * Some functions need other functionalities. It should works automatically.
  18. *
  19. * 1 - will be compiled
  20. * 0 - won't be compiled
  21. *
  22. * */
  23. #define AVR_USING 0
  24. #define STM32_USING 1
  25. #define GFX_DrawPixel(x,y,color) SSD1327_DrawPixel(x,y,color)
  26. #define WIDTH SSD1327_LCDWIDTH
  27. #define HEIGHT SSD1327_LCDHEIGHT
  28. #define PIXEL_BLACK BLACK
  29. #define PIXEL_WHITE WHITE
  30. #define PIXEL_INVERSE INVERSE
  31. #define USING_STRINGS 1 // 0 - do not compile, 1 - compile
  32. #define USING_IMAGE 1
  33. #if USING_IMAGE == 1
  34. #define USING_IMAGE_ROTATE 0
  35. #endif
  36. // Trygonometric graphic functions
  37. #define USING_RECTANGLE 1
  38. #define USING_CIRCLE 1
  39. #define USING_FILL_CIRCLE 1
  40. #define USING_ROUND_RECTANGLE 1
  41. #define USING_FILL_ROUND_RECTANGLE 1
  42. #define USING_TRIANGLE 1
  43. #define USING_FILL_TRIANGLE 1
  44. #if ((USING_FILL_ROUND_RECTANGLE == 0) && (USING_STRINGS == 0))
  45. #define USING_FILL_RECTANGLE 0
  46. #endif
  47. #if (USING_RECTANGLE == 0) && (USING_FILL_RECTANGLE == 0) && (USING_FILL_CIRCLE == 0) && (USING_ROUND_RECTANGLE == 0) && (USING_TRIANGLE == 0) && (USING_FILL_TRIANGLE == 0)
  48. #define USING_LINES 0
  49. #endif
  50. /****************************************************************/
  51. #if (USING_FILL_ROUND_RECTANGLE == 1 || USING_STRINGS == 1)
  52. #define USING_FILL_RECTANGLE 1
  53. #endif
  54. #if (USING_RECTANGLE == 1) || (USING_FILL_RECTANGLE == 1) || (USING_FILL_CIRCLE == 1) || (USING_ROUND_RECTANGLE == 1) || (USING_TRIANGLE == 1) || (USING_FILL_TRIANGLE == 1)
  55. #define USING_LINES 1
  56. #endif
  57. #if USING_ROUND_RECTANGLE == 1
  58. #define CIRCLE_HELPER
  59. #endif
  60. #if (USING_FILL_CIRCLE == 1) || (USING_FILL_ROUND_RECTANGLE == 1)
  61. #define FILL_CIRCLE_HELPER
  62. #endif
  63. #if USING_STRINGS == 1
  64. /*
  65. *
  66. */
  67. void GFX_SetFont(const uint8_t* font_t);
  68. void GFX_SetFontSize(uint8_t size_t);
  69. uint8_t GFX_GetFontHeight(void);
  70. uint8_t GFX_GetFontWidth(void);
  71. uint8_t GFX_GetFontSize(void);
  72. void GFX_DrawChar(int x, int y, char chr, uint8_t color, uint8_t background);
  73. void GFX_DrawString(int x, int y, char* str, uint8_t color, uint8_t background);
  74. #endif
  75. #if USING_LINES == 1
  76. void GFX_DrawLine(int x_start, int y_start, int x_end, int y_end, uint8_t color);
  77. #endif
  78. #if USING_RECTANGLE == 1
  79. void GFX_DrawRectangle(int x, int y, uint16_t w, uint16_t h, uint8_t color);
  80. #endif
  81. #if USING_FILL_RECTANGLE ==1
  82. void GFX_DrawFillRectangle(int x, int y, uint16_t w, uint16_t h, uint8_t color);
  83. #endif
  84. #if USING_CIRCLE == 1
  85. void GFX_DrawCircle(int x0, int y0, uint16_t r, uint8_t color);
  86. #endif
  87. #if USING_FILL_CIRCLE == 1
  88. void GFX_DrawFillCircle(int x0, int y0, uint16_t r, uint8_t color);
  89. #endif
  90. #if USING_ROUND_RECTANGLE == 1
  91. void GFX_DrawRoundRectangle(int x, int y, uint16_t w, uint16_t h, uint16_t r, uint8_t color);
  92. #endif
  93. #if USING_FILL_ROUND_RECTANGLE == 1
  94. void GFX_DrawFillRoundRectangle(int x, int y, uint16_t w, uint16_t h, uint16_t r, uint8_t color);
  95. #endif
  96. #if USING_TRIANGLE == 1
  97. void GFX_DrawTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8_t color);
  98. #endif
  99. #if USING_FILL_TRIANGLE == 1
  100. void GFX_DrawFillTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8_t color);
  101. #endif
  102. #if USING_IMAGE == 1
  103. #if AVR_USING ==1
  104. void GFX_Image_P(int x, int y, uint8_t *img, uint8_t w, uint8_t h, uint8_t color);
  105. #endif
  106. #if STM32_USING ==1
  107. void GFX_Image(int x, int y, const uint8_t *img, uint8_t w, uint8_t h);
  108. #if USING_IMAGE_ROTATE == 1
  109. void GFX_ImageRotate(int x, int y, const uint8_t *img, uint8_t w, uint8_t h, uint8_t color, uint16_t angle);
  110. #endif
  111. #endif
  112. #endif
  113. #endif /* GFX_SSD1327_H_ */