26 #if !defined(AJA_WINDOWS)
33 #define LOGGING_MAPPINGS (AJADebug::IsActive(AJA_DebugUnit_Enumeration))
34 #define HEX16(__x__) "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
35 #define INSTP(_p_) HEX16(uint64_t(_p_))
36 #define REiFAIL(__x__) AJA_sERROR (AJA_DebugUnit_Enumeration, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
37 #define REiWARN(__x__) AJA_sWARNING(AJA_DebugUnit_Enumeration, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
38 #define REiNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_Enumeration, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
39 #define REiINFO(__x__) AJA_sINFO (AJA_DebugUnit_Enumeration, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
40 #define REiDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_Enumeration, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
42 #define DEF_REGNAME(_num_) DefineRegName(_num_, #_num_)
43 #define DEF_REG(_num_, _dec_, _rw_, _c1_, _c2_, _c3_) DefineRegister((_num_), #_num_, _dec_, _rw_, _c1_, _c2_, _c3_)
48 static const string sSpace(
" ");
88 "DisplayHorzPixelsPerLine",
94 "RasterVideoFill_YCb_GB",
95 "RasterVideoFill_Cr_AR",
98 "RasterOutputTimingPreset",
100 "RasterSmpteFramePulse",
101 "RasterOddLineStartAddress",
104 "RasterOffsetAlpha"};
126 static bool DisposeInstance(
void);
147 SetupMixerKeyerRegs();
155 SetupNTV4FrameStoreRegs();
160 REiDBG(
"RegsToStrsMap=" << mRegNumToStringMap.size()
161 <<
" RegsToDecodersMap=" << mRegNumToDecoderMap.size()
162 <<
" ClassToRegsMMap=" << mRegClassToRegNumMMap.size()
163 <<
" StrToRegsMMap=" << mStringToRegNumMMap.size()
164 <<
" InpXptsToXptRegInfoMap=" << mInputXpt2XptRegNumMaskIndexMap.size()
165 <<
" XptRegInfoToInpXptsMap=" << mXptRegNumMaskIndex2InputXptMap.size()
166 <<
" RegClasses=" << mAllRegClasses.size());
182 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
189 } mDefaultRegDecoder;
191 void DefineRegName(
const uint32_t regNumber,
const string & regName)
193 if (!regName.empty())
196 if (mRegNumToStringMap.find(regNumber) == mRegNumToStringMap.end())
198 mRegNumToStringMap.insert (RegNumToStringPair(regNumber, regName));
199 string lowerCaseRegName(regName);
200 mStringToRegNumMMap.insert (StringToRegNumPair(
aja::lower(lowerCaseRegName), regNumber));
204 inline void DefineRegDecoder(
const uint32_t inRegNum,
const Decoder & dec)
207 mRegNumToDecoderMap.insert (RegNumToDecoderPair(inRegNum, &dec));
209 inline void DefineRegClass (
const uint32_t inRegNum,
const string & className)
211 if (!className.empty())
214 mRegClassToRegNumMMap.insert(StringToRegNumPair(className, inRegNum));
217 void DefineRegReadWrite(
const uint32_t inRegNum,
const int rdWrt)
220 if (rdWrt == READONLY)
225 if (rdWrt == WRITEONLY)
231 void DefineRegister(
const uint32_t inRegNum,
const string & regName,
const Decoder & dec,
const int rdWrt,
const string & className1,
const string & className2,
const string & className3)
233 DefineRegName (inRegNum, regName);
234 DefineRegDecoder (inRegNum, dec);
235 DefineRegReadWrite (inRegNum, rdWrt);
236 DefineRegClass (inRegNum, className1);
237 DefineRegClass (inRegNum, className2);
238 DefineRegClass (inRegNum, className3);
244 for (
int ndx(0); ndx < 4; ndx++)
248 const XptRegNumAndMaskIndex regNumAndNdx(inRegNum, ndx);
249 if (mXptRegNumMaskIndex2InputXptMap.find(regNumAndNdx) == mXptRegNumMaskIndex2InputXptMap.end())
250 mXptRegNumMaskIndex2InputXptMap [regNumAndNdx] = indexes[ndx];
251 if (mInputXpt2XptRegNumMaskIndexMap.find(indexes[ndx]) == mInputXpt2XptRegNumMaskIndexMap.end())
252 mInputXpt2XptRegNumMaskIndexMap[indexes[ndx]] = regNumAndNdx;
256 void SetupBasicRegs(
void)
277 #if 1 // PCIAccessFrame regs are obsolete
286 #endif // PCIAccessFrame regs are obsolete
375 void SetupBOBRegs(
void)
384 void SetupLEDRegs(
void)
396 void SetupCMWRegs(
void)
406 void SetupVPIDRegs(
void)
442 void SetupTimecodeRegs(
void)
508 void SetupAudioRegs(
void)
594 void SetupMRRegs(
void)
605 void SetupDMARegs(
void)
636 void SetupXptSelect(
void)
648 if (mXptRegNumMaskIndex2InputXptMap.find (regNumAndNdx) == mXptRegNumMaskIndex2InputXptMap.end())
650 if (mInputXpt2XptRegNumMaskIndexMap.find (
NTV2_XptHDMIOutQ1Input) == mInputXpt2XptRegNumMaskIndexMap.end())
686 { ostringstream regName;
693 if (inputXptEnumName.empty())
694 regName <<
"kRegXptValid" <<
DEC0N(rawInputXpt,3) <<
"N" <<
DEC(ndx);
696 regName <<
"kRegXptValid" <<
aja::replace(inputXptEnumName,
"NTV2_Xpt",
"") <<
DEC(ndx);
699 regName <<
"kRegXptValue" <<
HEX0N(regNum,4);
704 void SetupAncInsExt(
void)
706 static const string AncExtRegNames [] = {
"Control",
"F1 Start Address",
"F1 End Address",
707 "F2 Start Address",
"F2 End Address",
"Field Cutoff Lines",
708 "Memory Total",
"F1 Memory Usage",
"F2 Memory Usage",
709 "V Blank Lines",
"Lines Per Frame",
"Field ID Lines",
710 "Ignore DID 1-4",
"Ignore DID 5-8",
"Ignore DID 9-12",
711 "Ignore DID 13-16",
"Ignore DID 17-20",
"Analog Start Line",
712 "Analog F1 Y Filter",
"Analog F2 Y Filter",
"Analog F1 C Filter",
713 "Analog F2 C Filter",
"",
"",
715 "Analog Act Line Len"};
716 static const string AncInsRegNames [] = {
"Field Bytes",
"Control",
"F1 Start Address",
717 "F2 Start Address",
"Pixel Delay",
"Active Start",
718 "Pixels Per Line",
"Lines Per Frame",
"Field ID Lines",
719 "Payload ID Control",
"Payload ID",
"Chroma Blank Lines",
720 "F1 C Blanking Mask",
"F2 C Blanking Mask",
"Field Bytes High",
721 "Reserved 15",
"RTP Payload ID",
"RTP SSRC",
723 static const uint32_t AncExtPerChlRegBase [] = { 0x1000, 0x1040, 0x1080, 0x10C0, 0x1100, 0x1140, 0x1180, 0x11C0 };
724 static const uint32_t AncInsPerChlRegBase [] = { 0x1200, 0x1240, 0x1280, 0x12C0, 0x1300, 0x1340, 0x1380, 0x13C0 };
726 NTV2_ASSERT(
sizeof(AncExtRegNames[0]) ==
sizeof(AncExtRegNames[1]));
731 for (
ULWord offsetNdx (0); offsetNdx < 8; offsetNdx++)
735 if (AncExtRegNames[reg].empty())
continue;
736 ostringstream oss; oss <<
"Extract " << (offsetNdx+1) <<
" " << AncExtRegNames[reg];
737 DefineRegName (AncExtPerChlRegBase[offsetNdx] + reg, oss.str());
741 ostringstream oss; oss <<
"Insert " << (offsetNdx+1) <<
" " << AncInsRegNames[reg];
742 DefineRegName (AncInsPerChlRegBase[offsetNdx] + reg, oss.str());
745 for (
ULWord ndx (0); ndx < 8; ndx++)
792 void SetupAuxInsExt(
void)
794 static const string AuxExtRegNames [] = {
"Control",
"F1 Start Address",
"F1 End Address",
795 "F2 Start Address",
"",
"",
796 "Memory Total",
"F1 Memory Usage",
"F2 Memory Usage",
797 "V Blank Lines",
"Lines Per Frame",
"Field ID Lines",
798 "Ignore DID 1-4",
"Ignore DID 5-8",
"Ignore DID 9-12",
799 "Ignore DID 13-16",
"Buffer Fill"};
807 static const uint32_t AuxExtPerChlRegBase [] = { 7616, 7680, 7744, 7808 };
808 static const uint32_t AuxInsPerChlRegBase [] = { 4608, 4672, 4736, 4800 };
811 NTV2_ASSERT(
sizeof(AuxExtRegNames[0]) ==
sizeof(AuxExtRegNames[1]));
816 for (
ULWord offsetNdx (0); offsetNdx < 4; offsetNdx++)
820 if (AuxExtRegNames[reg].empty())
continue;
821 ostringstream oss; oss <<
"Extract " << (offsetNdx+1) <<
" " << AuxExtRegNames[reg];
822 DefineRegName (AuxExtPerChlRegBase[offsetNdx] + reg, oss.str());
830 for (
ULWord ndx (0); ndx < 4; ndx++)
873 void SetupHDMIRegs(
void)
1101 void SetupSDIErrorRegs(
void)
1104 static const string suffixes [] = {
"Status",
"CRCErrorCount",
"FrameCountLow",
"FrameCountHigh",
"FrameRefCountLow",
"FrameRefCountHigh"};
1105 static const int perms [] = {READWRITE, READWRITE, READWRITE, READWRITE, READONLY, READONLY};
1108 for (
ULWord chan (0); chan < 8; chan++)
1109 for (
UWord ndx(0); ndx < 6; ndx++)
1111 ostringstream ossName; ossName <<
"kRegRXSDI" <<
DEC(chan+1) << suffixes[ndx];
1112 const string & regName (ossName.str());
1113 const uint32_t regNum (baseNum[chan] + ndx);
1114 const int perm (perms[ndx]);
1126 void SetupLUTRegs (
void)
1131 void SetupCSCRegs(
void)
1136 for (
unsigned num(0); num < 8; num++)
1138 ostringstream ossRegName; ossRegName <<
"kRegEnhancedCSC" << (num+1);
1139 const string & chanClass (sChan[num]);
const string rootName (ossRegName.str());
1140 const string modeName (rootName +
"Mode");
const string inOff01Name (rootName +
"InOffset0_1");
const string inOff2Name (rootName +
"InOffset2");
1141 const string coeffA0Name (rootName +
"CoeffA0");
const string coeffA1Name (rootName +
"CoeffA1");
const string coeffA2Name (rootName +
"CoeffA2");
1142 const string coeffB0Name (rootName +
"CoeffB0");
const string coeffB1Name (rootName +
"CoeffB1");
const string coeffB2Name (rootName +
"CoeffB2");
1143 const string coeffC0Name (rootName +
"CoeffC0");
const string coeffC1Name (rootName +
"CoeffC1");
const string coeffC2Name (rootName +
"CoeffC2");
1144 const string outOffABName(rootName +
"OutOffsetA_B");
const string outOffCName (rootName +
"OutOffsetC");
1145 const string keyModeName (rootName +
"KeyMode");
const string keyClipOffName (rootName +
"KeyClipOffset");
const string keyGainName (rootName +
"KeyGain");
1172 for (
unsigned chan(0); chan < 8; chan++)
1174 const string & chanClass (sChan[chan]);
1187 #if 1 // V2 tables need the appropriate Enable & Bank bits set in kRegLUTV2Control, otherwise they'll always readback zero!
1190 for (
ULWord ndx(0); ndx < 512; ndx++)
1192 ostringstream regNameR, regNameG, regNameB;
1193 regNameR <<
"kRegLUTRed" <<
DEC0N(ndx,3); regNameG <<
"kRegLUTGreen" <<
DEC0N(ndx,3); regNameB <<
"kRegLUTBlue" <<
DEC0N(ndx,3);
1201 void SetupMixerKeyerRegs(
void)
1220 void SetupNTV4FrameStoreRegs(
void)
1222 for (
ULWord fsNdx(0); fsNdx < 4; fsNdx++)
1226 ostringstream regName; regName <<
"kRegNTV4FS" <<
DEC(fsNdx+1) <<
"_";
1257 regName <<
"InputSourceSelect";
1261 regName <<
DEC(regNdx);
1269 void SetupVRegs(
void)
1793 for (
ULWord ndx(1); ndx < 1024; ndx++)
1795 ostringstream oss; oss <<
"VIRTUALREG_START+" << ndx;
1796 const string regName (oss.str());
1798 if (mRegNumToStringMap.find(regNum) == mRegNumToStringMap.end())
1800 mRegNumToStringMap.insert (RegNumToStringPair(regNum, regName));
1801 mStringToRegNumMMap.insert (StringToRegNumPair(ToLower(regName), regNum));
1803 DefineRegDecoder (regNum, mDefaultRegDecoder);
1804 DefineRegReadWrite (regNum, READWRITE);
1819 const string & label (it->first);
1820 const string & value (it->second);
1823 else if (label.at(label.length()-1) !=
' ' && label.at(label.length()-1) !=
':')
1824 oss << label <<
": " << value;
1825 else if (label.at(label.length()-1) ==
':')
1826 oss << label <<
" " << value;
1828 oss << label << value;
1829 if (++it != inLabelValuePairs.end())
1838 RegNumToStringMap::const_iterator iter (mRegNumToStringMap.find (inRegNum));
1839 if (iter != mRegNumToStringMap.end())
1840 return iter->second;
1842 ostringstream oss; oss <<
"Reg ";
1844 oss <<
DEC(inRegNum);
1845 else if (inRegNum <= 0x0000FFFF)
1846 oss <<
xHEX0N(inRegNum,4);
1848 oss <<
xHEX0N(inRegNum,8);
1855 RegNumToDecoderMap::const_iterator iter(mRegNumToDecoderMap.find(inRegNum));
1857 if (iter != mRegNumToDecoderMap.end() && iter->second)
1859 const Decoder * pDecoder (iter->second);
1860 oss << (*pDecoder)(inRegNum, inRegValue, inDeviceID);
1865 bool IsRegInClass (
const uint32_t inRegNum,
const string & inClassName)
const
1868 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1869 if (it->second == inRegNum)
1880 if (mAllRegClasses.empty())
1881 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1882 if (mAllRegClasses.find(it->first) == mAllRegClasses.end())
1883 mAllRegClasses.insert(it->first);
1884 return mAllRegClasses;
1893 if (IsRegInClass (inRegNum, *it))
1898 if (result.find(str) == result.end())
1908 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1909 if (result.find(it->second) == result.end())
1910 result.insert(it->second);
1919 for (uint32_t regNum (0); regNum <= maxRegNum; regNum++)
1920 result.insert(regNum);
1929 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1931 for (
UWord num(0); num < numSpigots; num++)
1934 allChanRegs.insert(chRegs.begin(), chRegs.end());
1936 std::set_intersection (ancRegs.begin(), ancRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1944 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1946 for (
UWord num(0); num < numSpigots; num++)
1949 allChanRegs.insert(chRegs.begin(), chRegs.end());
1951 std::set_intersection (auxRegs.begin(), auxRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1957 result.insert(sdiErrRegs.begin(), sdiErrRegs.end());
1963 result.insert(regNum);
1965 result.insert(regNum);
1977 for (
UWord num(0); num < numCSCs; num++)
1980 allChanRegs.insert(chRegs.begin(), chRegs.end());
1982 std::set_intersection (ecscRegs.begin(), ecscRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1988 result.insert(LUTRegs.begin(), LUTRegs.end());
1993 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1994 result.insert(regNum);
1995 for (
ULWord regNum = 0x2500; regNum <= 0x251f; regNum++)
1996 result.insert(regNum);
1997 for (
ULWord regNum = 0x2c00; regNum <= 0x2c1f; regNum++)
1998 result.insert(regNum);
1999 for (
ULWord regNum = 0x3000; regNum <= 0x301f; regNum++)
2000 result.insert(regNum);
2004 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
2005 result.insert(regNum);
2006 for (
ULWord regNum = 0x1d40; regNum <= 0x1d5f; regNum++)
2007 result.insert(regNum);
2008 for (
ULWord regNum = 0x3C00; regNum <= 0x3C0A; regNum++)
2009 result.insert(regNum);
2027 for (
UWord num(0); num < numFrameStores; num++)
2030 chanRegs.insert(chRegs.begin(), chRegs.end());
2032 std::set_intersection (ntv4FSRegs.begin(), ntv4FSRegs.end(), chanRegs.begin(), chanRegs.end(), std::inserter(result, result.begin()));
2080 result.insert(vRegs.begin(), vRegs.end());
2086 result.insert(xptMapRegs.begin(), xptMapRegs.end());
2095 string nameStr(inName);
2096 const size_t nameStrLen(
aja::lower(nameStr).length());
2097 StringToRegNumConstIter it;
2099 if (inMatchStyle == EXACTMATCH)
2101 it = mStringToRegNumMMap.find(nameStr);
2102 if (it != mStringToRegNumMMap.end())
2103 result.insert(it->second);
2107 for (it = mStringToRegNumMMap.begin(); it != mStringToRegNumMMap.end(); ++it)
2109 const size_t pos(it->first.find(nameStr));
2110 if (pos == string::npos)
2112 switch (inMatchStyle)
2114 case CONTAINS: result.insert(it->second);
break;
2115 case STARTSWITH:
if (pos == 0)
2116 {result.insert(it->second);}
2118 case ENDSWITH:
if (pos+nameStrLen == it->first.length())
2119 {result.insert(it->second);}
2130 outXptRegNum = 0xFFFFFFFF;
2131 outMaskIndex = 0xFFFFFFFF;
2132 InputXpt2XptRegNumMaskIndexMapConstIter iter (mInputXpt2XptRegNumMaskIndexMap.find (inInputXpt));
2133 if (iter == mInputXpt2XptRegNumMaskIndexMap.end())
2135 outXptRegNum = iter->second.first;
2136 outMaskIndex = iter->second.second;
2143 const XptRegNumAndMaskIndex key (inXptRegNum, inMaskIndex);
2144 XptRegNumMaskIndex2InputXptMapConstIter iter (mXptRegNumMaskIndex2InputXptMap.find (key));
2145 if (iter != mXptRegNumMaskIndex2InputXptMap.end())
2146 return iter->second;
2150 ostream &
Print (ostream & inOutStream)
const
2153 static const string sLineBreak (96,
'=');
2154 static const uint32_t
sMasks[4] = {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000};
2156 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToStringMap: " << mRegNumToStringMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2157 for (RegNumToStringMap::const_iterator it (mRegNumToStringMap.begin()); it != mRegNumToStringMap.end(); ++it)
2158 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => '" << it->second <<
"'" << endl;
2160 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToDecoderMap: " << mRegNumToDecoderMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2161 for (RegNumToDecoderMap::const_iterator it (mRegNumToDecoderMap.begin()); it != mRegNumToDecoderMap.end(); ++it)
2162 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => " << (it->second == &mDefaultRegDecoder ?
"(default decoder)" :
"Custom Decoder") << endl;
2164 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegClassToRegNumMMap: " << mRegClassToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2165 for (RegClassToRegNumMMap::const_iterator it (mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
2166 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2168 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of StringToRegNumMMap: " << mStringToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2169 for (StringToRegNumMMap::const_iterator it (mStringToRegNumMMap.begin()); it != mStringToRegNumMMap.end(); ++it)
2170 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2172 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of InputXpt2XptRegNumMaskIndexMap: " << mInputXpt2XptRegNumMaskIndexMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2173 for (InputXpt2XptRegNumMaskIndexMap::const_iterator it (mInputXpt2XptRegNumMaskIndexMap.begin()); it != mInputXpt2XptRegNumMaskIndexMap.end(); ++it)
2175 <<
") => reg " << setw(3) << it->second.first <<
"(" <<
HEX0N(it->second.first,3) << dec <<
"|" << setw(20) << RegNameToString(it->second.first)
2176 <<
") mask " << it->second.second <<
"(" <<
HEX0N(
sMasks[it->second.second],8) <<
")" << endl;
2178 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of XptRegNumMaskIndex2InputXptMap: " << mXptRegNumMaskIndex2InputXptMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2179 for (XptRegNumMaskIndex2InputXptMap::const_iterator it (mXptRegNumMaskIndex2InputXptMap.begin()); it != mXptRegNumMaskIndex2InputXptMap.end(); ++it)
2180 inOutStream <<
"reg " << setw(3) << it->first.first <<
"(" <<
HEX0N(it->first.first,4) <<
"|" << setw(20) << RegNameToString(it->first.first)
2181 <<
") mask " << it->first.second <<
"(" <<
HEX0N(
sMasks[it->first.second],8) <<
") => "
2187 typedef std::map<uint32_t, string> RegNumToStringMap;
2188 typedef std::pair<uint32_t, string> RegNumToStringPair;
2190 static string ToLower (
const string & inStr)
2192 string result (inStr);
2193 std::transform (result.begin (), result.end (), result.begin (), ::tolower);
2197 struct DecodeGlobalControlReg :
public Decoder
2199 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2216 for (
int led(0); led < 4; ++led)
2217 oss << (((inRegValue &
kRegMaskLED) >> (16 + led)) ?
"*" :
".");
2222 <<
"Color Correction: " <<
"Channel: " << ((inRegValue &
BIT(31)) ?
"2" :
"1")
2223 <<
" Bank " << ((inRegValue &
BIT (30)) ?
"1" :
"0");
2226 } mDecodeGlobalControlReg;
2229 struct DecodeGlobalControl2 :
public Decoder
2231 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2248 for (
unsigned ch(0); ch < 8; ch++)
2249 oss <<
"Audio " <<
DEC(ch+1) <<
" Play/Capture Mode: " <<
OnOff(inRegValue & playCaptModes[ch]) << endl;
2250 for (
unsigned ch(2); ch < 8; ch++)
2251 oss <<
"Ch " <<
DEC(ch+1) <<
" RP188 Output: " <<
EnabDisab(inRegValue & rp188Modes[ch]) << endl;
2252 for (
unsigned ch(0); ch < 3; ch++)
2253 oss <<
"Ch " <<
DEC(2*(ch+2)) <<
" 1080p50/p60 Link-B Mode: " <<
EnabDisab(inRegValue & BLinkModes[ch]) << endl;
2254 for (
unsigned ch(0); ch < 4; ch++)
2255 oss <<
"Ch " <<
DEC(ch*2+1) <<
"/" <<
DEC(ch*2+2) <<
" 2SI Mode: " <<
EnabDisab(inRegValue & k425Masks[ch]) << endl;
2256 oss <<
"2SI Min Align Delay 1-4: " <<
EnabDisab(inRegValue &
BIT(24)) << endl
2257 <<
"2SI Min Align Delay 5-8: " <<
EnabDisab(inRegValue &
BIT(25));
2260 } mDecodeGlobalControl2;
2263 struct DecodeGlobalControl3 :
public Decoder
2265 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2272 <<
"VU Meter Audio Select: " << (inRegValue &
kRegMaskVUMeterSelect ?
"AudMixer" :
"AudSys1") << endl
2282 } mDecodeGlobalControl3;
2285 struct DecodeGlobalControlChanReg :
public Decoder
2287 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2300 } mDecodeGlobalControlChanRegs;
2303 struct DecodeChannelControlReg :
public Decoder
2305 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2312 oss <<
"Mode: " << (inRegValue &
kRegMaskMode ?
"Capture" :
"Display") << endl
2315 <<
"Viper Squeeze: " << (inRegValue &
BIT(9) ?
"Squeeze" :
"Normal") << endl
2320 <<
"Frame Size: " << (1 << (((inRegValue &
kK2RegMaskFrameSize) >> 20) + 1)) <<
" MB" << endl;
2323 oss <<
"RGB Range: " << (inRegValue &
BIT(24) ?
"Black = 0x40" :
"Black = 0") << endl
2327 } mDecodeChannelControl;
2329 struct DecodeFBControlReg :
public Decoder
2331 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2335 const bool isOn ((inRegValue & (1 << 29)) != 0);
2336 const uint16_t format ((inRegValue >> 15) & 0x1F);
2338 oss <<
OnOff(isOn) << endl
2339 <<
"Format: " <<
xHEX0N(format,4) <<
" (" <<
DEC(format) <<
")";
2342 } mDecodeFBControlReg;
2344 struct DecodeChannelControlExtReg :
public Decoder
2346 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2351 oss <<
"Input Video 2:1 Decimate: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
2352 <<
"HDMI Rx Direct: " <<
EnabDisab(inRegValue &
BIT(1)) << endl
2353 <<
"3:2 Pulldown Mode: " <<
EnabDisab(inRegValue &
BIT(2));
2356 } mDecodeChannelControlExt;
2358 struct DecodeSysmonVccIntDieTemp :
public Decoder
2360 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2364 UWord rawDieTemp (0);
2365 double dieTempC (0);
2368 rawDieTemp = (inRegValue & 0x0000FFFF);
2369 dieTempC = double(rawDieTemp) / 128.0;
2373 rawDieTemp = ((inRegValue & 0x0000FFFF) >> 6);
2374 dieTempC = ((double(rawDieTemp)) * 503.975 / 1024.0 - 273.15 );
2376 const UWord rawVoltage ((inRegValue >> 22) & 0x3FF);
2377 const double dieTempF (dieTempC * 9.0 / 5.0 + 32.0);
2378 const double voltage (
double(rawVoltage)/ 1024.0 * 3.0);
2380 oss <<
"Die Temperature: " <<
fDEC(dieTempC,5,2) <<
" Celcius (" <<
fDEC(dieTempF,5,2) <<
" Fahrenheit)" << endl
2381 <<
"Core Voltage: " <<
fDEC(voltage,5,2) <<
" Volts DC";
2384 } mDecodeSysmonVccIntDieTemp;
2386 struct DecodeSDITransmitCtrl :
public Decoder
2388 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2393 const UWord numSpigots (numInputs > numOutputs ? numInputs : numOutputs);
2397 const uint32_t txEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
2399 for (
UWord spigot(0); spigot < numSpigots; )
2401 const uint32_t txEnabled (txEnableBits &
BIT(spigot));
2402 oss <<
"SDI " <<
DEC(++spigot) <<
": " << (txEnabled ?
"Output/Transmit" :
"Input/Receive");
2403 if (spigot < numSpigots)
2407 oss <<
"(No SDI inputs or outputs)";
2410 oss <<
"(Bi-directional SDI not supported)";
2414 } mDecodeSDITransmitCtrl;
2416 struct DecodeConversionCtrl :
public Decoder
2418 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2424 oss <<
"Bitfile ID: " <<
xHEX0N(bitfileID, 2) << endl
2425 <<
"Memory Test: Start: " <<
YesNo(inRegValue &
BIT(28)) << endl
2426 <<
"Memory Test: Done: " <<
YesNo(inRegValue &
BIT(29)) << endl
2427 <<
"Memory Test: Passed: " <<
YesNo(inRegValue &
BIT(30));
2446 <<
"Vert Filter Preload: " <<
DisabEnab(inRegValue &
BIT(7)) << endl
2453 } mConvControlRegDecoder;
2455 struct DecodeRelayCtrlStat :
public Decoder
2457 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2472 oss <<
"(SDI bypass relays not supported)";
2475 } mDecodeRelayCtrlStat;
2477 struct DecodeWatchdogTimeout :
public Decoder
2479 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2485 const uint32_t ticks8nanos (inRegValue);
2486 const double microsecs (
double(ticks8nanos) * 8.0 / 1000.0);
2487 const double millisecs (microsecs / 1000.0);
2488 oss <<
"Watchdog Timeout [8-ns ticks]: " <<
xHEX0N(ticks8nanos,8) <<
" (" <<
DEC(ticks8nanos) <<
")" << endl
2489 <<
"Watchdog Timeout [usec]: " << microsecs << endl
2490 <<
"Watchdog Timeout [msec]: " << millisecs;
2493 oss <<
"(SDI bypass relays not supported)";
2496 } mDecodeWatchdogTimeout;
2498 struct DecodeWatchdogKick :
public Decoder
2500 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2508 const uint32_t expectedValue(whichReg ? 0x01234567 : 0xA5A55A5A);
2509 oss <<
xHEX0N(inRegValue,8);
2510 if (inRegValue == expectedValue)
2513 oss <<
" (Not expected, should be " <<
xHEX0N(expectedValue,8) <<
")";
2516 oss <<
"(SDI bypass relays not supported)";
2519 } mDecodeWatchdogKick;
2521 struct DecodeInputVPID:
public Decoder
2523 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2531 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2534 } mVPIDInpRegDecoder;
2536 struct DecodeOutputVPID:
public Decoder
2538 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2545 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2548 } mVPIDOutRegDecoder;
2550 struct DecodeBitfileDateTime :
public Decoder
2552 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2558 const UWord yyyy ((inRegValue & 0xFFFF0000) >> 16);
2559 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2560 const UWord dd (inRegValue & 0x000000FF);
2561 if (yyyy > 0x2015 && mm > 0 && mm < 0x13 && dd > 0 && dd < 0x32)
2562 oss <<
"Bitfile Date: " <<
HEX0N(mm,2) <<
"/" <<
HEX0N(dd,2) <<
"/" <<
HEX0N(yyyy,4);
2564 oss <<
"Bitfile Date: " <<
xHEX0N(inRegValue, 8);
2568 const UWord hh ((inRegValue & 0x00FF0000) >> 16);
2569 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2570 const UWord ss (inRegValue & 0x000000FF);
2571 if (hh < 0x24 && mm < 0x60 && ss < 0x60)
2572 oss <<
"Bitfile Time: " <<
HEX0N(hh,2) <<
":" <<
HEX0N(mm,2) <<
":" <<
HEX0N(ss,2);
2574 oss <<
"Bitfile Time: " <<
xHEX0N(inRegValue, 8);
2579 } mDecodeBitfileDateTime;
2581 struct DecodeBoardID :
public Decoder
2583 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2584 { (
void) inRegNum; (
void) inDeviceID;
2589 <<
"Device Name: '" << str1 <<
"'";
2592 <<
"Retail Device Name: '" << str2 <<
"'";
2597 struct DecodeDynFWUpdateCounts :
public Decoder
2599 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2600 { (
void) inRegNum; (
void) inDeviceID;
2602 oss <<
"# attempts: " <<
DEC(inRegValue >> 16) << endl
2603 <<
"# successes: " <<
DEC(inRegValue & 0x0000FFFF);
2606 } mDecodeDynFWUpdateCounts;
2608 struct DecodeFWUserID :
public Decoder
2610 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2611 { (
void) inRegNum; (
void) inDeviceID;
2620 } mDecodeFirmwareUserID;
2622 struct DecodeCanDoStatus :
public Decoder
2624 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2625 { (
void) inRegNum; (
void) inDeviceID;
2627 oss <<
"Has CanConnect Xpt Route ROM: " <<
YesNo(inRegValue &
BIT(0)) << endl
2628 <<
"AudioSystems can start on VBI: " <<
YesNo(inRegValue &
BIT(1));
2631 } mDecodeCanDoStatus;
2633 struct DecodeVidControlReg :
public Decoder
2635 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2639 const bool is16x9 ((inRegValue &
BIT(31)) != 0);
2640 const bool isMono ((inRegValue &
BIT(30)) != 0);
2642 oss <<
"Aspect Ratio: " << (is16x9 ?
"16x9" :
"4x3") << endl
2643 <<
"Depth: " << (isMono ?
"Monochrome" :
"Color");
2646 } mDecodeVidControlReg;
2648 struct DecodeVidIntControl :
public Decoder
2650 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2655 oss <<
"Output 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(0)) << endl
2656 <<
"Input 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2657 <<
"Input 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2658 <<
"Audio Out Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(4)) << endl
2659 <<
"Audio In Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(5)) << endl
2660 <<
"Wrap Rate Interrupt Enable: " <<
YesNo(inRegValue &
BIT(6)) << endl
2661 <<
"UART Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(7)) << endl
2662 <<
"UART Rx Interrupt Enable" <<
YesNo(inRegValue &
BIT(8)) << endl
2663 <<
"UART Rx Interrupt Clear" <<
ActInact(inRegValue &
BIT(15)) << endl
2664 <<
"UART 2 Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(17)) << endl
2665 <<
"Output 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(18)) << endl
2666 <<
"Output 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2667 <<
"Output 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(20)) << endl
2668 <<
"Output 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(21)) << endl
2669 <<
"Output 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(22)) << endl
2670 <<
"Output 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(23)) << endl
2671 <<
"UART Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(24)) << endl
2672 <<
"Wrap Rate Interrupt Clear" <<
ActInact(inRegValue &
BIT(25)) << endl
2673 <<
"UART 2 Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(26)) << endl
2674 <<
"Audio Out Wrap Interrupt Clear" <<
ActInact(inRegValue &
BIT(27)) << endl
2675 <<
"Input 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2676 <<
"Input 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30)) << endl
2677 <<
"Output 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(31));
2680 } mDecodeVidIntControl;
2682 struct DecodeVidIntControl2 :
public Decoder
2684 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2689 oss <<
"Input 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2690 <<
"Input 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2691 <<
"Input 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(8)) << endl
2692 <<
"Input 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(9)) << endl
2693 <<
"Input 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(10)) << endl
2694 <<
"Input 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(11)) << endl
2695 <<
"Output 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
2696 <<
"Output 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(13)) << endl
2697 <<
"Output 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(14)) << endl
2698 <<
"Output 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(15)) << endl
2699 <<
"Output 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(16)) << endl
2700 <<
"Output 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(17)) << endl
2701 <<
"Output 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(18)) << endl
2702 <<
"Output 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(19)) << endl
2703 <<
"Input 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(25)) << endl
2704 <<
"Input 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(26)) << endl
2705 <<
"Input 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(27)) << endl
2706 <<
"Input 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(28)) << endl
2707 <<
"Input 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2708 <<
"Input 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30));
2711 } mDecodeVidIntControl2;
2713 struct DecodeStatusReg :
public Decoder
2715 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2720 oss <<
"Input 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(20)) << endl
2721 <<
"Input 1 Field ID: " << (inRegValue &
BIT(21) ?
"1" :
"0") << endl
2722 <<
"Input 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(30)) << endl
2723 <<
"Input 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(18)) << endl
2724 <<
"Input 2 Field ID: " << (inRegValue &
BIT(19) ?
"1" :
"0") << endl
2725 <<
"Input 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(29)) << endl
2726 <<
"Output 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(22)) << endl
2727 <<
"Output 1 Field ID: " << (inRegValue &
BIT(23) ?
"1" :
"0") << endl
2728 <<
"Output 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(31)) << endl
2729 <<
"Output 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(4)) << endl
2730 <<
"Output 2 Field ID: " << (inRegValue &
BIT(5) ?
"1" :
"0") << endl
2731 <<
"Output 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(8)) << endl;
2733 oss <<
"Output 3 Vertical Blank: " <<
ActInact(inRegValue &
BIT(2)) << endl
2734 <<
"Output 3 Field ID: " << (inRegValue &
BIT(3) ?
"1" :
"0") << endl
2735 <<
"Output 3 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(7)) << endl
2736 <<
"Output 4 Vertical Blank: " <<
ActInact(inRegValue &
BIT(0)) << endl
2737 <<
"Output 4 Field ID: " << (inRegValue &
BIT(1) ?
"1" :
"0") << endl
2738 <<
"Output 4 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(6)) << endl;
2739 oss <<
"Aux Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(12)) << endl
2740 <<
"I2C 1 Interrupt: " <<
ActInact(inRegValue &
BIT(14)) << endl
2741 <<
"I2C 2 Interrupt: " <<
ActInact(inRegValue &
BIT(13)) << endl
2742 <<
"Chunk Rate Interrupt: " <<
ActInact(inRegValue &
BIT(16)) << endl;
2744 oss <<
"Generic UART Interrupt: " <<
ActInact(inRegValue &
BIT(9)) << endl
2745 <<
"Uart 1 Rx Interrupt: " <<
ActInact(inRegValue &
BIT(15)) << endl
2746 <<
"Uart 1 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(24)) << endl;
2748 oss <<
"Uart 2 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(26)) << endl;
2750 oss <<
"LTC In 1 Present: " <<
YesNo(inRegValue &
BIT(17)) << endl;
2751 oss <<
"Wrap Rate Interrupt: " <<
ActInact(inRegValue &
BIT(25)) << endl
2752 <<
"Audio Out Wrap Interrupt: " <<
ActInact(inRegValue &
BIT(27)) << endl
2753 <<
"Audio 50Hz Interrupt: " <<
ActInact(inRegValue &
BIT(28));
2758 struct DecodeCPLDVersion :
public Decoder
2760 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2765 oss <<
"CPLD Version: " <<
DEC(inRegValue & (
BIT(0)|
BIT(1))) << endl
2766 <<
"Failsafe Bitfile Loaded: " << (inRegValue &
BIT(4) ?
"Yes" :
"No") << endl
2767 <<
"Force Reload: " <<
YesNo(inRegValue &
BIT(8));
2768 ULWord pcbRev ((inRegValue & 0xF0000000) >> 28);
2769 if (pcbRev) oss << endl
2770 <<
"PCB Version: " <<
xHEX0N(pcbRev,2);
2773 } mDecodeCPLDVersion;
2775 struct DecodeStatus2Reg :
public Decoder
2777 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2781 static const uint8_t bitNumsInputVBlank[] = {20, 18, 16, 14, 12, 10};
2782 static const uint8_t bitNumsInputFieldID[] = {21, 19, 17, 15, 13, 11};
2783 static const uint8_t bitNumsInputVertInt[] = {30, 29, 28, 27, 26, 25};
2784 static const uint8_t bitNumsOutputVBlank[] = { 8, 6, 4, 2};
2785 static const uint8_t bitNumsOutputFieldID[] = { 9, 7, 5, 3};
2786 static const uint8_t bitNumsOutputVertInt[] = {31, 24, 23, 22};
2788 for (
unsigned ndx(0); ndx < 6; ndx++)
2789 oss <<
"Input " << (ndx+3) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsInputVBlank[ndx])) << endl
2790 <<
"Input " << (ndx+3) <<
" Field ID: " << (inRegValue &
BIT(bitNumsInputFieldID[ndx]) ?
"1" :
"0") << endl
2791 <<
"Input " << (ndx+3) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsInputVertInt[ndx])) << endl;
2792 for (
unsigned ndx(0); ndx < 4; ndx++)
2793 oss <<
"Output " << (ndx+5) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVBlank[ndx])) << endl
2794 <<
"Output " << (ndx+5) <<
" Field ID: " << (inRegValue &
BIT(bitNumsOutputFieldID[ndx]) ?
"1" :
"0") << endl
2795 <<
"Output " << (ndx+5) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVertInt[ndx])) << endl;
2796 oss <<
"HDMI In Hot-Plug Detect Interrupt: " <<
ActInact(inRegValue &
BIT(0)) << endl
2797 <<
"HDMI In Chip Interrupt: " <<
ActInact(inRegValue &
BIT(1));
2800 } mDecodeStatus2Reg;
2802 struct DecodeInputStatusReg :
public Decoder
2804 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2813 <<
"Input 1 Geometry: ";
2814 if (
BIT(30) & inRegValue)
2815 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2817 case 0: oss <<
"2K x 1080";
break;
2818 case 1: oss <<
"2K x 1556";
break;
2819 default: oss <<
"Invalid HI";
break;
2822 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2824 case 0: oss <<
"Unknown";
break;
2825 case 1: oss <<
"525";
break;
2826 case 2: oss <<
"625";
break;
2827 case 3: oss <<
"750";
break;
2828 case 4: oss <<
"1125";
break;
2829 case 5: oss <<
"1250";
break;
2830 case 6:
case 7: oss <<
"Reserved";
break;
2831 default: oss <<
"Invalid LO";
break;
2834 <<
"Input 1 Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2836 <<
"Input 2 Geometry: ";
2837 if (
BIT(31) & inRegValue)
2838 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2840 case 0: oss <<
"2K x 1080";
break;
2841 case 1: oss <<
"2K x 1556";
break;
2842 default: oss <<
"Invalid HI";
break;
2845 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2847 case 0: oss <<
"Unknown";
break;
2848 case 1: oss <<
"525";
break;
2849 case 2: oss <<
"625";
break;
2850 case 3: oss <<
"750";
break;
2851 case 4: oss <<
"1125";
break;
2852 case 5: oss <<
"1250";
break;
2853 case 6:
case 7: oss <<
"Reserved";
break;
2854 default: oss <<
"Invalid LO";
break;
2857 <<
"Input 2 Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2859 <<
"Reference Geometry: ";
2860 switch (((
BIT(20)|
BIT(21)|
BIT(22)) & inRegValue) >> 20)
2862 case 0: oss <<
"NTV2_SG_UNKNOWN";
break;
2863 case 1: oss <<
"NTV2_SG_525";
break;
2864 case 2: oss <<
"NTV2_SG_625";
break;
2865 case 3: oss <<
"NTV2_SG_750";
break;
2866 case 4: oss <<
"NTV2_SG_1125";
break;
2867 case 5: oss <<
"NTV2_SG_1250";
break;
2868 default: oss <<
"Invalid";
break;
2871 <<
"Reference Scan Mode: " << ((
BIT(23) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2872 <<
"AES Channel 1-2: " << ((
BIT(24) & inRegValue) ?
"Invalid" :
"Valid") << endl
2873 <<
"AES Channel 3-4: " << ((
BIT(25) & inRegValue) ?
"Invalid" :
"Valid") << endl
2874 <<
"AES Channel 5-6: " << ((
BIT(26) & inRegValue) ?
"Invalid" :
"Valid") << endl
2875 <<
"AES Channel 7-8: " << ((
BIT(27) & inRegValue) ?
"Invalid" :
"Valid");
2878 } mDecodeInputStatusReg;
2880 struct DecodeSDIInputStatusReg :
public Decoder
2882 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2885 uint16_t numSpigots(0), startSpigot(0), doTsiMuxSync(0);
2896 for (uint16_t spigotNdx(0); spigotNdx < numSpigots; )
2898 const uint16_t spigotNum (spigotNdx + startSpigot);
2899 const uint8_t statusBits ((inRegValue >> (spigotNdx*8)) & 0xFF);
2900 const uint8_t speedBits (statusBits & 0xC1);
2901 ostringstream ossSpeed, ossSpigot;
2902 ossSpigot <<
"SDI In " << spigotNum <<
" ";
2903 const string spigotLabel (ossSpigot.str());
2904 if (speedBits & 0x01) ossSpeed <<
" 3G";
2907 if (speedBits & 0x40) ossSpeed <<
" 6G";
2908 if (speedBits & 0x80) ossSpeed <<
" 12G";
2910 if (speedBits == 0) ossSpeed <<
" 1.5G";
2911 oss << spigotLabel <<
"Link Speed:" << ossSpeed.str() << endl
2912 << spigotLabel <<
"SMPTE Level B: " <<
YesNo(statusBits & 0x02) << endl
2913 << spigotLabel <<
"Link A VPID Valid: " <<
YesNo(statusBits & 0x10) << endl
2914 << spigotLabel <<
"Link B VPID Valid: " <<
YesNo(statusBits & 0x20) << endl;
2916 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: " <<
EnabDisab(statusBits & 0x04);
2918 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: n/a";
2919 if (++spigotNdx < numSpigots)
2923 for (
UWord tsiMux(0); tsiMux < 4; ++tsiMux)
2925 <<
"TsiMux" <<
DEC(tsiMux+1) <<
" Sync Fail: " << ((inRegValue & (0x00010000UL << tsiMux)) ?
"FAILED" :
"OK");
2928 } mDecodeSDIInputStatusReg;
2930 struct DecodeSDIInputStatus2Reg :
public Decoder
2932 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2940 oss << sOdd <<
" Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2942 << sOdd <<
" Geometry: ";
2943 if (
BIT(30) & inRegValue)
switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2945 case 0: oss <<
"2K x 1080";
break;
2946 case 1: oss <<
"2K x 1556";
break;
2947 default: oss <<
"Invalid HI";
break;
2949 else switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2951 case 0: oss <<
"Unknown";
break;
2952 case 1: oss <<
"525";
break;
2953 case 2: oss <<
"625";
break;
2954 case 3: oss <<
"750";
break;
2955 case 4: oss <<
"1125";
break;
2956 case 5: oss <<
"1250";
break;
2957 case 6:
case 7: oss <<
"Reserved";
break;
2958 default: oss <<
"Invalid LO";
break;
2961 << sEven <<
" Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2963 << sEven <<
" Geometry: ";
2964 if (
BIT(31) & inRegValue)
switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2966 case 0: oss <<
"2K x 1080";
break;
2967 case 1: oss <<
"2K x 1556";
break;
2968 default: oss <<
"Invalid HI";
break;
2970 else switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2972 case 0: oss <<
"Unknown";
break;
2973 case 1: oss <<
"525";
break;
2974 case 2: oss <<
"625";
break;
2975 case 3: oss <<
"750";
break;
2976 case 4: oss <<
"1125";
break;
2977 case 5: oss <<
"1250";
break;
2978 case 6:
case 7: oss <<
"Reserved";
break;
2979 default: oss <<
"Invalid LO";
break;
2983 } mDecodeSDIInputStatus2Reg;
2985 struct DecodeFS1RefSelectReg :
public Decoder
2987 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2989 (
void) inDeviceID; (
void) inRegNum;
2991 oss <<
"BNC Select(LHi): " << (inRegValue & 0x00000010 ?
"LTCIn1" :
"Ref") << endl
2992 <<
"Ref BNC (Corvid): " <<
EnabDisab(inRegValue & 0x00000020) << endl
2993 <<
"LTC Present (also Reg 21): " <<
YesNo(inRegValue & 0x00000040) << endl
2994 <<
"LTC Emb Out Enable: " <<
YesNo(inRegValue & 0x00000080) << endl
2995 <<
"LTC Emb In Enable: " <<
YesNo(inRegValue & 0x00000100) << endl
2996 <<
"LTC Emb In Received: " <<
YesNo(inRegValue & 0x00000200) << endl
2997 <<
"LTC BNC Out Source: " << (inRegValue & 0x00000400 ?
"E-E" :
"Reg112/113");
3000 } mDecodeFS1RefSelectReg;
3002 struct DecodeLTCStatusControlReg :
public Decoder
3004 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3006 (
void) inDeviceID; (
void) inRegNum;
3007 const uint16_t LTC1InTimingSelect ((inRegValue >> 1) & 0x0000007);
3008 const uint16_t LTC2InTimingSelect ((inRegValue >> 9) & 0x0000007);
3009 const uint16_t LTC1OutTimingSelect ((inRegValue >> 16) & 0x0000007);
3010 const uint16_t LTC2OutTimingSelect ((inRegValue >> 20) & 0x0000007);
3012 oss <<
"LTC 1 Input Present: " <<
YesNo(inRegValue & 0x00000001) << endl
3013 <<
"LTC 1 Input FB Timing Select): " <<
xHEX0N(LTC1InTimingSelect,2) <<
" (" <<
DEC(LTC1InTimingSelect) <<
")" << endl
3014 <<
"LTC 1 Bypass: " <<
EnabDisab(inRegValue & 0x00000010) << endl
3015 <<
"LTC 1 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 5) & 0x00000001)) << endl
3016 <<
"LTC 2 Input Present: " <<
YesNo(inRegValue & 0x00000100) << endl
3017 <<
"LTC 2 Input FB Timing Select): " <<
xHEX0N(LTC2InTimingSelect,2) <<
" (" <<
DEC(LTC2InTimingSelect) <<
")" << endl
3018 <<
"LTC 2 Bypass: " <<
EnabDisab(inRegValue & 0x00001000) << endl
3019 <<
"LTC 2 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 13) & 0x00000001)) << endl
3020 <<
"LTC 1 Output FB Timing Select): " <<
xHEX0N(LTC1OutTimingSelect,2) <<
" (" <<
DEC(LTC1OutTimingSelect) <<
")" << endl
3021 <<
"LTC 2 Output FB Timing Select): " <<
xHEX0N(LTC2OutTimingSelect,2) <<
" (" <<
DEC(LTC2OutTimingSelect) <<
")";
3024 } mLTCStatusControlDecoder;
3026 struct DecodeAudDetectReg :
public Decoder
3028 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3036 for (uint16_t num(0); num < 8; )
3038 const uint16_t group (num / 2);
3039 const bool isChan34 (num & 1);
3040 oss <<
"Group " << group <<
" CH " << (isChan34 ?
"3-4: " :
"1-2: ") << (inRegValue &
BIT(num) ?
"Present" :
"Absent");
3051 } mDecodeAudDetectReg;
3053 struct DecodeAudControlReg :
public Decoder
3055 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3059 static const string ChStrs [] = {
"Ch 1/2",
"Ch 3/4",
"Ch 5/6",
"Ch 7/8" };
3060 uint16_t sdiOutput (0);
3070 oss <<
"Audio Capture: " <<
EnabDisab(
BIT(0) & inRegValue) << endl
3071 <<
"Audio Loopback: " <<
EnabDisab(
BIT(3) & inRegValue) << endl
3072 <<
"Audio Input: " <<
DisabEnab(
BIT(8) & inRegValue) << endl
3073 <<
"Audio Output: " <<
DisabEnab(
BIT(9) & inRegValue) << endl
3074 <<
"Output Paused: " <<
YesNo(
BIT(11) & inRegValue) << endl;
3076 oss <<
"Audio Embedder SDIOut" << sdiOutput <<
": " <<
DisabEnab(
BIT(13) & inRegValue) << endl
3077 <<
"Audio Embedder SDIOut" << (sdiOutput+1) <<
": " <<
DisabEnab(
BIT(15) & inRegValue) << endl;
3079 oss <<
"A/V Sync Mode: " <<
EnabDisab(
BIT(15) & inRegValue) << endl
3080 <<
"AES Rate Converter: " <<
DisabEnab(
BIT(19) & inRegValue) << endl
3081 <<
"Audio Buffer Format: " << (
BIT(20) & inRegValue ?
"16-Channel " : (
BIT(16) & inRegValue ?
"8-Channel " :
"6-Channel ")) << endl
3082 << (
BIT(18) & inRegValue ?
"96kHz" :
"48kHz") << endl
3083 << (
BIT(18) & inRegValue ?
"96kHz Support" :
"48kHz Support") << endl
3085 <<
"Slave Mode (64-chl): " <<
EnabDisab(
BIT(23) & inRegValue) << endl
3086 <<
"K-box, Monitor: " << ChStrs [(
BIT(24) &
BIT(25) & inRegValue) >> 24] << endl
3087 <<
"K-Box Input: " << (
BIT(26) & inRegValue ?
"XLR" :
"BNC") << endl
3088 <<
"K-Box: " << (
BIT(27) & inRegValue ?
"Present" :
"Absent") << endl
3089 <<
"Cable: " << (
BIT(28) & inRegValue ?
"XLR" :
"BNC") << endl
3090 <<
"Audio Buffer Size: " << (
BIT(31) & inRegValue ?
"4 MB" :
"1 MB");
3093 } mDecodeAudControlReg;
3095 struct DecodeAudSourceSelectReg :
public Decoder
3097 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3101 static const string SrcStrs [] = {
"AES Input",
"Embedded Groups 1 and 2",
"" };
3102 static const unsigned SrcStrMap [] = { 0, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
3103 const uint16_t vidInput = (inRegValue &
BIT(23) ? 2 : 0) + (inRegValue &
BIT(16) ? 1 : 0);
3106 oss <<
"Audio Source: " << SrcStrs [SrcStrMap [(
BIT(0) |
BIT(1) |
BIT(2) |
BIT(3)) & inRegValue]] << endl
3107 <<
"Embedded Source Select: Video Input " << (1 + vidInput) << endl
3108 <<
"AES Sync Mode bit (fib): " <<
EnabDisab(inRegValue &
BIT(18)) << endl
3109 <<
"PCM disabled: " <<
YesNo(inRegValue &
BIT(17)) << endl
3110 <<
"Erase head enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
3111 <<
"Embedded Clock Select: " << (inRegValue &
BIT(22) ?
"Video Input" :
"Board Reference") << endl
3112 <<
"3G audio source: " << (inRegValue &
BIT(21) ?
"Data stream 2" :
"Data stream 1");
3115 } mDecodeAudSourceSelectReg;
3117 struct DecodeAudOutputSrcMap :
public Decoder
3119 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3123 static const string AESOutputStrs[] = {
"AES Outputs 1-4",
"AES Outputs 5-8",
"AES Outputs 9-12",
"AES Outputs 13-16",
""};
3124 static const string SrcStrs[] = {
"AudSys1, Audio Channels 1-4",
"AudSys1, Audio Channels 5-8",
3125 "AudSys1, Audio Channels 9-12",
"AudSys1, Audio Channels 13-16",
3126 "AudSys2, Audio Channels 1-4",
"AudSys2, Audio Channels 5-8",
3127 "AudSys2, Audio Channels 9-12",
"AudSys2, Audio Channels 13-16",
3128 "AudSys3, Audio Channels 1-4",
"AudSys3, Audio Channels 5-8",
3129 "AudSys3, Audio Channels 9-12",
"AudSys3, Audio Channels 13-16",
3130 "AudSys4, Audio Channels 1-4",
"AudSys4, Audio Channels 5-8",
3131 "AudSys4, Audio Channels 9-12",
"AudSys4, Audio Channels 13-16",
""};
3132 static const unsigned AESChlMappingShifts [4] = {0, 4, 8, 12};
3135 const uint32_t AESOutMapping (inRegValue & 0x0000FFFF);
3139 for (
unsigned AESOutputQuad(0); AESOutputQuad < 4; AESOutputQuad++)
3140 oss << AESOutputStrs[AESOutputQuad] <<
" Source: " << SrcStrs[(AESOutMapping >> AESChlMappingShifts[AESOutputQuad]) & 0x0000000F] << endl;
3153 const uint32_t HDMIMon1234Info (HDMIMonInfo & 0x0F);
3156 const uint32_t HDMIMon5678Info ((HDMIMonInfo >> 4) & 0x0F);
3164 } mDecodeAudOutputSrcMap;
3166 struct DecodePCMControlReg :
public Decoder
3168 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3173 for (uint8_t audChan (0); audChan < 4; audChan++)
3175 oss <<
"Audio System " << (startAudioSystem + audChan) <<
": ";
3176 const uint8_t pcmBits (uint32_t(inRegValue >> (audChan * 8)) & 0x000000FF);
3177 if (pcmBits == 0x00)
3181 oss <<
"non-PCM channels";
3182 for (uint8_t chanPair (0); chanPair < 8; chanPair++)
3183 if (pcmBits & (0x01 << chanPair))
3184 oss <<
" " << (chanPair*2+1) <<
"-" << (chanPair*2+2);
3191 } mDecodePCMControlReg;
3193 struct DecodeAudioMixerInputSelectReg :
public Decoder
3195 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3196 { (
void) inDeviceID; (
void) inRegNum;
3197 const UWord mainInputSrc((inRegValue ) & 0x0000000F);
3198 const UWord aux1InputSrc((inRegValue >> 4) & 0x0000000F);
3199 const UWord aux2InputSrc((inRegValue >> 8) & 0x0000000F);
3206 } mAudMxrInputSelDecoder;
3208 struct DecodeAudioMixerGainRegs :
public Decoder
3212 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3213 { (
void)inRegNum; (
void)inDeviceID;
3214 static const double kUnityGain (0x00010000);
3215 const bool atUnity (inRegValue == 0x00010000);
3218 oss <<
"Gain: 0 dB (Unity)";
3221 const double dValue (inRegValue);
3222 const bool aboveUnity (inRegValue >= 0x00010000);
3223 const string plusMinus (atUnity ?
"" : (aboveUnity ?
"+" :
"-"));
3224 const string aboveBelow (atUnity ?
"at" : (aboveUnity ?
"above" :
"below"));
3225 const uint32_t unityDiff (aboveUnity ? inRegValue - 0x00010000 : 0x00010000 - inRegValue);
3226 const double dB (
double(20.0) * ::log10(dValue/kUnityGain));
3227 oss <<
"Gain: " << dB <<
" dB, " << plusMinus <<
xHEX0N(unityDiff,6)
3228 <<
" (" << plusMinus <<
DEC(unityDiff) <<
") " << aboveBelow <<
" unity gain";
3232 } mAudMxrGainDecoder;
3234 struct DecodeAudioMixerChannelSelectReg :
public Decoder
3236 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3237 { (
void) inRegNum; (
void) inDeviceID;
3242 <<
"Level Measurement Sample Count: " <<
DEC(
ULWord(1 << powerOfTwo)) <<
" (bits 8-15)";
3245 } mAudMxrChanSelDecoder;
3248 struct DecodeAudioMixerMutesReg :
public Decoder
3251 typedef std::bitset<16> AudioChannelSet16;
3252 typedef std::bitset<2> AudioChannelSet2;
3255 outSet.clear(); outClear.clear();
3256 for (
size_t ndx(0); ndx < 16; ndx++)
3257 { ostringstream oss; oss <<
DEC(ndx+1);
3258 if (inChSet.test(ndx))
3259 outSet.push_back(oss.str());
3261 outClear.push_back(oss.str());
3263 if (outSet.empty()) outSet.push_back(
"<none>");
3264 if (outClear.empty()) outClear.push_back(
"<none>");
3268 outSet.clear(); outClear.clear();
static const string LR[] = {
"L",
"R"};
3269 for (
size_t ndx(0); ndx < 2; ndx++)
3270 if (inChSet.test(ndx))
3271 outSet.push_back(LR[ndx]);
3273 outClear.push_back(LR[ndx]);
3274 if (outSet.empty()) outSet.push_back(
"<none>");
3275 if (outClear.empty()) outClear.push_back(
"<none>");
3278 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3279 { (
void) inRegNum; (
void) inDeviceID;
3285 NTV2StringList mutedMainOut, unmutedMainOut, mutedMain, unmutedMain, mutedAux1, unmutedAux1, mutedAux2, unmutedAux2;
3286 SplitAudioChannelSet16(AudioChannelSet16(mainOutputMuteBits), mutedMainOut, unmutedMainOut);
3287 SplitAudioChannelSet2(AudioChannelSet2(mainInputMuteBits), mutedMain, unmutedMain);
3288 SplitAudioChannelSet2(AudioChannelSet2(aux1InputMuteBits), mutedAux1, unmutedAux1);
3289 SplitAudioChannelSet2(AudioChannelSet2(aux2InputMuteBits), mutedAux2, unmutedAux2);
3290 oss <<
"Main Output Muted/Disabled Channels: " << mutedMainOut << endl
3291 <<
"Main Output Unmuted/Enabled Channels: " << unmutedMainOut << endl;
3292 oss <<
"Main Input Muted/Disabled Channels: " << mutedMain << endl
3293 <<
"Main Input Unmuted/Enabled Channels: " << unmutedMain << endl;
3294 oss <<
"Aux Input 1 Muted/Disabled Channels: " << mutedAux1 << endl
3295 <<
"Aux Input 1 Unmuted/Enabled Channels: " << unmutedAux1 << endl;
3296 oss <<
"Aux Input 2 Muted/Disabled Channels: " << mutedAux2 << endl
3297 <<
"Aux Input 2 Unmuted/Enabled Channels: " << unmutedAux2;
3300 } mAudMxrMutesDecoder;
3302 struct DecodeAudioMixerLevelsReg :
public Decoder
3306 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3307 { (
void) inDeviceID;
3308 static const string sLabels[] = {
"Aux Input 1",
"Aux Input 2",
"Main Input Audio Channels 1|2",
"Main Input Audio Channels 3|4",
3309 "Main Input Audio Channels 5|6",
"Main Input Audio Channels 7|8",
"Main Input Audio Channels 9|10",
3310 "Main Input Audio Channels 11|12",
"Main Input Audio Channels 13|14",
"Main Input Audio Channels 15|16",
3311 "Main Output Audio Channels 1|2",
"Main Output Audio Channels 3|4",
"Main Output Audio Channels 5|6",
3312 "Main Output Audio Channels 7|8",
"Main Output Audio Channels 9|10",
"Main Output Audio Channels 11|12",
3313 "Main Output Audio Channels 13|14",
"Main Output Audio Channels 15|16"};
3317 const string & label(sLabels[labelOffset]);
3321 oss << label <<
" Left Level:" <<
xHEX0N(leftLevel, 4) <<
" (" <<
DEC(leftLevel) <<
")" << endl
3322 << label <<
" Right Level:" <<
xHEX0N(rightLevel,4) <<
" (" <<
DEC(rightLevel) <<
")";
3325 } mAudMxrLevelDecoder;
3327 struct DecodeAncExtControlReg :
public Decoder
3329 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3334 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3335 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3336 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3337 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3338 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3339 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3340 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3341 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3342 <<
"SD Y+C Demux: " <<
EnabDisab(inRegValue &
BIT(30)) << endl
3343 <<
"Metadata from: " << (inRegValue &
BIT(31) ?
"LSBs" :
"MSBs");
3346 } mDecodeAncExtControlReg;
3348 struct DecodeAuxExtControlReg :
public Decoder
3350 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3355 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3356 oss <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3357 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3358 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3359 <<
"Filter inclusion: " <<
EnabDisab(inRegValue &
BIT(29));
3362 } mDecodeAuxExtControlReg;
3365 struct DecodeAncExtFieldLinesReg :
public Decoder
3367 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3371 const uint32_t which (inRegNum & 0x1F);
3372 const uint32_t valueLow (inRegValue & 0xFFF);
3373 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFF);
3376 case 5: oss <<
"F1 cutoff line: " << valueLow << endl
3377 <<
"F2 cutoff line: " << valueHigh;
3379 case 9: oss <<
"F1 VBL start line: " << valueLow << endl
3380 <<
"F2 VBL start line: " << valueHigh;
3382 case 11: oss <<
"Field ID high on line: " << valueLow << endl
3383 <<
"Field ID low on line: " << valueHigh;
3385 case 17: oss <<
"F1 analog start line: " << valueLow << endl
3386 <<
"F2 analog start line: " << valueHigh;
3389 oss <<
"Invalid register type";
3394 } mDecodeAncExtFieldLines;
3397 struct DecodeAncExtStatusReg :
public Decoder
3399 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3403 const uint32_t which (inRegNum & 0x1F);
3404 const uint32_t byteTotal (inRegValue & 0xFFFFFF);
3405 const bool overrun ((inRegValue &
BIT(28)) ?
true :
false);
3408 case 6: oss <<
"Total bytes: ";
break;
3409 case 7: oss <<
"Total F1 bytes: ";
break;
3410 case 8: oss <<
"Total F2 bytes: ";
break;
3411 default: oss <<
"Invalid register type";
break;
3413 oss <<
DEC(byteTotal) << endl
3414 <<
"Overrun: " <<
YesNo(overrun);
3417 } mDecodeAncExtStatus;
3420 struct DecodeAncExtIgnoreDIDReg :
public Decoder
3422 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3427 oss <<
"Ignoring DIDs " <<
HEX0N((inRegValue >> 0) & 0xFF, 2)
3428 <<
", " <<
HEX0N((inRegValue >> 8) & 0xFF, 2)
3429 <<
", " <<
HEX0N((inRegValue >> 16) & 0xFF, 2)
3430 <<
", " <<
HEX0N((inRegValue >> 24) & 0xFF, 2);
3433 } mDecodeAncExtIgnoreDIDs;
3435 struct DecodeAncExtAnalogFilterReg :
public Decoder
3437 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3442 uint32_t which (inRegNum & 0x1F);
3443 oss <<
"Each 1 bit specifies capturing ";
3446 case 18: oss <<
"F1 Y";
break;
3447 case 19: oss <<
"F2 Y";
break;
3448 case 20: oss <<
"F1 C";
break;
3449 case 21: oss <<
"F2 C";
break;
3450 default:
return "Invalid register type";
3452 oss <<
" line as analog, else digital";
3455 } mDecodeAncExtAnalogFilter;
3457 struct DecodeAncInsValuePairReg :
public Decoder
3459 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3463 const uint32_t which (inRegNum & 0x1F);
3464 const uint32_t valueLow (inRegValue & 0xFFFF);
3465 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFFF);
3469 case 0: oss <<
"F1 byte count low: " << valueLow << endl
3470 <<
"F2 byte count low: " << valueHigh;
3472 case 4: oss <<
"HANC pixel delay: " << (valueLow & 0x3FF) << endl
3473 <<
"VANC pixel delay: " << (valueHigh & 0x7FF);
3475 case 5: oss <<
"F1 first active line: " << (valueLow & 0x7FF) << endl
3476 <<
"F2 first active line: " << (valueHigh & 0x7FF);
3478 case 6: oss <<
"Active line length: " << (valueLow & 0x7FF) << endl
3479 <<
"Total line length: " << (valueHigh & 0xFFF);
3481 case 8: oss <<
"Field ID high on line: " << (valueLow & 0x7FF) << endl
3482 <<
"Field ID low on line: " << (valueHigh & 0x7FF);
3484 case 11: oss <<
"F1 chroma blnk start line: " << (valueLow & 0x7FF) << endl
3485 <<
"F2 chroma blnk start line: " << (valueHigh & 0x7FF);
3487 case 14: oss <<
"F1 byte count high: " << valueLow << endl
3488 <<
"F2 byte count high: " << valueHigh;
3490 default:
return "Invalid register type";
3494 } mDecodeAncInsValuePairReg;
3496 struct DecodeAncInsControlReg :
public Decoder
3498 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3503 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3504 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3505 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3506 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3507 <<
"Payload Y insert: " <<
YesNo(inRegValue &
BIT(16)) << endl
3508 <<
"Payload C insert: " <<
YesNo(inRegValue &
BIT(17)) << endl
3509 <<
"Payload F1 insert: " <<
YesNo(inRegValue &
BIT(20)) << endl
3510 <<
"Payload F2 insert: " <<
YesNo(inRegValue &
BIT(21)) << endl
3511 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(24)) << endl
3512 <<
"Memory reads: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3513 <<
"SD Packet Split: " <<
EnabDisab(inRegValue &
BIT(31));
3516 } mDecodeAncInsControlReg;
3518 struct DecodeAncInsChromaBlankReg :
public Decoder
3520 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3525 uint32_t which (inRegNum & 0x1F);
3527 oss <<
"Each 1 bit specifies if chroma in ";
3530 case 12: oss <<
"F1";
break;
3531 case 13: oss <<
"F2";
break;
3532 default:
return "Invalid register type";
3534 oss <<
" should be blanked or passed thru";
3537 } mDecodeAncInsChromaBlankReg;
3539 struct DecodeXptGroupReg :
public Decoder
3541 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3543 static unsigned sShifts[4] = {0, 8, 16, 24};
3545 for (
unsigned ndx(0); ndx < 4; ndx++)
3563 strs.push_back(oss.str());
3569 } mDecodeXptGroupReg;
3571 struct DecodeXptValidReg :
public Decoder
3573 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3590 ss <<
xHEX0N(outputXpt,2) <<
"(" <<
DEC(outputXpt) <<
")";
3592 ss <<
"'" << name <<
"'";
3593 outputXptNames.push_back(ss.str());
3595 if (!outputXptNames.empty())
3596 oss <<
"Valid Xpts: " << outputXptNames;
3600 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3602 } mDecodeXptValidReg;
3604 struct DecodeNTV4FSReg :
public Decoder
3606 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3607 { (
void) inDeviceID;
3608 static const string sPixClkSelects[] = {
"27",
"74.1758",
"74.25",
"148.3516",
"148.5",
"inv5",
"inv6",
"inv7"};
3609 static const string sSyncs[] = {
"Sync to Frame",
"Sync to Field",
"Immediate",
"Sync to External"};
3615 {
const ULWord disabled (inRegValue &
BIT(1));
3616 const ULWord sync ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3617 const ULWord pixClkSel((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18))) >> 16);
3620 oss <<
"Enabled: " <<
YesNo(!disabled) << endl
3621 <<
"Mode: " << ((inRegValue &
BIT( 0)) ?
"Capture" :
"Display") << endl
3622 <<
"DRT_DISP: " <<
OnOff(inRegValue &
BIT( 2)) << endl
3623 <<
"Fill Bit: " <<
DEC((inRegValue &
BIT( 3)) ? 1 : 0) << endl
3624 <<
"Dither: " <<
EnabDisab(inRegValue &
BIT( 4)) << endl
3625 <<
"RGB8 Convert: " << ((inRegValue &
BIT( 5)) ?
"Use '00'" :
"Copy MSBs") << endl
3626 <<
"Progressive: " <<
YesNo(inRegValue &
BIT( 6)) << endl
3628 <<
"Pix Clk Sel: " << sPixClkSelects[pixClkSel] <<
" MHz" << endl
3629 <<
"Sync: " << sSyncs[sync];
3631 oss <<
"Enabled: " <<
YesNo(!disabled);
3635 {
const ULWord lineCnt ((inRegValue & (0xFFFF0000)) >> 16);
3636 oss <<
"Field ID: " <<
OddEven(inRegValue &
BIT( 0)) << endl
3637 <<
"Line Count: " <<
DEC(lineCnt);
3641 {
const int32_t xferByteCnt((inRegValue & 0xFFFF0000) >> 16), linePitch(inRegValue & 0x0000FFFF);
3642 oss <<
"Line Pitch: " << linePitch << (linePitch < 0 ?
" (flipped)" :
"") << endl
3643 <<
"Xfer Byte Count: " << xferByteCnt <<
" [bytes/line]" << (linePitch < 0 ?
" (flipped)" :
"");
3647 {
const ULWord ROIVSize((inRegValue & (0x0FFF0000)) >> 16), ROIHSize(inRegValue & 0x00000FFF);
3648 oss <<
"ROI Horz Size: " <<
DEC(ROIHSize) <<
" [pixels]" << endl
3649 <<
"ROI Vert Size: " <<
DEC(ROIVSize) <<
" [lines]";
3654 {
const ULWord ROIVOff((inRegValue & (0x0FFF0000)) >> 16), ROIHOff(inRegValue & 0x00000FFF);
3656 oss <<
"ROI " << fld <<
" Horz Offset: " <<
DEC(ROIHOff) << endl
3657 <<
"ROI " << fld <<
" Vert Offset: " <<
DEC(ROIVOff);
3661 {
const ULWord tot((inRegValue & (0x0FFF0000)) >> 16), act(inRegValue & 0x00000FFF);
3662 oss <<
"Disp Horz Active: " <<
DEC(act) << endl
3663 <<
"Disp Horz Total: " <<
DEC(tot);
3667 {
const ULWord lo((inRegValue & (0x07FF0000)) >> 16), hi(inRegValue & 0x000007FF);
3668 oss <<
"Disp FID Lo: " <<
DEC(lo) << endl
3669 <<
"Disp FID Hi: " <<
DEC(hi);
3674 {
const ULWord actEnd((inRegValue & (0x07FF0000)) >> 16), actStart(inRegValue & 0x000007FF);
3676 oss <<
"Disp " << fld <<
" Active Start: " <<
DEC(actStart) << endl
3677 <<
"Disp " << fld <<
" Active End: " <<
DEC(actEnd);
3681 oss <<
"Unpacker Horz Offset: " <<
DEC(inRegValue & 0x0000FFFF);
3685 {
const ULWord hi((inRegValue & (0xFFFF0000)) >> 16), lo(inRegValue & 0x0000FFFF);
3688 oss <<
"Disp Fill " << CbBorCrR <<
": " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4) << endl
3689 <<
"Disp Fill " << YGorA <<
": " <<
DEC(hi) <<
" " <<
xHEX0N(hi,4);
3693 {
const ULWord lo(inRegValue & 0x0000FFFF);
3694 oss <<
"ROI Fill Alpha: " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4);
3698 oss <<
"Output Timing Frame Pulse Preset: " <<
DEC(inRegValue & 0x00FFFFFF) <<
" "
3699 <<
xHEX0N(inRegValue & 0x00FFFFFF,6);
3704 {
const int32_t lo (inRegValue & 0x00001FFF);
3705 oss <<
"Output Video Offset: " << lo <<
" " <<
xHEX0N(lo,6);
3709 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3715 struct DecodeHDMIOutputControl :
public Decoder
3717 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3721 static const string sHDMIStdV1[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" };
3722 static const string sHDMIStdV2V3[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3723 static const string sVidRates[] = {
"",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95",
"",
"",
"",
"",
"" };
3724 static const string sSrcSampling[] = {
"YC422",
"RGB",
"YC420",
"Unknown/invalid" };
3725 static const string sBitDepth[] = {
"8",
"10",
"12",
"Unknown/invalid" };
3728 const string hdmiVidStdStr (hdmiVers > 1 ? sHDMIStdV2V3[rawVideoStd] : (hdmiVers == 1 ? sHDMIStdV1[rawVideoStd] :
""));
3731 const uint32_t srcBPC ((inRegValue & (
BIT(16)|
BIT(17))) >> 16);
3732 const uint32_t txBitDepth ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3733 oss <<
"Video Standard: " << hdmiVidStdStr;
3734 if (hdmiVidStdStr != vidStdStr)
3735 oss <<
" (" << vidStdStr <<
")";
3737 <<
"Color Mode: " << ((inRegValue &
BIT( 8)) ?
"RGB" :
"YCbCr") << endl
3739 <<
"Scan Mode: " << ((inRegValue &
BIT(13)) ?
"Progressive" :
"Interlaced") << endl
3740 <<
"Bit Depth: " << ((inRegValue &
BIT(14)) ?
"10-bit" :
"8-bit") << endl
3741 <<
"Output Color Sampling: " << ((inRegValue &
BIT(15)) ?
"4:4:4" :
"4:2:2") << endl
3742 <<
"Output Bit Depth: " << sBitDepth[txBitDepth] << endl
3743 <<
"Src Color Sampling: " << sSrcSampling[srcSampling] << endl
3744 <<
"Src Bits Per Component: " << sBitDepth[srcBPC] << endl
3745 <<
"Output Range: " << ((inRegValue &
BIT(28)) ?
"Full" :
"SMPTE") << endl
3746 <<
"Audio Channels: " << ((inRegValue &
BIT(29)) ?
"8" :
"2") << endl
3747 <<
"Output: " << ((inRegValue &
BIT(30)) ?
"DVI" :
"HDMI");
3750 <<
"Audio Loopback: " <<
OnOff(inRegValue &
BIT(31));
3753 } mDecodeHDMIOutputControl;
3755 struct DecodeHDMIInputStatus :
public Decoder
3757 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3764 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"2K1080p",
"2K1080i",
"3840p",
"4096p"};
3765 static const string sRates[32] = {
"invalid",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95" };
3766 oss <<
"HDMI Input: " << (inRegValue &
BIT(0) ?
"Locked" :
"Unlocked") << endl
3767 <<
"HDMI Input: " << (inRegValue &
BIT(1) ?
"Stable" :
"Unstable") << endl
3768 <<
"Color Mode: " << (inRegValue &
BIT(2) ?
"RGB" :
"YCbCr") << endl
3769 <<
"Bitdepth: " << (inRegValue &
BIT(3) ?
"10-bit" :
"8-bit") << endl
3770 <<
"Audio Channels: " << (inRegValue &
BIT(12) ? 2 : 8) << endl
3771 <<
"Scan Mode: " << (inRegValue &
BIT(13) ?
"Progressive" :
"Interlaced") << endl
3772 <<
"Standard: " << (inRegValue &
BIT(14) ?
"SD" :
"HD") << endl
3773 <<
"Video Standard: " << sStds[vidStd] << endl
3774 <<
"Protocol: " << (inRegValue &
BIT(27) ?
"DVI" :
"HDMI") << endl
3775 <<
"Video Rate : " << (rate < 11 ? sRates[rate] :
string(
"invalid"));
3778 } mDecodeHDMIInputStatus;
3780 struct DecodeHDMIInputControl :
public Decoder
3782 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3784 (
void) inRegNum; (
void) inDeviceID;
3786 const UWord chanPair ((inRegValue & (
BIT(2) |
BIT(3))) >> 2);
3788 const UWord txCh12Sel ((inRegValue & (
BIT(29)|
BIT(30))) >> 29);
3790 oss <<
"HDMI In EDID Write-Enable: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
3791 <<
"HDMI Force Output Params: " <<
SetNotset(inRegValue &
BIT(1)) << endl
3793 <<
"hdmi_rx_8ch_src_off: " <<
YesNo(inRegValue &
BIT(4)) << endl
3794 <<
"Swap HDMI In Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(5)) << endl
3795 <<
"Swap HDMI Out Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(6)) << endl
3796 <<
"HDMI Prefer 420: " <<
SetNotset(inRegValue &
BIT(7)) << endl
3797 <<
"hdmi_rx_spdif_err: " <<
SetNotset(inRegValue &
BIT(8)) << endl
3798 <<
"hdmi_rx_afifo_under: " <<
SetNotset(inRegValue &
BIT(9)) << endl
3799 <<
"hdmi_rx_afifo_empty: " <<
SetNotset(inRegValue &
BIT(10)) << endl
3800 <<
"H polarity: " << (inRegValue &
BIT(16) ?
"Inverted" :
"Normal") << endl
3801 <<
"V polarity: " << (inRegValue &
BIT(17) ?
"Inverted" :
"Normal") << endl
3802 <<
"F polarity: " << (inRegValue &
BIT(18) ?
"Inverted" :
"Normal") << endl
3803 <<
"DE polarity: " << (inRegValue &
BIT(19) ?
"Inverted" :
"Normal") << endl
3804 <<
"Tx Src Sel: " <<
DEC(txSrcSel) <<
" (" <<
xHEX0N(txSrcSel,4) <<
")" << endl
3805 <<
"Tx Center Cut: " <<
SetNotset(inRegValue &
BIT(24)) << endl
3806 <<
"Tx 12 bit: " <<
SetNotset(inRegValue &
BIT(26)) << endl
3807 <<
"RGB Input Gamut: " << (inRegValue &
BIT(28) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3808 <<
"Tx_ch12_sel: " <<
DEC(txCh12Sel) <<
" (" <<
xHEX0N(txCh12Sel,4) <<
")" << endl
3809 <<
"Input AVI Gamut: " << (inRegValue &
BIT(31) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3813 } mDecodeHDMIInputControl;
3815 struct DecodeHDMIOutputStatus :
public Decoder
3817 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3818 { (
void) inRegNum; (
void) inDeviceID;
3824 } mDecodeHDMIOutputStatus;
3826 struct DecodeHDMIOutHDRPrimary :
public Decoder
3828 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3864 const double xFloat (
double(xPrimary) * 0.00002);
3865 const double yFloat (
double(yPrimary) * 0.00002);
3867 oss <<
"X: " <<
fDEC(xFloat,7,5) << endl;
3869 oss <<
"X: " <<
HEX0N(xPrimary, 4) <<
"(invalid)" << endl;
3871 oss <<
"Y: " <<
fDEC(yFloat,7,5);
3873 oss <<
"Y: " <<
HEX0N(yPrimary, 4) <<
"(invalid)";
3884 const double minFloat (
double(minValue) * 0.00001);
3885 const double maxFloat (maxValue);
3886 oss <<
"Min: " <<
fDEC(minFloat,7,5) << endl
3887 <<
"Max: " <<
fDEC(maxFloat,7,5);
3898 const double cntFloat (cntValue);
3899 const double frmFloat (frmValue);
3900 oss <<
"Max Content Light Level: " <<
fDEC(cntFloat,7,5) << endl
3901 <<
"Max Frame Light Level: " <<
fDEC(frmFloat,7,5);
3908 } mDecodeHDMIOutHDRPrimary;
3910 struct DecodeHDMIOutHDRControl :
public Decoder
3912 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3915 static const string sEOTFs[] = {
"Trad Gamma SDR",
"Trad Gamma HDR",
"SMPTE ST 2084",
"HLG"};
3924 <<
"EOTF: " << sEOTFs[(EOTFvalue < 3) ? EOTFvalue : 3] << endl
3925 <<
"Static MetaData Desc ID: " <<
HEX0N(staticMetaDataDescID, 2) <<
" (" <<
DEC(staticMetaDataDescID) <<
")";
3929 } mDecodeHDMIOutHDRControl;
3931 struct DecodeHDMIOutMRControl :
public Decoder
3933 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3934 { (
void) inRegNum; (
void) inDeviceID;
3936 static const string sMRStandard[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3938 const string hdmiVidStdStr (sMRStandard[rawVideoStd]);
3940 oss <<
"Video Standard: " << hdmiVidStdStr;
3941 if (hdmiVidStdStr != vidStdStr)
3942 oss <<
" (" << vidStdStr <<
")";
3944 <<
"Capture Mode: " << ((inRegValue &
kRegMaskMREnable) ?
"Enabled" :
"Disabled");
3947 } mDecodeHDMIOutMRControl;
3949 struct DecodeSDIOutputControl :
public Decoder
3951 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3956 const uint32_t vidStd (inRegValue & (
BIT(0)|
BIT(1)|
BIT(2)));
3957 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"6",
"7"};
3958 oss <<
"Video Standard: " << sStds[vidStd] << endl
3959 <<
"2Kx1080 mode: " << (inRegValue &
BIT(3) ?
"2048x1080" :
"1920x1080") << endl
3960 <<
"HBlank RGB Range: Black=" << (inRegValue &
BIT(7) ?
"0x40" :
"0x04") << endl
3961 <<
"12G enable: " <<
YesNo(inRegValue &
BIT(17)) << endl
3962 <<
"6G enable: " <<
YesNo(inRegValue &
BIT(16)) << endl
3963 <<
"3G enable: " <<
YesNo(inRegValue &
BIT(24)) << endl
3964 <<
"3G mode: " << (inRegValue &
BIT(25) ?
"b" :
"a") << endl
3965 <<
"VPID insert enable: " <<
YesNo(inRegValue &
BIT(26)) << endl
3966 <<
"VPID overwrite enable: " <<
YesNo(inRegValue &
BIT(27)) << endl
3967 <<
"DS 1 audio source: " "AudSys";
3968 switch ((inRegValue & (
BIT(28)|
BIT(30))) >> 28)
3970 case 0: oss << (inRegValue &
BIT(18) ? 5 : 1);
break;
3971 case 1: oss << (inRegValue &
BIT(18) ? 7 : 3);
break;
3972 case 4: oss << (inRegValue &
BIT(18) ? 6 : 2);
break;
3973 case 5: oss << (inRegValue &
BIT(18) ? 8 : 4);
break;
3975 oss << endl <<
"DS 2 audio source: AudSys";
3976 switch ((inRegValue & (
BIT(29)|
BIT(31))) >> 29)
3978 case 0: oss << (inRegValue &
BIT(19) ? 5 : 1);
break;
3979 case 1: oss << (inRegValue &
BIT(19) ? 7 : 3);
break;
3980 case 4: oss << (inRegValue &
BIT(19) ? 6 : 2);
break;
3981 case 5: oss << (inRegValue &
BIT(19) ? 8 : 4);
break;
3985 } mDecodeSDIOutputControl;
3987 struct DecodeSDIOutTimingCtrl :
public Decoder
3989 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3990 { (
void)inRegNum; (
void)inDeviceID;
3992 const uint32_t hMask(0x00001FFF), vMask(0x1FFF0000);
3993 const uint32_t hOffset(inRegValue & hMask), vOffset((inRegValue & vMask) >> 16);
3994 oss <<
"Horz Offset: " <<
xHEX0N(
UWord(hOffset),4) << endl
3995 <<
"Vert Offset: " <<
xHEX0N(
UWord(vOffset),4) << endl
3996 <<
"E-E Timing Override: " <<
EnabDisab(inRegValue &
BIT(31));
3999 } mDecodeSDIOutTimingCtrl;
4001 struct DecodeDMAControl :
public Decoder
4003 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4007 const uint16_t gen ((inRegValue & (
BIT(20)|
BIT(21)|
BIT(22)|
BIT(23))) >> 20);
4008 const uint16_t lanes ((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18)|
BIT(19))) >> 16);
4009 const uint16_t fwRev ((inRegValue & 0x0000FF00) >> 8);
4011 for (uint16_t engine(0); engine < 4; engine++)
4012 oss <<
"DMA " << (engine+1) <<
" Int Active?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
4013 oss <<
"Bus Error Int Active?: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4014 for (uint16_t engine(0); engine < 4; engine++)
4015 oss <<
"DMA " << (engine+1) <<
" Busy?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
4016 oss <<
"Strap: " << ((inRegValue &
BIT(7)) ?
"Installed" :
"Not Installed") << endl
4017 <<
"Firmware Rev: " <<
xHEX0N(fwRev, 2) <<
" (" <<
DEC(fwRev) <<
")" << endl
4018 <<
"Gen: " << gen << ((gen > 0 && gen < 4) ?
"" :
" <invalid>") << endl
4019 <<
"Lanes: " <<
DEC(lanes) << ((lanes < 9) ?
"" :
" <invalid>");
4022 } mDMAControlRegDecoder;
4024 struct DecodeDMAIntControl :
public Decoder
4026 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4031 for (uint16_t eng(0); eng < 4; eng++)
4032 oss <<
"DMA " << (eng+1) <<
" Enabled?: " <<
YesNo(inRegValue &
BIT(eng)) << endl;
4033 oss <<
"Bus Error Enabled?: " <<
YesNo(inRegValue &
BIT(4)) << endl;
4034 for (uint16_t eng(0); eng < 4; eng++)
4035 oss <<
"DMA " << (eng+1) <<
" Active?: " <<
YesNo(inRegValue &
BIT(27+eng)) << endl;
4036 oss <<
"Bus Error: " <<
YesNo(inRegValue &
BIT(31));
4039 } mDMAIntControlRegDecoder;
4041 struct DecodeDMAXferRate :
public Decoder
4043 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4044 { (
void) inRegNum; (
void) inDeviceID;
4046 oss <<
DEC(inRegValue) <<
" [MB/sec] [kB/ms] [B/us]";
4049 } mDMAXferRateRegDecoder;
4051 struct DecodeRP188InOutDBB :
public Decoder
4053 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4057 const bool isReceivingRP188 (inRegValue &
BIT(16));
4058 const bool isReceivingSelectedRP188 (inRegValue &
BIT(17));
4059 const bool isReceivingLTC (inRegValue &
BIT(18));
4060 const bool isReceivingVITC (inRegValue &
BIT(19));
4062 oss <<
"RP188: " << (isReceivingRP188 ? (isReceivingSelectedRP188 ?
"Selected" :
"Unselected") :
"No") <<
" RP-188 received"
4063 << (isReceivingLTC ?
" +LTC" :
"") << (isReceivingVITC ?
" +VITC" :
"") << endl
4064 <<
"Bypass: " << (inRegValue &
BIT(23) ? (inRegValue &
BIT(22) ?
"SDI In 2" :
"SDI In 1") :
"Disabled") << endl
4065 <<
"Filter: " <<
HEX0N((inRegValue & 0xFF000000) >> 24, 2) << endl
4066 <<
"DBB: " <<
HEX0N((inRegValue & 0x0000FF00) >> 8, 2) <<
" " <<
HEX0N(inRegValue & 0x000000FF, 2);
4069 } mRP188InOutDBBRegDecoder;
4071 struct DecodeVidProcControl :
public Decoder
4073 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4078 static const string sSplitStds [8] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"?6?",
"?7?"};
4079 oss <<
"Mode: " << (inRegValue &
kRegMaskVidProcMode ? ((inRegValue &
BIT(24)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
4080 <<
"FG Control: " << (inRegValue &
kRegMaskVidProcFGControl ? ((inRegValue &
BIT(20)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
4081 <<
"BG Control: " << (inRegValue &
kRegMaskVidProcBGControl ? ((inRegValue &
BIT(22)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
4082 <<
"VANC Pass-Thru: " << ((inRegValue &
BIT(13)) ?
"Background" :
"Foreground") << endl
4086 <<
"Limiting: " << ((inRegValue &
BIT(11)) ?
"Off" : ((inRegValue &
BIT(12)) ?
"Legal Broadcast" :
"Legal SDI")) << endl
4090 } mVidProcControlRegDecoder;
4092 struct DecodeSplitControl :
public Decoder
4094 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4099 const uint32_t startmask (0x0000FFFF);
4100 const uint32_t slopemask (0x3FFF0000);
4101 const uint32_t fractionmask(0x00000007);
4102 oss <<
"Split Start: " <<
HEX0N((inRegValue & startmask) & ~fractionmask, 4) <<
" "
4103 <<
HEX0N((inRegValue & startmask) & fractionmask, 4) << endl
4104 <<
"Split Slope: " <<
HEX0N(((inRegValue & slopemask) >> 16) & ~fractionmask, 4) <<
" "
4105 <<
HEX0N(((inRegValue & slopemask) >> 16) & fractionmask, 4) << endl
4106 <<
"Split Type: " << ((inRegValue &
BIT(30)) ?
"Vertical" :
"Horizontal");
4109 } mSplitControlRegDecoder;
4111 struct DecodeFlatMatteValue :
public Decoder
4113 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4118 const uint32_t mask (0x000003FF);
4119 oss <<
"Flat Matte Cb: " <<
HEX0N(inRegValue & mask, 3) << endl
4120 <<
"Flat Matte Y: " <<
HEX0N(((inRegValue >> 10) & mask) - 0x40, 3) << endl
4121 <<
"Flat Matte Cr: " <<
HEX0N((inRegValue >> 20) & mask, 3);
4124 } mFlatMatteValueRegDecoder;
4126 struct DecodeEnhancedCSCMode :
public Decoder
4128 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4132 static const string sFiltSel[] = {
"Full",
"Simple",
"None",
"?"};
4133 static const string sEdgeCtrl[] = {
"black",
"extended pixels"};
4134 static const string sPixFmts[] = {
"RGB 4:4:4",
"YCbCr 4:4:4",
"YCbCr 4:2:2",
"?"};
4135 const uint32_t filterSelect ((inRegValue >> 12) & 0x3);
4136 const uint32_t edgeControl ((inRegValue >> 8) & 0x1);
4137 const uint32_t outPixFmt ((inRegValue >> 4) & 0x3);
4138 const uint32_t inpPixFmt (inRegValue & 0x3);
4140 oss <<
"Filter select: " << sFiltSel[filterSelect] << endl
4141 <<
"Filter edge control: " <<
"Filter to " << sEdgeCtrl[edgeControl] << endl
4142 <<
"Output pixel format: " << sPixFmts[outPixFmt] << endl
4143 <<
"Input pixel format: " << sPixFmts[inpPixFmt];
4146 } mEnhCSCModeDecoder;
4148 struct DecodeEnhancedCSCOffset :
public Decoder
4150 static string U10Dot6ToFloat (
const uint32_t inOffset)
4152 double result (
double((inOffset >> 6) & 0x3FF));
4153 result += double(inOffset & 0x3F) / 64.0;
4154 ostringstream oss; oss <<
fDEC(result,12,5);
string resultStr(oss.str());
4157 static string U12Dot4ToFloat (
const uint32_t inOffset)
4159 double result (
double((inOffset >> 4) & 0xFFF));
4160 result += double(inOffset & 0xF) / 16.0;
4161 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4164 static string S13Dot2ToFloat (
const uint32_t inOffset)
4166 double result (
double((inOffset >> 2) & 0x1FFF));
4167 result += double(inOffset & 0x3) / 4.0;
4168 if (inOffset &
BIT(15))
4170 ostringstream oss; oss <<
fDEC(result,12,2);
string resultStr(oss.str());
4173 static string S11Dot4ToFloat (
const uint32_t inOffset)
4175 double result (
double((inOffset >> 4) & 0x7FF));
4176 result += double(inOffset & 0xF) / 16.0;
4177 if (inOffset &
BIT(15))
4179 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4182 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4185 const uint32_t regNum (inRegNum & 0x1F);
4186 const uint32_t lo (inRegValue & 0x0000FFFF);
4187 const uint32_t hi ((inRegValue >> 16) & 0xFFFF);
4191 case 1: oss <<
"Component 0 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4192 <<
"Component 1 input offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4194 case 2: oss <<
"Component 2 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4196 case 12: oss <<
"Component A output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4197 <<
"Component B output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4199 case 13: oss <<
"Component C output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4201 case 15: oss <<
"Key input offset: " << S13Dot2ToFloat(lo) <<
" (12-bit), " << S11Dot4ToFloat(lo) <<
" (10-bit)" << endl
4202 <<
"Key output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4208 } mEnhCSCOffsetDecoder;
4210 struct DecodeEnhancedCSCKeyMode :
public Decoder
4212 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4216 static const string sSrcSel[] = {
"Key Input",
"Video Y Input"};
4217 static const string sRange[] = {
"Full Range",
"SMPTE Range"};
4218 const uint32_t keySrcSelect (inRegValue & 0x1);
4219 const uint32_t keyOutRange ((inRegValue >> 4) & 0x1);
4221 oss <<
"Key Source Select: " << sSrcSel[keySrcSelect] << endl
4222 <<
"Key Output Range: " << sRange[keyOutRange];
4225 } mEnhCSCKeyModeDecoder;
4227 struct DecodeEnhancedCSCCoefficient :
public Decoder
4229 static string S2Dot15ToFloat (
const uint32_t inCoefficient)
4231 double result = (double((inCoefficient >> 15) & 0x3));
4232 result += double(inCoefficient & 0x7FFF) / 32768.0;
4233 if (inCoefficient &
BIT(17))
4235 ostringstream oss; oss <<
fDEC(result,12,10);
string resultStr(oss.str());
4238 static string S12Dot12ToFloat (
const uint32_t inCoefficient)
4240 double result(
double((inCoefficient >> 12) & 0xFFF));
4241 result += double(inCoefficient & 0xFFF) / 4096.0;
4242 if (inCoefficient &
BIT(24))
4244 ostringstream oss; oss <<
fDEC(result,12,6);
string resultStr(oss.str());
4247 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4250 uint32_t regNum (inRegNum & 0x1F);
4252 if (regNum > 2 && regNum < 12)
4255 static const string sCoeffNames[] = {
"A0",
"A1",
"A2",
"B0",
"B1",
"B2",
"C0",
"C1",
"C2"};
4256 const uint32_t coeff ((inRegValue >> 9) & 0x0003FFFF);
4257 oss << sCoeffNames[regNum] <<
" coefficient: " << S2Dot15ToFloat(coeff) <<
" (" <<
xHEX0N(coeff,8) <<
")";
4259 else if (regNum == 16)
4261 const uint32_t gain ((inRegValue >> 4) & 0x01FFFFFF);
4262 oss <<
"Key gain: " << S12Dot12ToFloat(gain) <<
" (" <<
HEX0N(gain,8) <<
")";
4266 } mEnhCSCCoeffDecoder;
4268 struct DecodeCSCoeff1234 :
public Decoder
4270 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4273 const uint32_t coeff1 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4274 const uint32_t coeff2 ((inRegValue >> 14) & 0x00001FFF);
4275 uint16_t nCoeff1(1), nCoeff2(2);
4280 nCoeff1 = 3; nCoeff2 = 4;
break;
4296 oss <<
"Video Key Sync Status: " << (inRegValue &
BIT(28) ?
"SyncFail" :
"OK") << endl
4297 <<
"Make Alpha From Key Input: " <<
EnabDisab(inRegValue &
BIT(29)) << endl
4298 <<
"Matrix Select: " << (inRegValue &
BIT(30) ?
"Rec601" :
"Rec709") << endl
4299 <<
"Use Custom Coeffs: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4301 oss <<
"RGB Range: " << (inRegValue &
BIT(31) ?
"SMPTE (0x040-0x3C0)" :
"Full (0x000-0x3FF)") << endl;
4302 oss <<
"Coefficient" <<
DEC(nCoeff1) <<
": " <<
xHEX0N(coeff1, 4) << endl
4303 <<
"Coefficient" <<
DEC(nCoeff2) <<
": " <<
xHEX0N(coeff2, 4);
4306 } mCSCoeff1234Decoder;
4308 struct DecodeCSCoeff567890 :
public Decoder
4310 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4313 const uint32_t coeff5 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4314 const uint32_t coeff6 ((inRegValue >> 14) & 0x00001FFF);
4315 uint16_t nCoeff5(5), nCoeff6(6);
4320 nCoeff5 = 7; nCoeff6 = 8;
break;
4323 nCoeff5 = 9; nCoeff6 = 10;
break;
4333 oss <<
"Coefficient" <<
DEC(nCoeff5) <<
": " <<
xHEX0N(coeff5, 4) << endl
4334 <<
"Coefficient" <<
DEC(nCoeff6) <<
": " <<
xHEX0N(coeff6, 4);
4337 } mCSCoeff567890Decoder;
4339 struct DecodeLUTV1ControlReg :
public Decoder
4341 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4342 {
static const string sModes[] = {
"Off",
"RGB",
"YCbCr",
"3-Way",
"Invalid"};
4355 if (lutVersion != 1)
4356 oss <<
"(Register data relevant for V1 LUT, this device has V" <<
DEC(lutVersion) <<
" LUT)";
4359 oss <<
"LUT Saturation Value: " <<
xHEX0N(saturation,4) <<
" (" <<
DEC(saturation) <<
")" << endl
4360 <<
"LUT Output Bank Select: " <<
SetNotset(outBankSelect) << endl
4361 <<
"LUT Mode: " << sModes[mode] <<
" (" <<
DEC(mode) <<
")";
4364 <<
"LUT5 Host Bank Select: " <<
SetNotset(cc5HostBank) << endl
4365 <<
"LUT5 Output Bank Select: " <<
SetNotset(cc5OutputBank) << endl
4366 <<
"LUT5 Select: " <<
SetNotset(cc5Select) << endl
4367 <<
"Config 2nd LUT Set: " <<
YesNo(ccConfig2);
4370 <<
"LUT3 Bank Select: " <<
SetNotset(cc3BankSel) << endl
4371 <<
"LUT4 Bank Select: " <<
SetNotset(cc4BankSel);
4374 } mLUTV1ControlRegDecoder;
4376 struct DecodeLUTV2ControlReg :
public Decoder
4378 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4382 if (lutVersion != 2)
4383 oss <<
"(Register data relevant for V2 LUT, this device has V" <<
DEC(lutVersion) <<
"LUT)";
4386 for (
UWord lutNum(0); lutNum < 8; lutNum++)
4387 oss <<
"LUT" <<
DEC(lutNum+1) <<
" Enabled: " << (
YesNo(inRegValue & (1<<lutNum))) << endl
4388 <<
"LUT" <<
DEC(lutNum+1) <<
" Host Access Bank Select: " << (inRegValue & (1<<(lutNum+8)) ?
'1' :
'0') << endl
4389 <<
"LUT" <<
DEC(lutNum+1) <<
" Output Bank Select: " << (inRegValue & (1<<(lutNum+16)) ?
'1' :
'0') << endl;
4390 oss <<
"12-Bit LUT mode: " << ((inRegValue &
BIT(28)) ?
"12-bit" :
"10-bit") << endl
4391 <<
"12-Bit LUT page reg: " <<
DEC(
UWord((inRegValue & (
BIT(24)|
BIT(25))) >> 24));
4395 } mLUTV2ControlRegDecoder;
4397 struct DecodeLUT :
public Decoder
4399 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4403 const bool isRed(inRegNum >= RedReg && inRegNum < GreenReg), isGreen(inRegNum >= GreenReg && inRegNum < BlueReg), isBlue(inRegNum>=BlueReg);
4409 const string label(isRed ?
"Red[" : (isGreen ?
"Green[" :
"Blue["));
4410 const ULWord ndx((inRegNum - (isRed ? RedReg : (isGreen ? GreenReg : BlueReg))) * 2);
4413 oss << label <<
DEC0N(ndx+0,3) <<
"]: " <<
DEC0N(lo,3) << endl
4414 << label <<
DEC0N(ndx+1,3) <<
"]: " <<
DEC0N(hi,3);
4419 struct DecodeSDIErrorStatus :
public Decoder
4421 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4427 oss <<
"Unlock Tally: " <<
DEC(inRegValue & 0x7FFF) << endl
4428 <<
"Locked: " <<
YesNo(inRegValue &
BIT(16)) << endl
4429 <<
"Link A VPID Valid: " <<
YesNo(inRegValue &
BIT(20)) << endl
4430 <<
"Link B VPID Valid: " <<
YesNo(inRegValue &
BIT(21)) << endl
4431 <<
"TRS Error Detected: " <<
YesNo(inRegValue &
BIT(24));
4434 } mSDIErrorStatusRegDecoder;
4436 struct DecodeSDIErrorCount :
public Decoder
4438 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4444 oss <<
"Link A: " <<
DEC(inRegValue & 0x0000FFFF) << endl
4445 <<
"Link B: " <<
DEC((inRegValue & 0xFFFF0000) >> 16);
4448 } mSDIErrorCountRegDecoder;
4450 struct DecodeDriverVersion :
public Decoder
4452 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4453 { (
void) inDeviceID;
4457 ULWord buildType((inRegValue >> 30) & 0x00000003);
4458 static const string sBuildTypes[] = {
"Release",
"Beta",
"Alpha",
"Development"};
4459 static const string sBldTypes[] = {
"",
"b",
"a",
"d"};
4461 oss <<
"Driver Version: " <<
DEC(vMaj) <<
"." <<
DEC(vMin) <<
"." <<
DEC(vDot);
4462 if (buildType) oss << sBldTypes[buildType] <<
DEC(vBld);
4464 <<
"Major Version: " <<
DEC(vMaj) << endl
4465 <<
"Minor Version: " <<
DEC(vMin) << endl
4466 <<
"Point Version: " <<
DEC(vDot) << endl
4467 <<
"Build Type: " << sBuildTypes[buildType] << endl
4468 <<
"Build Number: " <<
DEC(vBld);
4471 } mDriverVersionDecoder;
4473 struct DecodeFourCC :
public Decoder
4475 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4476 { (
void) inDeviceID; (
void) inRegNum;
4477 char ch;
string str4cc;
4478 ch = char((inRegValue & 0xFF000000) >> 24);
4479 str4cc += ::isprint(ch) ? ch :
'?';
4480 ch = char((inRegValue & 0x00FF0000) >> 16);
4481 str4cc += ::isprint(ch) ? ch :
'?';
4482 ch = char((inRegValue & 0x0000FF00) >> 8);
4483 str4cc += ::isprint(ch) ? ch :
'?';
4484 ch = char((inRegValue & 0x000000FF) >> 0);
4485 str4cc += ::isprint(ch) ? ch :
'?';
4488 oss <<
"'" << str4cc <<
"'";
4493 struct DecodeDriverType :
public Decoder
4495 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4496 { (
void) inDeviceID; (
void) inRegNum;
4499 if (inRegValue == 0x44455854)
4500 oss <<
"DriverKit ('DEXT')";
4501 else if (inRegValue)
4502 oss <<
"(Unknown/Invalid " <<
xHEX0N(inRegValue,8) <<
")";
4504 oss <<
"Kernel Extension ('KEXT')";
4511 } mDecodeDriverType;
4513 struct DecodeIDSwitchStatus :
public Decoder
4515 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4520 const uint32_t switchEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
4521 for (
UWord idSwitch(0); idSwitch < 4; )
4523 const uint32_t switchEnabled (switchEnableBits &
BIT(idSwitch));
4524 oss <<
"Switch " <<
DEC(++idSwitch) <<
": " << (switchEnabled ?
"Enabled" :
"Disabled");
4531 oss <<
"(ID Switch not supported)";
4536 } mDecodeIDSwitchStatus;
4538 struct DecodePWMFanControl :
public Decoder
4540 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4548 } mDecodePWMFanControl;
4550 struct DecodePWMFanMonitor :
public Decoder
4552 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4560 } mDecodePWMFanMonitor;
4562 struct DecodeBOBStatus :
public Decoder
4564 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4568 oss <<
"Break Out Board: " << ((inRegValue &
kRegMaskBOBAbsent) ?
"Disconnected" :
"Connected") << endl
4572 oss <<
"Device does not support a breakout board";
4577 struct DecodeBOBGPIIn :
public Decoder
4579 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4588 oss <<
"Device does not support a breakout board";
4593 struct DecodeBOBGPIInInterruptControl :
public Decoder
4595 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4604 oss <<
"Device does not support a breakout board";
4607 } mDecodeBOBGPIInInterruptControl;
4609 struct DecodeBOBGPIOut :
public Decoder
4611 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4620 oss <<
"Device does not support a breakout board";
4625 struct DecodeBOBAudioControl :
public Decoder
4627 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4636 dBuLabel =
"+24dBu";
4639 dBuLabel =
"+18dBu";
4642 dBuLabel =
"+12dBu";
4645 dBuLabel =
"+15dBu";
4650 <<
"Analog Level Control: " << dBuLabel << endl
4654 oss <<
"Device does not support a breakout board";
4657 } mDecodeBOBAudioControl;
4659 struct DecodeLEDControl :
public Decoder
4661 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4669 oss <<
"Device does not support a breakout board";
4672 } mDecodeLEDControl;
4674 static const int NOREADWRITE = 0;
4675 static const int READONLY = 1;
4676 static const int WRITEONLY = 2;
4677 static const int READWRITE = 3;
4679 static const int CONTAINS = 0;
4680 static const int STARTSWITH = 1;
4681 static const int ENDSWITH = 2;
4682 static const int EXACTMATCH = 3;
4684 typedef map <uint32_t, const Decoder *> RegNumToDecoderMap;
4685 typedef pair <uint32_t, const Decoder *> RegNumToDecoderPair;
4686 typedef multimap <string, uint32_t> RegClassToRegNumMMap, StringToRegNumMMap;
4687 typedef pair <string, uint32_t> StringToRegNumPair;
4688 typedef RegClassToRegNumMMap::const_iterator RegClassToRegNumConstIter;
4689 typedef StringToRegNumMMap::const_iterator StringToRegNumConstIter;
4691 typedef pair <uint32_t, uint32_t> XptRegNumAndMaskIndex;
4692 typedef map <NTV2InputCrosspointID, XptRegNumAndMaskIndex> InputXpt2XptRegNumMaskIndexMap;
4693 typedef map <XptRegNumAndMaskIndex, NTV2InputCrosspointID> XptRegNumMaskIndex2InputXptMap;
4694 typedef InputXpt2XptRegNumMaskIndexMap::const_iterator InputXpt2XptRegNumMaskIndexMapConstIter;
4695 typedef XptRegNumMaskIndex2InputXptMap::const_iterator XptRegNumMaskIndex2InputXptMapConstIter;
4699 RegNumToStringMap mRegNumToStringMap;
4700 RegNumToDecoderMap mRegNumToDecoderMap;
4701 RegClassToRegNumMMap mRegClassToRegNumMMap;
4702 StringToRegNumMMap mStringToRegNumMMap;
4704 InputXpt2XptRegNumMaskIndexMap mInputXpt2XptRegNumMaskIndexMap;
4705 XptRegNumMaskIndex2InputXptMap mXptRegNumMaskIndex2InputXptMap;
4735 return pInst ?
true :
false;
4742 return pInst ?
true :
false;
4749 return pInst ? pInst->DisposeInstance() :
false;
4757 return pRegExpert->RegNameToString(inRegNum);
4759 ostringstream oss; oss <<
"Reg ";
4761 oss <<
DEC(inRegNum);
4762 else if (inRegNum <= 0x0000FFFF)
4763 oss <<
xHEX0N(inRegNum,4);
4765 oss <<
xHEX0N(inRegNum,8);
4773 return pRegExpert ? pRegExpert->RegValueToString(inRegNum, inRegValue, inDeviceID) : string();
4780 return pRegExpert ? pRegExpert->IsRegInClass(inRegNum, inClassName) :
false;
4787 return pRegExpert ? pRegExpert->GetAllRegisterClasses() :
NTV2StringSet();
4794 return pRegExpert ? pRegExpert->GetRegisterClasses(inRegNum, inRemovePrefix) :
NTV2StringSet();
4801 return pRegExpert ? pRegExpert->GetRegistersForClass(inClassName) :
NTV2RegNumSet();
4815 return pRegExpert ? pRegExpert->GetRegistersForDevice(inDeviceID, inOtherRegsToInclude) :
NTV2RegNumSet();
4822 return pRegExpert ? pRegExpert->GetRegistersWithName(inName, inSearchStyle) :
NTV2RegNumSet();
4836 return pRegExpert ? pRegExpert->GetXptRegNumAndMaskIndex(inInputXpt, outXptRegNum, outMaskIndex) :
false;