#ifndef EPAPER_MANAGER_H
#define EPAPER_MANAGER_H

#include <stdbool.h>

/**
 * Launches the e-Paper display handling loop on Core 1.
 * This function returns immediately after launching the core.
 */
void epaper_start_background_thread();

/**
 * Sends an update to the e-Paper display.
 * @param entry The text content of the current line.
 * @param finish_line If true, the line is committed (moved to the list of static lines).
 *                    If false, it updates the current line being typed.
 */
void epaper_send_update(const char *entry, bool finish_line);

/**
 * Displays a full-screen raw image.
 * @param image_data Pointer to the raw image data (1 bit per pixel).
 *                   The buffer must be allocated with malloc and will be freed by the display core.
 * @param len Length of the image data in bytes.
 */
void epaper_display_full_image(const unsigned char* image_data, unsigned int len);

/**
 * Clears all text entries and refreshes the display to white.
 */
void epaper_clear();

/**
 * Forces a full refresh of the display on the next update.
 * Useful for clearing ghosting.
 */
void epaper_force_refresh();

#endif // EPAPER_MANAGER_H
