### Gate/Source Start Setting (GSST) Register Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configures the starting position for gate and source lines, allowing for custom display resolutions and offsets. ```APIDOC ## Gate/Source Start Setting (GSST) Register (R65h) ### Description This command defines the resolution start gate/source position by setting horizontal and vertical display start positions. ### Method Write (W/R = 0) ### Endpoint Not Applicable (Register Access) ### Parameters #### Register Access - **Address**: R65h #### Data Fields - **HST[9:3]** (8-bit) - Required - Horizontal Display Start Position (Source). Value range: 00h ~ 63h. - **VST[9:0]** (10-bit) - Required - Vertical Display Start Position (Gate). Value range: 000h ~ 257h. ### Request Example ```json { "address": "R65h", "data": { "HST": "0000101", "VST": "0000000000" } } ``` ### Response #### Success Response (200) No specific success response defined for register writes, typically acknowledged by subsequent reads or absence of error. #### Response Example (No response example provided for register write.) ``` -------------------------------- ### Complete E-Paper Display Update Example Application Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt A comprehensive C example demonstrating the initialization of an E-Paper display, reading internal temperature, drawing graphics (rectangles and borders), updating the display, clearing it, and entering deep sleep. This example utilizes various EPD functions and standard C library functions like `malloc` and `memset`. Dependencies include EPD driver functions, `printf`, `malloc`, `memset`, and `free`. ```c #include #include #include // Complete example: Initialize display and show image int main(void) { // Hardware initialization epd_gpio_init(); // Display initialization epd_init(); // Read and display temperature int temperature = epd_read_internal_temperature(); printf("Temperature: %d°C\n", temperature); // Create image buffer uint8_t *image = malloc(48000); memset(image, 0xFF, 48000); // Clear to white // Draw test pattern epd_fill_rect(image, 50, 50, 700, 380, 0); // Black rectangle epd_fill_rect(image, 100, 100, 600, 280, 1); // White inner rectangle // Draw border epd_draw_rect(image, 0, 0, 800, 480, 0); // Display the image epd_display_image(image); // Wait 5 seconds delayMilliseconds(5000); // Clear display epd_clear_display(); // Free memory free(image); // Enter deep sleep to save power epd_power_off(); epd_deep_sleep(); return 0; } ``` -------------------------------- ### Data Start Transmission 1 (DTM1) Configuration Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Initiates data transmission to the display's SRAM. The data written depends on the current mode (KW, KWR, or Program mode). ```APIDOC ## Data Start Transmission 1 (DTM1) Configuration ### Description Initiates data transmission to the display's SRAM. The data written depends on the current mode (KW, KWR, or Program mode). ### Method POST ### Endpoint /rahulkolasseri/7.5inch_e-paper_v2_specification/api/dtm1 ### Parameters #### Request Body - **mode** (string) - Required - Specifies the data writing mode. Accepted values: "KW", "KWR", "Program". - **data** (array of bytes) - Required - The pixel data to be transmitted. The format depends on the mode. ### Request Example { "mode": "KW", "data": [ 0b00000000, 0b10101010, 0b01010101 ] } ### Response #### Success Response (200) - **status** (string) - Indicates the data transmission was initiated successfully. #### Response Example { "status": "Data transmission started successfully." } ``` -------------------------------- ### Data Start Transmission 2 (DTM2) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to start transmitting data to the SRAM. This command is used to write new data (in KW mode) or red data (in KWR mode) into the SRAM. ```APIDOC ## Data Start Transmission 2 (DTM2) ### Description This command initiates the transmission of pixel data to the SRAM. It is used to write new data in KW mode or red data in KWR mode into the display's SRAM. ### Method Write ### Endpoint R13h ### Parameters #### Command Byte - **00000111** (binary) - Starts data transmission to SRAM. #### Pixel Data - **Pixel1 to Pixel8** (data) - Required - Represents the pixel data for the display. This can be in byte or bit format depending on the context and display resolution. ### Request Example ```json { "command": "00000111", "data": [ // Array of pixel data bytes/bits for the entire frame ] } ``` ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Initialize 7.5inch E-Paper V2 Module Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt Initializes the 7.5inch E-Paper V2 module by performing a hardware reset, configuring booster soft start, power settings, and panel parameters. It sets up the display resolution to 800x480 and configures TCON and VCOM settings. This function is crucial for bringing the display to an operational state. ```c void epd_init(void) { epd_hardware_reset(); // Booster soft start epd_booster_soft_start(); // Power setting epd_power_setting(); // Power on epd_power_on(); // Panel setting epd_send_command(0x00); epd_send_data(0x3F); // LUT from register, KWR mode, scan up, shift right, booster on // PLL control (50Hz frame rate) epd_send_command(0x30); epd_send_data(0x06); // Resolution setting (800x480) epd_send_command(0x61); epd_send_data(0x03); // HRES[9:8] epd_send_data(0x20); // HRES[7:3] = 100 -> 800 pixels epd_send_data(0x01); // VRES[9:8] epd_send_data(0xE0); // VRES[7:0] = 480 // Dual SPI mode epd_send_command(0x15); epd_send_data(0x00); // Single SPI mode // TCON setting epd_send_command(0x60); epd_send_data(0x22); // S2G=12, G2S=12 // VCOM_DC setting epd_send_command(0x82); epd_send_data(0x26); // VCOM = -2.0V (typical value) // VCOM and data interval setting epd_send_command(0x50); epd_send_data(0x31); // Border control epd_send_data(0x07); } ``` -------------------------------- ### e-Paper V2 Pin Definitions and Initialization (C) Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt Defines the pin configuration for the 24-pin FPC connector of the 7.5inch e-Paper V2 display and provides an example of hardware initialization for the SPI interface. It sets up GPIO directions and initial states for SPI communication and control signals. ```c // Pin definitions for 24-pin FPC connector #define PIN_NC 1 // No connection (Keep Open) #define PIN_GDR 2 // N-MOS gate control output #define PIN_RESET 3 // Current sense input #define PIN_VSHR 5 // Positive source voltage for Red #define PIN_TSCL 6 // I²C clock for external temperature sensor #define PIN_TSDA 7 // I²C data for external temperature sensor #define PIN_BS 8 // Interface selection (Low=4-wire SPI, High=3-wire SPI) #define PIN_BUSY_N 9 // Driver status output (Low=busy) #define PIN_RST_N 10 // Global reset (Low=reset) #define PIN_DC 11 // Command/Data input #define PIN_CSB 12 // Chip select (active Low) #define PIN_SCL 13 // Serial clock input #define PIN_SDA 14 // Serial data input/output #define PIN_VDDIO 15 // IO voltage supply #define PIN_VDD 16 // Digital/Analog power #define PIN_VSS 17 // Digital ground #define PIN_VDD_18V 18 // 1.8V voltage input/output #define PIN_VOTP 19 // OTP program power (7.5V) #define PIN_VSH 20 // Positive source voltage #define PIN_VGH 21 // Positive gate voltage #define PIN_VSL 22 // Negative source voltage #define PIN_VGL 23 // Negative gate voltage #define PIN_VCOM 24 // VCOM output // Example hardware initialization void epd_gpio_init(void) { // Configure SPI interface pins gpio_set_direction(PIN_CSB, GPIO_MODE_OUTPUT); gpio_set_direction(PIN_DC, GPIO_MODE_OUTPUT); gpio_set_direction(PIN_SCL, GPIO_MODE_OUTPUT); gpio_set_direction(PIN_SDA, GPIO_MODE_OUTPUT); // Configure control pins gpio_set_direction(PIN_RST_N, GPIO_MODE_OUTPUT); gpio_set_direction(PIN_BUSY_N, GPIO_MODE_INPUT); // Configure interface selection (4-wire SPI) gpio_set_direction(PIN_BS, GPIO_MODE_OUTPUT); gpio_set_level(PIN_BS, 0); // 0=4-wire SPI, 1=3-wire SPI // Initial state gpio_set_level(PIN_CSB, 1); gpio_set_level(PIN_RST_N, 1); } ``` -------------------------------- ### Get Status (FLG) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Reads the IC status, including partial display status, I2C errors, busy states, data reception status, power status, and driver busy status. ```APIDOC ## GET /status ### Description Reads the IC status, providing information about partial display, I2C communication, data reception, power states, and driver activity. ### Method GET ### Endpoint `/status` ### Parameters #### Query Parameters - **command** (string) - Required - The command to execute, which is 'FLG' for getting status. ### Request Example ```json { "command": "FLG" } ``` ### Response #### Success Response (200) - **PTL_Flag** (boolean) - True if in partial display mode, false otherwise. - **I2C_ERR** (boolean) - True if an I2C master error occurred, false otherwise. - **I2C_BUSYN** (boolean) - True if the I2C master is busy (active low), false otherwise. - **Data_Flag** (boolean) - True if the driver has received all data for one frame, false otherwise. - **PON** (boolean) - True if the device is in Power ON state, false otherwise. - **POF** (boolean) - True if the device is in Power OFF state, false otherwise. - **BUSY_N** (boolean) - True if the driver is busy (active low), false otherwise. #### Response Example ```json { "PTL_Flag": false, "I2C_ERR": false, "I2C_BUSYN": false, "Data_Flag": true, "PON": true, "POF": false, "BUSY_N": false } ``` ``` -------------------------------- ### Partial In (PTIN) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to make the display enter partial update mode. This should typically be followed by commands to define the partial window and then the data to be updated. ```APIDOC ## PARTIAL IN (PTIN) ### Description This command makes the display enter partial update mode. After issuing this command, subsequent commands can be used to define the partial window and update its content. ### Method Not Applicable (This is a command sent to the device, not a typical HTTP API endpoint) ### Endpoint Not Applicable ### Parameters #### Command Details - **Command Code**: R91h ### Request Example ``` // Command: R91h ``` ### Response #### Success Response (No specific success response code, indicates successful command reception/execution) #### Response Example (No specific response format defined for this command) ``` -------------------------------- ### Auto Sequence Command (AUTO) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Enable the internal sequence to execute multiple commands continuously, reducing power consumption and host control complexity. ```APIDOC ## Auto Sequence (AUTO) ### Description This command enables an internal sequence of operations, such as PON, DRF, POF, and DSLP, to execute continuously. This minimizes idle time, reduces power consumption, and simplifies the host's control procedure. ### Method SET ### Endpoint N/A (Command Set) ### Parameters #### Command Parameters - **AUTO (0x17)**: The base command for Auto Sequence. - **Code**: Specifies the sequence of operations. - **0xA5**: Executes the sequence (PON → DRF → POF). - **0xA7**: Executes the sequence (PON → DRF → POF → DSLP). ``` -------------------------------- ### KW LUT Option (KWOPT) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configure the Keyword Lookup Table (KW LUT) mechanism option in KWR mode. ```APIDOC ## KW LUT Option (KWOPT) ### Description This command sets the KW LUT mechanism option, which is only valid in K/W/R mode. It controls how the LUT is used for keyword detection. ### Method SET ### Endpoint N/A (Command Set) ### Parameters #### Command Parameters - **KWOPT (0x2B)**: The base command for KW LUT Option. - **Selection**: Controls the LUT selection mechanism. - **{ATRED, NORED}**: Keyword LUT or KWR LUT selection control. - `00`: KWR LUT always. - `01`: KW LUT only. - `10`: Auto detect by red data. - `11`: KW LUT only. - **KWE[9:0]**: KW LUT enable control bits. Each bit controls one state (KWE[0] for state-1, KWE[1] for state-2, etc.). At least one bit must be set if 'KW LUT only' is selected. - Example: `00 0000 0001b` enables KW LUT in State-1. - Example: `00 0000 0011b` enables KW LUT in State-1 and State-2. - Example: `00 0000 1011b` enables KW LUT in State-1, State-2, and State-4. ``` -------------------------------- ### e-Paper V2 Command and Register Table Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md This section details the commands, their write/read (W/R) and command/data (C/D) properties, bit configurations (D7-D0), register names, and default values for the 7.5 inch e-Paper V2. ```APIDOC ## 7.5 inch e-Paper V2 Commands and Registers ### Description This table provides a detailed breakdown of the commands and their associated registers for the 7.5 inch e-Paper V2. It includes information on data direction, bit configuration, register functionality, and default settings. ### Parameters #### Command Details - **KW LUT option (KWOPT)** - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `--`, `--`, `--`, `--`, `--`, `#`, `#`, `` - Registers: `ATRED`, `NORED` - Default: `00H` - **PLL control (PLL)** - W/R: 0 (Write) - C/D: 0 (Command) - Bits D7-D0: `0`, `0`, `1`, `1`, `0`, `0`, `0`, `0` - Registers: `` - Default: `30H` - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `--`, `--`, `--`, `#`, `#`, `#`, `#`, `#` - Registers: `FRS[3:0]` - Default: `06H` - **Temperature Sensor Calibration (TSC)** - W/R: 0 (Write) - C/D: 0 (Command) - Bits D7-D0: `0`, `1`, `0`, `0`, `0`, `0`, `0`, `0` - Registers: `` - Default: `40H` - W/R: 1 (Read) - C/D: 1 (Command) - Bits D7-D0: `#`, `#`, `#`, `#`, `#`, `#`, `#`, `#` - Registers: `D[10:3] / TS[7:0]` - Default: `00H` - W/R: 1 (Read) - C/D: 1 (Command) - Bits D7-D0: `#`, `#`, `#`, `--`, `--`, `--`, `--`, `--` - Registers: `D[2:0] / -` - Default: `00H` - **Temperature Sensor Selection (TSE)** - W/R: 0 (Write) - C/D: 0 (Command) - Bits D7-D0: `0`, `1`, `0`, `0`, `0`, `0`, `0`, `1` - Registers: `` - Default: `41H` - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `#`, `--`, `--`, `#`, `#`, `#`, `#`, `#` - Registers: `TSE`, `TO[3:0]` - Default: `00H` - **Temperature Sensor Write (TSW)** - W/R: 0 (Write) - C/D: 0 (Command) - Bits D7-D0: `0`, `1`, `0`, `0`, `0`, `0`, `1`, `0` - Registers: `` - Default: `42H` - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `#`, `#`, `#`, `#`, `#`, `#`, `#`, `#` - Registers: `WATTR[7:0]` - Default: `00H` - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `#`, `#`, `#`, `#`, `#`, `#`, `#`, `#` - Registers: `WMSB[7:0]` - Default: `00H` - W/R: 0 (Write) - C/D: 1 (Command) - Bits D7-D0: `#`, `#`, `#`, `#`, `#`, `#`, `#`, `#` - Registers: `WLSB[7:0]` - Default: `00H` - **Temperature Sensor Read (TSR)** - W/R: 0 (Write) - C/D: 0 (Command) - Bits D7-D0: `0`, `1`, `0`, `0`, `0`, `0`, `0`, `0` - Registers: `` - Default: `` (The default value for TSR is not specified in the provided text) ### Request Example ```json { "command": "KWOPT", "value": "01" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **data** (object) - Contains the response data, which might include read register values. #### Response Example ```json { "status": "success", "data": { "register": "ATRED", "value": "01" } } ``` ``` -------------------------------- ### Program Mode (PGM) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to enter program mode. After issuing this command, the chip enters program mode. A hardware reset is required to exit program mode after programming is complete. ```APIDOC ## PROGRAM MODE (PGM) ### Description This command instructs the e-Paper controller chip to enter program mode. This mode is typically used for firmware updates or programming specific settings. A hardware reset is required to exit this mode after the programming procedure is completed. ### Method Not Applicable (This is a command sent to the device, not a typical HTTP API endpoint) ### Endpoint Not Applicable ### Parameters #### Command Details - **Command Code**: RA0h ### Request Example ``` // Command: RA0h ``` ### Response #### Success Response (No specific success response code, indicates successful command reception/execution) #### Response Example (No specific response format defined for this command) ``` -------------------------------- ### Partial Out (PTOUT) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to make the display exit partial update mode and return to normal operation mode. This should be issued after partial updates are complete. ```APIDOC ## PARTIAL OUT (PTOUT) ### Description This command makes the display exit partial update mode and return to the normal display mode. It should be issued after all partial updates have been completed. ### Method Not Applicable (This is a command sent to the device, not a typical HTTP API endpoint) ### Endpoint Not Applicable ### Parameters #### Command Details - **Command Code**: R92h ### Request Example ``` // Command: R92h ``` ### Response #### Success Response (No specific success response code, indicates successful command reception/execution) #### Response Example (No specific response format defined for this command) ``` -------------------------------- ### Set Partial Window (PTL) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configures the display to update only a specific rectangular region. This allows for partial screen refreshes, improving performance. ```APIDOC ## SET PARTIAL WINDOW (PTL) ### Description Sets the partial window for screen updates. This command defines the rectangular area on the e-Paper display that will be updated, allowing for partial screen refreshes. ### Method Not Applicable (This is a command sent to the device, not a typical HTTP API endpoint) ### Endpoint Not Applicable ### Parameters #### Command Details - **Command Code**: R90h #### Data Bytes (Following Command) - **HRST[9:3]** (byte array) - Required - Horizontal start channel bank. (Value range: 00h~63h) - **HRED[9:3]** (byte array) - Required - Horizontal end channel bank. (Value range: 00h~63h). HRED must be greater than HRST. - **VRST[9:0]** (byte array) - Required - Vertical start line. (Value range: 000h~257h) - **VRED[9:0]** (byte array) - Required - Vertical end line. (Value range: 000h~257h). VRED must be greater than VRST. - **PT_SCAN** (byte) - Optional - Controls scanning behavior. - 0: Gates scan only inside of the partial window. - 1: Gates scan both inside and outside of the partial window. (default) ### Request Example (Illustrative - actual byte sequence depends on implementation) ``` // Example: Setting a partial window from horizontal 10 to 50, vertical 20 to 100 // Assuming HRST = 0x0A, HRED = 0x32, VRST = 0x0014, VRED = 0x0064, PT_SCAN = 0x01 // Command: R90h // Data: [0x0A, 0x00, 0x14, 0x00, 0x64, 0x01] (This is a simplified representation) ``` ### Response #### Success Response (No specific success response code, indicates successful command reception/execution) #### Response Example (No specific response format defined for this command) ``` -------------------------------- ### Configure and Refresh Partial E-Paper Window (C) Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt Enables partial updates on the e-paper display by defining a specific window for refresh. Includes functions to set the partial window boundaries, enter partial update mode, and exit it. This optimizes refresh times by only updating changed areas. ```c // Set partial window void epd_set_partial_window(int x_start, int y_start, int x_end, int y_end) { epd_send_command(0x90); // PTL command // HRST (horizontal start) epd_send_data((x_start >> 8) & 0x03); epd_send_data((x_start >> 3) & 0xF8); // HRED (horizontal end) epd_send_data((x_end >> 8) & 0x03); epd_send_data((x_end >> 3) & 0xF8); // VRST (vertical start) epd_send_data((y_start >> 8) & 0x03); epd_send_data(y_start & 0xFF); // VRED (vertical end) epd_send_data((y_end >> 8) & 0x03); epd_send_data(y_end & 0xFF); // PT_SCAN: scan both inside and outside epd_send_data(0x01); } // Enter partial mode void epd_partial_in(void) { epd_send_command(0x91); // PTIN command } // Exit partial mode void epd_partial_out(void) { epd_send_command(0x92); // PTOUT command } // Partial update example void epd_partial_update_example(void) { // Initialize display epd_init(); // Clear entire display first epd_clear_display(); // Define partial window (100,100) to (300,200) epd_set_partial_window(100, 100, 300, 200); // Enter partial mode epd_partial_in(); // Create partial image data uint8_t *partial_data = malloc(48000); memset(partial_data, 0xFF, 48000); // Draw something in the partial area epd_fill_rect(partial_data, 100, 100, 200, 100, 0); // Send and display partial data epd_send_old_data(partial_data); epd_send_new_data(partial_data); epd_send_command(0x12); // Refresh epd_wait_busy(); free(partial_data); // Exit partial mode epd_partial_out(); } ``` -------------------------------- ### Cascade Setting (CCSET) - RE0h Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configures cascade mode for connecting multiple e-paper displays. Allows setting TSFIX (temperature synchronization) and CCEN (cascade clock enable). ```APIDOC ## Cascade Setting (CCSET) - RE0h ### Description Used for cascade configuration. TSFIX synchronizes slave temperature to master's. CCEN enables/disables the cascade output clock. ### Method Writes to a command register. ### Endpoint `/rahulkolasseri/7.5inch_e-paper_v2_specification/commands/cascade_setting` ### Parameters #### Command Data - **D7** (bit) - 1 - Part of the CCSET command code. - **D6** (bit) - 1 - Part of the CCSET command code. - **D5** (bit) - 1 - Part of the CCSET command code. - **D4** (bit) - 0 - Part of the CCSET command code. - **D3** (bit) - 0 - Part of the CCSET command code. - **D2** (bit) - 0 - Part of the CCSET command code. - **D1** (bit) - 0 - Part of the CCSET command code. - **D0** (bit) - 0 - Part of the CCSET command code. #### Request Body - **TSFIX** (boolean) - Optional - Set to true to use slave's temperature from TS_SET[7:0] registers. Defaults to false (use internal/external sensor). - **CCEN** (boolean) - Optional - Set to true to enable output clock at CL pin to slave chip. Defaults to false (output 0V at CL pin). ``` -------------------------------- ### Dual SPI Mode and MM Input Pin Configuration Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configure the e-Paper display to use Dual SPI mode and enable/disable the MM input pin definition. ```APIDOC ## Set Dual SPI Mode ### Description This command configures the e-Paper display to operate in dual SPI mode. It also allows enabling or disabling the MM input pin definition. ### Method SET ### Endpoint N/A (Command Set) ### Parameters #### Command Parameters - **MM_EN** (0 or 1) - Enable/disable MM input pin definition. `0`: disable, `1`: enable. - **DUSPI_EN** (0 or 1) - Enable/disable Dual SPI mode. `0`: disable (single SPI mode), `1`: enable. ``` -------------------------------- ### Active Program (APG) - RA1h Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Activates the programming state machine for the e-Paper V2. The BUSY_N flag will indicate the programming completion status. ```APIDOC ## Active Program (APG) - RA1h ### Description Activates the programming state machine. The BUSY_N flag will fall to 0 until the programming is completed. ### Method Writes to a command register. ### Endpoint `/rahulkolasseri/7.5inch_e-paper_v2_specification/commands/active_program` ### Parameters #### Command Data - **D7** (bit) - 1 - Part of the APG command code. - **D6** (bit) - 0 - Part of the APG command code. - **D5** (bit) - 1 - Part of the APG command code. - **D4** (bit) - 0 - Part of the APG command code. - **D3** (bit) - 0 - Part of the APG command code. - **D2** (bit) - 0 - Part of the APG command code. - **D1** (bit) - 0 - Part of the APG command code. - **D0** (bit) - 1 - Part of the APG command code. ### Request Example ```json { "command": "RA1h", "data": { "D7": 1, "D6": 0, "D5": 1, "D4": 0, "D3": 0, "D2": 0, "D1": 0, "D0": 1 } } ``` ### Response #### Success Response (200) - **status** (string) - "Programming initiated" - **message** (string) - "BUSY_N flag will indicate completion." ``` -------------------------------- ### Dual SPI Mode (DUSPI) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to configure the Dual SPI mode. This allows for enabling or disabling dual SPI communication and muting SPI using specific bits. ```APIDOC ## Dual SPI Mode (DUSPI) ### Description This command configures the device for Dual SPI communication. It allows enabling or disabling the dual SPI mode (`DUSPI_EN`) and muting SPI (`MM_EN`) through specific bits in the command byte. ### Method Write ### Endpoint R15h ### Parameters #### Command Byte - **000010101** (binary) - Stops data transmission (this seems to be a typo in the source, likely intended for configuration). #### Configuration Bits - **MM_EN** (boolean) - Optional - Mutes SPI communication. - **DUSPI_EN** (boolean) - Optional - Enables Dual SPI mode. ### Request Example ```json { "command": "000010101", "config": { "MM_EN": true, "DUSPI_EN": false } } ``` ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Auto Measure VCOM (AMV) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Triggers the auto VCOM sensing mechanism with configurable parameters for timing, gate control, source output, and enable/disable. ```APIDOC ## POST /vcom/auto-measure ### Description Triggers the automatic VCOM sensing mechanism. Allows configuration of measurement time, gate behavior, source output, and enabling/disabling the process. ### Method POST ### Endpoint `/vcom/auto-measure` ### Parameters #### Query Parameters - **command** (string) - Required - The command to execute, which is 'AMV' for auto measure VCOM. #### Request Body - **AMVT** (string) - Optional - Auto Measure VCOM Time. Accepts '3s', '5s', '8s', '10s'. Defaults to '5s'. - **XON** (boolean) - Optional - All Gate ON during Auto Measure VCOM period. Default is false. - **AMVS** (boolean) - Optional - Source output during Auto Measure VCOM period. false outputs 0V, true outputs VDHR. Default is false. - **AMV** (boolean) - Optional - Analog signal for VCOM value. false uses VV command (R81h), true uses external ADC. Default is false. - **AMVE** (boolean) - Optional - Auto Measure VCOM Enable/Disable. Default is false. ### Request Example ```json { "command": "AMV", "AMVT": "8s", "XON": true, "AMVS": false, "AMV": true, "AMVE": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the result of the operation, e.g., 'success'. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Power Saving (PWS) - RE3h Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Enables power saving mode for VCOM and Source during refreshing periods. Allows configuration of active period width. ```APIDOC ## Power Saving (PWS) - RE3h ### Description Sets power saving for VCOM & Source during refreshing period. If output voltage changes polarity, power saving is activated. The active period width is defined by VCOM_W and SD_W. ### Method Writes to a command register. ### Endpoint `/rahulkolasseri/7.5inch_e-paper_v2_specification/commands/power_saving` ### Parameters #### Command Data - **D7** (bit) - 1 - Part of the PWS command code. - **D6** (bit) - 1 - Part of the PWS command code. - **D5** (bit) - 1 - Part of the PWS command code. - **D4** (bit) - 0 - Part of the PWS command code. - **D3** (bit) - 0 - Part of the PWS command code. - **D2** (bit) - 0 - Part of the PWS command code. - **D1** (bit) - 1 - Part of the PWS command code. - **D0** (bit) - 1 - Part of the PWS command code. #### Request Body - **VCOM_W** (integer) - Optional - Defines the active period width for VCOM. Range 0-15. - **SD_W** (integer) - Optional - Defines the active period width for Source. Range 0-15. ``` -------------------------------- ### Deep Sleep (DSLP) Mode Configuration Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Configures the display to enter Deep Sleep Mode for power saving. The chip returns to Standby Mode via hardware reset. A check code of 0xA5 is required for execution. ```APIDOC ## Deep Sleep (DSLP) Mode Configuration ### Description Configures the display to enter Deep Sleep Mode for power saving. The chip returns to Standby Mode via hardware reset. A check code of 0xA5 is required for execution. ### Method POST ### Endpoint /rahulkolasseri/7.5inch_e-paper_v2_specification/api/dsleep ### Parameters #### Request Body - **check_code** (hex) - Required - Must be 0xA5 to execute the command. ### Request Example { "check_code": "0xA5" } ### Response #### Success Response (200) - **status** (string) - Indicates the operation was successful. #### Response Example { "status": "Deep Sleep Mode entered successfully." } ``` -------------------------------- ### 4-Wire SPI Communication for E-Paper Display (C) Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt Implements 4-wire SPI communication for sending commands and data to the e-paper display. It defines timing parameters and includes functions to send single bytes of commands or data, as well as arrays of data. It also includes a utility to wait for the display to become ready. ```c // 4-wire SPI timing parameters #define SPI_CLOCK_MIN_PERIOD_NS 100 #define SPI_CLOCK_HIGH_MIN_NS 35 #define SPI_CLOCK_LOW_MIN_NS 35 #define SPI_CS_SETUP_TIME_NS 100 #define SPI_CS_HOLD_TIME_NS 100 #define SPI_DATA_SETUP_TIME_NS 30 #define SPI_DATA_HOLD_TIME_NS 30 // Send command via 4-wire SPI void epd_send_command(uint8_t command) { gpio_set_level(PIN_DC, 0); // DC=0 for command gpio_set_level(PIN_CSB, 0); // CS active for (int i = 7; i >= 0; i--) { gpio_set_level(PIN_SCL, 0); gpio_set_level(PIN_SDA, (command >> i) & 0x01); delayNanoseconds(35); gpio_set_level(PIN_SCL, 1); delayNanoseconds(35); } gpio_set_level(PIN_CSB, 1); // CS inactive } // Send data via 4-wire SPI void epd_send_data(uint8_t data) { gpio_set_level(PIN_DC, 1); // DC=1 for data gpio_set_level(PIN_CSB, 0); // CS active for (int i = 7; i >= 0; i--) { gpio_set_level(PIN_SCL, 0); gpio_set_level(PIN_SDA, (data >> i) & 0x01); delayNanoseconds(35); gpio_set_level(PIN_SCL, 1); delayNanoseconds(35); } gpio_set_level(PIN_CSB, 1); // CS inactive } // Send multiple data bytes void epd_send_data_array(const uint8_t *data, size_t length) { gpio_set_level(PIN_DC, 1); // DC=1 for data gpio_set_level(PIN_CSB, 0); // CS active for (size_t n = 0; n < length; n++) { for (int i = 7; i >= 0; i--) { gpio_set_level(PIN_SCL, 0); gpio_set_level(PIN_SDA, (data[n] >> i) & 0x01); delayNanoseconds(35); gpio_set_level(PIN_SCL, 1); delayNanoseconds(35); } } gpio_set_level(PIN_CSB, 1); // CS inactive } // Wait for display to be ready void epd_wait_busy(void) { while (gpio_get_level(PIN_BUSY_N) == 0) { delayMilliseconds(10); } } ``` -------------------------------- ### Low Power Display Loop in C Source: https://context7.com/rahulkolasseri/7.5inch_e-paper_v2_specification/llms.txt This C code demonstrates a typical loop for a battery-powered e-paper display. It includes waking the device, checking battery status, displaying content or a warning, powering down, and entering deep sleep for a specified duration. It relies on external functions for e-paper interaction, image creation, and system sleep. ```c // Example: Battery-powered device with low power monitoring void battery_powered_display_loop(void) { while (1) { // Wake from sleep epd_wake_from_sleep(); // Check battery voltage if (!epd_check_low_power()) { // Battery low - display warning uint8_t *warning = create_low_battery_image(); epd_display_image(warning); free(warning); } else { // Battery OK - normal operation uint8_t *image = create_display_content(); epd_display_image(image); free(image); } // Power down and sleep epd_power_off(); epd_deep_sleep(); // Sleep for 1 hour (external timer/RTC wakes MCU) system_sleep_for_hours(1); } } ``` -------------------------------- ### Data Stop (DSP) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to stop data transmission. It checks the completeness of data before initiating a display refresh. The data_flag indicates whether all necessary data has been received. ```APIDOC ## Data Stop (DSP) ### Description This command stops data transmission and checks if all data has been received. If `data_flag` is 1, it signifies that all one-frame data (DTM1 and DTM2) has been received, and the display refresh process will begin. The BUSY_N signal will go low upon starting the refresh. ### Method Write ### Endpoint R11h ### Parameters #### Command Byte - **00000101** (binary) - Stops data transmission. - **00000101** (binary) with `data_flag` set to 1 - Indicates all data received, initiates refresh. #### Data Byte (`data_flag`) - **data_flag** (boolean) - Required - 0: Driver did not receive all data. 1: Driver has received all one-frame data. ### Response Example N/A (This is a command to the hardware) ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Display Refresh (DRF) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Command to refresh the display. This command triggers the e-Paper V2 to update its display content based on the data in SRAM and the Look-Up Table (LUT). ```APIDOC ## Display Refresh (DRF) ### Description This command instructs the driver to refresh the display using the data from SRAM and the LUT. After this command is issued, the BUSY_N signal will go low, indicating that the display refresh process has started. ### Method Write ### Endpoint R12h ### Parameters #### Command Byte - **00000110** (binary) - Initiates display refresh. ### Request Example N/A (This is a command to the hardware) ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### VCOM Value (VV) Source: https://github.com/rahulkolasseri/7.5inch_e-paper_v2_specification/blob/main/7.5inch_e-Paper_V2_Specification.md Retrieves the VCOM value, typically used after the 'Auto Measure VCOM' command when 'AMV' is set to false. ```APIDOC ## GET /vcom/value ### Description Retrieves the measured VCOM value. This command is typically used after triggering the VCOM measurement process (e.g., via the AMV command with AMV set to false). ### Method GET ### Endpoint `/vcom/value` ### Parameters #### Query Parameters - **command** (string) - Required - The command to execute, which is 'VV' for getting VCOM value. ### Request Example ```json { "command": "VV" } ``` ### Response #### Success Response (200) - **VV** (integer) - The measured VCOM value (7-bit). #### Response Example ```json { "VV": 50 } ``` ```