epd2in13b_V2.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @filename : epd2in13b.h
  3. * @brief : Header file for Dual-color e-paper library epd2in13b.cpp
  4. * @author : Yehui from Waveshare
  5. *
  6. * Copyright (C) Waveshare July 31 2017
  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 EPD2IN13B_H
  27. #define EPD2IN13B_H
  28. #include "epdif.h"
  29. // Display resolution
  30. #define EPD_WIDTH 104
  31. #define EPD_HEIGHT 212
  32. class Epd : EpdIf {
  33. public:
  34. int width;
  35. int height;
  36. int count;
  37. Epd();
  38. ~Epd();
  39. int Init(void);
  40. void SendCommand(unsigned char command);
  41. void SendData(unsigned char data);
  42. void WaitUntilIdle(void);
  43. void Reset(void);
  44. void DisplayFrame(const unsigned char* frame_buffer_black, const unsigned char* frame_buffer_red);
  45. void DisplayFrame(void);
  46. void Display(const unsigned char* frame_buffer) ;
  47. void ClearFrame(void);
  48. void Sleep(void);
  49. private:
  50. unsigned int reset_pin;
  51. unsigned int dc_pin;
  52. unsigned int cs_pin;
  53. unsigned int busy_pin;
  54. };
  55. #endif /* EPD2IN13B_H */
  56. /* END OF FILE */