RS232 control for TVOne products

Dependents:   SPK-DVIMXR

Files at this revision

API Documentation at this revision

Comitter:
tobyspark
Date:
Sun May 12 18:36:40 2013 +0000
Parent:
20:ebddf3ddb1f6
Child:
22:3ad38163cb8b
Commit message:
Convenience methods getResolution() and getEDID()

Changed in this revision

spk_tvone_mbed.cpp Show annotated file Show diff for this revision Revisions of this file
spk_tvone_mbed.h Show annotated file Show diff for this revision Revisions of this file
--- a/spk_tvone_mbed.cpp	Tue Dec 11 17:54:33 2012 +0000
+++ b/spk_tvone_mbed.cpp	Sun May 12 18:36:40 2013 +0000
@@ -255,6 +255,31 @@
   return ok;
 }
 
+int SPKTVOne::getEDID()
+{
+    bool ok = true;
+
+    int32_t payload1 = -1;
+    ok = ok && readCommand(kTV1SourceRGB1, kTV1WindowIDA, kTV1FunctionAdjustSourceEDID, payload1);
+    
+    int32_t payload2 = -1;
+    ok = ok && readCommand(kTV1SourceRGB2, kTV1WindowIDA, kTV1FunctionAdjustSourceEDID, payload2);
+    
+    int EDID = (payload1 == payload2) ? payload1 : -1;
+    
+    return ok ? EDID : -1;
+}
+
+int SPKTVOne::getResolution()
+{
+    bool ok;
+
+    int32_t payload = -1;
+    ok = readCommand(0, kTV1WindowIDA, kTV1FunctionAdjustOutputsOutputResolution, payload);
+    
+    return ok ? payload : -1;
+}
+
 bool SPKTVOne::setResolution(int resolution, int edidSlot)
 {
     bool ok;
--- a/spk_tvone_mbed.h	Tue Dec 11 17:54:33 2012 +0000
+++ b/spk_tvone_mbed.h	Sun May 12 18:36:40 2013 +0000
@@ -39,7 +39,9 @@
     
     struct processorType {int version; int productType; int boardType;};
     processorType getProcessorType();
-        
+    
+    int  getResolution();
+    int  getEDID();
     bool setResolution(int resolution, int edidSlot);
     bool setHDCPOn(bool state);