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)
1027 void SetupSDIErrorRegs(
void)
1030 static const string suffixes [] = {
"Status",
"CRCErrorCount",
"FrameCountLow",
"FrameCountHigh",
"FrameRefCountLow",
"FrameRefCountHigh"};
1031 static const int perms [] = {READWRITE, READWRITE, READWRITE, READWRITE, READONLY, READONLY};
1034 for (
ULWord chan (0); chan < 8; chan++)
1035 for (
UWord ndx(0); ndx < 6; ndx++)
1037 ostringstream ossName; ossName <<
"kRegRXSDI" <<
DEC(chan+1) << suffixes[ndx];
1038 const string & regName (ossName.str());
1039 const uint32_t regNum (baseNum[chan] + ndx);
1040 const int perm (perms[ndx]);
1052 void SetupLUTRegs (
void)
1057 void SetupCSCRegs(
void)
1062 for (
unsigned num(0); num < 8; num++)
1064 ostringstream ossRegName; ossRegName <<
"kRegEnhancedCSC" << (num+1);
1065 const string & chanClass (sChan[num]);
const string rootName (ossRegName.str());
1066 const string modeName (rootName +
"Mode");
const string inOff01Name (rootName +
"InOffset0_1");
const string inOff2Name (rootName +
"InOffset2");
1067 const string coeffA0Name (rootName +
"CoeffA0");
const string coeffA1Name (rootName +
"CoeffA1");
const string coeffA2Name (rootName +
"CoeffA2");
1068 const string coeffB0Name (rootName +
"CoeffB0");
const string coeffB1Name (rootName +
"CoeffB1");
const string coeffB2Name (rootName +
"CoeffB2");
1069 const string coeffC0Name (rootName +
"CoeffC0");
const string coeffC1Name (rootName +
"CoeffC1");
const string coeffC2Name (rootName +
"CoeffC2");
1070 const string outOffABName(rootName +
"OutOffsetA_B");
const string outOffCName (rootName +
"OutOffsetC");
1071 const string keyModeName (rootName +
"KeyMode");
const string keyClipOffName (rootName +
"KeyClipOffset");
const string keyGainName (rootName +
"KeyGain");
1098 for (
unsigned chan(0); chan < 8; chan++)
1100 const string & chanClass (sChan[chan]);
1113 #if 1 // V2 tables need the appropriate Enable & Bank bits set in kRegLUTV2Control, otherwise they'll always readback zero!
1116 for (
ULWord ndx(0); ndx < 512; ndx++)
1118 ostringstream regNameR, regNameG, regNameB;
1119 regNameR <<
"kRegLUTRed" <<
DEC0N(ndx,3); regNameG <<
"kRegLUTGreen" <<
DEC0N(ndx,3); regNameB <<
"kRegLUTBlue" <<
DEC0N(ndx,3);
1127 void SetupMixerKeyerRegs(
void)
1146 void SetupNTV4FrameStoreRegs(
void)
1148 for (
ULWord fsNdx(0); fsNdx < 4; fsNdx++)
1152 ostringstream regName; regName <<
"kRegNTV4FS" <<
DEC(fsNdx+1) <<
"_";
1183 regName <<
"InputSourceSelect";
1187 regName <<
DEC(regNdx);
1195 void SetupVRegs(
void)
1719 for (
ULWord ndx(1); ndx < 1024; ndx++)
1721 ostringstream oss; oss <<
"VIRTUALREG_START+" << ndx;
1722 const string regName (oss.str());
1724 if (mRegNumToStringMap.find(regNum) == mRegNumToStringMap.end())
1726 mRegNumToStringMap.insert (RegNumToStringPair(regNum, regName));
1727 mStringToRegNumMMap.insert (StringToRegNumPair(ToLower(regName), regNum));
1729 DefineRegDecoder (regNum, mDefaultRegDecoder);
1730 DefineRegReadWrite (regNum, READWRITE);
1745 const string & label (it->first);
1746 const string & value (it->second);
1749 else if (label.at(label.length()-1) !=
' ' && label.at(label.length()-1) !=
':')
1750 oss << label <<
": " << value;
1751 else if (label.at(label.length()-1) ==
':')
1752 oss << label <<
" " << value;
1754 oss << label << value;
1755 if (++it != inLabelValuePairs.end())
1764 RegNumToStringMap::const_iterator iter (mRegNumToStringMap.find (inRegNum));
1765 if (iter != mRegNumToStringMap.end())
1766 return iter->second;
1768 ostringstream oss; oss <<
"Reg ";
1770 oss <<
DEC(inRegNum);
1771 else if (inRegNum <= 0x0000FFFF)
1772 oss <<
xHEX0N(inRegNum,4);
1774 oss <<
xHEX0N(inRegNum,8);
1781 RegNumToDecoderMap::const_iterator iter(mRegNumToDecoderMap.find(inRegNum));
1783 if (iter != mRegNumToDecoderMap.end() && iter->second)
1785 const Decoder * pDecoder (iter->second);
1786 oss << (*pDecoder)(inRegNum, inRegValue, inDeviceID);
1791 bool IsRegInClass (
const uint32_t inRegNum,
const string & inClassName)
const
1794 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1795 if (it->second == inRegNum)
1806 if (mAllRegClasses.empty())
1807 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1808 if (mAllRegClasses.find(it->first) == mAllRegClasses.end())
1809 mAllRegClasses.insert(it->first);
1810 return mAllRegClasses;
1819 if (IsRegInClass (inRegNum, *it))
1824 if (result.find(str) == result.end())
1834 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1835 if (result.find(it->second) == result.end())
1836 result.insert(it->second);
1845 for (uint32_t regNum (0); regNum <= maxRegNum; regNum++)
1846 result.insert(regNum);
1855 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1857 for (
UWord num(0); num < numSpigots; num++)
1860 allChanRegs.insert(chRegs.begin(), chRegs.end());
1862 std::set_intersection (ancRegs.begin(), ancRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1870 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1872 for (
UWord num(0); num < numSpigots; num++)
1875 allChanRegs.insert(chRegs.begin(), chRegs.end());
1877 std::set_intersection (auxRegs.begin(), auxRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1883 result.insert(sdiErrRegs.begin(), sdiErrRegs.end());
1889 result.insert(regNum);
1891 result.insert(regNum);
1903 for (
UWord num(0); num < numCSCs; num++)
1906 allChanRegs.insert(chRegs.begin(), chRegs.end());
1908 std::set_intersection (ecscRegs.begin(), ecscRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1914 result.insert(LUTRegs.begin(), LUTRegs.end());
1919 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1920 result.insert(regNum);
1921 for (
ULWord regNum = 0x2500; regNum <= 0x251f; regNum++)
1922 result.insert(regNum);
1923 for (
ULWord regNum = 0x2c00; regNum <= 0x2c1f; regNum++)
1924 result.insert(regNum);
1925 for (
ULWord regNum = 0x3000; regNum <= 0x301f; regNum++)
1926 result.insert(regNum);
1930 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1931 result.insert(regNum);
1932 for (
ULWord regNum = 0x1d40; regNum <= 0x1d5f; regNum++)
1933 result.insert(regNum);
1934 for (
ULWord regNum = 0x3C00; regNum <= 0x3C0A; regNum++)
1935 result.insert(regNum);
1953 for (
UWord num(0); num < numFrameStores; num++)
1956 chanRegs.insert(chRegs.begin(), chRegs.end());
1958 std::set_intersection (ntv4FSRegs.begin(), ntv4FSRegs.end(), chanRegs.begin(), chanRegs.end(), std::inserter(result, result.begin()));
2006 result.insert(vRegs.begin(), vRegs.end());
2012 result.insert(xptMapRegs.begin(), xptMapRegs.end());
2021 string nameStr(inName);
2022 const size_t nameStrLen(
aja::lower(nameStr).length());
2023 StringToRegNumConstIter it;
2025 if (inMatchStyle == EXACTMATCH)
2027 it = mStringToRegNumMMap.find(nameStr);
2028 if (it != mStringToRegNumMMap.end())
2029 result.insert(it->second);
2033 for (it = mStringToRegNumMMap.begin(); it != mStringToRegNumMMap.end(); ++it)
2035 const size_t pos(it->first.find(nameStr));
2036 if (pos == string::npos)
2038 switch (inMatchStyle)
2040 case CONTAINS: result.insert(it->second);
break;
2041 case STARTSWITH:
if (pos == 0)
2042 {result.insert(it->second);}
2044 case ENDSWITH:
if (pos+nameStrLen == it->first.length())
2045 {result.insert(it->second);}
2056 outXptRegNum = 0xFFFFFFFF;
2057 outMaskIndex = 0xFFFFFFFF;
2058 InputXpt2XptRegNumMaskIndexMapConstIter iter (mInputXpt2XptRegNumMaskIndexMap.find (inInputXpt));
2059 if (iter == mInputXpt2XptRegNumMaskIndexMap.end())
2061 outXptRegNum = iter->second.first;
2062 outMaskIndex = iter->second.second;
2069 const XptRegNumAndMaskIndex key (inXptRegNum, inMaskIndex);
2070 XptRegNumMaskIndex2InputXptMapConstIter iter (mXptRegNumMaskIndex2InputXptMap.find (key));
2071 if (iter != mXptRegNumMaskIndex2InputXptMap.end())
2072 return iter->second;
2076 ostream &
Print (ostream & inOutStream)
const
2079 static const string sLineBreak (96,
'=');
2080 static const uint32_t
sMasks[4] = {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000};
2082 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToStringMap: " << mRegNumToStringMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2083 for (RegNumToStringMap::const_iterator it (mRegNumToStringMap.begin()); it != mRegNumToStringMap.end(); ++it)
2084 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => '" << it->second <<
"'" << endl;
2086 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToDecoderMap: " << mRegNumToDecoderMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2087 for (RegNumToDecoderMap::const_iterator it (mRegNumToDecoderMap.begin()); it != mRegNumToDecoderMap.end(); ++it)
2088 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => " << (it->second == &mDefaultRegDecoder ?
"(default decoder)" :
"Custom Decoder") << endl;
2090 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegClassToRegNumMMap: " << mRegClassToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2091 for (RegClassToRegNumMMap::const_iterator it (mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
2092 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2094 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of StringToRegNumMMap: " << mStringToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2095 for (StringToRegNumMMap::const_iterator it (mStringToRegNumMMap.begin()); it != mStringToRegNumMMap.end(); ++it)
2096 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2098 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of InputXpt2XptRegNumMaskIndexMap: " << mInputXpt2XptRegNumMaskIndexMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2099 for (InputXpt2XptRegNumMaskIndexMap::const_iterator it (mInputXpt2XptRegNumMaskIndexMap.begin()); it != mInputXpt2XptRegNumMaskIndexMap.end(); ++it)
2101 <<
") => reg " << setw(3) << it->second.first <<
"(" <<
HEX0N(it->second.first,3) << dec <<
"|" << setw(20) << RegNameToString(it->second.first)
2102 <<
") mask " << it->second.second <<
"(" <<
HEX0N(
sMasks[it->second.second],8) <<
")" << endl;
2104 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of XptRegNumMaskIndex2InputXptMap: " << mXptRegNumMaskIndex2InputXptMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2105 for (XptRegNumMaskIndex2InputXptMap::const_iterator it (mXptRegNumMaskIndex2InputXptMap.begin()); it != mXptRegNumMaskIndex2InputXptMap.end(); ++it)
2106 inOutStream <<
"reg " << setw(3) << it->first.first <<
"(" <<
HEX0N(it->first.first,4) <<
"|" << setw(20) << RegNameToString(it->first.first)
2107 <<
") mask " << it->first.second <<
"(" <<
HEX0N(
sMasks[it->first.second],8) <<
") => "
2113 typedef std::map<uint32_t, string> RegNumToStringMap;
2114 typedef std::pair<uint32_t, string> RegNumToStringPair;
2116 static string ToLower (
const string & inStr)
2118 string result (inStr);
2119 std::transform (result.begin (), result.end (), result.begin (), ::tolower);
2123 struct DecodeGlobalControlReg :
public Decoder
2125 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2142 for (
int led(0); led < 4; ++led)
2143 oss << (((inRegValue &
kRegMaskLED) >> (16 + led)) ?
"*" :
".");
2148 <<
"Color Correction: " <<
"Channel: " << ((inRegValue &
BIT(31)) ?
"2" :
"1")
2149 <<
" Bank " << ((inRegValue &
BIT (30)) ?
"1" :
"0");
2152 } mDecodeGlobalControlReg;
2155 struct DecodeGlobalControl2 :
public Decoder
2157 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2174 for (
unsigned ch(0); ch < 8; ch++)
2175 oss <<
"Audio " <<
DEC(ch+1) <<
" Play/Capture Mode: " <<
OnOff(inRegValue & playCaptModes[ch]) << endl;
2176 for (
unsigned ch(2); ch < 8; ch++)
2177 oss <<
"Ch " <<
DEC(ch+1) <<
" RP188 Output: " <<
EnabDisab(inRegValue & rp188Modes[ch]) << endl;
2178 for (
unsigned ch(0); ch < 3; ch++)
2179 oss <<
"Ch " <<
DEC(2*(ch+2)) <<
" 1080p50/p60 Link-B Mode: " <<
EnabDisab(inRegValue & BLinkModes[ch]) << endl;
2180 for (
unsigned ch(0); ch < 4; ch++)
2181 oss <<
"Ch " <<
DEC(ch+1) <<
"/" <<
DEC(ch+2) <<
" 2SI Mode: " <<
EnabDisab(inRegValue & k425Masks[ch]) << endl;
2182 oss <<
"2SI Min Align Delay 1-4: " <<
EnabDisab(inRegValue &
BIT(24)) << endl
2183 <<
"2SI Min Align Delay 5-8: " <<
EnabDisab(inRegValue &
BIT(25));
2186 } mDecodeGlobalControl2;
2189 struct DecodeGlobalControl3 :
public Decoder
2191 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2198 <<
"VU Meter Audio Select: " << (inRegValue &
kRegMaskVUMeterSelect ?
"AudMixer" :
"AudSys1") << endl
2208 } mDecodeGlobalControl3;
2211 struct DecodeGlobalControlChanReg :
public Decoder
2213 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2226 } mDecodeGlobalControlChanRegs;
2229 struct DecodeChannelControlReg :
public Decoder
2231 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2238 oss <<
"Mode: " << (inRegValue &
kRegMaskMode ?
"Capture" :
"Display") << endl
2241 <<
"Viper Squeeze: " << (inRegValue &
BIT(9) ?
"Squeeze" :
"Normal") << endl
2246 <<
"Frame Size: " << (1 << (((inRegValue &
kK2RegMaskFrameSize) >> 20) + 1)) <<
" MB" << endl;
2249 oss <<
"RGB Range: " << (inRegValue &
BIT(24) ?
"Black = 0x40" :
"Black = 0") << endl
2253 } mDecodeChannelControl;
2255 struct DecodeFBControlReg :
public Decoder
2257 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2261 const bool isOn ((inRegValue & (1 << 29)) != 0);
2262 const uint16_t format ((inRegValue >> 15) & 0x1F);
2264 oss <<
OnOff(isOn) << endl
2265 <<
"Format: " <<
xHEX0N(format,4) <<
" (" <<
DEC(format) <<
")";
2268 } mDecodeFBControlReg;
2270 struct DecodeChannelControlExtReg :
public Decoder
2272 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2277 oss <<
"Input Video 2:1 Decimate: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
2278 <<
"HDMI Rx Direct: " <<
EnabDisab(inRegValue &
BIT(1)) << endl
2279 <<
"3:2 Pulldown Mode: " <<
EnabDisab(inRegValue &
BIT(2));
2282 } mDecodeChannelControlExt;
2284 struct DecodeSysmonVccIntDieTemp :
public Decoder
2286 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2290 UWord rawDieTemp (0);
2291 double dieTempC (0);
2294 rawDieTemp = (inRegValue & 0x0000FFFF);
2295 dieTempC = double(rawDieTemp) / 128.0;
2299 rawDieTemp = ((inRegValue & 0x0000FFFF) >> 6);
2300 dieTempC = ((double(rawDieTemp)) * 503.975 / 1024.0 - 273.15 );
2302 const UWord rawVoltage ((inRegValue >> 22) & 0x3FF);
2303 const double dieTempF (dieTempC * 9.0 / 5.0 + 32.0);
2304 const double voltage (
double(rawVoltage)/ 1024.0 * 3.0);
2306 oss <<
"Die Temperature: " <<
fDEC(dieTempC,5,2) <<
" Celcius (" <<
fDEC(dieTempF,5,2) <<
" Fahrenheit)" << endl
2307 <<
"Core Voltage: " <<
fDEC(voltage,5,2) <<
" Volts DC";
2310 } mDecodeSysmonVccIntDieTemp;
2312 struct DecodeSDITransmitCtrl :
public Decoder
2314 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2319 const UWord numSpigots (numInputs > numOutputs ? numInputs : numOutputs);
2323 const uint32_t txEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
2325 for (
UWord spigot(0); spigot < numSpigots; )
2327 const uint32_t txEnabled (txEnableBits &
BIT(spigot));
2328 oss <<
"SDI " <<
DEC(++spigot) <<
": " << (txEnabled ?
"Output/Transmit" :
"Input/Receive");
2329 if (spigot < numSpigots)
2333 oss <<
"(No SDI inputs or outputs)";
2336 oss <<
"(Bi-directional SDI not supported)";
2340 } mDecodeSDITransmitCtrl;
2342 struct DecodeConversionCtrl :
public Decoder
2344 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2350 oss <<
"Bitfile ID: " <<
xHEX0N(bitfileID, 2) << endl
2351 <<
"Memory Test: Start: " <<
YesNo(inRegValue &
BIT(28)) << endl
2352 <<
"Memory Test: Done: " <<
YesNo(inRegValue &
BIT(29)) << endl
2353 <<
"Memory Test: Passed: " <<
YesNo(inRegValue &
BIT(30));
2372 <<
"Vert Filter Preload: " <<
DisabEnab(inRegValue &
BIT(7)) << endl
2379 } mConvControlRegDecoder;
2381 struct DecodeRelayCtrlStat :
public Decoder
2383 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2398 oss <<
"(SDI bypass relays not supported)";
2401 } mDecodeRelayCtrlStat;
2403 struct DecodeWatchdogTimeout :
public Decoder
2405 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2411 const uint32_t ticks8nanos (inRegValue);
2412 const double microsecs (
double(ticks8nanos) * 8.0 / 1000.0);
2413 const double millisecs (microsecs / 1000.0);
2414 oss <<
"Watchdog Timeout [8-ns ticks]: " <<
xHEX0N(ticks8nanos,8) <<
" (" <<
DEC(ticks8nanos) <<
")" << endl
2415 <<
"Watchdog Timeout [usec]: " << microsecs << endl
2416 <<
"Watchdog Timeout [msec]: " << millisecs;
2419 oss <<
"(SDI bypass relays not supported)";
2422 } mDecodeWatchdogTimeout;
2424 struct DecodeWatchdogKick :
public Decoder
2426 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2434 const uint32_t expectedValue(whichReg ? 0x01234567 : 0xA5A55A5A);
2435 oss <<
xHEX0N(inRegValue,8);
2436 if (inRegValue == expectedValue)
2439 oss <<
" (Not expected, should be " <<
xHEX0N(expectedValue,8) <<
")";
2442 oss <<
"(SDI bypass relays not supported)";
2445 } mDecodeWatchdogKick;
2447 struct DecodeInputVPID:
public Decoder
2449 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2457 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2460 } mVPIDInpRegDecoder;
2462 struct DecodeOutputVPID:
public Decoder
2464 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2471 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2474 } mVPIDOutRegDecoder;
2476 struct DecodeBitfileDateTime :
public Decoder
2478 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2484 const UWord yyyy ((inRegValue & 0xFFFF0000) >> 16);
2485 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2486 const UWord dd (inRegValue & 0x000000FF);
2487 if (yyyy > 0x2015 && mm > 0 && mm < 0x13 && dd > 0 && dd < 0x32)
2488 oss <<
"Bitfile Date: " <<
HEX0N(mm,2) <<
"/" <<
HEX0N(dd,2) <<
"/" <<
HEX0N(yyyy,4);
2490 oss <<
"Bitfile Date: " <<
xHEX0N(inRegValue, 8);
2494 const UWord hh ((inRegValue & 0x00FF0000) >> 16);
2495 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2496 const UWord ss (inRegValue & 0x000000FF);
2497 if (hh < 0x24 && mm < 0x60 && ss < 0x60)
2498 oss <<
"Bitfile Time: " <<
HEX0N(hh,2) <<
":" <<
HEX0N(mm,2) <<
":" <<
HEX0N(ss,2);
2500 oss <<
"Bitfile Time: " <<
xHEX0N(inRegValue, 8);
2505 } mDecodeBitfileDateTime;
2507 struct DecodeBoardID :
public Decoder
2509 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2510 { (
void) inRegNum; (
void) inDeviceID;
2515 <<
"Device Name: '" << str1 <<
"'";
2518 <<
"Retail Device Name: '" << str2 <<
"'";
2523 struct DecodeDynFWUpdateCounts :
public Decoder
2525 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2526 { (
void) inRegNum; (
void) inDeviceID;
2528 oss <<
"# attempts: " <<
DEC(inRegValue >> 16) << endl
2529 <<
"# successes: " <<
DEC(inRegValue & 0x0000FFFF);
2532 } mDecodeDynFWUpdateCounts;
2534 struct DecodeFWUserID :
public Decoder
2536 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2537 { (
void) inRegNum; (
void) inDeviceID;
2546 } mDecodeFirmwareUserID;
2548 struct DecodeCanDoStatus :
public Decoder
2550 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2551 { (
void) inRegNum; (
void) inDeviceID;
2553 oss <<
"Has CanConnect Xpt Route ROM: " <<
YesNo(inRegValue &
BIT(0)) << endl
2554 <<
"AudioSystems can start on VBI: " <<
YesNo(inRegValue &
BIT(1));
2557 } mDecodeCanDoStatus;
2559 struct DecodeVidControlReg :
public Decoder
2561 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2565 const bool is16x9 ((inRegValue &
BIT(31)) != 0);
2566 const bool isMono ((inRegValue &
BIT(30)) != 0);
2568 oss <<
"Aspect Ratio: " << (is16x9 ?
"16x9" :
"4x3") << endl
2569 <<
"Depth: " << (isMono ?
"Monochrome" :
"Color");
2572 } mDecodeVidControlReg;
2574 struct DecodeVidIntControl :
public Decoder
2576 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2581 oss <<
"Output 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(0)) << endl
2582 <<
"Input 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2583 <<
"Input 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2584 <<
"Audio Out Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(4)) << endl
2585 <<
"Audio In Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(5)) << endl
2586 <<
"Wrap Rate Interrupt Enable: " <<
YesNo(inRegValue &
BIT(6)) << endl
2587 <<
"UART Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(7)) << endl
2588 <<
"UART Rx Interrupt Enable" <<
YesNo(inRegValue &
BIT(8)) << endl
2589 <<
"UART Rx Interrupt Clear" <<
ActInact(inRegValue &
BIT(15)) << endl
2590 <<
"UART 2 Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(17)) << endl
2591 <<
"Output 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(18)) << endl
2592 <<
"Output 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2593 <<
"Output 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(20)) << endl
2594 <<
"Output 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(21)) << endl
2595 <<
"Output 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(22)) << endl
2596 <<
"Output 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(23)) << endl
2597 <<
"UART Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(24)) << endl
2598 <<
"Wrap Rate Interrupt Clear" <<
ActInact(inRegValue &
BIT(25)) << endl
2599 <<
"UART 2 Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(26)) << endl
2600 <<
"Audio Out Wrap Interrupt Clear" <<
ActInact(inRegValue &
BIT(27)) << endl
2601 <<
"Input 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2602 <<
"Input 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30)) << endl
2603 <<
"Output 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(31));
2606 } mDecodeVidIntControl;
2608 struct DecodeVidIntControl2 :
public Decoder
2610 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2615 oss <<
"Input 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2616 <<
"Input 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2617 <<
"Input 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(8)) << endl
2618 <<
"Input 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(9)) << endl
2619 <<
"Input 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(10)) << endl
2620 <<
"Input 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(11)) << endl
2621 <<
"Output 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
2622 <<
"Output 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(13)) << endl
2623 <<
"Output 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(14)) << endl
2624 <<
"Output 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(15)) << endl
2625 <<
"Output 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(16)) << endl
2626 <<
"Output 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(17)) << endl
2627 <<
"Output 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(18)) << endl
2628 <<
"Output 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(19)) << endl
2629 <<
"Input 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(25)) << endl
2630 <<
"Input 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(26)) << endl
2631 <<
"Input 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(27)) << endl
2632 <<
"Input 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(28)) << endl
2633 <<
"Input 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2634 <<
"Input 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30));
2637 } mDecodeVidIntControl2;
2639 struct DecodeStatusReg :
public Decoder
2641 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2646 oss <<
"Input 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(20)) << endl
2647 <<
"Input 1 Field ID: " << (inRegValue &
BIT(21) ?
"1" :
"0") << endl
2648 <<
"Input 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(30)) << endl
2649 <<
"Input 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(18)) << endl
2650 <<
"Input 2 Field ID: " << (inRegValue &
BIT(19) ?
"1" :
"0") << endl
2651 <<
"Input 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(29)) << endl
2652 <<
"Output 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(22)) << endl
2653 <<
"Output 1 Field ID: " << (inRegValue &
BIT(23) ?
"1" :
"0") << endl
2654 <<
"Output 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(31)) << endl
2655 <<
"Output 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(4)) << endl
2656 <<
"Output 2 Field ID: " << (inRegValue &
BIT(5) ?
"1" :
"0") << endl
2657 <<
"Output 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(8)) << endl;
2659 oss <<
"Output 3 Vertical Blank: " <<
ActInact(inRegValue &
BIT(2)) << endl
2660 <<
"Output 3 Field ID: " << (inRegValue &
BIT(3) ?
"1" :
"0") << endl
2661 <<
"Output 3 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(7)) << endl
2662 <<
"Output 4 Vertical Blank: " <<
ActInact(inRegValue &
BIT(0)) << endl
2663 <<
"Output 4 Field ID: " << (inRegValue &
BIT(1) ?
"1" :
"0") << endl
2664 <<
"Output 4 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(6)) << endl;
2665 oss <<
"Aux Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(12)) << endl
2666 <<
"I2C 1 Interrupt: " <<
ActInact(inRegValue &
BIT(14)) << endl
2667 <<
"I2C 2 Interrupt: " <<
ActInact(inRegValue &
BIT(13)) << endl
2668 <<
"Chunk Rate Interrupt: " <<
ActInact(inRegValue &
BIT(16)) << endl;
2670 oss <<
"Generic UART Interrupt: " <<
ActInact(inRegValue &
BIT(9)) << endl
2671 <<
"Uart 1 Rx Interrupt: " <<
ActInact(inRegValue &
BIT(15)) << endl
2672 <<
"Uart 1 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(24)) << endl;
2674 oss <<
"Uart 2 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(26)) << endl;
2676 oss <<
"LTC In 1 Present: " <<
YesNo(inRegValue &
BIT(17)) << endl;
2677 oss <<
"Wrap Rate Interrupt: " <<
ActInact(inRegValue &
BIT(25)) << endl
2678 <<
"Audio Out Wrap Interrupt: " <<
ActInact(inRegValue &
BIT(27)) << endl
2679 <<
"Audio 50Hz Interrupt: " <<
ActInact(inRegValue &
BIT(28));
2684 struct DecodeCPLDVersion :
public Decoder
2686 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2691 oss <<
"CPLD Version: " <<
DEC(inRegValue & (
BIT(0)|
BIT(1))) << endl
2692 <<
"Failsafe Bitfile Loaded: " << (inRegValue &
BIT(4) ?
"Yes" :
"No") << endl
2693 <<
"Force Reload: " <<
YesNo(inRegValue &
BIT(8));
2696 } mDecodeCPLDVersion;
2698 struct DecodeStatus2Reg :
public Decoder
2700 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2704 static const uint8_t bitNumsInputVBlank[] = {20, 18, 16, 14, 12, 10};
2705 static const uint8_t bitNumsInputFieldID[] = {21, 19, 17, 15, 13, 11};
2706 static const uint8_t bitNumsInputVertInt[] = {30, 29, 28, 27, 26, 25};
2707 static const uint8_t bitNumsOutputVBlank[] = { 8, 6, 4, 2};
2708 static const uint8_t bitNumsOutputFieldID[] = { 9, 7, 5, 3};
2709 static const uint8_t bitNumsOutputVertInt[] = {31, 24, 23, 22};
2711 for (
unsigned ndx(0); ndx < 6; ndx++)
2712 oss <<
"Input " << (ndx+3) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsInputVBlank[ndx])) << endl
2713 <<
"Input " << (ndx+3) <<
" Field ID: " << (inRegValue &
BIT(bitNumsInputFieldID[ndx]) ?
"1" :
"0") << endl
2714 <<
"Input " << (ndx+3) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsInputVertInt[ndx])) << endl;
2715 for (
unsigned ndx(0); ndx < 4; ndx++)
2716 oss <<
"Output " << (ndx+5) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVBlank[ndx])) << endl
2717 <<
"Output " << (ndx+5) <<
" Field ID: " << (inRegValue &
BIT(bitNumsOutputFieldID[ndx]) ?
"1" :
"0") << endl
2718 <<
"Output " << (ndx+5) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVertInt[ndx])) << endl;
2719 oss <<
"HDMI In Hot-Plug Detect Interrupt: " <<
ActInact(inRegValue &
BIT(0)) << endl
2720 <<
"HDMI In Chip Interrupt: " <<
ActInact(inRegValue &
BIT(1));
2723 } mDecodeStatus2Reg;
2725 struct DecodeInputStatusReg :
public Decoder
2727 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2736 <<
"Input 1 Geometry: ";
2737 if (
BIT(30) & inRegValue)
2738 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2740 case 0: oss <<
"2K x 1080";
break;
2741 case 1: oss <<
"2K x 1556";
break;
2742 default: oss <<
"Invalid HI";
break;
2745 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2747 case 0: oss <<
"Unknown";
break;
2748 case 1: oss <<
"525";
break;
2749 case 2: oss <<
"625";
break;
2750 case 3: oss <<
"750";
break;
2751 case 4: oss <<
"1125";
break;
2752 case 5: oss <<
"1250";
break;
2753 case 6:
case 7: oss <<
"Reserved";
break;
2754 default: oss <<
"Invalid LO";
break;
2757 <<
"Input 1 Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2759 <<
"Input 2 Geometry: ";
2760 if (
BIT(31) & inRegValue)
2761 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2763 case 0: oss <<
"2K x 1080";
break;
2764 case 1: oss <<
"2K x 1556";
break;
2765 default: oss <<
"Invalid HI";
break;
2768 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2770 case 0: oss <<
"Unknown";
break;
2771 case 1: oss <<
"525";
break;
2772 case 2: oss <<
"625";
break;
2773 case 3: oss <<
"750";
break;
2774 case 4: oss <<
"1125";
break;
2775 case 5: oss <<
"1250";
break;
2776 case 6:
case 7: oss <<
"Reserved";
break;
2777 default: oss <<
"Invalid LO";
break;
2780 <<
"Input 2 Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2782 <<
"Reference Geometry: ";
2783 switch (((
BIT(20)|
BIT(21)|
BIT(22)) & inRegValue) >> 20)
2785 case 0: oss <<
"NTV2_SG_UNKNOWN";
break;
2786 case 1: oss <<
"NTV2_SG_525";
break;
2787 case 2: oss <<
"NTV2_SG_625";
break;
2788 case 3: oss <<
"NTV2_SG_750";
break;
2789 case 4: oss <<
"NTV2_SG_1125";
break;
2790 case 5: oss <<
"NTV2_SG_1250";
break;
2791 default: oss <<
"Invalid";
break;
2794 <<
"Reference Scan Mode: " << ((
BIT(23) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2795 <<
"AES Channel 1-2: " << ((
BIT(24) & inRegValue) ?
"Invalid" :
"Valid") << endl
2796 <<
"AES Channel 3-4: " << ((
BIT(25) & inRegValue) ?
"Invalid" :
"Valid") << endl
2797 <<
"AES Channel 5-6: " << ((
BIT(26) & inRegValue) ?
"Invalid" :
"Valid") << endl
2798 <<
"AES Channel 7-8: " << ((
BIT(27) & inRegValue) ?
"Invalid" :
"Valid");
2801 } mDecodeInputStatusReg;
2803 struct DecodeSDIInputStatusReg :
public Decoder
2805 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2808 uint16_t numSpigots(0), startSpigot(0), doTsiMuxSync(0);
2819 for (uint16_t spigotNdx(0); spigotNdx < numSpigots; )
2821 const uint16_t spigotNum (spigotNdx + startSpigot);
2822 const uint8_t statusBits ((inRegValue >> (spigotNdx*8)) & 0xFF);
2823 const uint8_t speedBits (statusBits & 0xC1);
2824 ostringstream ossSpeed, ossSpigot;
2825 ossSpigot <<
"SDI In " << spigotNum <<
" ";
2826 const string spigotLabel (ossSpigot.str());
2827 if (speedBits & 0x01) ossSpeed <<
" 3G";
2830 if (speedBits & 0x40) ossSpeed <<
" 6G";
2831 if (speedBits & 0x80) ossSpeed <<
" 12G";
2833 if (speedBits == 0) ossSpeed <<
" 1.5G";
2834 oss << spigotLabel <<
"Link Speed:" << ossSpeed.str() << endl
2835 << spigotLabel <<
"SMPTE Level B: " <<
YesNo(statusBits & 0x02) << endl
2836 << spigotLabel <<
"Link A VPID Valid: " <<
YesNo(statusBits & 0x10) << endl
2837 << spigotLabel <<
"Link B VPID Valid: " <<
YesNo(statusBits & 0x20) << endl;
2839 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: " <<
EnabDisab(statusBits & 0x04);
2841 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: n/a";
2842 if (++spigotNdx < numSpigots)
2846 for (
UWord tsiMux(0); tsiMux < 4; ++tsiMux)
2848 <<
"TsiMux" <<
DEC(tsiMux+1) <<
" Sync Fail: " << ((inRegValue & (0x00010000UL << tsiMux)) ?
"FAILED" :
"OK");
2851 } mDecodeSDIInputStatusReg;
2853 struct DecodeSDIInputStatus2Reg :
public Decoder
2855 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2863 oss << sOdd <<
" Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2865 << sOdd <<
" Geometry: ";
2866 if (
BIT(30) & inRegValue)
switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2868 case 0: oss <<
"2K x 1080";
break;
2869 case 1: oss <<
"2K x 1556";
break;
2870 default: oss <<
"Invalid HI";
break;
2872 else switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2874 case 0: oss <<
"Unknown";
break;
2875 case 1: oss <<
"525";
break;
2876 case 2: oss <<
"625";
break;
2877 case 3: oss <<
"750";
break;
2878 case 4: oss <<
"1125";
break;
2879 case 5: oss <<
"1250";
break;
2880 case 6:
case 7: oss <<
"Reserved";
break;
2881 default: oss <<
"Invalid LO";
break;
2884 << sEven <<
" Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2886 << sEven <<
" Geometry: ";
2887 if (
BIT(31) & inRegValue)
switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2889 case 0: oss <<
"2K x 1080";
break;
2890 case 1: oss <<
"2K x 1556";
break;
2891 default: oss <<
"Invalid HI";
break;
2893 else switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2895 case 0: oss <<
"Unknown";
break;
2896 case 1: oss <<
"525";
break;
2897 case 2: oss <<
"625";
break;
2898 case 3: oss <<
"750";
break;
2899 case 4: oss <<
"1125";
break;
2900 case 5: oss <<
"1250";
break;
2901 case 6:
case 7: oss <<
"Reserved";
break;
2902 default: oss <<
"Invalid LO";
break;
2906 } mDecodeSDIInputStatus2Reg;
2908 struct DecodeFS1RefSelectReg :
public Decoder
2910 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2912 (
void) inDeviceID; (
void) inRegNum;
2914 oss <<
"BNC Select(LHi): " << (inRegValue & 0x00000010 ?
"LTCIn1" :
"Ref") << endl
2915 <<
"Ref BNC (Corvid): " <<
EnabDisab(inRegValue & 0x00000020) << endl
2916 <<
"LTC Present (also Reg 21): " <<
YesNo(inRegValue & 0x00000040) << endl
2917 <<
"LTC Emb Out Enable: " <<
YesNo(inRegValue & 0x00000080) << endl
2918 <<
"LTC Emb In Enable: " <<
YesNo(inRegValue & 0x00000100) << endl
2919 <<
"LTC Emb In Received: " <<
YesNo(inRegValue & 0x00000200) << endl
2920 <<
"LTC BNC Out Source: " << (inRegValue & 0x00000400 ?
"E-E" :
"Reg112/113");
2923 } mDecodeFS1RefSelectReg;
2925 struct DecodeLTCStatusControlReg :
public Decoder
2927 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2929 (
void) inDeviceID; (
void) inRegNum;
2930 const uint16_t LTC1InTimingSelect ((inRegValue >> 1) & 0x0000007);
2931 const uint16_t LTC2InTimingSelect ((inRegValue >> 9) & 0x0000007);
2932 const uint16_t LTC1OutTimingSelect ((inRegValue >> 16) & 0x0000007);
2933 const uint16_t LTC2OutTimingSelect ((inRegValue >> 20) & 0x0000007);
2935 oss <<
"LTC 1 Input Present: " <<
YesNo(inRegValue & 0x00000001) << endl
2936 <<
"LTC 1 Input FB Timing Select): " <<
xHEX0N(LTC1InTimingSelect,2) <<
" (" <<
DEC(LTC1InTimingSelect) <<
")" << endl
2937 <<
"LTC 1 Bypass: " <<
EnabDisab(inRegValue & 0x00000010) << endl
2938 <<
"LTC 1 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 5) & 0x00000001)) << endl
2939 <<
"LTC 2 Input Present: " <<
YesNo(inRegValue & 0x00000100) << endl
2940 <<
"LTC 2 Input FB Timing Select): " <<
xHEX0N(LTC2InTimingSelect,2) <<
" (" <<
DEC(LTC2InTimingSelect) <<
")" << endl
2941 <<
"LTC 2 Bypass: " <<
EnabDisab(inRegValue & 0x00001000) << endl
2942 <<
"LTC 2 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 13) & 0x00000001)) << endl
2943 <<
"LTC 1 Output FB Timing Select): " <<
xHEX0N(LTC1OutTimingSelect,2) <<
" (" <<
DEC(LTC1OutTimingSelect) <<
")" << endl
2944 <<
"LTC 2 Output FB Timing Select): " <<
xHEX0N(LTC2OutTimingSelect,2) <<
" (" <<
DEC(LTC2OutTimingSelect) <<
")";
2947 } mLTCStatusControlDecoder;
2949 struct DecodeAudDetectReg :
public Decoder
2951 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2959 for (uint16_t num(0); num < 8; )
2961 const uint16_t group (num / 2);
2962 const bool isChan34 (num & 1);
2963 oss <<
"Group " << group <<
" CH " << (isChan34 ?
"3-4: " :
"1-2: ") << (inRegValue &
BIT(num) ?
"Present" :
"Absent");
2974 } mDecodeAudDetectReg;
2976 struct DecodeAudControlReg :
public Decoder
2978 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2982 static const string ChStrs [] = {
"Ch 1/2",
"Ch 3/4",
"Ch 5/6",
"Ch 7/8" };
2983 uint16_t sdiOutput (0);
2993 oss <<
"Audio Capture: " <<
EnabDisab(
BIT(0) & inRegValue) << endl
2994 <<
"Audio Loopback: " <<
EnabDisab(
BIT(3) & inRegValue) << endl
2995 <<
"Audio Input: " <<
DisabEnab(
BIT(8) & inRegValue) << endl
2996 <<
"Audio Output: " <<
DisabEnab(
BIT(9) & inRegValue) << endl
2997 <<
"Output Paused: " <<
YesNo(
BIT(11) & inRegValue) << endl;
2999 oss <<
"Audio Embedder SDIOut" << sdiOutput <<
": " <<
DisabEnab(
BIT(13) & inRegValue) << endl
3000 <<
"Audio Embedder SDIOut" << (sdiOutput+1) <<
": " <<
DisabEnab(
BIT(15) & inRegValue) << endl;
3002 oss <<
"A/V Sync Mode: " <<
EnabDisab(
BIT(15) & inRegValue) << endl
3003 <<
"AES Rate Converter: " <<
DisabEnab(
BIT(19) & inRegValue) << endl
3004 <<
"Audio Buffer Format: " << (
BIT(20) & inRegValue ?
"16-Channel " : (
BIT(16) & inRegValue ?
"8-Channel " :
"6-Channel ")) << endl
3005 << (
BIT(18) & inRegValue ?
"96kHz" :
"48kHz") << endl
3006 << (
BIT(18) & inRegValue ?
"96kHz Support" :
"48kHz Support") << endl
3008 <<
"Slave Mode (64-chl): " <<
EnabDisab(
BIT(23) & inRegValue) << endl
3009 <<
"K-box, Monitor: " << ChStrs [(
BIT(24) &
BIT(25) & inRegValue) >> 24] << endl
3010 <<
"K-Box Input: " << (
BIT(26) & inRegValue ?
"XLR" :
"BNC") << endl
3011 <<
"K-Box: " << (
BIT(27) & inRegValue ?
"Present" :
"Absent") << endl
3012 <<
"Cable: " << (
BIT(28) & inRegValue ?
"XLR" :
"BNC") << endl
3013 <<
"Audio Buffer Size: " << (
BIT(31) & inRegValue ?
"4 MB" :
"1 MB");
3016 } mDecodeAudControlReg;
3018 struct DecodeAudSourceSelectReg :
public Decoder
3020 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3024 static const string SrcStrs [] = {
"AES Input",
"Embedded Groups 1 and 2",
"" };
3025 static const unsigned SrcStrMap [] = { 0, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
3026 const uint16_t vidInput = (inRegValue &
BIT(23) ? 2 : 0) + (inRegValue &
BIT(16) ? 1 : 0);
3029 oss <<
"Audio Source: " << SrcStrs [SrcStrMap [(
BIT(0) |
BIT(1) |
BIT(2) |
BIT(3)) & inRegValue]] << endl
3030 <<
"Embedded Source Select: Video Input " << (1 + vidInput) << endl
3031 <<
"AES Sync Mode bit (fib): " <<
EnabDisab(inRegValue &
BIT(18)) << endl
3032 <<
"PCM disabled: " <<
YesNo(inRegValue &
BIT(17)) << endl
3033 <<
"Erase head enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
3034 <<
"Embedded Clock Select: " << (inRegValue &
BIT(22) ?
"Video Input" :
"Board Reference") << endl
3035 <<
"3G audio source: " << (inRegValue &
BIT(21) ?
"Data stream 2" :
"Data stream 1");
3038 } mDecodeAudSourceSelectReg;
3040 struct DecodeAudOutputSrcMap :
public Decoder
3042 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3046 static const string AESOutputStrs[] = {
"AES Outputs 1-4",
"AES Outputs 5-8",
"AES Outputs 9-12",
"AES Outputs 13-16",
""};
3047 static const string SrcStrs[] = {
"AudSys1, Audio Channels 1-4",
"AudSys1, Audio Channels 5-8",
3048 "AudSys1, Audio Channels 9-12",
"AudSys1, Audio Channels 13-16",
3049 "AudSys2, Audio Channels 1-4",
"AudSys2, Audio Channels 5-8",
3050 "AudSys2, Audio Channels 9-12",
"AudSys2, Audio Channels 13-16",
3051 "AudSys3, Audio Channels 1-4",
"AudSys3, Audio Channels 5-8",
3052 "AudSys3, Audio Channels 9-12",
"AudSys3, Audio Channels 13-16",
3053 "AudSys4, Audio Channels 1-4",
"AudSys4, Audio Channels 5-8",
3054 "AudSys4, Audio Channels 9-12",
"AudSys4, Audio Channels 13-16",
""};
3055 static const unsigned AESChlMappingShifts [4] = {0, 4, 8, 12};
3058 const uint32_t AESOutMapping (inRegValue & 0x0000FFFF);
3062 for (
unsigned AESOutputQuad(0); AESOutputQuad < 4; AESOutputQuad++)
3063 oss << AESOutputStrs[AESOutputQuad] <<
" Source: " << SrcStrs[(AESOutMapping >> AESChlMappingShifts[AESOutputQuad]) & 0x0000000F] << endl;
3076 const uint32_t HDMIMon1234Info (HDMIMonInfo & 0x0F);
3079 const uint32_t HDMIMon5678Info ((HDMIMonInfo >> 4) & 0x0F);
3087 } mDecodeAudOutputSrcMap;
3089 struct DecodePCMControlReg :
public Decoder
3091 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3096 for (uint8_t audChan (0); audChan < 4; audChan++)
3098 oss <<
"Audio System " << (startAudioSystem + audChan) <<
": ";
3099 const uint8_t pcmBits (uint32_t(inRegValue >> (audChan * 8)) & 0x000000FF);
3100 if (pcmBits == 0x00)
3104 oss <<
"non-PCM channels";
3105 for (uint8_t chanPair (0); chanPair < 8; chanPair++)
3106 if (pcmBits & (0x01 << chanPair))
3107 oss <<
" " << (chanPair*2+1) <<
"-" << (chanPair*2+2);
3114 } mDecodePCMControlReg;
3116 struct DecodeAudioMixerInputSelectReg :
public Decoder
3118 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3119 { (
void) inDeviceID; (
void) inRegNum;
3120 const UWord mainInputSrc((inRegValue ) & 0x0000000F);
3121 const UWord aux1InputSrc((inRegValue >> 4) & 0x0000000F);
3122 const UWord aux2InputSrc((inRegValue >> 8) & 0x0000000F);
3129 } mAudMxrInputSelDecoder;
3131 struct DecodeAudioMixerGainRegs :
public Decoder
3135 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3136 { (
void)inRegNum; (
void)inDeviceID;
3137 static const double kUnityGain (0x00010000);
3138 const bool atUnity (inRegValue == 0x00010000);
3141 oss <<
"Gain: 0 dB (Unity)";
3144 const double dValue (inRegValue);
3145 const bool aboveUnity (inRegValue >= 0x00010000);
3146 const string plusMinus (atUnity ?
"" : (aboveUnity ?
"+" :
"-"));
3147 const string aboveBelow (atUnity ?
"at" : (aboveUnity ?
"above" :
"below"));
3148 const uint32_t unityDiff (aboveUnity ? inRegValue - 0x00010000 : 0x00010000 - inRegValue);
3149 const double dB (
double(20.0) * ::log10(dValue/kUnityGain));
3150 oss <<
"Gain: " << dB <<
" dB, " << plusMinus <<
xHEX0N(unityDiff,6)
3151 <<
" (" << plusMinus <<
DEC(unityDiff) <<
") " << aboveBelow <<
" unity gain";
3155 } mAudMxrGainDecoder;
3157 struct DecodeAudioMixerChannelSelectReg :
public Decoder
3159 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3160 { (
void) inRegNum; (
void) inDeviceID;
3165 <<
"Level Measurement Sample Count: " <<
DEC(
ULWord(1 << powerOfTwo)) <<
" (bits 8-15)";
3168 } mAudMxrChanSelDecoder;
3171 struct DecodeAudioMixerMutesReg :
public Decoder
3174 typedef std::bitset<16> AudioChannelSet16;
3175 typedef std::bitset<2> AudioChannelSet2;
3178 outSet.clear(); outClear.clear();
3179 for (
size_t ndx(0); ndx < 16; ndx++)
3180 { ostringstream oss; oss <<
DEC(ndx+1);
3181 if (inChSet.test(ndx))
3182 outSet.push_back(oss.str());
3184 outClear.push_back(oss.str());
3186 if (outSet.empty()) outSet.push_back(
"<none>");
3187 if (outClear.empty()) outClear.push_back(
"<none>");
3191 outSet.clear(); outClear.clear();
static const string LR[] = {
"L",
"R"};
3192 for (
size_t ndx(0); ndx < 2; ndx++)
3193 if (inChSet.test(ndx))
3194 outSet.push_back(LR[ndx]);
3196 outClear.push_back(LR[ndx]);
3197 if (outSet.empty()) outSet.push_back(
"<none>");
3198 if (outClear.empty()) outClear.push_back(
"<none>");
3201 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3202 { (
void) inRegNum; (
void) inDeviceID;
3208 NTV2StringList mutedMainOut, unmutedMainOut, mutedMain, unmutedMain, mutedAux1, unmutedAux1, mutedAux2, unmutedAux2;
3209 SplitAudioChannelSet16(AudioChannelSet16(mainOutputMuteBits), mutedMainOut, unmutedMainOut);
3210 SplitAudioChannelSet2(AudioChannelSet2(mainInputMuteBits), mutedMain, unmutedMain);
3211 SplitAudioChannelSet2(AudioChannelSet2(aux1InputMuteBits), mutedAux1, unmutedAux1);
3212 SplitAudioChannelSet2(AudioChannelSet2(aux2InputMuteBits), mutedAux2, unmutedAux2);
3213 oss <<
"Main Output Muted/Disabled Channels: " << mutedMainOut << endl
3214 <<
"Main Output Unmuted/Enabled Channels: " << unmutedMainOut << endl;
3215 oss <<
"Main Input Muted/Disabled Channels: " << mutedMain << endl
3216 <<
"Main Input Unmuted/Enabled Channels: " << unmutedMain << endl;
3217 oss <<
"Aux Input 1 Muted/Disabled Channels: " << mutedAux1 << endl
3218 <<
"Aux Input 1 Unmuted/Enabled Channels: " << unmutedAux1 << endl;
3219 oss <<
"Aux Input 2 Muted/Disabled Channels: " << mutedAux2 << endl
3220 <<
"Aux Input 2 Unmuted/Enabled Channels: " << unmutedAux2;
3223 } mAudMxrMutesDecoder;
3225 struct DecodeAudioMixerLevelsReg :
public Decoder
3229 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3230 { (
void) inDeviceID;
3231 static const string sLabels[] = {
"Aux Input 1",
"Aux Input 2",
"Main Input Audio Channels 1|2",
"Main Input Audio Channels 3|4",
3232 "Main Input Audio Channels 5|6",
"Main Input Audio Channels 7|8",
"Main Input Audio Channels 9|10",
3233 "Main Input Audio Channels 11|12",
"Main Input Audio Channels 13|14",
"Main Input Audio Channels 15|16",
3234 "Main Output Audio Channels 1|2",
"Main Output Audio Channels 3|4",
"Main Output Audio Channels 5|6",
3235 "Main Output Audio Channels 7|8",
"Main Output Audio Channels 9|10",
"Main Output Audio Channels 11|12",
3236 "Main Output Audio Channels 13|14",
"Main Output Audio Channels 15|16"};
3240 const string & label(sLabels[labelOffset]);
3244 oss << label <<
" Left Level:" <<
xHEX0N(leftLevel, 4) <<
" (" <<
DEC(leftLevel) <<
")" << endl
3245 << label <<
" Right Level:" <<
xHEX0N(rightLevel,4) <<
" (" <<
DEC(rightLevel) <<
")";
3248 } mAudMxrLevelDecoder;
3250 struct DecodeAncExtControlReg :
public Decoder
3252 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3257 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3258 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3259 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3260 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3261 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3262 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3263 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3264 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3265 <<
"SD Y+C Demux: " <<
EnabDisab(inRegValue &
BIT(30)) << endl
3266 <<
"Metadata from: " << (inRegValue &
BIT(31) ?
"LSBs" :
"MSBs");
3269 } mDecodeAncExtControlReg;
3271 struct DecodeAuxExtControlReg :
public Decoder
3273 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3278 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3279 oss <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3280 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3281 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3282 <<
"Filter inclusion: " <<
EnabDisab(inRegValue &
BIT(29));
3285 } mDecodeAuxExtControlReg;
3288 struct DecodeAncExtFieldLinesReg :
public Decoder
3290 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3294 const uint32_t which (inRegNum & 0x1F);
3295 const uint32_t valueLow (inRegValue & 0xFFF);
3296 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFF);
3299 case 5: oss <<
"F1 cutoff line: " << valueLow << endl
3300 <<
"F2 cutoff line: " << valueHigh;
3302 case 9: oss <<
"F1 VBL start line: " << valueLow << endl
3303 <<
"F2 VBL start line: " << valueHigh;
3305 case 11: oss <<
"Field ID high on line: " << valueLow << endl
3306 <<
"Field ID low on line: " << valueHigh;
3308 case 17: oss <<
"F1 analog start line: " << valueLow << endl
3309 <<
"F2 analog start line: " << valueHigh;
3312 oss <<
"Invalid register type";
3317 } mDecodeAncExtFieldLines;
3320 struct DecodeAncExtStatusReg :
public Decoder
3322 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3326 const uint32_t which (inRegNum & 0x1F);
3327 const uint32_t byteTotal (inRegValue & 0xFFFFFF);
3328 const bool overrun ((inRegValue &
BIT(28)) ?
true :
false);
3331 case 6: oss <<
"Total bytes: ";
break;
3332 case 7: oss <<
"Total F1 bytes: ";
break;
3333 case 8: oss <<
"Total F2 bytes: ";
break;
3334 default: oss <<
"Invalid register type";
break;
3336 oss <<
DEC(byteTotal) << endl
3337 <<
"Overrun: " <<
YesNo(overrun);
3340 } mDecodeAncExtStatus;
3343 struct DecodeAncExtIgnoreDIDReg :
public Decoder
3345 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3350 oss <<
"Ignoring DIDs " <<
HEX0N((inRegValue >> 0) & 0xFF, 2)
3351 <<
", " <<
HEX0N((inRegValue >> 8) & 0xFF, 2)
3352 <<
", " <<
HEX0N((inRegValue >> 16) & 0xFF, 2)
3353 <<
", " <<
HEX0N((inRegValue >> 24) & 0xFF, 2);
3356 } mDecodeAncExtIgnoreDIDs;
3358 struct DecodeAncExtAnalogFilterReg :
public Decoder
3360 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3365 uint32_t which (inRegNum & 0x1F);
3366 oss <<
"Each 1 bit specifies capturing ";
3369 case 18: oss <<
"F1 Y";
break;
3370 case 19: oss <<
"F2 Y";
break;
3371 case 20: oss <<
"F1 C";
break;
3372 case 21: oss <<
"F2 C";
break;
3373 default:
return "Invalid register type";
3375 oss <<
" line as analog, else digital";
3378 } mDecodeAncExtAnalogFilter;
3380 struct DecodeAncInsValuePairReg :
public Decoder
3382 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3386 const uint32_t which (inRegNum & 0x1F);
3387 const uint32_t valueLow (inRegValue & 0xFFFF);
3388 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFFF);
3392 case 0: oss <<
"F1 byte count low: " << valueLow << endl
3393 <<
"F2 byte count low: " << valueHigh;
3395 case 4: oss <<
"HANC pixel delay: " << (valueLow & 0x3FF) << endl
3396 <<
"VANC pixel delay: " << (valueHigh & 0x7FF);
3398 case 5: oss <<
"F1 first active line: " << (valueLow & 0x7FF) << endl
3399 <<
"F2 first active line: " << (valueHigh & 0x7FF);
3401 case 6: oss <<
"Active line length: " << (valueLow & 0x7FF) << endl
3402 <<
"Total line length: " << (valueHigh & 0xFFF);
3404 case 8: oss <<
"Field ID high on line: " << (valueLow & 0x7FF) << endl
3405 <<
"Field ID low on line: " << (valueHigh & 0x7FF);
3407 case 11: oss <<
"F1 chroma blnk start line: " << (valueLow & 0x7FF) << endl
3408 <<
"F2 chroma blnk start line: " << (valueHigh & 0x7FF);
3410 case 14: oss <<
"F1 byte count high: " << valueLow << endl
3411 <<
"F2 byte count high: " << valueHigh;
3413 default:
return "Invalid register type";
3417 } mDecodeAncInsValuePairReg;
3419 struct DecodeAncInsControlReg :
public Decoder
3421 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3426 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3427 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3428 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3429 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3430 <<
"Payload Y insert: " <<
YesNo(inRegValue &
BIT(16)) << endl
3431 <<
"Payload C insert: " <<
YesNo(inRegValue &
BIT(17)) << endl
3432 <<
"Payload F1 insert: " <<
YesNo(inRegValue &
BIT(20)) << endl
3433 <<
"Payload F2 insert: " <<
YesNo(inRegValue &
BIT(21)) << endl
3434 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(24)) << endl
3435 <<
"Memory reads: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3436 <<
"SD Packet Split: " <<
EnabDisab(inRegValue &
BIT(31));
3439 } mDecodeAncInsControlReg;
3441 struct DecodeAncInsChromaBlankReg :
public Decoder
3443 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3448 uint32_t which (inRegNum & 0x1F);
3450 oss <<
"Each 1 bit specifies if chroma in ";
3453 case 12: oss <<
"F1";
break;
3454 case 13: oss <<
"F2";
break;
3455 default:
return "Invalid register type";
3457 oss <<
" should be blanked or passed thru";
3460 } mDecodeAncInsChromaBlankReg;
3462 struct DecodeXptGroupReg :
public Decoder
3464 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3466 static unsigned sShifts[4] = {0, 8, 16, 24};
3468 for (
unsigned ndx(0); ndx < 4; ndx++)
3486 strs.push_back(oss.str());
3492 } mDecodeXptGroupReg;
3494 struct DecodeXptValidReg :
public Decoder
3496 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3513 ss <<
xHEX0N(outputXpt,2) <<
"(" <<
DEC(outputXpt) <<
")";
3515 ss <<
"'" << name <<
"'";
3516 outputXptNames.push_back(ss.str());
3518 if (!outputXptNames.empty())
3519 oss <<
"Valid Xpts: " << outputXptNames;
3523 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3525 } mDecodeXptValidReg;
3527 struct DecodeNTV4FSReg :
public Decoder
3529 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3530 { (
void) inDeviceID;
3531 static const string sPixClkSelects[] = {
"27",
"74.1758",
"74.25",
"148.3516",
"148.5",
"inv5",
"inv6",
"inv7"};
3532 static const string sSyncs[] = {
"Sync to Frame",
"Sync to Field",
"Immediate",
"Sync to External"};
3538 {
const ULWord disabled (inRegValue &
BIT(1));
3539 const ULWord sync ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3540 const ULWord pixClkSel((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18))) >> 16);
3543 oss <<
"Enabled: " <<
YesNo(!disabled) << endl
3544 <<
"Mode: " << ((inRegValue &
BIT( 0)) ?
"Capture" :
"Display") << endl
3545 <<
"DRT_DISP: " <<
OnOff(inRegValue &
BIT( 2)) << endl
3546 <<
"Fill Bit: " <<
DEC((inRegValue &
BIT( 3)) ? 1 : 0) << endl
3547 <<
"Dither: " <<
EnabDisab(inRegValue &
BIT( 4)) << endl
3548 <<
"RGB8 Convert: " << ((inRegValue &
BIT( 5)) ?
"Use '00'" :
"Copy MSBs") << endl
3549 <<
"Progressive: " <<
YesNo(inRegValue &
BIT( 6)) << endl
3551 <<
"Pix Clk Sel: " << sPixClkSelects[pixClkSel] <<
" MHz" << endl
3552 <<
"Sync: " << sSyncs[sync];
3554 oss <<
"Enabled: " <<
YesNo(!disabled);
3558 {
const ULWord lineCnt ((inRegValue & (0xFFFF0000)) >> 16);
3559 oss <<
"Field ID: " <<
OddEven(inRegValue &
BIT( 0)) << endl
3560 <<
"Line Count: " <<
DEC(lineCnt);
3564 {
const int32_t xferByteCnt((inRegValue & 0xFFFF0000) >> 16), linePitch(inRegValue & 0x0000FFFF);
3565 oss <<
"Line Pitch: " << linePitch << (linePitch < 0 ?
" (flipped)" :
"") << endl
3566 <<
"Xfer Byte Count: " << xferByteCnt <<
" [bytes/line]" << (linePitch < 0 ?
" (flipped)" :
"");
3570 {
const ULWord ROIVSize((inRegValue & (0x0FFF0000)) >> 16), ROIHSize(inRegValue & 0x00000FFF);
3571 oss <<
"ROI Horz Size: " <<
DEC(ROIHSize) <<
" [pixels]" << endl
3572 <<
"ROI Vert Size: " <<
DEC(ROIVSize) <<
" [lines]";
3577 {
const ULWord ROIVOff((inRegValue & (0x0FFF0000)) >> 16), ROIHOff(inRegValue & 0x00000FFF);
3579 oss <<
"ROI " << fld <<
" Horz Offset: " <<
DEC(ROIHOff) << endl
3580 <<
"ROI " << fld <<
" Vert Offset: " <<
DEC(ROIVOff);
3584 {
const ULWord tot((inRegValue & (0x0FFF0000)) >> 16), act(inRegValue & 0x00000FFF);
3585 oss <<
"Disp Horz Active: " <<
DEC(act) << endl
3586 <<
"Disp Horz Total: " <<
DEC(tot);
3590 {
const ULWord lo((inRegValue & (0x07FF0000)) >> 16), hi(inRegValue & 0x000007FF);
3591 oss <<
"Disp FID Lo: " <<
DEC(lo) << endl
3592 <<
"Disp FID Hi: " <<
DEC(hi);
3597 {
const ULWord actEnd((inRegValue & (0x07FF0000)) >> 16), actStart(inRegValue & 0x000007FF);
3599 oss <<
"Disp " << fld <<
" Active Start: " <<
DEC(actStart) << endl
3600 <<
"Disp " << fld <<
" Active End: " <<
DEC(actEnd);
3604 oss <<
"Unpacker Horz Offset: " <<
DEC(inRegValue & 0x0000FFFF);
3608 {
const ULWord hi((inRegValue & (0xFFFF0000)) >> 16), lo(inRegValue & 0x0000FFFF);
3611 oss <<
"Disp Fill " << CbBorCrR <<
": " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4) << endl
3612 <<
"Disp Fill " << YGorA <<
": " <<
DEC(hi) <<
" " <<
xHEX0N(hi,4);
3616 {
const ULWord lo(inRegValue & 0x0000FFFF);
3617 oss <<
"ROI Fill Alpha: " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4);
3621 oss <<
"Output Timing Frame Pulse Preset: " <<
DEC(inRegValue & 0x00FFFFFF) <<
" "
3622 <<
xHEX0N(inRegValue & 0x00FFFFFF,6);
3627 {
const int32_t lo (inRegValue & 0x00001FFF);
3628 oss <<
"Output Video Offset: " << lo <<
" " <<
xHEX0N(lo,6);
3632 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3638 struct DecodeHDMIOutputControl :
public Decoder
3640 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3644 static const string sHDMIStdV1[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" };
3645 static const string sHDMIStdV2V3[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3646 static const string sVidRates[] = {
"",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95",
"",
"",
"",
"",
"" };
3647 static const string sSrcSampling[] = {
"YC422",
"RGB",
"YC420",
"Unknown/invalid" };
3648 static const string sBitDepth[] = {
"8",
"10",
"12",
"Unknown/invalid" };
3651 const string hdmiVidStdStr (hdmiVers > 1 ? sHDMIStdV2V3[rawVideoStd] : (hdmiVers == 1 ? sHDMIStdV1[rawVideoStd] :
""));
3654 const uint32_t srcBPC ((inRegValue & (
BIT(16)|
BIT(17))) >> 16);
3655 const uint32_t txBitDepth ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3656 oss <<
"Video Standard: " << hdmiVidStdStr;
3657 if (hdmiVidStdStr != vidStdStr)
3658 oss <<
" (" << vidStdStr <<
")";
3660 <<
"Color Mode: " << ((inRegValue &
BIT( 8)) ?
"RGB" :
"YCbCr") << endl
3662 <<
"Scan Mode: " << ((inRegValue &
BIT(13)) ?
"Progressive" :
"Interlaced") << endl
3663 <<
"Bit Depth: " << ((inRegValue &
BIT(14)) ?
"10-bit" :
"8-bit") << endl
3664 <<
"Output Color Sampling: " << ((inRegValue &
BIT(15)) ?
"4:4:4" :
"4:2:2") << endl
3665 <<
"Output Bit Depth: " << sBitDepth[txBitDepth] << endl
3666 <<
"Src Color Sampling: " << sSrcSampling[srcSampling] << endl
3667 <<
"Src Bits Per Component: " << sBitDepth[srcBPC] << endl
3668 <<
"Output Range: " << ((inRegValue &
BIT(28)) ?
"Full" :
"SMPTE") << endl
3669 <<
"Audio Channels: " << ((inRegValue &
BIT(29)) ?
"8" :
"2") << endl
3670 <<
"Output: " << ((inRegValue &
BIT(30)) ?
"DVI" :
"HDMI");
3673 <<
"Audio Loopback: " <<
OnOff(inRegValue &
BIT(31));
3676 } mDecodeHDMIOutputControl;
3678 struct DecodeHDMIInputStatus :
public Decoder
3680 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3687 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"2K1080p",
"2K1080i",
"3840p",
"4096p"};
3688 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" };
3689 oss <<
"HDMI Input: " << (inRegValue &
BIT(0) ?
"Locked" :
"Unlocked") << endl
3690 <<
"HDMI Input: " << (inRegValue &
BIT(1) ?
"Stable" :
"Unstable") << endl
3691 <<
"Color Mode: " << (inRegValue &
BIT(2) ?
"RGB" :
"YCbCr") << endl
3692 <<
"Bitdepth: " << (inRegValue &
BIT(3) ?
"10-bit" :
"8-bit") << endl
3693 <<
"Audio Channels: " << (inRegValue &
BIT(12) ? 2 : 8) << endl
3694 <<
"Scan Mode: " << (inRegValue &
BIT(13) ?
"Progressive" :
"Interlaced") << endl
3695 <<
"Standard: " << (inRegValue &
BIT(14) ?
"SD" :
"HD") << endl
3696 <<
"Video Standard: " << sStds[vidStd] << endl
3697 <<
"Protocol: " << (inRegValue &
BIT(27) ?
"DVI" :
"HDMI") << endl
3698 <<
"Video Rate : " << (rate < 11 ? sRates[rate] :
string(
"invalid"));
3701 } mDecodeHDMIInputStatus;
3703 struct DecodeHDMIInputControl :
public Decoder
3705 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3707 (
void) inRegNum; (
void) inDeviceID;
3709 const UWord chanPair ((inRegValue & (
BIT(2) |
BIT(3))) >> 2);
3711 const UWord txCh12Sel ((inRegValue & (
BIT(29)|
BIT(30))) >> 29);
3713 oss <<
"HDMI In EDID Write-Enable: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
3714 <<
"HDMI Force Output Params: " <<
SetNotset(inRegValue &
BIT(1)) << endl
3716 <<
"hdmi_rx_8ch_src_off: " <<
YesNo(inRegValue &
BIT(4)) << endl
3717 <<
"Swap HDMI In Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(5)) << endl
3718 <<
"Swap HDMI Out Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(6)) << endl
3719 <<
"HDMI Prefer 420: " <<
SetNotset(inRegValue &
BIT(7)) << endl
3720 <<
"hdmi_rx_spdif_err: " <<
SetNotset(inRegValue &
BIT(8)) << endl
3721 <<
"hdmi_rx_afifo_under: " <<
SetNotset(inRegValue &
BIT(9)) << endl
3722 <<
"hdmi_rx_afifo_empty: " <<
SetNotset(inRegValue &
BIT(10)) << endl
3723 <<
"H polarity: " << (inRegValue &
BIT(16) ?
"Inverted" :
"Normal") << endl
3724 <<
"V polarity: " << (inRegValue &
BIT(17) ?
"Inverted" :
"Normal") << endl
3725 <<
"F polarity: " << (inRegValue &
BIT(18) ?
"Inverted" :
"Normal") << endl
3726 <<
"DE polarity: " << (inRegValue &
BIT(19) ?
"Inverted" :
"Normal") << endl
3727 <<
"Tx Src Sel: " <<
DEC(txSrcSel) <<
" (" <<
xHEX0N(txSrcSel,4) <<
")" << endl
3728 <<
"Tx Center Cut: " <<
SetNotset(inRegValue &
BIT(24)) << endl
3729 <<
"Tx 12 bit: " <<
SetNotset(inRegValue &
BIT(26)) << endl
3730 <<
"RGB Input Gamut: " << (inRegValue &
BIT(28) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3731 <<
"Tx_ch12_sel: " <<
DEC(txCh12Sel) <<
" (" <<
xHEX0N(txCh12Sel,4) <<
")" << endl
3732 <<
"Input AVI Gamut: " << (inRegValue &
BIT(31) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3736 } mDecodeHDMIInputControl;
3738 struct DecodeHDMIOutputStatus :
public Decoder
3740 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3741 { (
void) inRegNum; (
void) inDeviceID;
3747 } mDecodeHDMIOutputStatus;
3749 struct DecodeHDMIOutHDRPrimary :
public Decoder
3751 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3771 const double xFloat (
double(xPrimary) * 0.00002);
3772 const double yFloat (
double(yPrimary) * 0.00002);
3774 oss <<
"X: " <<
fDEC(xFloat,7,5) << endl;
3776 oss <<
"X: " <<
HEX0N(xPrimary, 4) <<
"(invalid)" << endl;
3778 oss <<
"Y: " <<
fDEC(yFloat,7,5);
3780 oss <<
"Y: " <<
HEX0N(yPrimary, 4) <<
"(invalid)";
3787 const double minFloat (
double(minValue) * 0.00001);
3788 const double maxFloat (maxValue);
3789 oss <<
"Min: " <<
fDEC(minFloat,7,5) << endl
3790 <<
"Max: " <<
fDEC(maxFloat,7,5);
3797 const double cntFloat (cntValue);
3798 const double frmFloat (frmValue);
3799 oss <<
"Max Content Light Level: " <<
fDEC(cntFloat,7,5) << endl
3800 <<
"Max Frame Light Level: " <<
fDEC(frmFloat,7,5);
3807 } mDecodeHDMIOutHDRPrimary;
3809 struct DecodeHDMIOutHDRControl :
public Decoder
3811 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3814 static const string sEOTFs[] = {
"Trad Gamma SDR",
"Trad Gamma HDR",
"SMPTE ST 2084",
"HLG"};
3823 <<
"EOTF: " << sEOTFs[(EOTFvalue < 3) ? EOTFvalue : 3] << endl
3824 <<
"Static MetaData Desc ID: " <<
HEX0N(staticMetaDataDescID, 2) <<
" (" <<
DEC(staticMetaDataDescID) <<
")";
3828 } mDecodeHDMIOutHDRControl;
3830 struct DecodeHDMIOutMRControl :
public Decoder
3832 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3833 { (
void) inRegNum; (
void) inDeviceID;
3835 static const string sMRStandard[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3837 const string hdmiVidStdStr (sMRStandard[rawVideoStd]);
3839 oss <<
"Video Standard: " << hdmiVidStdStr;
3840 if (hdmiVidStdStr != vidStdStr)
3841 oss <<
" (" << vidStdStr <<
")";
3843 <<
"Capture Mode: " << ((inRegValue &
kRegMaskMREnable) ?
"Enabled" :
"Disabled");
3846 } mDecodeHDMIOutMRControl;
3848 struct DecodeSDIOutputControl :
public Decoder
3850 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3855 const uint32_t vidStd (inRegValue & (
BIT(0)|
BIT(1)|
BIT(2)));
3856 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"6",
"7"};
3857 oss <<
"Video Standard: " << sStds[vidStd] << endl
3858 <<
"2Kx1080 mode: " << (inRegValue &
BIT(3) ?
"2048x1080" :
"1920x1080") << endl
3859 <<
"HBlank RGB Range: Black=" << (inRegValue &
BIT(7) ?
"0x40" :
"0x04") << endl
3860 <<
"12G enable: " <<
YesNo(inRegValue &
BIT(17)) << endl
3861 <<
"6G enable: " <<
YesNo(inRegValue &
BIT(16)) << endl
3862 <<
"3G enable: " <<
YesNo(inRegValue &
BIT(24)) << endl
3863 <<
"3G mode: " << (inRegValue &
BIT(25) ?
"b" :
"a") << endl
3864 <<
"VPID insert enable: " <<
YesNo(inRegValue &
BIT(26)) << endl
3865 <<
"VPID overwrite enable: " <<
YesNo(inRegValue &
BIT(27)) << endl
3866 <<
"DS 1 audio source: " "AudSys";
3867 switch ((inRegValue & (
BIT(28)|
BIT(30))) >> 28)
3869 case 0: oss << (inRegValue &
BIT(18) ? 5 : 1);
break;
3870 case 1: oss << (inRegValue &
BIT(18) ? 7 : 3);
break;
3871 case 4: oss << (inRegValue &
BIT(18) ? 6 : 2);
break;
3872 case 5: oss << (inRegValue &
BIT(18) ? 8 : 4);
break;
3874 oss << endl <<
"DS 2 audio source: AudSys";
3875 switch ((inRegValue & (
BIT(29)|
BIT(31))) >> 29)
3877 case 0: oss << (inRegValue &
BIT(19) ? 5 : 1);
break;
3878 case 1: oss << (inRegValue &
BIT(19) ? 7 : 3);
break;
3879 case 4: oss << (inRegValue &
BIT(19) ? 6 : 2);
break;
3880 case 5: oss << (inRegValue &
BIT(19) ? 8 : 4);
break;
3884 } mDecodeSDIOutputControl;
3886 struct DecodeSDIOutTimingCtrl :
public Decoder
3888 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3889 { (
void)inRegNum; (
void)inDeviceID;
3891 const uint32_t hMask(0x00001FFF), vMask(0x1FFF0000);
3892 const uint32_t hOffset(inRegValue & hMask), vOffset((inRegValue & vMask) >> 16);
3893 oss <<
"Horz Offset: " <<
xHEX0N(
UWord(hOffset),4) << endl
3894 <<
"Vert Offset: " <<
xHEX0N(
UWord(vOffset),4) << endl
3895 <<
"E-E Timing Override: " <<
EnabDisab(inRegValue &
BIT(31));
3898 } mDecodeSDIOutTimingCtrl;
3900 struct DecodeDMAControl :
public Decoder
3902 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3906 const uint16_t gen ((inRegValue & (
BIT(20)|
BIT(21)|
BIT(22)|
BIT(23))) >> 20);
3907 const uint16_t lanes ((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18)|
BIT(19))) >> 16);
3908 const uint16_t fwRev ((inRegValue & 0x0000FF00) >> 8);
3910 for (uint16_t engine(0); engine < 4; engine++)
3911 oss <<
"DMA " << (engine+1) <<
" Int Active?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3912 oss <<
"Bus Error Int Active?: " <<
YesNo(inRegValue &
BIT(31)) << endl;
3913 for (uint16_t engine(0); engine < 4; engine++)
3914 oss <<
"DMA " << (engine+1) <<
" Busy?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3915 oss <<
"Strap: " << ((inRegValue &
BIT(7)) ?
"Installed" :
"Not Installed") << endl
3916 <<
"Firmware Rev: " <<
xHEX0N(fwRev, 2) <<
" (" <<
DEC(fwRev) <<
")" << endl
3917 <<
"Gen: " << gen << ((gen > 0 && gen < 4) ?
"" :
" <invalid>") << endl
3918 <<
"Lanes: " <<
DEC(lanes) << ((lanes < 9) ?
"" :
" <invalid>");
3921 } mDMAControlRegDecoder;
3923 struct DecodeDMAIntControl :
public Decoder
3925 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3930 for (uint16_t eng(0); eng < 4; eng++)
3931 oss <<
"DMA " << (eng+1) <<
" Enabled?: " <<
YesNo(inRegValue &
BIT(eng)) << endl;
3932 oss <<
"Bus Error Enabled?: " <<
YesNo(inRegValue &
BIT(4)) << endl;
3933 for (uint16_t eng(0); eng < 4; eng++)
3934 oss <<
"DMA " << (eng+1) <<
" Active?: " <<
YesNo(inRegValue &
BIT(27+eng)) << endl;
3935 oss <<
"Bus Error: " <<
YesNo(inRegValue &
BIT(31));
3938 } mDMAIntControlRegDecoder;
3940 struct DecodeDMAXferRate :
public Decoder
3942 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3943 { (
void) inRegNum; (
void) inDeviceID;
3945 oss <<
DEC(inRegValue) <<
" [MB/sec] [kB/ms] [B/us]";
3948 } mDMAXferRateRegDecoder;
3950 struct DecodeRP188InOutDBB :
public Decoder
3952 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3956 const bool isReceivingRP188 (inRegValue &
BIT(16));
3957 const bool isReceivingSelectedRP188 (inRegValue &
BIT(17));
3958 const bool isReceivingLTC (inRegValue &
BIT(18));
3959 const bool isReceivingVITC (inRegValue &
BIT(19));
3961 oss <<
"RP188: " << (isReceivingRP188 ? (isReceivingSelectedRP188 ?
"Selected" :
"Unselected") :
"No") <<
" RP-188 received"
3962 << (isReceivingLTC ?
" +LTC" :
"") << (isReceivingVITC ?
" +VITC" :
"") << endl
3963 <<
"Bypass: " << (inRegValue &
BIT(23) ? (inRegValue &
BIT(22) ?
"SDI In 2" :
"SDI In 1") :
"Disabled") << endl
3964 <<
"Filter: " <<
HEX0N((inRegValue & 0xFF000000) >> 24, 2) << endl
3965 <<
"DBB: " <<
HEX0N((inRegValue & 0x0000FF00) >> 8, 2) <<
" " <<
HEX0N(inRegValue & 0x000000FF, 2);
3968 } mRP188InOutDBBRegDecoder;
3970 struct DecodeVidProcControl :
public Decoder
3972 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3977 static const string sSplitStds [8] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"?6?",
"?7?"};
3978 oss <<
"Mode: " << (inRegValue &
kRegMaskVidProcMode ? ((inRegValue &
BIT(24)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3979 <<
"FG Control: " << (inRegValue &
kRegMaskVidProcFGControl ? ((inRegValue &
BIT(20)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3980 <<
"BG Control: " << (inRegValue &
kRegMaskVidProcBGControl ? ((inRegValue &
BIT(22)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3981 <<
"VANC Pass-Thru: " << ((inRegValue &
BIT(13)) ?
"Background" :
"Foreground") << endl
3985 <<
"Limiting: " << ((inRegValue &
BIT(11)) ?
"Off" : ((inRegValue &
BIT(12)) ?
"Legal Broadcast" :
"Legal SDI")) << endl
3989 } mVidProcControlRegDecoder;
3991 struct DecodeSplitControl :
public Decoder
3993 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3998 const uint32_t startmask (0x0000FFFF);
3999 const uint32_t slopemask (0x3FFF0000);
4000 const uint32_t fractionmask(0x00000007);
4001 oss <<
"Split Start: " <<
HEX0N((inRegValue & startmask) & ~fractionmask, 4) <<
" "
4002 <<
HEX0N((inRegValue & startmask) & fractionmask, 4) << endl
4003 <<
"Split Slope: " <<
HEX0N(((inRegValue & slopemask) >> 16) & ~fractionmask, 4) <<
" "
4004 <<
HEX0N(((inRegValue & slopemask) >> 16) & fractionmask, 4) << endl
4005 <<
"Split Type: " << ((inRegValue &
BIT(30)) ?
"Vertical" :
"Horizontal");
4008 } mSplitControlRegDecoder;
4010 struct DecodeFlatMatteValue :
public Decoder
4012 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4017 const uint32_t mask (0x000003FF);
4018 oss <<
"Flat Matte Cb: " <<
HEX0N(inRegValue & mask, 3) << endl
4019 <<
"Flat Matte Y: " <<
HEX0N(((inRegValue >> 10) & mask) - 0x40, 3) << endl
4020 <<
"Flat Matte Cr: " <<
HEX0N((inRegValue >> 20) & mask, 3);
4023 } mFlatMatteValueRegDecoder;
4025 struct DecodeEnhancedCSCMode :
public Decoder
4027 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4031 static const string sFiltSel[] = {
"Full",
"Simple",
"None",
"?"};
4032 static const string sEdgeCtrl[] = {
"black",
"extended pixels"};
4033 static const string sPixFmts[] = {
"RGB 4:4:4",
"YCbCr 4:4:4",
"YCbCr 4:2:2",
"?"};
4034 const uint32_t filterSelect ((inRegValue >> 12) & 0x3);
4035 const uint32_t edgeControl ((inRegValue >> 8) & 0x1);
4036 const uint32_t outPixFmt ((inRegValue >> 4) & 0x3);
4037 const uint32_t inpPixFmt (inRegValue & 0x3);
4039 oss <<
"Filter select: " << sFiltSel[filterSelect] << endl
4040 <<
"Filter edge control: " <<
"Filter to " << sEdgeCtrl[edgeControl] << endl
4041 <<
"Output pixel format: " << sPixFmts[outPixFmt] << endl
4042 <<
"Input pixel format: " << sPixFmts[inpPixFmt];
4045 } mEnhCSCModeDecoder;
4047 struct DecodeEnhancedCSCOffset :
public Decoder
4049 static string U10Dot6ToFloat (
const uint32_t inOffset)
4051 double result (
double((inOffset >> 6) & 0x3FF));
4052 result += double(inOffset & 0x3F) / 64.0;
4053 ostringstream oss; oss <<
fDEC(result,12,5);
string resultStr(oss.str());
4056 static string U12Dot4ToFloat (
const uint32_t inOffset)
4058 double result (
double((inOffset >> 4) & 0xFFF));
4059 result += double(inOffset & 0xF) / 16.0;
4060 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4063 static string S13Dot2ToFloat (
const uint32_t inOffset)
4065 double result (
double((inOffset >> 2) & 0x1FFF));
4066 result += double(inOffset & 0x3) / 4.0;
4067 if (inOffset &
BIT(15))
4069 ostringstream oss; oss <<
fDEC(result,12,2);
string resultStr(oss.str());
4072 static string S11Dot4ToFloat (
const uint32_t inOffset)
4074 double result (
double((inOffset >> 4) & 0x7FF));
4075 result += double(inOffset & 0xF) / 16.0;
4076 if (inOffset &
BIT(15))
4078 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4081 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4084 const uint32_t regNum (inRegNum & 0x1F);
4085 const uint32_t lo (inRegValue & 0x0000FFFF);
4086 const uint32_t hi ((inRegValue >> 16) & 0xFFFF);
4090 case 1: oss <<
"Component 0 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4091 <<
"Component 1 input offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4093 case 2: oss <<
"Component 2 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4095 case 12: oss <<
"Component A output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4096 <<
"Component B output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4098 case 13: oss <<
"Component C output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4100 case 15: oss <<
"Key input offset: " << S13Dot2ToFloat(lo) <<
" (12-bit), " << S11Dot4ToFloat(lo) <<
" (10-bit)" << endl
4101 <<
"Key output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4107 } mEnhCSCOffsetDecoder;
4109 struct DecodeEnhancedCSCKeyMode :
public Decoder
4111 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4115 static const string sSrcSel[] = {
"Key Input",
"Video Y Input"};
4116 static const string sRange[] = {
"Full Range",
"SMPTE Range"};
4117 const uint32_t keySrcSelect (inRegValue & 0x1);
4118 const uint32_t keyOutRange ((inRegValue >> 4) & 0x1);
4120 oss <<
"Key Source Select: " << sSrcSel[keySrcSelect] << endl
4121 <<
"Key Output Range: " << sRange[keyOutRange];
4124 } mEnhCSCKeyModeDecoder;
4126 struct DecodeEnhancedCSCCoefficient :
public Decoder
4128 static string S2Dot15ToFloat (
const uint32_t inCoefficient)
4130 double result = (double((inCoefficient >> 15) & 0x3));
4131 result += double(inCoefficient & 0x7FFF) / 32768.0;
4132 if (inCoefficient &
BIT(17))
4134 ostringstream oss; oss <<
fDEC(result,12,10);
string resultStr(oss.str());
4137 static string S12Dot12ToFloat (
const uint32_t inCoefficient)
4139 double result(
double((inCoefficient >> 12) & 0xFFF));
4140 result += double(inCoefficient & 0xFFF) / 4096.0;
4141 if (inCoefficient &
BIT(24))
4143 ostringstream oss; oss <<
fDEC(result,12,6);
string resultStr(oss.str());
4146 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4149 uint32_t regNum (inRegNum & 0x1F);
4151 if (regNum > 2 && regNum < 12)
4154 static const string sCoeffNames[] = {
"A0",
"A1",
"A2",
"B0",
"B1",
"B2",
"C0",
"C1",
"C2"};
4155 const uint32_t coeff ((inRegValue >> 9) & 0x0003FFFF);
4156 oss << sCoeffNames[regNum] <<
" coefficient: " << S2Dot15ToFloat(coeff) <<
" (" <<
xHEX0N(coeff,8) <<
")";
4158 else if (regNum == 16)
4160 const uint32_t gain ((inRegValue >> 4) & 0x01FFFFFF);
4161 oss <<
"Key gain: " << S12Dot12ToFloat(gain) <<
" (" <<
HEX0N(gain,8) <<
")";
4165 } mEnhCSCCoeffDecoder;
4167 struct DecodeCSCoeff1234 :
public Decoder
4169 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4172 const uint32_t coeff1 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4173 const uint32_t coeff2 ((inRegValue >> 14) & 0x00001FFF);
4174 uint16_t nCoeff1(1), nCoeff2(2);
4179 nCoeff1 = 3; nCoeff2 = 4;
break;
4195 oss <<
"Video Key Sync Status: " << (inRegValue &
BIT(28) ?
"SyncFail" :
"OK") << endl
4196 <<
"Make Alpha From Key Input: " <<
EnabDisab(inRegValue &
BIT(29)) << endl
4197 <<
"Matrix Select: " << (inRegValue &
BIT(30) ?
"Rec601" :
"Rec709") << endl
4198 <<
"Use Custom Coeffs: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4200 oss <<
"RGB Range: " << (inRegValue &
BIT(31) ?
"SMPTE (0x040-0x3C0)" :
"Full (0x000-0x3FF)") << endl;
4201 oss <<
"Coefficient" <<
DEC(nCoeff1) <<
": " <<
xHEX0N(coeff1, 4) << endl
4202 <<
"Coefficient" <<
DEC(nCoeff2) <<
": " <<
xHEX0N(coeff2, 4);
4205 } mCSCoeff1234Decoder;
4207 struct DecodeCSCoeff567890 :
public Decoder
4209 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4212 const uint32_t coeff5 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4213 const uint32_t coeff6 ((inRegValue >> 14) & 0x00001FFF);
4214 uint16_t nCoeff5(5), nCoeff6(6);
4219 nCoeff5 = 7; nCoeff6 = 8;
break;
4222 nCoeff5 = 9; nCoeff6 = 10;
break;
4232 oss <<
"Coefficient" <<
DEC(nCoeff5) <<
": " <<
xHEX0N(coeff5, 4) << endl
4233 <<
"Coefficient" <<
DEC(nCoeff6) <<
": " <<
xHEX0N(coeff6, 4);
4236 } mCSCoeff567890Decoder;
4238 struct DecodeLUTV1ControlReg :
public Decoder
4240 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4241 {
static const string sModes[] = {
"Off",
"RGB",
"YCbCr",
"3-Way",
"Invalid"};
4254 if (lutVersion != 1)
4255 oss <<
"(Register data relevant for V1 LUT, this device has V" <<
DEC(lutVersion) <<
" LUT)";
4258 oss <<
"LUT Saturation Value: " <<
xHEX0N(saturation,4) <<
" (" <<
DEC(saturation) <<
")" << endl
4259 <<
"LUT Output Bank Select: " <<
SetNotset(outBankSelect) << endl
4260 <<
"LUT Mode: " << sModes[mode] <<
" (" <<
DEC(mode) <<
")";
4263 <<
"LUT5 Host Bank Select: " <<
SetNotset(cc5HostBank) << endl
4264 <<
"LUT5 Output Bank Select: " <<
SetNotset(cc5OutputBank) << endl
4265 <<
"LUT5 Select: " <<
SetNotset(cc5Select) << endl
4266 <<
"Config 2nd LUT Set: " <<
YesNo(ccConfig2);
4269 <<
"LUT3 Bank Select: " <<
SetNotset(cc3BankSel) << endl
4270 <<
"LUT4 Bank Select: " <<
SetNotset(cc4BankSel);
4273 } mLUTV1ControlRegDecoder;
4275 struct DecodeLUTV2ControlReg :
public Decoder
4277 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4281 if (lutVersion != 2)
4282 oss <<
"(Register data relevant for V2 LUT, this device has V" <<
DEC(lutVersion) <<
"LUT)";
4285 for (
UWord lutNum(0); lutNum < 8; lutNum++)
4286 oss <<
"LUT" <<
DEC(lutNum+1) <<
" Enabled: " << (
YesNo(inRegValue & (1<<lutNum))) << endl
4287 <<
"LUT" <<
DEC(lutNum+1) <<
" Host Access Bank Select: " << (inRegValue & (1<<(lutNum+8)) ?
'1' :
'0') << endl
4288 <<
"LUT" <<
DEC(lutNum+1) <<
" Output Bank Select: " << (inRegValue & (1<<(lutNum+16)) ?
'1' :
'0') << endl;
4289 oss <<
"12-Bit LUT mode: " << ((inRegValue &
BIT(28)) ?
"12-bit" :
"10-bit") << endl
4290 <<
"12-Bit LUT page reg: " <<
DEC(
UWord((inRegValue & (
BIT(24)|
BIT(25))) >> 24));
4294 } mLUTV2ControlRegDecoder;
4296 struct DecodeLUT :
public Decoder
4298 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4302 const bool isRed(inRegNum >= RedReg && inRegNum < GreenReg), isGreen(inRegNum >= GreenReg && inRegNum < BlueReg), isBlue(inRegNum>=BlueReg);
4308 const string label(isRed ?
"Red[" : (isGreen ?
"Green[" :
"Blue["));
4309 const ULWord ndx((inRegNum - (isRed ? RedReg : (isGreen ? GreenReg : BlueReg))) * 2);
4312 oss << label <<
DEC0N(ndx+0,3) <<
"]: " <<
DEC0N(lo,3) << endl
4313 << label <<
DEC0N(ndx+1,3) <<
"]: " <<
DEC0N(hi,3);
4318 struct DecodeSDIErrorStatus :
public Decoder
4320 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4326 oss <<
"Unlock Tally: " <<
DEC(inRegValue & 0x7FFF) << endl
4327 <<
"Locked: " <<
YesNo(inRegValue &
BIT(16)) << endl
4328 <<
"Link A VPID Valid: " <<
YesNo(inRegValue &
BIT(20)) << endl
4329 <<
"Link B VPID Valid: " <<
YesNo(inRegValue &
BIT(21)) << endl
4330 <<
"TRS Error Detected: " <<
YesNo(inRegValue &
BIT(24));
4333 } mSDIErrorStatusRegDecoder;
4335 struct DecodeSDIErrorCount :
public Decoder
4337 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4343 oss <<
"Link A: " <<
DEC(inRegValue & 0x0000FFFF) << endl
4344 <<
"Link B: " <<
DEC((inRegValue & 0xFFFF0000) >> 16);
4347 } mSDIErrorCountRegDecoder;
4349 struct DecodeDriverVersion :
public Decoder
4351 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4352 { (
void) inDeviceID;
4356 ULWord buildType((inRegValue >> 30) & 0x00000003);
4357 static const string sBuildTypes[] = {
"Release",
"Beta",
"Alpha",
"Development"};
4358 static const string sBldTypes[] = {
"",
"b",
"a",
"d"};
4360 oss <<
"Driver Version: " <<
DEC(vMaj) <<
"." <<
DEC(vMin) <<
"." <<
DEC(vDot);
4361 if (buildType) oss << sBldTypes[buildType] <<
DEC(vBld);
4363 <<
"Major Version: " <<
DEC(vMaj) << endl
4364 <<
"Minor Version: " <<
DEC(vMin) << endl
4365 <<
"Point Version: " <<
DEC(vDot) << endl
4366 <<
"Build Type: " << sBuildTypes[buildType] << endl
4367 <<
"Build Number: " <<
DEC(vBld);
4370 } mDriverVersionDecoder;
4372 struct DecodeFourCC :
public Decoder
4374 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4375 { (
void) inDeviceID; (
void) inRegNum;
4376 char ch;
string str4cc;
4377 ch = char((inRegValue & 0xFF000000) >> 24);
4378 str4cc += ::isprint(ch) ? ch :
'?';
4379 ch = char((inRegValue & 0x00FF0000) >> 16);
4380 str4cc += ::isprint(ch) ? ch :
'?';
4381 ch = char((inRegValue & 0x0000FF00) >> 8);
4382 str4cc += ::isprint(ch) ? ch :
'?';
4383 ch = char((inRegValue & 0x000000FF) >> 0);
4384 str4cc += ::isprint(ch) ? ch :
'?';
4387 oss <<
"'" << str4cc <<
"'";
4392 struct DecodeDriverType :
public Decoder
4394 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4395 { (
void) inDeviceID; (
void) inRegNum;
4398 if (inRegValue == 0x44455854)
4399 oss <<
"DriverKit ('DEXT')";
4400 else if (inRegValue)
4401 oss <<
"(Unknown/Invalid " <<
xHEX0N(inRegValue,8) <<
")";
4403 oss <<
"Kernel Extension ('KEXT')";
4410 } mDecodeDriverType;
4412 struct DecodeIDSwitchStatus :
public Decoder
4414 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4419 const uint32_t switchEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
4420 for (
UWord idSwitch(0); idSwitch < 4; )
4422 const uint32_t switchEnabled (switchEnableBits &
BIT(idSwitch));
4423 oss <<
"Switch " <<
DEC(++idSwitch) <<
": " << (switchEnabled ?
"Enabled" :
"Disabled");
4430 oss <<
"(ID Switch not supported)";
4435 } mDecodeIDSwitchStatus;
4437 struct DecodePWMFanControl :
public Decoder
4439 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4447 } mDecodePWMFanControl;
4449 struct DecodePWMFanMonitor :
public Decoder
4451 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4459 } mDecodePWMFanMonitor;
4461 struct DecodeBOBStatus :
public Decoder
4463 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4467 oss <<
"BOB : " << ((inRegValue &
kRegMaskBOBAbsent) ?
"Disconnected" :
"Connected") << endl
4471 oss <<
"Device does not support a breakout board";
4476 struct DecodeBOBGPIIn :
public Decoder
4478 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4487 oss <<
"Device does not support a breakout board";
4492 struct DecodeBOBGPIInInterruptControl :
public Decoder
4494 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4503 oss <<
"Device does not support a breakout board";
4506 } mDecodeBOBGPIInInterruptControl;
4508 struct DecodeBOBGPIOut :
public Decoder
4510 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4519 oss <<
"Device does not support a breakout board";
4524 struct DecodeBOBAudioControl :
public Decoder
4526 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4535 dBuLabel =
"+24dBu";
4538 dBuLabel =
"+18dBu";
4541 dBuLabel =
"+12dBu";
4544 dBuLabel =
"+15dBu";
4549 <<
"Analog Level Control: " << dBuLabel << endl
4553 oss <<
"Device does not support a breakout board";
4556 } mDecodeBOBAudioControl;
4558 struct DecodeLEDControl :
public Decoder
4560 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4568 oss <<
"Device does not support a breakout board";
4571 } mDecodeLEDControl;
4573 static const int NOREADWRITE = 0;
4574 static const int READONLY = 1;
4575 static const int WRITEONLY = 2;
4576 static const int READWRITE = 3;
4578 static const int CONTAINS = 0;
4579 static const int STARTSWITH = 1;
4580 static const int ENDSWITH = 2;
4581 static const int EXACTMATCH = 3;
4583 typedef map <uint32_t, const Decoder *> RegNumToDecoderMap;
4584 typedef pair <uint32_t, const Decoder *> RegNumToDecoderPair;
4585 typedef multimap <string, uint32_t> RegClassToRegNumMMap, StringToRegNumMMap;
4586 typedef pair <string, uint32_t> StringToRegNumPair;
4587 typedef RegClassToRegNumMMap::const_iterator RegClassToRegNumConstIter;
4588 typedef StringToRegNumMMap::const_iterator StringToRegNumConstIter;
4590 typedef pair <uint32_t, uint32_t> XptRegNumAndMaskIndex;
4591 typedef map <NTV2InputCrosspointID, XptRegNumAndMaskIndex> InputXpt2XptRegNumMaskIndexMap;
4592 typedef map <XptRegNumAndMaskIndex, NTV2InputCrosspointID> XptRegNumMaskIndex2InputXptMap;
4593 typedef InputXpt2XptRegNumMaskIndexMap::const_iterator InputXpt2XptRegNumMaskIndexMapConstIter;
4594 typedef XptRegNumMaskIndex2InputXptMap::const_iterator XptRegNumMaskIndex2InputXptMapConstIter;
4598 RegNumToStringMap mRegNumToStringMap;
4599 RegNumToDecoderMap mRegNumToDecoderMap;
4600 RegClassToRegNumMMap mRegClassToRegNumMMap;
4601 StringToRegNumMMap mStringToRegNumMMap;
4603 InputXpt2XptRegNumMaskIndexMap mInputXpt2XptRegNumMaskIndexMap;
4604 XptRegNumMaskIndex2InputXptMap mXptRegNumMaskIndex2InputXptMap;
4634 return pInst ?
true :
false;
4641 return pInst ?
true :
false;
4648 return pInst ? pInst->DisposeInstance() :
false;
4656 return pRegExpert->RegNameToString(inRegNum);
4658 ostringstream oss; oss <<
"Reg ";
4660 oss <<
DEC(inRegNum);
4661 else if (inRegNum <= 0x0000FFFF)
4662 oss <<
xHEX0N(inRegNum,4);
4664 oss <<
xHEX0N(inRegNum,8);
4672 return pRegExpert ? pRegExpert->RegValueToString(inRegNum, inRegValue, inDeviceID) : string();
4679 return pRegExpert ? pRegExpert->IsRegInClass(inRegNum, inClassName) :
false;
4686 return pRegExpert ? pRegExpert->GetAllRegisterClasses() :
NTV2StringSet();
4693 return pRegExpert ? pRegExpert->GetRegisterClasses(inRegNum, inRemovePrefix) :
NTV2StringSet();
4700 return pRegExpert ? pRegExpert->GetRegistersForClass(inClassName) :
NTV2RegNumSet();
4714 return pRegExpert ? pRegExpert->GetRegistersForDevice(inDeviceID, inOtherRegsToInclude) :
NTV2RegNumSet();
4721 return pRegExpert ? pRegExpert->GetRegistersWithName(inName, inSearchStyle) :
NTV2RegNumSet();
4735 return pRegExpert ? pRegExpert->GetXptRegNumAndMaskIndex(inInputXpt, outXptRegNum, outMaskIndex) :
false;