2
0

epd4in2b_V2.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * @filename : epd4in2_V2.h
  3. * @brief : Header file for Dual-color e-paper library epd4in2.cpp
  4. * @author : Yehui from Waveshare
  5. *
  6. * Copyright (C) Waveshare Nov 11 2020
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documnetation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. #ifndef EPD4IN2_V2_H
  27. #define EPD4IN2_V2_H
  28. #include "epdif.h"
  29. // Display resolution
  30. #define EPD_WIDTH 400
  31. #define EPD_HEIGHT 300
  32. #define UWORD unsigned int
  33. #define UBYTE unsigned char
  34. class Epd : EpdIf {
  35. public:
  36. unsigned int width;
  37. unsigned int height;
  38. Epd();
  39. ~Epd();
  40. int Init_new(void);
  41. int Init_old(void);
  42. int Init(void);
  43. void SendCommand(unsigned char command);
  44. void SendData(unsigned char data);
  45. void ReadBusy(void);
  46. void Reset(void);
  47. void Display_Window_Black(const UBYTE *image, UBYTE count);
  48. void Display_Window_Red_new(const UBYTE *image, UBYTE count);
  49. void Display_Window_Red_old(const UBYTE *image, UBYTE count);
  50. void Display_Window_Red(const UBYTE *image, UBYTE count);
  51. void DisplayFrame(void);
  52. void Display_old(const UBYTE *blackimage, const UBYTE *ryimage);
  53. void Display_new(const UBYTE *blackimage, const UBYTE *ryimage);
  54. void Display(const UBYTE *blackimage, const UBYTE *ryimage);
  55. void Clear_new();
  56. void Clear_old();
  57. void Clear();
  58. void Sleep_new(void);
  59. void Sleep_old();
  60. void Sleep(void);
  61. private:
  62. unsigned int reset_pin;
  63. unsigned int dc_pin;
  64. unsigned int cs_pin;
  65. unsigned int busy_pin;
  66. unsigned char flag;
  67. };
  68. #endif /* EPD4IN2_H */
  69. /* END OF FILE */