EPD_1in54b.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*****************************************************************************
  2. * | File : EPD_1in54b.h
  3. * | Author : Waveshare team
  4. * | Function : Electronic paper driver
  5. * | Info :
  6. *----------------
  7. * | This version: V2.0
  8. * | Date : 2018-10-30
  9. * | Info :
  10. * 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8]
  11. * 2.Change:EPD_Display(UBYTE *Image)
  12. * Need to pass parameters: pointer to cached data
  13. #
  14. # Permission is hereby granted, free of charge, to any person obtaining a copy
  15. # of this software and associated documnetation files (the "Software"), to deal
  16. # in the Software without restriction, including without limitation the rights
  17. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18. # copies of the Software, and to permit persons to whom the Software is
  19. # furished to do so, subject to the following conditions:
  20. #
  21. # The above copyright notice and this permission notice shall be included in
  22. # all copies or substantial portions of the Software.
  23. #
  24. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  30. # THE SOFTWARE.
  31. #
  32. ******************************************************************************/
  33. #ifndef _EPD1IN54B_H_
  34. #define _EPD1IN54B_H_
  35. #include "DEV_Config.h"
  36. // Display resolution
  37. #define EPD_WIDTH 200
  38. #define EPD_HEIGHT 200
  39. // EPD1IN54B commands
  40. #define PANEL_SETTING 0x00
  41. #define POWER_SETTING 0x01
  42. #define POWER_OFF 0x02
  43. #define POWER_OFF_SEQUENCE_SETTING 0x03
  44. #define POWER_ON 0x04
  45. #define POWER_ON_MEASURE 0x05
  46. #define BOOSTER_SOFT_START 0x06
  47. #define DEEP_SLEEP 0x07
  48. #define DATA_START_TRANSMISSION_1 0x10
  49. #define DATA_STOP 0x11
  50. #define DISPLAY_REFRESH 0x12
  51. #define DATA_START_TRANSMISSION_2 0x13
  52. #define PLL_CONTROL 0x30
  53. #define TEMPERATURE_SENSOR_COMMAND 0x40
  54. #define TEMPERATURE_SENSOR_CALIBRATION 0x41
  55. #define TEMPERATURE_SENSOR_WRITE 0x42
  56. #define TEMPERATURE_SENSOR_READ 0x43
  57. #define VCOM_AND_DATA_INTERVAL_SETTING 0x50
  58. #define LOW_POWER_DETECTION 0x51
  59. #define TCON_SETTING 0x60
  60. #define TCON_RESOLUTION 0x61
  61. #define SOURCE_AND_GATE_START_SETTING 0x62
  62. #define GET_STATUS 0x71
  63. #define AUTO_MEASURE_VCOM 0x80
  64. #define VCOM_VALUE 0x81
  65. #define VCM_DC_SETTING_REGISTER 0x82
  66. #define PROGRAM_MODE 0xA0
  67. #define ACTIVE_PROGRAM 0xA1
  68. #define READ_OTP_DATA 0xA2
  69. UBYTE EPD_Init(void);
  70. void EPD_Clear(void);
  71. void EPD_Display(const UBYTE *blackimage, const UBYTE *redimage);
  72. void EPD_Sleep(void);
  73. #endif