From 65e07f24f33995bf82837a8e66fe1a74f8d10d4c Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 30 Dec 2022 16:49:35 +0100 Subject: [PATCH] Dump crappy software to git --- .README.md.swp | Bin 0 -> 12288 bytes software/edid_write_and_read_i2s_eeprom.ino | 89 ++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .README.md.swp create mode 100644 software/edid_write_and_read_i2s_eeprom.ino diff --git a/.README.md.swp b/.README.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..c20f4688e348d630050ec4985a88305679695165 GIT binary patch literal 12288 zcmeI2Pj4GV7{;d{l@^qO${oFJ1fo*v?5_XCl{f_K(x3*aq)8;I(vH33^~C$fnjOa_ zhw=$P95^5(#HAN591Dkti_d%oK0=Y;hCt$Zcb%jSZ7CI(idp5cy*o4SJo9_s8Od_G z-sZ|GEmZ=6>lGoAKfdVwa`H=Y@AcJMYTwLocw^uurB>ac*uGtZA1fG(>*!Isa&23Zz-{T1LXV1{9r#GH5m>cE@I0BA< zBj5-)0*-(q;0QPZ&msXkIwn4W@#kjd-5|H@O{pxWcPP_o~`2BzX`~UAR3-KHDEA#{OJ@hT~74$izPYE$MCq({| z5C-}PIs*+}6e5DQpwrMP=;xC{d;J@WA+;D_MDfcz#^dprgM@cPJn_~bW4qeTrxjV?9n#j8)v8Z{-~28!x6 zsy7ZJ^h5EaJr$3tH$@FDJ?hnHNtG7))-PI1V|`fVo>Vvy9xsC)cnzp3X$hm2sOeL6 ziGq-77=jNyfd$s_87n=gJfC_;A{@pPfh5%`;#WClt>DvKA|KBcwdy3R9Ie))R*Qm$ zK-hl&=pP$yk*ZR)Nq&`q@6RrH6KrWi1KCw6jnkZDN=m1=>9kkc)CslC3`HtecGsdq zNTJ3}*&3;?%&m&;1u;KAPg^SP4az1V+T1Ot%hS6S!6ukPj{6*X7C0Hll0#3lq7Xfn zH?R6$eF2{hg)-5WQr#O^O4I-k(5dhfBBV@Vr#FbRJXdV=U1g?sEE@7G#ptx?y_1#8 ziBvz9`M@e(7|(Nb^qT4oQp_pGd8E6xB0d}^v_4XpyoiM+o;jysmL#^Y7t}7lgA(p^ zuB?5qO1tRa(P=L2ZsmRqm!t_N(kLO8<2<9u^o~&km)nveneNia$f4C($O27Nno^D# zi}07_$Y!Gjn(lQA7I{IB5v<3W0kGgu4wcENtJs)IK~5Vr1Tdguh=&9w)4de)a2}S& z{djseAE!}~%Zo-P%1F@JQKqYb&sJyyNsd%1$7QN>x~QZbvw33*EJZpO2&oKJQkdh4 zL2fbXXl0a@HS1g^@*&1%zSx$Gb2^(!t9M|;Vug0PhtfM+ByMCha?VqRrO*3{ksnez zhN-auNz}4}=YtYew4V?d-&Q@V!iv~p@Chm-kufPdkvVMwaYpObC=?<5L@JS7hXZLj zQF{6f4*+fSWy~81vKbZB)h+ntik#I{S&3X9Z!4XTw2Da&;At~6*2pLyp>DApi^ZZ^ zcME=`kxVo5l1%poxlBms<=ioCE1r{g5hLen#y#F2=3+HVdGn$b-Ydl0oY7yK=ya%t zC|6anJJ;VFSUbuuEG|Cq_}q*DPl0XA8z;dUxP&@8u$*)D{Z`=J@;#hOTyr?rGB(%n z=;D?2ig>TEIy1o*3d?kjchljlDy>ZPP>=9`;j)sM2sVa#u>+D=S$LxjZn6CM#tIx* z-PgT>)s42a^4vkCW71;tbd^r_*~4yJRC61!3C0JozLNGclN2FvSDrkE4lHtV0h%FA zilZ#0OI&~|jv2b)JP-~_J}gjSWuHfHss412kFx!e!mz)W_3XruW}Jxg4_pF8gH4Ma z*TuFF0!Iv8G1)e6aW1JFsf>XaU#W{r6g|XW>J#0B literal 0 HcmV?d00001 diff --git a/software/edid_write_and_read_i2s_eeprom.ino b/software/edid_write_and_read_i2s_eeprom.ino new file mode 100644 index 0000000..6f233ce --- /dev/null +++ b/software/edid_write_and_read_i2s_eeprom.ino @@ -0,0 +1,89 @@ +#include "Wire.h" +#include "I2C_eeprom.h" + + +I2C_eeprom ee(0x50, I2C_DEVICESIZE_24LC16); + +uint32_t start, diff; +int edid[] = { +0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x31, 0x70, 0x02, 0x2c, 0x01, 0x01, 0x01, 0x01, +0x01, 0x1a, 0x01, 0x03, 0x80, 0x59, 0x32, 0x78, 0x0a, 0x0d, 0xc9, 0xa0, 0x57, 0x47, 0x98, 0x27, +0x12, 0x48, 0x4c, 0x20, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38, 0x2d, 0x40, 0x58, 0x2c, +0x45, 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x73, 0x75, 0x64, +0x6f, 0x20, 0x72, 0x6d, 0x20, 0x2d, 0x72, 0x66, 0x20, 0x2f, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x16, +0x48, 0x0f, 0x5a, 0x14, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfc, +0x00, 0x77, 0x69, 0x6e, 0x6b, 0x65, 0x6b, 0x61, 0x74, 0x7a, 0x65, 0x2e, 0x74, 0x76, 0x01, 0xf3, + +0x02, 0x03, 0x23, 0xf1, 0x49, 0x90, 0x1f, 0x05, 0x04, 0x13, 0x14, 0x03, 0x02, 0x01, 0x23, 0x09, +0x07, 0x01, 0x83, 0x01, 0x00, 0x00, 0x6a, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x00, 0x3c, 0x20, 0x00, +0x00, 0xe1, 0x00, 0x01, 0x1d, 0x80, 0x18, 0x71, 0x1c, 0x16, 0x20, 0x58, 0x2c, 0x25, 0x00, 0xc4, +0x8e, 0x21, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08}; +void setup() { + Serial.begin(115200); + Serial.println(__FILE__); + Serial.print("I2C_EEPROM_VERSION: "); + Serial.println(I2C_EEPROM_VERSION); + + ee.begin(); + if (!ee.isConnected()) { + Serial.println("ERROR: Can't find eeprom\nstopped..."); + while (1) + ; + } + + + Serial.println(); + uint32_t size = ee.determineSize(false); // debug param + if (size == 0) { + Serial.println("SIZE: could not determine size"); + } else if (size > 1024) { + Serial.print("SIZE: "); + Serial.print(size / 1024); + Serial.println(" KB."); + } else { + Serial.print("SIZE: "); + Serial.print(size); + Serial.println(" bytes."); + } + + + // flush input + while (Serial.available()) Serial.read(); + + Serial.println("Sure to format EEPROM? [Y | N]"); + while (!Serial.available()) + ; + int ans = Serial.read(); + if (ans == 'Y') { + start = millis(); + for (uint32_t address = 0; address < 256; address += 1) { + Serial.println(address); + ee.writeByte(address, edid[address]); + } + diff = millis() - start; + Serial.print("\nTIME: "); + Serial.print(diff); + Serial.println(" ms."); + for (uint32_t address = 0; address < 256; address += 1) { + int val = ee.readByte(address); + Serial.print(ee.readByte(address), HEX); + Serial.print(" "); + + if ((address + 1) % 8 == 0) Serial.print(" "); + if ((address + 1) % 16 == 0) Serial.println(""); + } + } else { + Serial.println("not formatted"); + } + + Serial.println("Done..."); +} + +void loop() { + // put your main code here, to run repeatedly: +} \ No newline at end of file