probe_plane_invert.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. // Standalone print wrapper around the emitter's plane-invert probe
  3. // (emit::probe_plane_invert_values, in emit_descriptor.h). plane_invert[k] is
  4. // "does plane k's wire byte need to be the bit-complement of the engine's
  5. // buffer byte"; the probe drives known full-screen fills and reads each
  6. // plane's wire byte, reconciling against the engine's fixed buffer convention
  7. // (plane0 bit=white, plane1 bit=red). See emit_descriptor.h for the detail.
  8. // This header just prints the result for eyeballing; the emitter uses the
  9. // values directly to fill plane_invert in the generated descriptor.
  10. #include <cstdio>
  11. #include "emit_descriptor.h"
  12. namespace emit {
  13. template<typename Driver> void probe_plane_invert(const char *name, uint8_t plane0_cmd, uint8_t plane1_cmd, int plane_count) {
  14. const PlaneInvert r = probe_plane_invert_values<Driver>(plane0_cmd, plane1_cmd, (size_t) plane_count);
  15. printf("=== %s plane-invert probe ===\n", name);
  16. printf(" white-fill plane0 wire=0x%02X -> is_1bpp=%s\n", r.w0_white & 0xFF, r.is_1bpp ? "true" : "false");
  17. if (!r.is_1bpp) {
  18. printf(" => packed panel (bits_per_pixel>1): plane_invert unused, see diag pass\n");
  19. return;
  20. }
  21. printf(" => plane_invert[0] = %s\n", r.inv0 ? "true" : "false");
  22. if (plane_count > 1) {
  23. if (r.plane1_valid)
  24. printf(" => plane_invert[1] = %s (red-fill plane1 wire=0x%02X)\n", r.inv1 ? "true" : "false", r.w1_red & 0xFF);
  25. else
  26. printf(" => plane_invert[1] = (undetermined; no 2-arg writeScreenBuffer)\n");
  27. }
  28. }
  29. } // namespace emit