#include #include "edid.h" #define FAILURE(buf_str, line) \ fprintf(stderr, "X Failed on line %d: [%s]\n", line, buf_str); \ return EXIT_FAILURE; #define SUCCESS(buf_str, line) \ fprintf(stdout, "✓ Success on line %d: [%s]\n", line, buf_str); #define CHECK_TRUE(expr) \ if (!(expr)) { \ FAILURE(#expr, __LINE__); \ } else { \ SUCCESS(#expr, __LINE__); \ } static const uint8_t i2c_data_screen_0[EDID_LEN] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1e, 0x6d, 0xd5, 0x59, 0x04, 0x45, 0x09, 0x00, 0x03, 0x17, 0x01, 0x03, 0x68, 0x35, 0x1e, 0x78, 0xea, 0x33, 0x31, 0xa4, 0x57, 0x51, 0xa0, 0x26, 0x10, 0x50, 0x54, 0xa7, 0x6b, 0x80, 0xb3, 0x00, 0x81, 0x80, 0x95, 0x00, 0x71, 0x4f, 0xa9, 0xc0, 0x81, 0x00, 0x81, 0xc0, 0x90, 0x40, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38, 0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0x09, 0x25, 0x21, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x38, 0x4b, 0x1e, 0x53, 0x0f, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x32, 0x34, 0x45, 0x4e, 0x33, 0x33, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xff, 0x00, 0x33, 0x30, 0x33, 0x4e, 0x44, 0x51, 0x41, 0x48, 0x56, 0x34, 0x39, 0x32, 0x0a, 0x00, 0xf1 }; /** * @brief Helper function to compare EDID data structure with golden design data structure extracted from real * VGA screen. */ static int compare_edid(const uint8_t* const edid, const uint8_t* const edid_golden) { for (int sanny=0; sanny %d\n", ret); return ret; } printf("\n"); printf("Generated EDID data from %s:\n", json_file); disp_buf((uint8_t*)&edith, EDID_LEN); return 0; }