EPD_3in52.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*****************************************************************************
  2. * | File : EPD_3IN52.h
  3. * | Author : Waveshare team
  4. * | Function : 3.52inch e-paper
  5. * | Info :
  6. *----------------
  7. * | This version: V1.0
  8. * | Date : 2022-05-07
  9. * | Info :
  10. * -----------------------------------------------------------------------------
  11. #
  12. # Permission is hereby granted, free of charge, to any person obtaining a copy
  13. # of this software and associated documnetation files (the "Software"), to deal
  14. # in the Software without restriction, including without limitation the rights
  15. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16. # copies of the Software, and to permit persons to whom the Software is
  17. # furished to do so, subject to the following conditions:
  18. #
  19. # The above copyright notice and this permission notice shall be included in
  20. # all copies or substantial portions of the Software.
  21. #
  22. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  25. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  27. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  28. # THE SOFTWARE.
  29. #
  30. ******************************************************************************/
  31. #ifndef __EPD_3IN52_H_
  32. #define __EPD_3IN52_H_
  33. #include "epdif.h"
  34. // Display resolution
  35. #define EPD_WIDTH 240
  36. #define EPD_HEIGHT 360
  37. #define UWORD unsigned int
  38. #define UBYTE unsigned char
  39. #define UDOUBLE unsigned long
  40. #define EPD_3IN52_WHITE 0xFF //
  41. #define EPD_3IN52_BLACK 0x00 //
  42. #define EPD_3IN52_Source_Line 0xAA //
  43. #define EPD_3IN52_Gate_Line 0x55 //
  44. #define EPD_3IN52_UP_BLACK_DOWN_WHITE 0xF0 //
  45. #define EPD_3IN52_LEFT_BLACK_RIGHT_WHITE 0x0F //
  46. #define EPD_3IN52_Frame 0x01 //
  47. #define EPD_3IN52_Crosstalk 0x02 //
  48. #define EPD_3IN52_Chessboard 0x03 //
  49. #define EPD_3IN52_Image 0x04 //
  50. extern unsigned char EPD_3IN52_Flag;
  51. class Epd : EpdIf {
  52. public:
  53. Epd();
  54. ~Epd();
  55. int Init(void);
  56. void Reset(void);
  57. void SendCommand(unsigned char command);
  58. void SendData(unsigned char data);
  59. void ReadBusy(void);
  60. void lut(void);
  61. void refresh(void);
  62. void lut_GC(void);
  63. void lut_DU(void);
  64. void display(UBYTE* picData);
  65. void display_part(UBYTE *Image, UWORD xstart, UWORD ystart, UWORD image_width, UWORD image_heigh);
  66. void display_NUM(UBYTE NUM);
  67. void Clear(void);
  68. void sleep(void);
  69. private:
  70. unsigned int reset_pin;
  71. unsigned int dc_pin;
  72. unsigned int cs_pin;
  73. unsigned int busy_pin;
  74. unsigned long width;
  75. unsigned long height;
  76. unsigned char EPD_3IN52_Flag;
  77. };
  78. #endif