epdif.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @filename : epdif.h
  3. * @brief : Header file of epdif.cpp providing EPD interface functions
  4. * Users have to implement all the functions in epdif.cpp
  5. * @author : Yehui from Waveshare
  6. *
  7. * Copyright (C) Waveshare August 10 2017
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10. * of this software and associated documnetation files (the "Software"), to deal
  11. * in the Software without restriction, including without limitation the rights
  12. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. * copies of the Software, and to permit persons to whom the Software is
  14. * furished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice and this permission notice shall be included in
  17. * all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. * THE SOFTWARE.
  26. */
  27. #ifndef EPDIF_H
  28. #define EPDIF_H
  29. #include <Arduino.h>
  30. // Pin definition
  31. #define RST_PIN 8
  32. #define DC_PIN 9
  33. #define CS_PIN 10
  34. #define BUSY_PIN 7
  35. #define PWR_PIN 6
  36. class EpdIf {
  37. public:
  38. EpdIf(void);
  39. ~EpdIf(void);
  40. static int IfInit(void);
  41. static void DigitalWrite(int pin, int value);
  42. static int DigitalRead(int pin);
  43. static void DelayMs(unsigned int delaytime);
  44. static void SpiTransfer(unsigned char data);
  45. };
  46. #endif