#ifndef VACUUM_DISPLAY_H
#define VACUUM_DISPLAY_H
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
typedef struct {
 uint8_t level,percent;bool fan_enabled,fault,qualified,measurement_valid,low_suction;
 bool learning_busy,restart_required;uint32_t sampled_ms,now_ms;
} vd_input;
typedef struct {char lines[4][22];bool percent_visible,alarm_visible;} vd_view;
void vd_render(const vd_input *in,uint8_t frame[512],vd_view *view);
/* callback transmits the entire packet to a7-bit address, with ACKs and a
   bounded deadline. No GPIO implementation or physical transfer is supplied. */
typedef bool (*vd_write)(void *ctx,uint8_t address,const uint8_t *bytes,size_t count);
typedef struct {uint8_t frame[512],address,page,chunk,phase;bool failed,display_off_confirmed;} vd_driver;
bool vd_begin(vd_driver *d,uint8_t address,const uint8_t frame[512]);
/* Exactly one callback per normal service, at most two on failure (off attempt).
   Returns true iff more work remains. Check failed after termination. */
bool vd_service(vd_driver *d,vd_write write,void *ctx);
#endif
