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