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)
1717 for (
ULWord ndx(1); ndx < 1024; ndx++)
1719 ostringstream oss; oss <<
"VIRTUALREG_START+" << ndx;
1720 const string regName (oss.str());
1722 if (mRegNumToStringMap.find(regNum) == mRegNumToStringMap.end())
1724 mRegNumToStringMap.insert (RegNumToStringPair(regNum, regName));
1725 mStringToRegNumMMap.insert (StringToRegNumPair(ToLower(regName), regNum));
1727 DefineRegDecoder (regNum, mDefaultRegDecoder);
1728 DefineRegReadWrite (regNum, READWRITE);
1743 const string & label (it->first);
1744 const string & value (it->second);
1747 else if (label.at(label.length()-1) !=
' ' && label.at(label.length()-1) !=
':')
1748 oss << label <<
": " << value;
1749 else if (label.at(label.length()-1) ==
':')
1750 oss << label <<
" " << value;
1752 oss << label << value;
1753 if (++it != inLabelValuePairs.end())
1762 RegNumToStringMap::const_iterator iter (mRegNumToStringMap.find (inRegNum));
1763 if (iter != mRegNumToStringMap.end())
1764 return iter->second;
1766 ostringstream oss; oss <<
"Reg ";
1768 oss <<
DEC(inRegNum);
1769 else if (inRegNum <= 0x0000FFFF)
1770 oss <<
xHEX0N(inRegNum,4);
1772 oss <<
xHEX0N(inRegNum,8);
1779 RegNumToDecoderMap::const_iterator iter(mRegNumToDecoderMap.find(inRegNum));
1781 if (iter != mRegNumToDecoderMap.end() && iter->second)
1783 const Decoder * pDecoder (iter->second);
1784 oss << (*pDecoder)(inRegNum, inRegValue, inDeviceID);
1789 bool IsRegInClass (
const uint32_t inRegNum,
const string & inClassName)
const
1792 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1793 if (it->second == inRegNum)
1804 if (mAllRegClasses.empty())
1805 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1806 if (mAllRegClasses.find(it->first) == mAllRegClasses.end())
1807 mAllRegClasses.insert(it->first);
1808 return mAllRegClasses;
1817 if (IsRegInClass (inRegNum, *it))
1822 if (result.find(str) == result.end())
1832 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1833 if (result.find(it->second) == result.end())
1834 result.insert(it->second);
1843 for (uint32_t regNum (0); regNum <= maxRegNum; regNum++)
1844 result.insert(regNum);
1853 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1855 for (
UWord num(0); num < numSpigots; num++)
1858 allChanRegs.insert(chRegs.begin(), chRegs.end());
1860 std::set_intersection (ancRegs.begin(), ancRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1868 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1870 for (
UWord num(0); num < numSpigots; num++)
1873 allChanRegs.insert(chRegs.begin(), chRegs.end());
1875 std::set_intersection (auxRegs.begin(), auxRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1881 result.insert(sdiErrRegs.begin(), sdiErrRegs.end());
1887 result.insert(regNum);
1889 result.insert(regNum);
1901 for (
UWord num(0); num < numCSCs; num++)
1904 allChanRegs.insert(chRegs.begin(), chRegs.end());
1906 std::set_intersection (ecscRegs.begin(), ecscRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1912 result.insert(LUTRegs.begin(), LUTRegs.end());
1917 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1918 result.insert(regNum);
1919 for (
ULWord regNum = 0x2500; regNum <= 0x251f; regNum++)
1920 result.insert(regNum);
1921 for (
ULWord regNum = 0x2c00; regNum <= 0x2c1f; regNum++)
1922 result.insert(regNum);
1923 for (
ULWord regNum = 0x3000; regNum <= 0x301f; regNum++)
1924 result.insert(regNum);
1928 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1929 result.insert(regNum);
1930 for (
ULWord regNum = 0x1d40; regNum <= 0x1d5f; regNum++)
1931 result.insert(regNum);
1932 for (
ULWord regNum = 0x3C00; regNum <= 0x3C0A; regNum++)
1933 result.insert(regNum);
1951 for (
UWord num(0); num < numFrameStores; num++)
1954 chanRegs.insert(chRegs.begin(), chRegs.end());
1956 std::set_intersection (ntv4FSRegs.begin(), ntv4FSRegs.end(), chanRegs.begin(), chanRegs.end(), std::inserter(result, result.begin()));
2004 result.insert(vRegs.begin(), vRegs.end());
2010 result.insert(xptMapRegs.begin(), xptMapRegs.end());
2019 string nameStr(inName);
2020 const size_t nameStrLen(
aja::lower(nameStr).length());
2021 StringToRegNumConstIter it;
2023 if (inMatchStyle == EXACTMATCH)
2025 it = mStringToRegNumMMap.find(nameStr);
2026 if (it != mStringToRegNumMMap.end())
2027 result.insert(it->second);
2031 for (it = mStringToRegNumMMap.begin(); it != mStringToRegNumMMap.end(); ++it)
2033 const size_t pos(it->first.find(nameStr));
2034 if (pos == string::npos)
2036 switch (inMatchStyle)
2038 case CONTAINS: result.insert(it->second);
break;
2039 case STARTSWITH:
if (pos == 0)
2040 {result.insert(it->second);}
2042 case ENDSWITH:
if (pos+nameStrLen == it->first.length())
2043 {result.insert(it->second);}
2054 outXptRegNum = 0xFFFFFFFF;
2055 outMaskIndex = 0xFFFFFFFF;
2056 InputXpt2XptRegNumMaskIndexMapConstIter iter (mInputXpt2XptRegNumMaskIndexMap.find (inInputXpt));
2057 if (iter == mInputXpt2XptRegNumMaskIndexMap.end())
2059 outXptRegNum = iter->second.first;
2060 outMaskIndex = iter->second.second;
2067 const XptRegNumAndMaskIndex key (inXptRegNum, inMaskIndex);
2068 XptRegNumMaskIndex2InputXptMapConstIter iter (mXptRegNumMaskIndex2InputXptMap.find (key));
2069 if (iter != mXptRegNumMaskIndex2InputXptMap.end())
2070 return iter->second;
2074 ostream &
Print (ostream & inOutStream)
const
2077 static const string sLineBreak (96,
'=');
2078 static const uint32_t
sMasks[4] = {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000};
2080 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToStringMap: " << mRegNumToStringMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2081 for (RegNumToStringMap::const_iterator it (mRegNumToStringMap.begin()); it != mRegNumToStringMap.end(); ++it)
2082 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => '" << it->second <<
"'" << endl;
2084 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToDecoderMap: " << mRegNumToDecoderMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2085 for (RegNumToDecoderMap::const_iterator it (mRegNumToDecoderMap.begin()); it != mRegNumToDecoderMap.end(); ++it)
2086 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => " << (it->second == &mDefaultRegDecoder ?
"(default decoder)" :
"Custom Decoder") << endl;
2088 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegClassToRegNumMMap: " << mRegClassToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2089 for (RegClassToRegNumMMap::const_iterator it (mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
2090 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2092 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of StringToRegNumMMap: " << mStringToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2093 for (StringToRegNumMMap::const_iterator it (mStringToRegNumMMap.begin()); it != mStringToRegNumMMap.end(); ++it)
2094 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2096 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of InputXpt2XptRegNumMaskIndexMap: " << mInputXpt2XptRegNumMaskIndexMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2097 for (InputXpt2XptRegNumMaskIndexMap::const_iterator it (mInputXpt2XptRegNumMaskIndexMap.begin()); it != mInputXpt2XptRegNumMaskIndexMap.end(); ++it)
2099 <<
") => reg " << setw(3) << it->second.first <<
"(" <<
HEX0N(it->second.first,3) << dec <<
"|" << setw(20) << RegNameToString(it->second.first)
2100 <<
") mask " << it->second.second <<
"(" <<
HEX0N(
sMasks[it->second.second],8) <<
")" << endl;
2102 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of XptRegNumMaskIndex2InputXptMap: " << mXptRegNumMaskIndex2InputXptMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2103 for (XptRegNumMaskIndex2InputXptMap::const_iterator it (mXptRegNumMaskIndex2InputXptMap.begin()); it != mXptRegNumMaskIndex2InputXptMap.end(); ++it)
2104 inOutStream <<
"reg " << setw(3) << it->first.first <<
"(" <<
HEX0N(it->first.first,4) <<
"|" << setw(20) << RegNameToString(it->first.first)
2105 <<
") mask " << it->first.second <<
"(" <<
HEX0N(
sMasks[it->first.second],8) <<
") => "
2111 typedef std::map<uint32_t, string> RegNumToStringMap;
2112 typedef std::pair<uint32_t, string> RegNumToStringPair;
2114 static string ToLower (
const string & inStr)
2116 string result (inStr);
2117 std::transform (result.begin (), result.end (), result.begin (), ::tolower);
2121 struct DecodeGlobalControlReg :
public Decoder
2123 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2140 for (
int led(0); led < 4; ++led)
2141 oss << (((inRegValue &
kRegMaskLED) >> (16 + led)) ?
"*" :
".");
2146 <<
"Color Correction: " <<
"Channel: " << ((inRegValue &
BIT(31)) ?
"2" :
"1")
2147 <<
" Bank " << ((inRegValue &
BIT (30)) ?
"1" :
"0");
2150 } mDecodeGlobalControlReg;
2153 struct DecodeGlobalControl2 :
public Decoder
2155 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2172 for (
unsigned ch(0); ch < 8; ch++)
2173 oss <<
"Audio " <<
DEC(ch+1) <<
" Play/Capture Mode: " <<
OnOff(inRegValue & playCaptModes[ch]) << endl;
2174 for (
unsigned ch(2); ch < 8; ch++)
2175 oss <<
"Ch " <<
DEC(ch+1) <<
" RP188 Output: " <<
EnabDisab(inRegValue & rp188Modes[ch]) << endl;
2176 for (
unsigned ch(0); ch < 3; ch++)
2177 oss <<
"Ch " <<
DEC(2*(ch+2)) <<
" 1080p50/p60 Link-B Mode: " <<
EnabDisab(inRegValue & BLinkModes[ch]) << endl;
2178 for (
unsigned ch(0); ch < 4; ch++)
2179 oss <<
"Ch " <<
DEC(ch+1) <<
"/" <<
DEC(ch+2) <<
" 2SI Mode: " <<
EnabDisab(inRegValue & k425Masks[ch]) << endl;
2180 oss <<
"2SI Min Align Delay 1-4: " <<
EnabDisab(inRegValue &
BIT(24)) << endl
2181 <<
"2SI Min Align Delay 5-8: " <<
EnabDisab(inRegValue &
BIT(25));
2184 } mDecodeGlobalControl2;
2187 struct DecodeGlobalControl3 :
public Decoder
2189 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2196 <<
"VU Meter Audio Select: " << (inRegValue &
kRegMaskVUMeterSelect ?
"AudMixer" :
"AudSys1") << endl
2206 } mDecodeGlobalControl3;
2209 struct DecodeGlobalControlChanReg :
public Decoder
2211 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2224 } mDecodeGlobalControlChanRegs;
2227 struct DecodeChannelControlReg :
public Decoder
2229 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2236 oss <<
"Mode: " << (inRegValue &
kRegMaskMode ?
"Capture" :
"Display") << endl
2239 <<
"Viper Squeeze: " << (inRegValue &
BIT(9) ?
"Squeeze" :
"Normal") << endl
2244 <<
"Frame Size: " << (1 << (((inRegValue &
kK2RegMaskFrameSize) >> 20) + 1)) <<
" MB" << endl;
2247 oss <<
"RGB Range: " << (inRegValue &
BIT(24) ?
"Black = 0x40" :
"Black = 0") << endl
2251 } mDecodeChannelControl;
2253 struct DecodeFBControlReg :
public Decoder
2255 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2259 const bool isOn ((inRegValue & (1 << 29)) != 0);
2260 const uint16_t format ((inRegValue >> 15) & 0x1F);
2262 oss <<
OnOff(isOn) << endl
2263 <<
"Format: " <<
xHEX0N(format,4) <<
" (" <<
DEC(format) <<
")";
2266 } mDecodeFBControlReg;
2268 struct DecodeChannelControlExtReg :
public Decoder
2270 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2275 oss <<
"Input Video 2:1 Decimate: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
2276 <<
"HDMI Rx Direct: " <<
EnabDisab(inRegValue &
BIT(1)) << endl
2277 <<
"3:2 Pulldown Mode: " <<
EnabDisab(inRegValue &
BIT(2));
2280 } mDecodeChannelControlExt;
2282 struct DecodeSysmonVccIntDieTemp :
public Decoder
2284 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2288 const UWord rawDieTemp ((inRegValue & 0x0000FFFF) >> 6);
2289 const UWord rawVoltage ((inRegValue >> 22) & 0x3FF);
2290 const double dieTempC ((
double(rawDieTemp)) * 503.975 / 1024.0 - 273.15 );
2291 const double dieTempF (dieTempC * 9.0 / 5.0 + 32.0);
2292 const double voltage (
double(rawVoltage)/ 1024.0 * 3.0);
2294 oss <<
"Die Temperature: " <<
fDEC(dieTempC,5,2) <<
" Celcius (" <<
fDEC(dieTempF,5,2) <<
" Fahrenheit)" << endl
2295 <<
"Core Voltage: " <<
fDEC(voltage,5,2) <<
" Volts DC";
2298 } mDecodeSysmonVccIntDieTemp;
2300 struct DecodeSDITransmitCtrl :
public Decoder
2302 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2307 const UWord numSpigots (numInputs > numOutputs ? numInputs : numOutputs);
2311 const uint32_t txEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
2313 for (
UWord spigot(0); spigot < numSpigots; )
2315 const uint32_t txEnabled (txEnableBits &
BIT(spigot));
2316 oss <<
"SDI " <<
DEC(++spigot) <<
": " << (txEnabled ?
"Output/Transmit" :
"Input/Receive");
2317 if (spigot < numSpigots)
2321 oss <<
"(No SDI inputs or outputs)";
2324 oss <<
"(Bi-directional SDI not supported)";
2328 } mDecodeSDITransmitCtrl;
2330 struct DecodeConversionCtrl :
public Decoder
2332 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2338 oss <<
"Bitfile ID: " <<
xHEX0N(bitfileID, 2) << endl
2339 <<
"Memory Test: Start: " <<
YesNo(inRegValue &
BIT(28)) << endl
2340 <<
"Memory Test: Done: " <<
YesNo(inRegValue &
BIT(29)) << endl
2341 <<
"Memory Test: Passed: " <<
YesNo(inRegValue &
BIT(30));
2360 <<
"Vert Filter Preload: " <<
DisabEnab(inRegValue &
BIT(7)) << endl
2367 } mConvControlRegDecoder;
2369 struct DecodeRelayCtrlStat :
public Decoder
2371 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2386 oss <<
"(SDI bypass relays not supported)";
2389 } mDecodeRelayCtrlStat;
2391 struct DecodeWatchdogTimeout :
public Decoder
2393 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2399 const uint32_t ticks8nanos (inRegValue);
2400 const double microsecs (
double(ticks8nanos) * 8.0 / 1000.0);
2401 const double millisecs (microsecs / 1000.0);
2402 oss <<
"Watchdog Timeout [8-ns ticks]: " <<
xHEX0N(ticks8nanos,8) <<
" (" <<
DEC(ticks8nanos) <<
")" << endl
2403 <<
"Watchdog Timeout [usec]: " << microsecs << endl
2404 <<
"Watchdog Timeout [msec]: " << millisecs;
2407 oss <<
"(SDI bypass relays not supported)";
2410 } mDecodeWatchdogTimeout;
2412 struct DecodeWatchdogKick :
public Decoder
2414 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2422 const uint32_t expectedValue(whichReg ? 0x01234567 : 0xA5A55A5A);
2423 oss <<
xHEX0N(inRegValue,8);
2424 if (inRegValue == expectedValue)
2427 oss <<
" (Not expected, should be " <<
xHEX0N(expectedValue,8) <<
")";
2430 oss <<
"(SDI bypass relays not supported)";
2433 } mDecodeWatchdogKick;
2435 struct DecodeInputVPID:
public Decoder
2437 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2445 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2448 } mVPIDInpRegDecoder;
2450 struct DecodeOutputVPID:
public Decoder
2452 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2459 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2462 } mVPIDOutRegDecoder;
2464 struct DecodeBitfileDateTime :
public Decoder
2466 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2472 const UWord yyyy ((inRegValue & 0xFFFF0000) >> 16);
2473 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2474 const UWord dd (inRegValue & 0x000000FF);
2475 if (yyyy > 0x2015 && mm > 0 && mm < 0x13 && dd > 0 && dd < 0x32)
2476 oss <<
"Bitfile Date: " <<
HEX0N(mm,2) <<
"/" <<
HEX0N(dd,2) <<
"/" <<
HEX0N(yyyy,4);
2478 oss <<
"Bitfile Date: " <<
xHEX0N(inRegValue, 8);
2482 const UWord hh ((inRegValue & 0x00FF0000) >> 16);
2483 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2484 const UWord ss (inRegValue & 0x000000FF);
2485 if (hh < 0x24 && mm < 0x60 && ss < 0x60)
2486 oss <<
"Bitfile Time: " <<
HEX0N(hh,2) <<
":" <<
HEX0N(mm,2) <<
":" <<
HEX0N(ss,2);
2488 oss <<
"Bitfile Time: " <<
xHEX0N(inRegValue, 8);
2493 } mDecodeBitfileDateTime;
2495 struct DecodeBoardID :
public Decoder
2497 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2498 { (
void) inRegNum; (
void) inDeviceID;
2503 <<
"Device Name: '" << str1 <<
"'";
2506 <<
"Retail Device Name: '" << str2 <<
"'";
2511 struct DecodeDynFWUpdateCounts :
public Decoder
2513 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2514 { (
void) inRegNum; (
void) inDeviceID;
2516 oss <<
"# attempts: " <<
DEC(inRegValue >> 16) << endl
2517 <<
"# successes: " <<
DEC(inRegValue & 0x0000FFFF);
2520 } mDecodeDynFWUpdateCounts;
2522 struct DecodeFWUserID :
public Decoder
2524 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2525 { (
void) inRegNum; (
void) inDeviceID;
2534 } mDecodeFirmwareUserID;
2536 struct DecodeCanDoStatus :
public Decoder
2538 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2539 { (
void) inRegNum; (
void) inDeviceID;
2541 oss <<
"Has CanConnect Xpt Route ROM: " <<
YesNo(inRegValue &
BIT(0)) << endl
2542 <<
"AudioSystems can start on VBI: " <<
YesNo(inRegValue &
BIT(1));
2545 } mDecodeCanDoStatus;
2547 struct DecodeVidControlReg :
public Decoder
2549 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2553 const bool is16x9 ((inRegValue &
BIT(31)) != 0);
2554 const bool isMono ((inRegValue &
BIT(30)) != 0);
2556 oss <<
"Aspect Ratio: " << (is16x9 ?
"16x9" :
"4x3") << endl
2557 <<
"Depth: " << (isMono ?
"Monochrome" :
"Color");
2560 } mDecodeVidControlReg;
2562 struct DecodeVidIntControl :
public Decoder
2564 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2569 oss <<
"Output 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(0)) << endl
2570 <<
"Input 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2571 <<
"Input 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2572 <<
"Audio Out Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(4)) << endl
2573 <<
"Audio In Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(5)) << endl
2574 <<
"Wrap Rate Interrupt Enable: " <<
YesNo(inRegValue &
BIT(6)) << endl
2575 <<
"UART Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(7)) << endl
2576 <<
"UART Rx Interrupt Enable" <<
YesNo(inRegValue &
BIT(8)) << endl
2577 <<
"UART Rx Interrupt Clear" <<
ActInact(inRegValue &
BIT(15)) << endl
2578 <<
"UART 2 Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(17)) << endl
2579 <<
"Output 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(18)) << endl
2580 <<
"Output 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2581 <<
"Output 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(20)) << endl
2582 <<
"Output 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(21)) << endl
2583 <<
"Output 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(22)) << endl
2584 <<
"Output 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(23)) << endl
2585 <<
"UART Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(24)) << endl
2586 <<
"Wrap Rate Interrupt Clear" <<
ActInact(inRegValue &
BIT(25)) << endl
2587 <<
"UART 2 Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(26)) << endl
2588 <<
"Audio Out Wrap Interrupt Clear" <<
ActInact(inRegValue &
BIT(27)) << endl
2589 <<
"Input 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2590 <<
"Input 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30)) << endl
2591 <<
"Output 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(31));
2594 } mDecodeVidIntControl;
2596 struct DecodeVidIntControl2 :
public Decoder
2598 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2603 oss <<
"Input 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2604 <<
"Input 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2605 <<
"Input 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(8)) << endl
2606 <<
"Input 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(9)) << endl
2607 <<
"Input 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(10)) << endl
2608 <<
"Input 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(11)) << endl
2609 <<
"Output 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
2610 <<
"Output 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(13)) << endl
2611 <<
"Output 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(14)) << endl
2612 <<
"Output 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(15)) << endl
2613 <<
"Output 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(16)) << endl
2614 <<
"Output 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(17)) << endl
2615 <<
"Output 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(18)) << endl
2616 <<
"Output 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(19)) << endl
2617 <<
"Input 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(25)) << endl
2618 <<
"Input 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(26)) << endl
2619 <<
"Input 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(27)) << endl
2620 <<
"Input 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(28)) << endl
2621 <<
"Input 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2622 <<
"Input 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30));
2625 } mDecodeVidIntControl2;
2627 struct DecodeStatusReg :
public Decoder
2629 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2634 oss <<
"Input 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(20)) << endl
2635 <<
"Input 1 Field ID: " << (inRegValue &
BIT(21) ?
"1" :
"0") << endl
2636 <<
"Input 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(30)) << endl
2637 <<
"Input 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(18)) << endl
2638 <<
"Input 2 Field ID: " << (inRegValue &
BIT(19) ?
"1" :
"0") << endl
2639 <<
"Input 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(29)) << endl
2640 <<
"Output 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(22)) << endl
2641 <<
"Output 1 Field ID: " << (inRegValue &
BIT(23) ?
"1" :
"0") << endl
2642 <<
"Output 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(31)) << endl
2643 <<
"Output 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(4)) << endl
2644 <<
"Output 2 Field ID: " << (inRegValue &
BIT(5) ?
"1" :
"0") << endl
2645 <<
"Output 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(8)) << endl;
2647 oss <<
"Output 3 Vertical Blank: " <<
ActInact(inRegValue &
BIT(2)) << endl
2648 <<
"Output 3 Field ID: " << (inRegValue &
BIT(3) ?
"1" :
"0") << endl
2649 <<
"Output 3 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(7)) << endl
2650 <<
"Output 4 Vertical Blank: " <<
ActInact(inRegValue &
BIT(0)) << endl
2651 <<
"Output 4 Field ID: " << (inRegValue &
BIT(1) ?
"1" :
"0") << endl
2652 <<
"Output 4 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(6)) << endl;
2653 oss <<
"Aux Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(12)) << endl
2654 <<
"I2C 1 Interrupt: " <<
ActInact(inRegValue &
BIT(14)) << endl
2655 <<
"I2C 2 Interrupt: " <<
ActInact(inRegValue &
BIT(13)) << endl
2656 <<
"Chunk Rate Interrupt: " <<
ActInact(inRegValue &
BIT(16)) << endl;
2658 oss <<
"Generic UART Interrupt: " <<
ActInact(inRegValue &
BIT(9)) << endl
2659 <<
"Uart 1 Rx Interrupt: " <<
ActInact(inRegValue &
BIT(15)) << endl
2660 <<
"Uart 1 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(24)) << endl;
2662 oss <<
"Uart 2 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(26)) << endl;
2664 oss <<
"LTC In 1 Present: " <<
YesNo(inRegValue &
BIT(17)) << endl;
2665 oss <<
"Wrap Rate Interrupt: " <<
ActInact(inRegValue &
BIT(25)) << endl
2666 <<
"Audio Out Wrap Interrupt: " <<
ActInact(inRegValue &
BIT(27)) << endl
2667 <<
"Audio 50Hz Interrupt: " <<
ActInact(inRegValue &
BIT(28));
2672 struct DecodeCPLDVersion :
public Decoder
2674 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2679 oss <<
"CPLD Version: " <<
DEC(inRegValue & (
BIT(0)|
BIT(1))) << endl
2680 <<
"Failsafe Bitfile Loaded: " << (inRegValue &
BIT(4) ?
"Yes" :
"No") << endl
2681 <<
"Force Reload: " <<
YesNo(inRegValue &
BIT(8));
2684 } mDecodeCPLDVersion;
2686 struct DecodeStatus2Reg :
public Decoder
2688 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2692 static const uint8_t bitNumsInputVBlank[] = {20, 18, 16, 14, 12, 10};
2693 static const uint8_t bitNumsInputFieldID[] = {21, 19, 17, 15, 13, 11};
2694 static const uint8_t bitNumsInputVertInt[] = {30, 29, 28, 27, 26, 25};
2695 static const uint8_t bitNumsOutputVBlank[] = { 8, 6, 4, 2};
2696 static const uint8_t bitNumsOutputFieldID[] = { 9, 7, 5, 3};
2697 static const uint8_t bitNumsOutputVertInt[] = {31, 24, 23, 22};
2699 for (
unsigned ndx(0); ndx < 6; ndx++)
2700 oss <<
"Input " << (ndx+3) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsInputVBlank[ndx])) << endl
2701 <<
"Input " << (ndx+3) <<
" Field ID: " << (inRegValue &
BIT(bitNumsInputFieldID[ndx]) ?
"1" :
"0") << endl
2702 <<
"Input " << (ndx+3) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsInputVertInt[ndx])) << endl;
2703 for (
unsigned ndx(0); ndx < 4; ndx++)
2704 oss <<
"Output " << (ndx+5) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVBlank[ndx])) << endl
2705 <<
"Output " << (ndx+5) <<
" Field ID: " << (inRegValue &
BIT(bitNumsOutputFieldID[ndx]) ?
"1" :
"0") << endl
2706 <<
"Output " << (ndx+5) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVertInt[ndx])) << endl;
2707 oss <<
"HDMI In Hot-Plug Detect Interrupt: " <<
ActInact(inRegValue &
BIT(0)) << endl
2708 <<
"HDMI In Chip Interrupt: " <<
ActInact(inRegValue &
BIT(1));
2711 } mDecodeStatus2Reg;
2713 struct DecodeInputStatusReg :
public Decoder
2715 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2724 <<
"Input 1 Geometry: ";
2725 if (
BIT(30) & inRegValue)
2726 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2728 case 0: oss <<
"2K x 1080";
break;
2729 case 1: oss <<
"2K x 1556";
break;
2730 default: oss <<
"Invalid HI";
break;
2733 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2735 case 0: oss <<
"Unknown";
break;
2736 case 1: oss <<
"525";
break;
2737 case 2: oss <<
"625";
break;
2738 case 3: oss <<
"750";
break;
2739 case 4: oss <<
"1125";
break;
2740 case 5: oss <<
"1250";
break;
2741 case 6:
case 7: oss <<
"Reserved";
break;
2742 default: oss <<
"Invalid LO";
break;
2745 <<
"Input 1 Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2747 <<
"Input 2 Geometry: ";
2748 if (
BIT(31) & inRegValue)
2749 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2751 case 0: oss <<
"2K x 1080";
break;
2752 case 1: oss <<
"2K x 1556";
break;
2753 default: oss <<
"Invalid HI";
break;
2756 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2758 case 0: oss <<
"Unknown";
break;
2759 case 1: oss <<
"525";
break;
2760 case 2: oss <<
"625";
break;
2761 case 3: oss <<
"750";
break;
2762 case 4: oss <<
"1125";
break;
2763 case 5: oss <<
"1250";
break;
2764 case 6:
case 7: oss <<
"Reserved";
break;
2765 default: oss <<
"Invalid LO";
break;
2768 <<
"Input 2 Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2770 <<
"Reference Geometry: ";
2771 switch (((
BIT(20)|
BIT(21)|
BIT(22)) & inRegValue) >> 20)
2773 case 0: oss <<
"NTV2_SG_UNKNOWN";
break;
2774 case 1: oss <<
"NTV2_SG_525";
break;
2775 case 2: oss <<
"NTV2_SG_625";
break;
2776 case 3: oss <<
"NTV2_SG_750";
break;
2777 case 4: oss <<
"NTV2_SG_1125";
break;
2778 case 5: oss <<
"NTV2_SG_1250";
break;
2779 default: oss <<
"Invalid";
break;
2782 <<
"Reference Scan Mode: " << ((
BIT(23) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2783 <<
"AES Channel 1-2: " << ((
BIT(24) & inRegValue) ?
"Invalid" :
"Valid") << endl
2784 <<
"AES Channel 3-4: " << ((
BIT(25) & inRegValue) ?
"Invalid" :
"Valid") << endl
2785 <<
"AES Channel 5-6: " << ((
BIT(26) & inRegValue) ?
"Invalid" :
"Valid") << endl
2786 <<
"AES Channel 7-8: " << ((
BIT(27) & inRegValue) ?
"Invalid" :
"Valid");
2789 } mDecodeInputStatusReg;
2791 struct DecodeSDIInputStatusReg :
public Decoder
2793 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2796 uint16_t numSpigots(0), startSpigot(0), doTsiMuxSync(0);
2807 for (uint16_t spigotNdx(0); spigotNdx < numSpigots; )
2809 const uint16_t spigotNum (spigotNdx + startSpigot);
2810 const uint8_t statusBits ((inRegValue >> (spigotNdx*8)) & 0xFF);
2811 const uint8_t speedBits (statusBits & 0xC1);
2812 ostringstream ossSpeed, ossSpigot;
2813 ossSpigot <<
"SDI In " << spigotNum <<
" ";
2814 const string spigotLabel (ossSpigot.str());
2815 if (speedBits & 0x01) ossSpeed <<
" 3G";
2818 if (speedBits & 0x40) ossSpeed <<
" 6G";
2819 if (speedBits & 0x80) ossSpeed <<
" 12G";
2821 if (speedBits == 0) ossSpeed <<
" 1.5G";
2822 oss << spigotLabel <<
"Link Speed:" << ossSpeed.str() << endl
2823 << spigotLabel <<
"SMPTE Level B: " <<
YesNo(statusBits & 0x02) << endl
2824 << spigotLabel <<
"Link A VPID Valid: " <<
YesNo(statusBits & 0x10) << endl
2825 << spigotLabel <<
"Link B VPID Valid: " <<
YesNo(statusBits & 0x20) << endl;
2827 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: " <<
EnabDisab(statusBits & 0x04);
2829 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: n/a";
2830 if (++spigotNdx < numSpigots)
2834 for (
UWord tsiMux(0); tsiMux < 4; ++tsiMux)
2836 <<
"TsiMux" <<
DEC(tsiMux+1) <<
" Sync Fail: " << ((inRegValue & (0x00010000UL << tsiMux)) ?
"FAILED" :
"OK");
2839 } mDecodeSDIInputStatusReg;
2841 struct DecodeSDIInputStatus2Reg :
public Decoder
2843 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2851 oss << sOdd <<
" Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2853 << sOdd <<
" Geometry: ";
2854 if (
BIT(30) & inRegValue)
switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2856 case 0: oss <<
"2K x 1080";
break;
2857 case 1: oss <<
"2K x 1556";
break;
2858 default: oss <<
"Invalid HI";
break;
2860 else switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2862 case 0: oss <<
"Unknown";
break;
2863 case 1: oss <<
"525";
break;
2864 case 2: oss <<
"625";
break;
2865 case 3: oss <<
"750";
break;
2866 case 4: oss <<
"1125";
break;
2867 case 5: oss <<
"1250";
break;
2868 case 6:
case 7: oss <<
"Reserved";
break;
2869 default: oss <<
"Invalid LO";
break;
2872 << sEven <<
" Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2874 << sEven <<
" Geometry: ";
2875 if (
BIT(31) & inRegValue)
switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2877 case 0: oss <<
"2K x 1080";
break;
2878 case 1: oss <<
"2K x 1556";
break;
2879 default: oss <<
"Invalid HI";
break;
2881 else switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2883 case 0: oss <<
"Unknown";
break;
2884 case 1: oss <<
"525";
break;
2885 case 2: oss <<
"625";
break;
2886 case 3: oss <<
"750";
break;
2887 case 4: oss <<
"1125";
break;
2888 case 5: oss <<
"1250";
break;
2889 case 6:
case 7: oss <<
"Reserved";
break;
2890 default: oss <<
"Invalid LO";
break;
2894 } mDecodeSDIInputStatus2Reg;
2896 struct DecodeFS1RefSelectReg :
public Decoder
2898 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2900 (
void) inDeviceID; (
void) inRegNum;
2902 oss <<
"BNC Select(LHi): " << (inRegValue & 0x00000010 ?
"LTCIn1" :
"Ref") << endl
2903 <<
"Ref BNC (Corvid): " <<
EnabDisab(inRegValue & 0x00000020) << endl
2904 <<
"LTC Present (also Reg 21): " <<
YesNo(inRegValue & 0x00000040) << endl
2905 <<
"LTC Emb Out Enable: " <<
YesNo(inRegValue & 0x00000080) << endl
2906 <<
"LTC Emb In Enable: " <<
YesNo(inRegValue & 0x00000100) << endl
2907 <<
"LTC Emb In Received: " <<
YesNo(inRegValue & 0x00000200) << endl
2908 <<
"LTC BNC Out Source: " << (inRegValue & 0x00000400 ?
"E-E" :
"Reg112/113");
2911 } mDecodeFS1RefSelectReg;
2913 struct DecodeLTCStatusControlReg :
public Decoder
2915 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2917 (
void) inDeviceID; (
void) inRegNum;
2918 const uint16_t LTC1InTimingSelect ((inRegValue >> 1) & 0x0000007);
2919 const uint16_t LTC2InTimingSelect ((inRegValue >> 9) & 0x0000007);
2920 const uint16_t LTC1OutTimingSelect ((inRegValue >> 16) & 0x0000007);
2921 const uint16_t LTC2OutTimingSelect ((inRegValue >> 20) & 0x0000007);
2923 oss <<
"LTC 1 Input Present: " <<
YesNo(inRegValue & 0x00000001) << endl
2924 <<
"LTC 1 Input FB Timing Select): " <<
xHEX0N(LTC1InTimingSelect,2) <<
" (" <<
DEC(LTC1InTimingSelect) <<
")" << endl
2925 <<
"LTC 1 Bypass: " <<
EnabDisab(inRegValue & 0x00000010) << endl
2926 <<
"LTC 1 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 5) & 0x00000001)) << endl
2927 <<
"LTC 2 Input Present: " <<
YesNo(inRegValue & 0x00000100) << endl
2928 <<
"LTC 2 Input FB Timing Select): " <<
xHEX0N(LTC2InTimingSelect,2) <<
" (" <<
DEC(LTC2InTimingSelect) <<
")" << endl
2929 <<
"LTC 2 Bypass: " <<
EnabDisab(inRegValue & 0x00001000) << endl
2930 <<
"LTC 2 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 13) & 0x00000001)) << endl
2931 <<
"LTC 1 Output FB Timing Select): " <<
xHEX0N(LTC1OutTimingSelect,2) <<
" (" <<
DEC(LTC1OutTimingSelect) <<
")" << endl
2932 <<
"LTC 2 Output FB Timing Select): " <<
xHEX0N(LTC2OutTimingSelect,2) <<
" (" <<
DEC(LTC2OutTimingSelect) <<
")";
2935 } mLTCStatusControlDecoder;
2937 struct DecodeAudDetectReg :
public Decoder
2939 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2947 for (uint16_t num(0); num < 8; )
2949 const uint16_t group (num / 2);
2950 const bool isChan34 (num & 1);
2951 oss <<
"Group " << group <<
" CH " << (isChan34 ?
"3-4: " :
"1-2: ") << (inRegValue &
BIT(num) ?
"Present" :
"Absent");
2962 } mDecodeAudDetectReg;
2964 struct DecodeAudControlReg :
public Decoder
2966 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2970 static const string ChStrs [] = {
"Ch 1/2",
"Ch 3/4",
"Ch 5/6",
"Ch 7/8" };
2971 uint16_t sdiOutput (0);
2981 oss <<
"Audio Capture: " <<
EnabDisab(
BIT(0) & inRegValue) << endl
2982 <<
"Audio Loopback: " <<
EnabDisab(
BIT(3) & inRegValue) << endl
2983 <<
"Audio Input: " <<
DisabEnab(
BIT(8) & inRegValue) << endl
2984 <<
"Audio Output: " <<
DisabEnab(
BIT(9) & inRegValue) << endl
2985 <<
"Output Paused: " <<
YesNo(
BIT(11) & inRegValue) << endl;
2987 oss <<
"Audio Embedder SDIOut" << sdiOutput <<
": " <<
DisabEnab(
BIT(13) & inRegValue) << endl
2988 <<
"Audio Embedder SDIOut" << (sdiOutput+1) <<
": " <<
DisabEnab(
BIT(15) & inRegValue) << endl;
2990 oss <<
"A/V Sync Mode: " <<
EnabDisab(
BIT(15) & inRegValue) << endl
2991 <<
"AES Rate Converter: " <<
DisabEnab(
BIT(19) & inRegValue) << endl
2992 <<
"Audio Buffer Format: " << (
BIT(20) & inRegValue ?
"16-Channel " : (
BIT(16) & inRegValue ?
"8-Channel " :
"6-Channel ")) << endl
2993 << (
BIT(18) & inRegValue ?
"96kHz" :
"48kHz") << endl
2994 << (
BIT(18) & inRegValue ?
"96kHz Support" :
"48kHz Support") << endl
2996 <<
"Slave Mode (64-chl): " <<
EnabDisab(
BIT(23) & inRegValue) << endl
2997 <<
"K-box, Monitor: " << ChStrs [(
BIT(24) &
BIT(25) & inRegValue) >> 24] << endl
2998 <<
"K-Box Input: " << (
BIT(26) & inRegValue ?
"XLR" :
"BNC") << endl
2999 <<
"K-Box: " << (
BIT(27) & inRegValue ?
"Present" :
"Absent") << endl
3000 <<
"Cable: " << (
BIT(28) & inRegValue ?
"XLR" :
"BNC") << endl
3001 <<
"Audio Buffer Size: " << (
BIT(31) & inRegValue ?
"4 MB" :
"1 MB");
3004 } mDecodeAudControlReg;
3006 struct DecodeAudSourceSelectReg :
public Decoder
3008 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3012 static const string SrcStrs [] = {
"AES Input",
"Embedded Groups 1 and 2",
"" };
3013 static const unsigned SrcStrMap [] = { 0, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
3014 const uint16_t vidInput = (inRegValue &
BIT(23) ? 2 : 0) + (inRegValue &
BIT(16) ? 1 : 0);
3017 oss <<
"Audio Source: " << SrcStrs [SrcStrMap [(
BIT(0) |
BIT(1) |
BIT(2) |
BIT(3)) & inRegValue]] << endl
3018 <<
"Embedded Source Select: Video Input " << (1 + vidInput) << endl
3019 <<
"AES Sync Mode bit (fib): " <<
EnabDisab(inRegValue &
BIT(18)) << endl
3020 <<
"PCM disabled: " <<
YesNo(inRegValue &
BIT(17)) << endl
3021 <<
"Erase head enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
3022 <<
"Embedded Clock Select: " << (inRegValue &
BIT(22) ?
"Video Input" :
"Board Reference") << endl
3023 <<
"3G audio source: " << (inRegValue &
BIT(21) ?
"Data stream 2" :
"Data stream 1");
3026 } mDecodeAudSourceSelectReg;
3028 struct DecodeAudOutputSrcMap :
public Decoder
3030 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3034 static const string AESOutputStrs[] = {
"AES Outputs 1-4",
"AES Outputs 5-8",
"AES Outputs 9-12",
"AES Outputs 13-16",
""};
3035 static const string SrcStrs[] = {
"AudSys1, Audio Channels 1-4",
"AudSys1, Audio Channels 5-8",
3036 "AudSys1, Audio Channels 9-12",
"AudSys1, Audio Channels 13-16",
3037 "AudSys2, Audio Channels 1-4",
"AudSys2, Audio Channels 5-8",
3038 "AudSys2, Audio Channels 9-12",
"AudSys2, Audio Channels 13-16",
3039 "AudSys3, Audio Channels 1-4",
"AudSys3, Audio Channels 5-8",
3040 "AudSys3, Audio Channels 9-12",
"AudSys3, Audio Channels 13-16",
3041 "AudSys4, Audio Channels 1-4",
"AudSys4, Audio Channels 5-8",
3042 "AudSys4, Audio Channels 9-12",
"AudSys4, Audio Channels 13-16",
""};
3043 static const unsigned AESChlMappingShifts [4] = {0, 4, 8, 12};
3046 const uint32_t AESOutMapping (inRegValue & 0x0000FFFF);
3050 for (
unsigned AESOutputQuad(0); AESOutputQuad < 4; AESOutputQuad++)
3051 oss << AESOutputStrs[AESOutputQuad] <<
" Source: " << SrcStrs[(AESOutMapping >> AESChlMappingShifts[AESOutputQuad]) & 0x0000000F] << endl;
3064 const uint32_t HDMIMon1234Info (HDMIMonInfo & 0x0F);
3067 const uint32_t HDMIMon5678Info ((HDMIMonInfo >> 4) & 0x0F);
3075 } mDecodeAudOutputSrcMap;
3077 struct DecodePCMControlReg :
public Decoder
3079 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3084 for (uint8_t audChan (0); audChan < 4; audChan++)
3086 oss <<
"Audio System " << (startAudioSystem + audChan) <<
": ";
3087 const uint8_t pcmBits (uint32_t(inRegValue >> (audChan * 8)) & 0x000000FF);
3088 if (pcmBits == 0x00)
3092 oss <<
"non-PCM channels";
3093 for (uint8_t chanPair (0); chanPair < 8; chanPair++)
3094 if (pcmBits & (0x01 << chanPair))
3095 oss <<
" " << (chanPair*2+1) <<
"-" << (chanPair*2+2);
3102 } mDecodePCMControlReg;
3104 struct DecodeAudioMixerInputSelectReg :
public Decoder
3106 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3107 { (
void) inDeviceID; (
void) inRegNum;
3108 const UWord mainInputSrc((inRegValue ) & 0x0000000F);
3109 const UWord aux1InputSrc((inRegValue >> 4) & 0x0000000F);
3110 const UWord aux2InputSrc((inRegValue >> 8) & 0x0000000F);
3117 } mAudMxrInputSelDecoder;
3119 struct DecodeAudioMixerGainRegs :
public Decoder
3123 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3124 { (
void)inRegNum; (
void)inDeviceID;
3125 static const double kUnityGain (0x00010000);
3126 const bool atUnity (inRegValue == 0x00010000);
3129 oss <<
"Gain: 0 dB (Unity)";
3132 const double dValue (inRegValue);
3133 const bool aboveUnity (inRegValue >= 0x00010000);
3134 const string plusMinus (atUnity ?
"" : (aboveUnity ?
"+" :
"-"));
3135 const string aboveBelow (atUnity ?
"at" : (aboveUnity ?
"above" :
"below"));
3136 const uint32_t unityDiff (aboveUnity ? inRegValue - 0x00010000 : 0x00010000 - inRegValue);
3137 const double dB (
double(20.0) * ::log10(dValue/kUnityGain));
3138 oss <<
"Gain: " << dB <<
" dB, " << plusMinus <<
xHEX0N(unityDiff,6)
3139 <<
" (" << plusMinus <<
DEC(unityDiff) <<
") " << aboveBelow <<
" unity gain";
3143 } mAudMxrGainDecoder;
3145 struct DecodeAudioMixerChannelSelectReg :
public Decoder
3147 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3148 { (
void) inRegNum; (
void) inDeviceID;
3153 <<
"Level Measurement Sample Count: " <<
DEC(
ULWord(1 << powerOfTwo)) <<
" (bits 8-15)";
3156 } mAudMxrChanSelDecoder;
3159 struct DecodeAudioMixerMutesReg :
public Decoder
3162 typedef std::bitset<16> AudioChannelSet16;
3163 typedef std::bitset<2> AudioChannelSet2;
3166 outSet.clear(); outClear.clear();
3167 for (
size_t ndx(0); ndx < 16; ndx++)
3168 { ostringstream oss; oss <<
DEC(ndx+1);
3169 if (inChSet.test(ndx))
3170 outSet.push_back(oss.str());
3172 outClear.push_back(oss.str());
3174 if (outSet.empty()) outSet.push_back(
"<none>");
3175 if (outClear.empty()) outClear.push_back(
"<none>");
3179 outSet.clear(); outClear.clear();
static const string LR[] = {
"L",
"R"};
3180 for (
size_t ndx(0); ndx < 2; ndx++)
3181 if (inChSet.test(ndx))
3182 outSet.push_back(LR[ndx]);
3184 outClear.push_back(LR[ndx]);
3185 if (outSet.empty()) outSet.push_back(
"<none>");
3186 if (outClear.empty()) outClear.push_back(
"<none>");
3189 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3190 { (
void) inRegNum; (
void) inDeviceID;
3196 NTV2StringList mutedMainOut, unmutedMainOut, mutedMain, unmutedMain, mutedAux1, unmutedAux1, mutedAux2, unmutedAux2;
3197 SplitAudioChannelSet16(AudioChannelSet16(mainOutputMuteBits), mutedMainOut, unmutedMainOut);
3198 SplitAudioChannelSet2(AudioChannelSet2(mainInputMuteBits), mutedMain, unmutedMain);
3199 SplitAudioChannelSet2(AudioChannelSet2(aux1InputMuteBits), mutedAux1, unmutedAux1);
3200 SplitAudioChannelSet2(AudioChannelSet2(aux2InputMuteBits), mutedAux2, unmutedAux2);
3201 oss <<
"Main Output Muted/Disabled Channels: " << mutedMainOut << endl
3202 <<
"Main Output Unmuted/Enabled Channels: " << unmutedMainOut << endl;
3203 oss <<
"Main Input Muted/Disabled Channels: " << mutedMain << endl
3204 <<
"Main Input Unmuted/Enabled Channels: " << unmutedMain << endl;
3205 oss <<
"Aux Input 1 Muted/Disabled Channels: " << mutedAux1 << endl
3206 <<
"Aux Input 1 Unmuted/Enabled Channels: " << unmutedAux1 << endl;
3207 oss <<
"Aux Input 2 Muted/Disabled Channels: " << mutedAux2 << endl
3208 <<
"Aux Input 2 Unmuted/Enabled Channels: " << unmutedAux2;
3211 } mAudMxrMutesDecoder;
3213 struct DecodeAudioMixerLevelsReg :
public Decoder
3217 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3218 { (
void) inDeviceID;
3219 static const string sLabels[] = {
"Aux Input 1",
"Aux Input 2",
"Main Input Audio Channels 1|2",
"Main Input Audio Channels 3|4",
3220 "Main Input Audio Channels 5|6",
"Main Input Audio Channels 7|8",
"Main Input Audio Channels 9|10",
3221 "Main Input Audio Channels 11|12",
"Main Input Audio Channels 13|14",
"Main Input Audio Channels 15|16",
3222 "Main Output Audio Channels 1|2",
"Main Output Audio Channels 3|4",
"Main Output Audio Channels 5|6",
3223 "Main Output Audio Channels 7|8",
"Main Output Audio Channels 9|10",
"Main Output Audio Channels 11|12",
3224 "Main Output Audio Channels 13|14",
"Main Output Audio Channels 15|16"};
3228 const string & label(sLabels[labelOffset]);
3232 oss << label <<
" Left Level:" <<
xHEX0N(leftLevel, 4) <<
" (" <<
DEC(leftLevel) <<
")" << endl
3233 << label <<
" Right Level:" <<
xHEX0N(rightLevel,4) <<
" (" <<
DEC(rightLevel) <<
")";
3236 } mAudMxrLevelDecoder;
3238 struct DecodeAncExtControlReg :
public Decoder
3240 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3245 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3246 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3247 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3248 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3249 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3250 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3251 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3252 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3253 <<
"SD Y+C Demux: " <<
EnabDisab(inRegValue &
BIT(30)) << endl
3254 <<
"Metadata from: " << (inRegValue &
BIT(31) ?
"LSBs" :
"MSBs");
3257 } mDecodeAncExtControlReg;
3259 struct DecodeAuxExtControlReg :
public Decoder
3261 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3266 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3267 oss <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3268 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3269 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3270 <<
"Filter inclusion: " <<
EnabDisab(inRegValue &
BIT(29));
3273 } mDecodeAuxExtControlReg;
3276 struct DecodeAncExtFieldLinesReg :
public Decoder
3278 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3282 const uint32_t which (inRegNum & 0x1F);
3283 const uint32_t valueLow (inRegValue & 0xFFF);
3284 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFF);
3287 case 5: oss <<
"F1 cutoff line: " << valueLow << endl
3288 <<
"F2 cutoff line: " << valueHigh;
3290 case 9: oss <<
"F1 VBL start line: " << valueLow << endl
3291 <<
"F2 VBL start line: " << valueHigh;
3293 case 11: oss <<
"Field ID high on line: " << valueLow << endl
3294 <<
"Field ID low on line: " << valueHigh;
3296 case 17: oss <<
"F1 analog start line: " << valueLow << endl
3297 <<
"F2 analog start line: " << valueHigh;
3300 oss <<
"Invalid register type";
3305 } mDecodeAncExtFieldLines;
3308 struct DecodeAncExtStatusReg :
public Decoder
3310 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3314 const uint32_t which (inRegNum & 0x1F);
3315 const uint32_t byteTotal (inRegValue & 0xFFFFFF);
3316 const bool overrun ((inRegValue &
BIT(28)) ?
true :
false);
3319 case 6: oss <<
"Total bytes: ";
break;
3320 case 7: oss <<
"Total F1 bytes: ";
break;
3321 case 8: oss <<
"Total F2 bytes: ";
break;
3322 default: oss <<
"Invalid register type";
break;
3324 oss <<
DEC(byteTotal) << endl
3325 <<
"Overrun: " <<
YesNo(overrun);
3328 } mDecodeAncExtStatus;
3331 struct DecodeAncExtIgnoreDIDReg :
public Decoder
3333 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3338 oss <<
"Ignoring DIDs " <<
HEX0N((inRegValue >> 0) & 0xFF, 2)
3339 <<
", " <<
HEX0N((inRegValue >> 8) & 0xFF, 2)
3340 <<
", " <<
HEX0N((inRegValue >> 16) & 0xFF, 2)
3341 <<
", " <<
HEX0N((inRegValue >> 24) & 0xFF, 2);
3344 } mDecodeAncExtIgnoreDIDs;
3346 struct DecodeAncExtAnalogFilterReg :
public Decoder
3348 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3353 uint32_t which (inRegNum & 0x1F);
3354 oss <<
"Each 1 bit specifies capturing ";
3357 case 18: oss <<
"F1 Y";
break;
3358 case 19: oss <<
"F2 Y";
break;
3359 case 20: oss <<
"F1 C";
break;
3360 case 21: oss <<
"F2 C";
break;
3361 default:
return "Invalid register type";
3363 oss <<
" line as analog, else digital";
3366 } mDecodeAncExtAnalogFilter;
3368 struct DecodeAncInsValuePairReg :
public Decoder
3370 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3374 const uint32_t which (inRegNum & 0x1F);
3375 const uint32_t valueLow (inRegValue & 0xFFFF);
3376 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFFF);
3380 case 0: oss <<
"F1 byte count low: " << valueLow << endl
3381 <<
"F2 byte count low: " << valueHigh;
3383 case 4: oss <<
"HANC pixel delay: " << (valueLow & 0x3FF) << endl
3384 <<
"VANC pixel delay: " << (valueHigh & 0x7FF);
3386 case 5: oss <<
"F1 first active line: " << (valueLow & 0x7FF) << endl
3387 <<
"F2 first active line: " << (valueHigh & 0x7FF);
3389 case 6: oss <<
"Active line length: " << (valueLow & 0x7FF) << endl
3390 <<
"Total line length: " << (valueHigh & 0xFFF);
3392 case 8: oss <<
"Field ID high on line: " << (valueLow & 0x7FF) << endl
3393 <<
"Field ID low on line: " << (valueHigh & 0x7FF);
3395 case 11: oss <<
"F1 chroma blnk start line: " << (valueLow & 0x7FF) << endl
3396 <<
"F2 chroma blnk start line: " << (valueHigh & 0x7FF);
3398 case 14: oss <<
"F1 byte count high: " << valueLow << endl
3399 <<
"F2 byte count high: " << valueHigh;
3401 default:
return "Invalid register type";
3405 } mDecodeAncInsValuePairReg;
3407 struct DecodeAncInsControlReg :
public Decoder
3409 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3414 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3415 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3416 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3417 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3418 <<
"Payload Y insert: " <<
YesNo(inRegValue &
BIT(16)) << endl
3419 <<
"Payload C insert: " <<
YesNo(inRegValue &
BIT(17)) << endl
3420 <<
"Payload F1 insert: " <<
YesNo(inRegValue &
BIT(20)) << endl
3421 <<
"Payload F2 insert: " <<
YesNo(inRegValue &
BIT(21)) << endl
3422 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(24)) << endl
3423 <<
"Memory reads: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3424 <<
"SD Packet Split: " <<
EnabDisab(inRegValue &
BIT(31));
3427 } mDecodeAncInsControlReg;
3429 struct DecodeAncInsChromaBlankReg :
public Decoder
3431 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3436 uint32_t which (inRegNum & 0x1F);
3438 oss <<
"Each 1 bit specifies if chroma in ";
3441 case 12: oss <<
"F1";
break;
3442 case 13: oss <<
"F2";
break;
3443 default:
return "Invalid register type";
3445 oss <<
" should be blanked or passed thru";
3448 } mDecodeAncInsChromaBlankReg;
3450 struct DecodeXptGroupReg :
public Decoder
3452 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3454 static unsigned sShifts[4] = {0, 8, 16, 24};
3456 for (
unsigned ndx(0); ndx < 4; ndx++)
3474 strs.push_back(oss.str());
3480 } mDecodeXptGroupReg;
3482 struct DecodeXptValidReg :
public Decoder
3484 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3501 ss <<
xHEX0N(outputXpt,2) <<
"(" <<
DEC(outputXpt) <<
")";
3503 ss <<
"'" << name <<
"'";
3504 outputXptNames.push_back(ss.str());
3506 if (!outputXptNames.empty())
3507 oss <<
"Valid Xpts: " << outputXptNames;
3511 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3513 } mDecodeXptValidReg;
3515 struct DecodeNTV4FSReg :
public Decoder
3517 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3518 { (
void) inDeviceID;
3519 static const string sPixClkSelects[] = {
"27",
"74.1758",
"74.25",
"148.3516",
"148.5",
"inv5",
"inv6",
"inv7"};
3520 static const string sSyncs[] = {
"Sync to Frame",
"Sync to Field",
"Immediate",
"Sync to External"};
3526 {
const ULWord disabled (inRegValue &
BIT(1));
3527 const ULWord sync ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3528 const ULWord pixClkSel((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18))) >> 16);
3531 oss <<
"Enabled: " <<
YesNo(!disabled) << endl
3532 <<
"Mode: " << ((inRegValue &
BIT( 0)) ?
"Capture" :
"Display") << endl
3533 <<
"DRT_DISP: " <<
OnOff(inRegValue &
BIT( 2)) << endl
3534 <<
"Fill Bit: " <<
DEC((inRegValue &
BIT( 3)) ? 1 : 0) << endl
3535 <<
"Dither: " <<
EnabDisab(inRegValue &
BIT( 4)) << endl
3536 <<
"RGB8 Convert: " << ((inRegValue &
BIT( 5)) ?
"Use '00'" :
"Copy MSBs") << endl
3537 <<
"Progressive: " <<
YesNo(inRegValue &
BIT( 6)) << endl
3539 <<
"Pix Clk Sel: " << sPixClkSelects[pixClkSel] <<
" MHz" << endl
3540 <<
"Sync: " << sSyncs[sync];
3542 oss <<
"Enabled: " <<
YesNo(!disabled);
3546 {
const ULWord lineCnt ((inRegValue & (0xFFFF0000)) >> 16);
3547 oss <<
"Field ID: " <<
OddEven(inRegValue &
BIT( 0)) << endl
3548 <<
"Line Count: " <<
DEC(lineCnt);
3552 {
const int32_t xferByteCnt((inRegValue & 0xFFFF0000) >> 16), linePitch(inRegValue & 0x0000FFFF);
3553 oss <<
"Line Pitch: " << linePitch << (linePitch < 0 ?
" (flipped)" :
"") << endl
3554 <<
"Xfer Byte Count: " << xferByteCnt <<
" [bytes/line]" << (linePitch < 0 ?
" (flipped)" :
"");
3558 {
const ULWord ROIVSize((inRegValue & (0x0FFF0000)) >> 16), ROIHSize(inRegValue & 0x00000FFF);
3559 oss <<
"ROI Horz Size: " <<
DEC(ROIHSize) <<
" [pixels]" << endl
3560 <<
"ROI Vert Size: " <<
DEC(ROIVSize) <<
" [lines]";
3565 {
const ULWord ROIVOff((inRegValue & (0x0FFF0000)) >> 16), ROIHOff(inRegValue & 0x00000FFF);
3567 oss <<
"ROI " << fld <<
" Horz Offset: " <<
DEC(ROIHOff) << endl
3568 <<
"ROI " << fld <<
" Vert Offset: " <<
DEC(ROIVOff);
3572 {
const ULWord tot((inRegValue & (0x0FFF0000)) >> 16), act(inRegValue & 0x00000FFF);
3573 oss <<
"Disp Horz Active: " <<
DEC(act) << endl
3574 <<
"Disp Horz Total: " <<
DEC(tot);
3578 {
const ULWord lo((inRegValue & (0x07FF0000)) >> 16), hi(inRegValue & 0x000007FF);
3579 oss <<
"Disp FID Lo: " <<
DEC(lo) << endl
3580 <<
"Disp FID Hi: " <<
DEC(hi);
3585 {
const ULWord actEnd((inRegValue & (0x07FF0000)) >> 16), actStart(inRegValue & 0x000007FF);
3587 oss <<
"Disp " << fld <<
" Active Start: " <<
DEC(actStart) << endl
3588 <<
"Disp " << fld <<
" Active End: " <<
DEC(actEnd);
3592 oss <<
"Unpacker Horz Offset: " <<
DEC(inRegValue & 0x0000FFFF);
3596 {
const ULWord hi((inRegValue & (0xFFFF0000)) >> 16), lo(inRegValue & 0x0000FFFF);
3599 oss <<
"Disp Fill " << CbBorCrR <<
": " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4) << endl
3600 <<
"Disp Fill " << YGorA <<
": " <<
DEC(hi) <<
" " <<
xHEX0N(hi,4);
3604 {
const ULWord lo(inRegValue & 0x0000FFFF);
3605 oss <<
"ROI Fill Alpha: " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4);
3609 oss <<
"Output Timing Frame Pulse Preset: " <<
DEC(inRegValue & 0x00FFFFFF) <<
" "
3610 <<
xHEX0N(inRegValue & 0x00FFFFFF,6);
3615 {
const int32_t lo (inRegValue & 0x00001FFF);
3616 oss <<
"Output Video Offset: " << lo <<
" " <<
xHEX0N(lo,6);
3620 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3626 struct DecodeHDMIOutputControl :
public Decoder
3628 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3632 static const string sHDMIStdV1[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" };
3633 static const string sHDMIStdV2V3[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3634 static const string sVidRates[] = {
"",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95",
"",
"",
"",
"",
"" };
3635 static const string sSrcSampling[] = {
"YC422",
"RGB",
"YC420",
"Unknown/invalid" };
3636 static const string sBitDepth[] = {
"8",
"10",
"12",
"Unknown/invalid" };
3639 const string hdmiVidStdStr (hdmiVers > 1 ? sHDMIStdV2V3[rawVideoStd] : (hdmiVers == 1 ? sHDMIStdV1[rawVideoStd] :
""));
3642 const uint32_t srcBPC ((inRegValue & (
BIT(16)|
BIT(17))) >> 16);
3643 const uint32_t txBitDepth ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3644 oss <<
"Video Standard: " << hdmiVidStdStr;
3645 if (hdmiVidStdStr != vidStdStr)
3646 oss <<
" (" << vidStdStr <<
")";
3648 <<
"Color Mode: " << ((inRegValue &
BIT( 8)) ?
"RGB" :
"YCbCr") << endl
3650 <<
"Scan Mode: " << ((inRegValue &
BIT(13)) ?
"Progressive" :
"Interlaced") << endl
3651 <<
"Bit Depth: " << ((inRegValue &
BIT(14)) ?
"10-bit" :
"8-bit") << endl
3652 <<
"Output Color Sampling: " << ((inRegValue &
BIT(15)) ?
"4:4:4" :
"4:2:2") << endl
3653 <<
"Output Bit Depth: " << sBitDepth[txBitDepth] << endl
3654 <<
"Src Color Sampling: " << sSrcSampling[srcSampling] << endl
3655 <<
"Src Bits Per Component: " << sBitDepth[srcBPC] << endl
3656 <<
"Output Range: " << ((inRegValue &
BIT(28)) ?
"Full" :
"SMPTE") << endl
3657 <<
"Audio Channels: " << ((inRegValue &
BIT(29)) ?
"8" :
"2") << endl
3658 <<
"Output: " << ((inRegValue &
BIT(30)) ?
"DVI" :
"HDMI");
3661 <<
"Audio Loopback: " <<
OnOff(inRegValue &
BIT(31));
3664 } mDecodeHDMIOutputControl;
3666 struct DecodeHDMIInputStatus :
public Decoder
3668 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3675 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"2K1080p",
"2K1080i",
"3840p",
"4096p"};
3676 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" };
3677 oss <<
"HDMI Input: " << (inRegValue &
BIT(0) ?
"Locked" :
"Unlocked") << endl
3678 <<
"HDMI Input: " << (inRegValue &
BIT(1) ?
"Stable" :
"Unstable") << endl
3679 <<
"Color Mode: " << (inRegValue &
BIT(2) ?
"RGB" :
"YCbCr") << endl
3680 <<
"Bitdepth: " << (inRegValue &
BIT(3) ?
"10-bit" :
"8-bit") << endl
3681 <<
"Audio Channels: " << (inRegValue &
BIT(12) ? 2 : 8) << endl
3682 <<
"Scan Mode: " << (inRegValue &
BIT(13) ?
"Progressive" :
"Interlaced") << endl
3683 <<
"Standard: " << (inRegValue &
BIT(14) ?
"SD" :
"HD") << endl
3684 <<
"Video Standard: " << sStds[vidStd] << endl
3685 <<
"Protocol: " << (inRegValue &
BIT(27) ?
"DVI" :
"HDMI") << endl
3686 <<
"Video Rate : " << (rate < 11 ? sRates[rate] :
string(
"invalid"));
3689 } mDecodeHDMIInputStatus;
3691 struct DecodeHDMIInputControl :
public Decoder
3693 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3695 (
void) inRegNum; (
void) inDeviceID;
3697 const UWord chanPair ((inRegValue & (
BIT(2) |
BIT(3))) >> 2);
3699 const UWord txCh12Sel ((inRegValue & (
BIT(29)|
BIT(30))) >> 29);
3701 oss <<
"HDMI In EDID Write-Enable: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
3702 <<
"HDMI Force Output Params: " <<
SetNotset(inRegValue &
BIT(1)) << endl
3704 <<
"hdmi_rx_8ch_src_off: " <<
YesNo(inRegValue &
BIT(4)) << endl
3705 <<
"Swap HDMI In Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(5)) << endl
3706 <<
"Swap HDMI Out Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(6)) << endl
3707 <<
"HDMI Prefer 420: " <<
SetNotset(inRegValue &
BIT(7)) << endl
3708 <<
"hdmi_rx_spdif_err: " <<
SetNotset(inRegValue &
BIT(8)) << endl
3709 <<
"hdmi_rx_afifo_under: " <<
SetNotset(inRegValue &
BIT(9)) << endl
3710 <<
"hdmi_rx_afifo_empty: " <<
SetNotset(inRegValue &
BIT(10)) << endl
3711 <<
"H polarity: " << (inRegValue &
BIT(16) ?
"Inverted" :
"Normal") << endl
3712 <<
"V polarity: " << (inRegValue &
BIT(17) ?
"Inverted" :
"Normal") << endl
3713 <<
"F polarity: " << (inRegValue &
BIT(18) ?
"Inverted" :
"Normal") << endl
3714 <<
"DE polarity: " << (inRegValue &
BIT(19) ?
"Inverted" :
"Normal") << endl
3715 <<
"Tx Src Sel: " <<
DEC(txSrcSel) <<
" (" <<
xHEX0N(txSrcSel,4) <<
")" << endl
3716 <<
"Tx Center Cut: " <<
SetNotset(inRegValue &
BIT(24)) << endl
3717 <<
"Tx 12 bit: " <<
SetNotset(inRegValue &
BIT(26)) << endl
3718 <<
"RGB Input Gamut: " << (inRegValue &
BIT(28) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3719 <<
"Tx_ch12_sel: " <<
DEC(txCh12Sel) <<
" (" <<
xHEX0N(txCh12Sel,4) <<
")" << endl
3720 <<
"Input AVI Gamut: " << (inRegValue &
BIT(31) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3724 } mDecodeHDMIInputControl;
3726 struct DecodeHDMIOutputStatus :
public Decoder
3728 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3729 { (
void) inRegNum; (
void) inDeviceID;
3735 } mDecodeHDMIOutputStatus;
3737 struct DecodeHDMIOutHDRPrimary :
public Decoder
3739 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3759 const double xFloat (
double(xPrimary) * 0.00002);
3760 const double yFloat (
double(yPrimary) * 0.00002);
3762 oss <<
"X: " <<
fDEC(xFloat,7,5) << endl;
3764 oss <<
"X: " <<
HEX0N(xPrimary, 4) <<
"(invalid)" << endl;
3766 oss <<
"Y: " <<
fDEC(yFloat,7,5);
3768 oss <<
"Y: " <<
HEX0N(yPrimary, 4) <<
"(invalid)";
3775 const double minFloat (
double(minValue) * 0.00001);
3776 const double maxFloat (maxValue);
3777 oss <<
"Min: " <<
fDEC(minFloat,7,5) << endl
3778 <<
"Max: " <<
fDEC(maxFloat,7,5);
3785 const double cntFloat (cntValue);
3786 const double frmFloat (frmValue);
3787 oss <<
"Max Content Light Level: " <<
fDEC(cntFloat,7,5) << endl
3788 <<
"Max Frame Light Level: " <<
fDEC(frmFloat,7,5);
3795 } mDecodeHDMIOutHDRPrimary;
3797 struct DecodeHDMIOutHDRControl :
public Decoder
3799 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3802 static const string sEOTFs[] = {
"Trad Gamma SDR",
"Trad Gamma HDR",
"SMPTE ST 2084",
"HLG"};
3811 <<
"EOTF: " << sEOTFs[(EOTFvalue < 3) ? EOTFvalue : 3] << endl
3812 <<
"Static MetaData Desc ID: " <<
HEX0N(staticMetaDataDescID, 2) <<
" (" <<
DEC(staticMetaDataDescID) <<
")";
3816 } mDecodeHDMIOutHDRControl;
3818 struct DecodeHDMIOutMRControl :
public Decoder
3820 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3821 { (
void) inRegNum; (
void) inDeviceID;
3823 static const string sMRStandard[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3825 const string hdmiVidStdStr (sMRStandard[rawVideoStd]);
3827 oss <<
"Video Standard: " << hdmiVidStdStr;
3828 if (hdmiVidStdStr != vidStdStr)
3829 oss <<
" (" << vidStdStr <<
")";
3831 <<
"Capture Mode: " << ((inRegValue &
kRegMaskMREnable) ?
"Enabled" :
"Disabled");
3834 } mDecodeHDMIOutMRControl;
3836 struct DecodeSDIOutputControl :
public Decoder
3838 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3843 const uint32_t vidStd (inRegValue & (
BIT(0)|
BIT(1)|
BIT(2)));
3844 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"6",
"7"};
3845 oss <<
"Video Standard: " << sStds[vidStd] << endl
3846 <<
"2Kx1080 mode: " << (inRegValue &
BIT(3) ?
"2048x1080" :
"1920x1080") << endl
3847 <<
"HBlank RGB Range: Black=" << (inRegValue &
BIT(7) ?
"0x40" :
"0x04") << endl
3848 <<
"12G enable: " <<
YesNo(inRegValue &
BIT(17)) << endl
3849 <<
"6G enable: " <<
YesNo(inRegValue &
BIT(16)) << endl
3850 <<
"3G enable: " <<
YesNo(inRegValue &
BIT(24)) << endl
3851 <<
"3G mode: " << (inRegValue &
BIT(25) ?
"b" :
"a") << endl
3852 <<
"VPID insert enable: " <<
YesNo(inRegValue &
BIT(26)) << endl
3853 <<
"VPID overwrite enable: " <<
YesNo(inRegValue &
BIT(27)) << endl
3854 <<
"DS 1 audio source: " "AudSys";
3855 switch ((inRegValue & (
BIT(28)|
BIT(30))) >> 28)
3857 case 0: oss << (inRegValue &
BIT(18) ? 5 : 1);
break;
3858 case 1: oss << (inRegValue &
BIT(18) ? 7 : 3);
break;
3859 case 4: oss << (inRegValue &
BIT(18) ? 6 : 2);
break;
3860 case 5: oss << (inRegValue &
BIT(18) ? 8 : 4);
break;
3862 oss << endl <<
"DS 2 audio source: AudSys";
3863 switch ((inRegValue & (
BIT(29)|
BIT(31))) >> 29)
3865 case 0: oss << (inRegValue &
BIT(19) ? 5 : 1);
break;
3866 case 1: oss << (inRegValue &
BIT(19) ? 7 : 3);
break;
3867 case 4: oss << (inRegValue &
BIT(19) ? 6 : 2);
break;
3868 case 5: oss << (inRegValue &
BIT(19) ? 8 : 4);
break;
3872 } mDecodeSDIOutputControl;
3874 struct DecodeSDIOutTimingCtrl :
public Decoder
3876 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3877 { (
void)inRegNum; (
void)inDeviceID;
3879 const uint32_t hMask(0x00001FFF), vMask(0x1FFF0000);
3880 const uint32_t hOffset(inRegValue & hMask), vOffset((inRegValue & vMask) >> 16);
3881 oss <<
"Horz Offset: " <<
xHEX0N(
UWord(hOffset),4) << endl
3882 <<
"Vert Offset: " <<
xHEX0N(
UWord(vOffset),4) << endl
3883 <<
"E-E Timing Override: " <<
EnabDisab(inRegValue &
BIT(31));
3886 } mDecodeSDIOutTimingCtrl;
3888 struct DecodeDMAControl :
public Decoder
3890 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3894 const uint16_t gen ((inRegValue & (
BIT(20)|
BIT(21)|
BIT(22)|
BIT(23))) >> 20);
3895 const uint16_t lanes ((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18)|
BIT(19))) >> 16);
3896 const uint16_t fwRev ((inRegValue & 0x0000FF00) >> 8);
3898 for (uint16_t engine(0); engine < 4; engine++)
3899 oss <<
"DMA " << (engine+1) <<
" Int Active?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3900 oss <<
"Bus Error Int Active?: " <<
YesNo(inRegValue &
BIT(31)) << endl;
3901 for (uint16_t engine(0); engine < 4; engine++)
3902 oss <<
"DMA " << (engine+1) <<
" Busy?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3903 oss <<
"Strap: " << ((inRegValue &
BIT(7)) ?
"Installed" :
"Not Installed") << endl
3904 <<
"Firmware Rev: " <<
xHEX0N(fwRev, 2) <<
" (" <<
DEC(fwRev) <<
")" << endl
3905 <<
"Gen: " << gen << ((gen > 0 && gen < 4) ?
"" :
" <invalid>") << endl
3906 <<
"Lanes: " <<
DEC(lanes) << ((lanes < 9) ?
"" :
" <invalid>");
3909 } mDMAControlRegDecoder;
3911 struct DecodeDMAIntControl :
public Decoder
3913 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3918 for (uint16_t eng(0); eng < 4; eng++)
3919 oss <<
"DMA " << (eng+1) <<
" Enabled?: " <<
YesNo(inRegValue &
BIT(eng)) << endl;
3920 oss <<
"Bus Error Enabled?: " <<
YesNo(inRegValue &
BIT(4)) << endl;
3921 for (uint16_t eng(0); eng < 4; eng++)
3922 oss <<
"DMA " << (eng+1) <<
" Active?: " <<
YesNo(inRegValue &
BIT(27+eng)) << endl;
3923 oss <<
"Bus Error: " <<
YesNo(inRegValue &
BIT(31));
3926 } mDMAIntControlRegDecoder;
3928 struct DecodeDMAXferRate :
public Decoder
3930 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3931 { (
void) inRegNum; (
void) inDeviceID;
3933 oss <<
DEC(inRegValue) <<
" [MB/sec] [kB/ms] [B/us]";
3936 } mDMAXferRateRegDecoder;
3938 struct DecodeRP188InOutDBB :
public Decoder
3940 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3944 const bool isReceivingRP188 (inRegValue &
BIT(16));
3945 const bool isReceivingSelectedRP188 (inRegValue &
BIT(17));
3946 const bool isReceivingLTC (inRegValue &
BIT(18));
3947 const bool isReceivingVITC (inRegValue &
BIT(19));
3949 oss <<
"RP188: " << (isReceivingRP188 ? (isReceivingSelectedRP188 ?
"Selected" :
"Unselected") :
"No") <<
" RP-188 received"
3950 << (isReceivingLTC ?
" +LTC" :
"") << (isReceivingVITC ?
" +VITC" :
"") << endl
3951 <<
"Bypass: " << (inRegValue &
BIT(23) ? (inRegValue &
BIT(22) ?
"SDI In 2" :
"SDI In 1") :
"Disabled") << endl
3952 <<
"Filter: " <<
HEX0N((inRegValue & 0xFF000000) >> 24, 2) << endl
3953 <<
"DBB: " <<
HEX0N((inRegValue & 0x0000FF00) >> 8, 2) <<
" " <<
HEX0N(inRegValue & 0x000000FF, 2);
3956 } mRP188InOutDBBRegDecoder;
3958 struct DecodeVidProcControl :
public Decoder
3960 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3965 static const string sSplitStds [8] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"?6?",
"?7?"};
3966 oss <<
"Mode: " << (inRegValue &
kRegMaskVidProcMode ? ((inRegValue &
BIT(24)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3967 <<
"FG Control: " << (inRegValue &
kRegMaskVidProcFGControl ? ((inRegValue &
BIT(20)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3968 <<
"BG Control: " << (inRegValue &
kRegMaskVidProcBGControl ? ((inRegValue &
BIT(22)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3969 <<
"VANC Pass-Thru: " << ((inRegValue &
BIT(13)) ?
"Background" :
"Foreground") << endl
3973 <<
"Limiting: " << ((inRegValue &
BIT(11)) ?
"Off" : ((inRegValue &
BIT(12)) ?
"Legal Broadcast" :
"Legal SDI")) << endl
3977 } mVidProcControlRegDecoder;
3979 struct DecodeSplitControl :
public Decoder
3981 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3986 const uint32_t startmask (0x0000FFFF);
3987 const uint32_t slopemask (0x3FFF0000);
3988 const uint32_t fractionmask(0x00000007);
3989 oss <<
"Split Start: " <<
HEX0N((inRegValue & startmask) & ~fractionmask, 4) <<
" "
3990 <<
HEX0N((inRegValue & startmask) & fractionmask, 4) << endl
3991 <<
"Split Slope: " <<
HEX0N(((inRegValue & slopemask) >> 16) & ~fractionmask, 4) <<
" "
3992 <<
HEX0N(((inRegValue & slopemask) >> 16) & fractionmask, 4) << endl
3993 <<
"Split Type: " << ((inRegValue &
BIT(30)) ?
"Vertical" :
"Horizontal");
3996 } mSplitControlRegDecoder;
3998 struct DecodeFlatMatteValue :
public Decoder
4000 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4005 const uint32_t mask (0x000003FF);
4006 oss <<
"Flat Matte Cb: " <<
HEX0N(inRegValue & mask, 3) << endl
4007 <<
"Flat Matte Y: " <<
HEX0N(((inRegValue >> 10) & mask) - 0x40, 3) << endl
4008 <<
"Flat Matte Cr: " <<
HEX0N((inRegValue >> 20) & mask, 3);
4011 } mFlatMatteValueRegDecoder;
4013 struct DecodeEnhancedCSCMode :
public Decoder
4015 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4019 static const string sFiltSel[] = {
"Full",
"Simple",
"None",
"?"};
4020 static const string sEdgeCtrl[] = {
"black",
"extended pixels"};
4021 static const string sPixFmts[] = {
"RGB 4:4:4",
"YCbCr 4:4:4",
"YCbCr 4:2:2",
"?"};
4022 const uint32_t filterSelect ((inRegValue >> 12) & 0x3);
4023 const uint32_t edgeControl ((inRegValue >> 8) & 0x1);
4024 const uint32_t outPixFmt ((inRegValue >> 4) & 0x3);
4025 const uint32_t inpPixFmt (inRegValue & 0x3);
4027 oss <<
"Filter select: " << sFiltSel[filterSelect] << endl
4028 <<
"Filter edge control: " <<
"Filter to " << sEdgeCtrl[edgeControl] << endl
4029 <<
"Output pixel format: " << sPixFmts[outPixFmt] << endl
4030 <<
"Input pixel format: " << sPixFmts[inpPixFmt];
4033 } mEnhCSCModeDecoder;
4035 struct DecodeEnhancedCSCOffset :
public Decoder
4037 static string U10Dot6ToFloat (
const uint32_t inOffset)
4039 double result (
double((inOffset >> 6) & 0x3FF));
4040 result += double(inOffset & 0x3F) / 64.0;
4041 ostringstream oss; oss <<
fDEC(result,12,5);
string resultStr(oss.str());
4044 static string U12Dot4ToFloat (
const uint32_t inOffset)
4046 double result (
double((inOffset >> 4) & 0xFFF));
4047 result += double(inOffset & 0xF) / 16.0;
4048 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4051 static string S13Dot2ToFloat (
const uint32_t inOffset)
4053 double result (
double((inOffset >> 2) & 0x1FFF));
4054 result += double(inOffset & 0x3) / 4.0;
4055 if (inOffset &
BIT(15))
4057 ostringstream oss; oss <<
fDEC(result,12,2);
string resultStr(oss.str());
4060 static string S11Dot4ToFloat (
const uint32_t inOffset)
4062 double result (
double((inOffset >> 4) & 0x7FF));
4063 result += double(inOffset & 0xF) / 16.0;
4064 if (inOffset &
BIT(15))
4066 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4069 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4072 const uint32_t regNum (inRegNum & 0x1F);
4073 const uint32_t lo (inRegValue & 0x0000FFFF);
4074 const uint32_t hi ((inRegValue >> 16) & 0xFFFF);
4078 case 1: oss <<
"Component 0 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4079 <<
"Component 1 input offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4081 case 2: oss <<
"Component 2 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4083 case 12: oss <<
"Component A output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4084 <<
"Component B output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4086 case 13: oss <<
"Component C output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4088 case 15: oss <<
"Key input offset: " << S13Dot2ToFloat(lo) <<
" (12-bit), " << S11Dot4ToFloat(lo) <<
" (10-bit)" << endl
4089 <<
"Key output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4095 } mEnhCSCOffsetDecoder;
4097 struct DecodeEnhancedCSCKeyMode :
public Decoder
4099 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4103 static const string sSrcSel[] = {
"Key Input",
"Video Y Input"};
4104 static const string sRange[] = {
"Full Range",
"SMPTE Range"};
4105 const uint32_t keySrcSelect (inRegValue & 0x1);
4106 const uint32_t keyOutRange ((inRegValue >> 4) & 0x1);
4108 oss <<
"Key Source Select: " << sSrcSel[keySrcSelect] << endl
4109 <<
"Key Output Range: " << sRange[keyOutRange];
4112 } mEnhCSCKeyModeDecoder;
4114 struct DecodeEnhancedCSCCoefficient :
public Decoder
4116 static string S2Dot15ToFloat (
const uint32_t inCoefficient)
4118 double result = (double((inCoefficient >> 15) & 0x3));
4119 result += double(inCoefficient & 0x7FFF) / 32768.0;
4120 if (inCoefficient &
BIT(17))
4122 ostringstream oss; oss <<
fDEC(result,12,10);
string resultStr(oss.str());
4125 static string S12Dot12ToFloat (
const uint32_t inCoefficient)
4127 double result(
double((inCoefficient >> 12) & 0xFFF));
4128 result += double(inCoefficient & 0xFFF) / 4096.0;
4129 if (inCoefficient &
BIT(24))
4131 ostringstream oss; oss <<
fDEC(result,12,6);
string resultStr(oss.str());
4134 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4137 uint32_t regNum (inRegNum & 0x1F);
4139 if (regNum > 2 && regNum < 12)
4142 static const string sCoeffNames[] = {
"A0",
"A1",
"A2",
"B0",
"B1",
"B2",
"C0",
"C1",
"C2"};
4143 const uint32_t coeff ((inRegValue >> 9) & 0x0003FFFF);
4144 oss << sCoeffNames[regNum] <<
" coefficient: " << S2Dot15ToFloat(coeff) <<
" (" <<
xHEX0N(coeff,8) <<
")";
4146 else if (regNum == 16)
4148 const uint32_t gain ((inRegValue >> 4) & 0x01FFFFFF);
4149 oss <<
"Key gain: " << S12Dot12ToFloat(gain) <<
" (" <<
HEX0N(gain,8) <<
")";
4153 } mEnhCSCCoeffDecoder;
4155 struct DecodeCSCoeff1234 :
public Decoder
4157 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4160 const uint32_t coeff1 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4161 const uint32_t coeff2 ((inRegValue >> 14) & 0x00001FFF);
4162 uint16_t nCoeff1(1), nCoeff2(2);
4167 nCoeff1 = 3; nCoeff2 = 4;
break;
4183 oss <<
"Video Key Sync Status: " << (inRegValue &
BIT(28) ?
"SyncFail" :
"OK") << endl
4184 <<
"Make Alpha From Key Input: " <<
EnabDisab(inRegValue &
BIT(29)) << endl
4185 <<
"Matrix Select: " << (inRegValue &
BIT(30) ?
"Rec601" :
"Rec709") << endl
4186 <<
"Use Custom Coeffs: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4188 oss <<
"RGB Range: " << (inRegValue &
BIT(31) ?
"SMPTE (0x040-0x3C0)" :
"Full (0x000-0x3FF)") << endl;
4189 oss <<
"Coefficient" <<
DEC(nCoeff1) <<
": " <<
xHEX0N(coeff1, 4) << endl
4190 <<
"Coefficient" <<
DEC(nCoeff2) <<
": " <<
xHEX0N(coeff2, 4);
4193 } mCSCoeff1234Decoder;
4195 struct DecodeCSCoeff567890 :
public Decoder
4197 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4200 const uint32_t coeff5 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4201 const uint32_t coeff6 ((inRegValue >> 14) & 0x00001FFF);
4202 uint16_t nCoeff5(5), nCoeff6(6);
4207 nCoeff5 = 7; nCoeff6 = 8;
break;
4210 nCoeff5 = 9; nCoeff6 = 10;
break;
4220 oss <<
"Coefficient" <<
DEC(nCoeff5) <<
": " <<
xHEX0N(coeff5, 4) << endl
4221 <<
"Coefficient" <<
DEC(nCoeff6) <<
": " <<
xHEX0N(coeff6, 4);
4224 } mCSCoeff567890Decoder;
4226 struct DecodeLUTV1ControlReg :
public Decoder
4228 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4229 {
static const string sModes[] = {
"Off",
"RGB",
"YCbCr",
"3-Way",
"Invalid"};
4242 if (lutVersion != 1)
4243 oss <<
"(Register data relevant for V1 LUT, this device has V" <<
DEC(lutVersion) <<
" LUT)";
4246 oss <<
"LUT Saturation Value: " <<
xHEX0N(saturation,4) <<
" (" <<
DEC(saturation) <<
")" << endl
4247 <<
"LUT Output Bank Select: " <<
SetNotset(outBankSelect) << endl
4248 <<
"LUT Mode: " << sModes[mode] <<
" (" <<
DEC(mode) <<
")";
4251 <<
"LUT5 Host Bank Select: " <<
SetNotset(cc5HostBank) << endl
4252 <<
"LUT5 Output Bank Select: " <<
SetNotset(cc5OutputBank) << endl
4253 <<
"LUT5 Select: " <<
SetNotset(cc5Select) << endl
4254 <<
"Config 2nd LUT Set: " <<
YesNo(ccConfig2);
4257 <<
"LUT3 Bank Select: " <<
SetNotset(cc3BankSel) << endl
4258 <<
"LUT4 Bank Select: " <<
SetNotset(cc4BankSel);
4261 } mLUTV1ControlRegDecoder;
4263 struct DecodeLUTV2ControlReg :
public Decoder
4265 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4269 if (lutVersion != 2)
4270 oss <<
"(Register data relevant for V2 LUT, this device has V" <<
DEC(lutVersion) <<
"LUT)";
4273 for (
UWord lutNum(0); lutNum < 8; lutNum++)
4274 oss <<
"LUT" <<
DEC(lutNum+1) <<
" Enabled: " << (
YesNo(inRegValue & (1<<lutNum))) << endl
4275 <<
"LUT" <<
DEC(lutNum+1) <<
" Host Access Bank Select: " << (inRegValue & (1<<(lutNum+8)) ?
'1' :
'0') << endl
4276 <<
"LUT" <<
DEC(lutNum+1) <<
" Output Bank Select: " << (inRegValue & (1<<(lutNum+16)) ?
'1' :
'0') << endl;
4277 oss <<
"12-Bit LUT mode: " << ((inRegValue &
BIT(28)) ?
"12-bit" :
"10-bit") << endl
4278 <<
"12-Bit LUT page reg: " <<
DEC(
UWord((inRegValue & (
BIT(24)|
BIT(25))) >> 24));
4282 } mLUTV2ControlRegDecoder;
4284 struct DecodeLUT :
public Decoder
4286 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4290 const bool isRed(inRegNum >= RedReg && inRegNum < GreenReg), isGreen(inRegNum >= GreenReg && inRegNum < BlueReg), isBlue(inRegNum>=BlueReg);
4296 const string label(isRed ?
"Red[" : (isGreen ?
"Green[" :
"Blue["));
4297 const ULWord ndx((inRegNum - (isRed ? RedReg : (isGreen ? GreenReg : BlueReg))) * 2);
4300 oss << label <<
DEC0N(ndx+0,3) <<
"]: " <<
DEC0N(lo,3) << endl
4301 << label <<
DEC0N(ndx+1,3) <<
"]: " <<
DEC0N(hi,3);
4306 struct DecodeSDIErrorStatus :
public Decoder
4308 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4314 oss <<
"Unlock Tally: " <<
DEC(inRegValue & 0x7FFF) << endl
4315 <<
"Locked: " <<
YesNo(inRegValue &
BIT(16)) << endl
4316 <<
"Link A VPID Valid: " <<
YesNo(inRegValue &
BIT(20)) << endl
4317 <<
"Link B VPID Valid: " <<
YesNo(inRegValue &
BIT(21)) << endl
4318 <<
"TRS Error Detected: " <<
YesNo(inRegValue &
BIT(24));
4321 } mSDIErrorStatusRegDecoder;
4323 struct DecodeSDIErrorCount :
public Decoder
4325 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4331 oss <<
"Link A: " <<
DEC(inRegValue & 0x0000FFFF) << endl
4332 <<
"Link B: " <<
DEC((inRegValue & 0xFFFF0000) >> 16);
4335 } mSDIErrorCountRegDecoder;
4337 struct DecodeDriverVersion :
public Decoder
4339 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4340 { (
void) inDeviceID;
4344 ULWord buildType((inRegValue >> 30) & 0x00000003);
4345 static const string sBuildTypes[] = {
"Release",
"Beta",
"Alpha",
"Development"};
4346 static const string sBldTypes[] = {
"",
"b",
"a",
"d"};
4348 oss <<
"Driver Version: " <<
DEC(vMaj) <<
"." <<
DEC(vMin) <<
"." <<
DEC(vDot);
4349 if (buildType) oss << sBldTypes[buildType] <<
DEC(vBld);
4351 <<
"Major Version: " <<
DEC(vMaj) << endl
4352 <<
"Minor Version: " <<
DEC(vMin) << endl
4353 <<
"Point Version: " <<
DEC(vDot) << endl
4354 <<
"Build Type: " << sBuildTypes[buildType] << endl
4355 <<
"Build Number: " <<
DEC(vBld);
4358 } mDriverVersionDecoder;
4360 struct DecodeFourCC :
public Decoder
4362 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4363 { (
void) inDeviceID; (
void) inRegNum;
4364 char ch;
string str4cc;
4365 ch = char((inRegValue & 0xFF000000) >> 24);
4366 str4cc += ::isprint(ch) ? ch :
'?';
4367 ch = char((inRegValue & 0x00FF0000) >> 16);
4368 str4cc += ::isprint(ch) ? ch :
'?';
4369 ch = char((inRegValue & 0x0000FF00) >> 8);
4370 str4cc += ::isprint(ch) ? ch :
'?';
4371 ch = char((inRegValue & 0x000000FF) >> 0);
4372 str4cc += ::isprint(ch) ? ch :
'?';
4375 oss <<
"'" << str4cc <<
"'";
4380 struct DecodeDriverType :
public Decoder
4382 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4383 { (
void) inDeviceID; (
void) inRegNum;
4386 if (inRegValue == 0x44455854)
4387 oss <<
"DriverKit ('DEXT')";
4388 else if (inRegValue)
4389 oss <<
"(Unknown/Invalid " <<
xHEX0N(inRegValue,8) <<
")";
4391 oss <<
"Kernel Extension ('KEXT')";
4398 } mDecodeDriverType;
4400 struct DecodeIDSwitchStatus :
public Decoder
4402 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4407 const uint32_t switchEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
4408 for (
UWord idSwitch(0); idSwitch < 4; )
4410 const uint32_t switchEnabled (switchEnableBits &
BIT(idSwitch));
4411 oss <<
"Switch " <<
DEC(++idSwitch) <<
": " << (switchEnabled ?
"Enabled" :
"Disabled");
4418 oss <<
"(ID Switch not supported)";
4423 } mDecodeIDSwitchStatus;
4425 struct DecodePWMFanControl :
public Decoder
4427 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4435 } mDecodePWMFanControl;
4437 struct DecodePWMFanMonitor :
public Decoder
4439 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4447 } mDecodePWMFanMonitor;
4449 struct DecodeBOBStatus :
public Decoder
4451 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4455 oss <<
"BOB : " << ((inRegValue &
kRegMaskBOBAbsent) ?
"Disconnected" :
"Connected") << endl
4459 oss <<
"Device does not support a breakout board";
4464 struct DecodeBOBGPIIn :
public Decoder
4466 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4475 oss <<
"Device does not support a breakout board";
4480 struct DecodeBOBGPIInInterruptControl :
public Decoder
4482 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4491 oss <<
"Device does not support a breakout board";
4494 } mDecodeBOBGPIInInterruptControl;
4496 struct DecodeBOBGPIOut :
public Decoder
4498 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4507 oss <<
"Device does not support a breakout board";
4512 struct DecodeBOBAudioControl :
public Decoder
4514 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4523 dBuLabel =
"+24dBu";
4526 dBuLabel =
"+18dBu";
4529 dBuLabel =
"+12dBu";
4532 dBuLabel =
"+15dBu";
4537 <<
"Analog Level Control: " << dBuLabel << endl
4541 oss <<
"Device does not support a breakout board";
4544 } mDecodeBOBAudioControl;
4546 struct DecodeLEDControl :
public Decoder
4548 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4556 oss <<
"Device does not support a breakout board";
4559 } mDecodeLEDControl;
4561 static const int NOREADWRITE = 0;
4562 static const int READONLY = 1;
4563 static const int WRITEONLY = 2;
4564 static const int READWRITE = 3;
4566 static const int CONTAINS = 0;
4567 static const int STARTSWITH = 1;
4568 static const int ENDSWITH = 2;
4569 static const int EXACTMATCH = 3;
4571 typedef map <uint32_t, const Decoder *> RegNumToDecoderMap;
4572 typedef pair <uint32_t, const Decoder *> RegNumToDecoderPair;
4573 typedef multimap <string, uint32_t> RegClassToRegNumMMap, StringToRegNumMMap;
4574 typedef pair <string, uint32_t> StringToRegNumPair;
4575 typedef RegClassToRegNumMMap::const_iterator RegClassToRegNumConstIter;
4576 typedef StringToRegNumMMap::const_iterator StringToRegNumConstIter;
4578 typedef pair <uint32_t, uint32_t> XptRegNumAndMaskIndex;
4579 typedef map <NTV2InputCrosspointID, XptRegNumAndMaskIndex> InputXpt2XptRegNumMaskIndexMap;
4580 typedef map <XptRegNumAndMaskIndex, NTV2InputCrosspointID> XptRegNumMaskIndex2InputXptMap;
4581 typedef InputXpt2XptRegNumMaskIndexMap::const_iterator InputXpt2XptRegNumMaskIndexMapConstIter;
4582 typedef XptRegNumMaskIndex2InputXptMap::const_iterator XptRegNumMaskIndex2InputXptMapConstIter;
4586 RegNumToStringMap mRegNumToStringMap;
4587 RegNumToDecoderMap mRegNumToDecoderMap;
4588 RegClassToRegNumMMap mRegClassToRegNumMMap;
4589 StringToRegNumMMap mStringToRegNumMMap;
4591 InputXpt2XptRegNumMaskIndexMap mInputXpt2XptRegNumMaskIndexMap;
4592 XptRegNumMaskIndex2InputXptMap mXptRegNumMaskIndex2InputXptMap;
4622 return pInst ?
true :
false;
4629 return pInst ?
true :
false;
4636 return pInst ? pInst->DisposeInstance() :
false;
4644 return pRegExpert->RegNameToString(inRegNum);
4646 ostringstream oss; oss <<
"Reg ";
4648 oss <<
DEC(inRegNum);
4649 else if (inRegNum <= 0x0000FFFF)
4650 oss <<
xHEX0N(inRegNum,4);
4652 oss <<
xHEX0N(inRegNum,8);
4660 return pRegExpert ? pRegExpert->RegValueToString(inRegNum, inRegValue, inDeviceID) : string();
4667 return pRegExpert ? pRegExpert->IsRegInClass(inRegNum, inClassName) :
false;
4674 return pRegExpert ? pRegExpert->GetAllRegisterClasses() :
NTV2StringSet();
4681 return pRegExpert ? pRegExpert->GetRegisterClasses(inRegNum, inRemovePrefix) :
NTV2StringSet();
4688 return pRegExpert ? pRegExpert->GetRegistersForClass(inClassName) :
NTV2RegNumSet();
4702 return pRegExpert ? pRegExpert->GetRegistersForDevice(inDeviceID, inOtherRegsToInclude) :
NTV2RegNumSet();
4709 return pRegExpert ? pRegExpert->GetRegistersWithName(inName, inSearchStyle) :
NTV2RegNumSet();
4723 return pRegExpert ? pRegExpert->GetXptRegNumAndMaskIndex(inInputXpt, outXptRegNum, outMaskIndex) :
false;