#ifndef PANEL_H
#define PANEL_H
#include <stdint.h>
// Faithful M5Stack PaperS3 e-ink panel model. The firmware clocks the panel one
// physical row at a time via LCD_CAM: 2 bits/pixel drive codes (0x1 = drive toward
// black, 0x2 = toward white, 0 = hold), 4 px/byte, 240 data bytes for the 960-wide
// row. The gate driver (GDSP/GDCK GPIOs) selects the row; GDSP resets to row 0. We
// accumulate each pixel's 0..15 grey level exactly as the bistable panel does.
void panel_frame_reset(void);                    // GDSP pulse: next row is row 0
void panel_row(const uint8_t *data, int len);    // one row of 2bpp drive codes
void panel_dump(const char *path);               // write current image as PGM
const uint8_t *panel_get(int *w, int *h);        // live 0..15 grey buffer (for the GUI)
#endif
