2
0

epd5in83.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * @filename : epd5in83.h
  3. * @brief : Header file for e-paper library epd5in83.cpp
  4. * @author : MyMX from Waveshare
  5. *
  6. * Copyright (C) Waveshare April 6 2018
  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 EPD5IN83_H
  27. #define EPD5IN83_H
  28. #include "epdif.h"
  29. // Display resolution
  30. #define EPD_WIDTH 600
  31. #define EPD_HEIGHT 448
  32. // EPD7IN5 commands
  33. #define PANEL_SETTING 0x00
  34. #define POWER_SETTING 0x01
  35. #define POWER_OFF 0x02
  36. #define POWER_OFF_SEQUENCE_SETTING 0x03
  37. #define POWER_ON 0x04
  38. #define POWER_ON_MEASURE 0x05
  39. #define BOOSTER_SOFT_START 0x06
  40. #define DEEP_SLEEP 0x07
  41. #define DATA_START_TRANSMISSION_1 0x10
  42. #define DATA_STOP 0x11
  43. #define DISPLAY_REFRESH 0x12
  44. #define IMAGE_PROCESS 0x13
  45. #define LUT_FOR_VCOM 0x20
  46. #define LUT_BLUE 0x21
  47. #define LUT_WHITE 0x22
  48. #define LUT_GRAY_1 0x23
  49. #define LUT_GRAY_2 0x24
  50. #define LUT_RED_0 0x25
  51. #define LUT_RED_1 0x26
  52. #define LUT_RED_2 0x27
  53. #define LUT_RED_3 0x28
  54. #define LUT_XON 0x29
  55. #define PLL_CONTROL 0x30
  56. #define TEMPERATURE_SENSOR_COMMAND 0x40
  57. #define TEMPERATURE_CALIBRATION 0x41
  58. #define TEMPERATURE_SENSOR_WRITE 0x42
  59. #define TEMPERATURE_SENSOR_READ 0x43
  60. #define VCOM_AND_DATA_INTERVAL_SETTING 0x50
  61. #define LOW_POWER_DETECTION 0x51
  62. #define TCON_SETTING 0x60
  63. #define TCON_RESOLUTION 0x61
  64. #define SPI_FLASH_CONTROL 0x65
  65. #define REVISION 0x70
  66. #define GET_STATUS 0x71
  67. #define AUTO_MEASUREMENT_VCOM 0x80
  68. #define READ_VCOM_VALUE 0x81
  69. #define VCM_DC_SETTING 0x82
  70. class Epd : EpdIf {
  71. public:
  72. Epd();
  73. ~Epd();
  74. int Init(void);
  75. void WaitUntilIdle(void);
  76. void Reset(void);
  77. void SetLut(void);
  78. void DisplayFrame(const unsigned char** frame_buffer);
  79. void SendCommand(unsigned char command);
  80. void SendData(unsigned char data);
  81. void Sleep(void);
  82. private:
  83. unsigned int reset_pin;
  84. unsigned int dc_pin;
  85. unsigned int cs_pin;
  86. unsigned int busy_pin;
  87. unsigned long width;
  88. unsigned long height;
  89. };
  90. #endif /* EPD5IN83_H */
  91. /* END OF FILE */