EPD_4in2.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*****************************************************************************
  2. * | File : EPD_4in2.h
  3. * | Author : Waveshare team
  4. * | Function : 4.2inch e-paper
  5. * | Info :
  6. *----------------
  7. * | This version: V3.0
  8. * | Date : 2019-06-13
  9. * | Info :
  10. * -----------------------------------------------------------------------------
  11. * V3.0(2019-06-13):
  12. * 1.Change:
  13. * lut_vcomDC[] => EPD_4IN2_lut_vcomDC[]
  14. * lut_ww[] => EPD_4IN2_lut_ww[]
  15. * lut_bw[] => EPD_4IN2_lut_bw[]
  16. * lut_wb[] => EPD_4IN2_lut_wb[]
  17. * lut_bb[] => EPD_4IN2_lut_bb[]
  18. * EPD_Reset() => EPD_4IN2_Reset()
  19. * EPD_SendCommand() => EPD_4IN2_SendCommand()
  20. * EPD_SendData() => EPD_4IN2_SendData()
  21. * EPD_WaitUntilIdle() => EPD_4IN2_ReadBusy()
  22. * EPD_SetFullReg() => EPD_4IN2_SetFullReg()
  23. * EPD_SetPartReg() => EPD_4IN2_SetPartReg()
  24. * EPD_TurnOnDisplay() => EPD_4IN2_TurnOnDisplay()
  25. * EPD_Init() => EPD_4IN2_Init()
  26. * EPD_Clear() => EPD_4IN2_Clear()
  27. * EPD_Display() => EPD_4IN2_Display()
  28. * EPD_Sleep() => EPD_4IN2_Sleep()
  29. * 2.remove commands define:
  30. * #define PANEL_SETTING 0x00
  31. * #define POWER_SETTING 0x01
  32. * #define POWER_OFF 0x02
  33. * #define POWER_OFF_SEQUENCE_SETTING 0x03
  34. * #define POWER_ON 0x04
  35. * #define POWER_ON_MEASURE 0x05
  36. * #define BOOSTER_SOFT_START 0x06
  37. * #define DEEP_SLEEP 0x07
  38. * #define DATA_START_TRANSMISSION_1 0x10
  39. * #define DATA_STOP 0x11
  40. * #define DISPLAY_REFRESH 0x12
  41. * #define DATA_START_TRANSMISSION_2 0x13
  42. * #define VCOM_LUT 0x20
  43. * #define W2W_LUT 0x21
  44. * #define B2W_LUT 0x22
  45. * #define W2B_LUT 0x23
  46. * #define B2B_LUT 0x24
  47. * #define PLL_CONTROL 0x30
  48. * #define TEMPERATURE_SENSOR_CALIBRATION 0x40
  49. * #define TEMPERATURE_SENSOR_SELECTION 0x41
  50. * #define TEMPERATURE_SENSOR_WRITE 0x42
  51. * #define TEMPERATURE_SENSOR_READ 0x43
  52. * #define VCOM_AND_DATA_INTERVAL_SETTING 0x50
  53. * #define LOW_POWER_DETECTION 0x51
  54. * #define TCON_SETTING 0x60
  55. * #define RESOLUTION_SETTING 0x61
  56. * #define GET_STATUS 0x71
  57. * #define AUTO_MEASURE_VCOM 0x80
  58. * #define READ_VCOM_VALUE 0x81
  59. * #define VCM_DC_SETTING 0x82
  60. * #define PARTIAL_WINDOW 0x90
  61. * #define PARTIAL_IN 0x91
  62. * #define PARTIAL_OUT 0x92
  63. * #define PROGRAM_MODE 0xA0
  64. * #define ACTIVE_PROGRAM 0xA1
  65. * #define READ_OTP_DATA 0xA2
  66. * #define POWER_SAVING 0xE3
  67. * V2.0(2018-10-30):
  68. * 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8]
  69. * 2.Change:EPD_Display(UBYTE *Image)
  70. * Need to pass parameters: pointer to cached data
  71. #
  72. # Permission is hereby granted, free of charge, to any person obtaining a copy
  73. # of this software and associated documnetation files (the "Software"), to deal
  74. # in the Software without restriction, including without limitation the rights
  75. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  76. # copies of the Software, and to permit persons to whom the Software is
  77. # furished to do so, subject to the following conditions:
  78. #
  79. # The above copyright notice and this permission notice shall be included in
  80. # all copies or substantial portions of the Software.
  81. #
  82. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  83. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  84. # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  85. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  86. # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  87. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  88. # THE SOFTWARE.
  89. #
  90. ******************************************************************************/
  91. #ifndef _EPD_4IN2_H_
  92. #define _EPD_4IN2_H_
  93. #include "DEV_Config.h"
  94. // Display resolution
  95. #define EPD_4IN2_WIDTH 400
  96. #define EPD_4IN2_HEIGHT 300
  97. void EPD_4IN2_Init(void);
  98. void EPD_4IN2_Clear(void);
  99. void EPD_4IN2_Display(UBYTE *Image);
  100. void EPD_4IN2_Sleep(void);
  101. #endif