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
363 void SetupBOBRegs(
void)
372 void SetupLEDRegs(
void)
384 void SetupCMWRegs(
void)
394 void SetupVPIDRegs(
void)
430 void SetupTimecodeRegs(
void)
496 void SetupAudioRegs(
void)
582 void SetupMRRegs(
void)
593 void SetupDMARegs(
void)
624 void SetupXptSelect(
void)
636 if (mXptRegNumMaskIndex2InputXptMap.find (regNumAndNdx) == mXptRegNumMaskIndex2InputXptMap.end())
638 if (mInputXpt2XptRegNumMaskIndexMap.find (
NTV2_XptHDMIOutQ1Input) == mInputXpt2XptRegNumMaskIndexMap.end())
674 { ostringstream regName;
681 if (inputXptEnumName.empty())
682 regName <<
"kRegXptValid" <<
DEC0N(rawInputXpt,3) <<
"N" <<
DEC(ndx);
684 regName <<
"kRegXptValid" <<
aja::replace(inputXptEnumName,
"NTV2_Xpt",
"") <<
DEC(ndx);
687 regName <<
"kRegXptValue" <<
HEX0N(regNum,4);
692 void SetupAncInsExt(
void)
694 static const string AncExtRegNames [] = {
"Control",
"F1 Start Address",
"F1 End Address",
695 "F2 Start Address",
"F2 End Address",
"Field Cutoff Lines",
696 "Memory Total",
"F1 Memory Usage",
"F2 Memory Usage",
697 "V Blank Lines",
"Lines Per Frame",
"Field ID Lines",
698 "Ignore DID 1-4",
"Ignore DID 5-8",
"Ignore DID 9-12",
699 "Ignore DID 13-16",
"Ignore DID 17-20",
"Analog Start Line",
700 "Analog F1 Y Filter",
"Analog F2 Y Filter",
"Analog F1 C Filter",
701 "Analog F2 C Filter",
"",
"",
703 "Analog Act Line Len"};
704 static const string AncInsRegNames [] = {
"Field Bytes",
"Control",
"F1 Start Address",
705 "F2 Start Address",
"Pixel Delay",
"Active Start",
706 "Pixels Per Line",
"Lines Per Frame",
"Field ID Lines",
707 "Payload ID Control",
"Payload ID",
"Chroma Blank Lines",
708 "F1 C Blanking Mask",
"F2 C Blanking Mask",
"Field Bytes High",
709 "Reserved 15",
"RTP Payload ID",
"RTP SSRC",
711 static const uint32_t AncExtPerChlRegBase [] = { 0x1000, 0x1040, 0x1080, 0x10C0, 0x1100, 0x1140, 0x1180, 0x11C0 };
712 static const uint32_t AncInsPerChlRegBase [] = { 0x1200, 0x1240, 0x1280, 0x12C0, 0x1300, 0x1340, 0x1380, 0x13C0 };
714 NTV2_ASSERT(
sizeof(AncExtRegNames[0]) ==
sizeof(AncExtRegNames[1]));
719 for (
ULWord offsetNdx (0); offsetNdx < 8; offsetNdx++)
723 if (AncExtRegNames[reg].empty())
continue;
724 ostringstream oss; oss <<
"Extract " << (offsetNdx+1) <<
" " << AncExtRegNames[reg];
725 DefineRegName (AncExtPerChlRegBase[offsetNdx] + reg, oss.str());
729 ostringstream oss; oss <<
"Insert " << (offsetNdx+1) <<
" " << AncInsRegNames[reg];
730 DefineRegName (AncInsPerChlRegBase[offsetNdx] + reg, oss.str());
733 for (
ULWord ndx (0); ndx < 8; ndx++)
780 void SetupAuxInsExt(
void)
782 static const string AuxExtRegNames [] = {
"Control",
"F1 Start Address",
"F1 End Address",
783 "F2 Start Address",
"",
"",
784 "Memory Total",
"F1 Memory Usage",
"F2 Memory Usage",
785 "V Blank Lines",
"Lines Per Frame",
"Field ID Lines",
786 "Ignore DID 1-4",
"Ignore DID 5-8",
"Ignore DID 9-12",
787 "Ignore DID 13-16",
"Buffer Fill"};
795 static const uint32_t AuxExtPerChlRegBase [] = { 7616, 7680, 7744, 7808 };
796 static const uint32_t AuxInsPerChlRegBase [] = { 4608, 4672, 4736, 4800 };
799 NTV2_ASSERT(
sizeof(AuxExtRegNames[0]) ==
sizeof(AuxExtRegNames[1]));
804 for (
ULWord offsetNdx (0); offsetNdx < 4; offsetNdx++)
808 if (AuxExtRegNames[reg].empty())
continue;
809 ostringstream oss; oss <<
"Extract " << (offsetNdx+1) <<
" " << AuxExtRegNames[reg];
810 DefineRegName (AuxExtPerChlRegBase[offsetNdx] + reg, oss.str());
818 for (
ULWord ndx (0); ndx < 4; ndx++)
861 void SetupHDMIRegs(
void)
1015 void SetupSDIErrorRegs(
void)
1018 static const string suffixes [] = {
"Status",
"CRCErrorCount",
"FrameCountLow",
"FrameCountHigh",
"FrameRefCountLow",
"FrameRefCountHigh"};
1019 static const int perms [] = {READWRITE, READWRITE, READWRITE, READWRITE, READONLY, READONLY};
1022 for (
ULWord chan (0); chan < 8; chan++)
1023 for (
UWord ndx(0); ndx < 6; ndx++)
1025 ostringstream ossName; ossName <<
"kRegRXSDI" <<
DEC(chan+1) << suffixes[ndx];
1026 const string & regName (ossName.str());
1027 const uint32_t regNum (baseNum[chan] + ndx);
1028 const int perm (perms[ndx]);
1040 void SetupLUTRegs (
void)
1045 void SetupCSCRegs(
void)
1050 for (
unsigned num(0); num < 8; num++)
1052 ostringstream ossRegName; ossRegName <<
"kRegEnhancedCSC" << (num+1);
1053 const string & chanClass (sChan[num]);
const string rootName (ossRegName.str());
1054 const string modeName (rootName +
"Mode");
const string inOff01Name (rootName +
"InOffset0_1");
const string inOff2Name (rootName +
"InOffset2");
1055 const string coeffA0Name (rootName +
"CoeffA0");
const string coeffA1Name (rootName +
"CoeffA1");
const string coeffA2Name (rootName +
"CoeffA2");
1056 const string coeffB0Name (rootName +
"CoeffB0");
const string coeffB1Name (rootName +
"CoeffB1");
const string coeffB2Name (rootName +
"CoeffB2");
1057 const string coeffC0Name (rootName +
"CoeffC0");
const string coeffC1Name (rootName +
"CoeffC1");
const string coeffC2Name (rootName +
"CoeffC2");
1058 const string outOffABName(rootName +
"OutOffsetA_B");
const string outOffCName (rootName +
"OutOffsetC");
1059 const string keyModeName (rootName +
"KeyMode");
const string keyClipOffName (rootName +
"KeyClipOffset");
const string keyGainName (rootName +
"KeyGain");
1086 for (
unsigned chan(0); chan < 8; chan++)
1088 const string & chanClass (sChan[chan]);
1101 #if 1 // V2 tables need the appropriate Enable & Bank bits set in kRegLUTV2Control, otherwise they'll always readback zero!
1104 for (
ULWord ndx(0); ndx < 512; ndx++)
1106 ostringstream regNameR, regNameG, regNameB;
1107 regNameR <<
"kRegLUTRed" <<
DEC0N(ndx,3); regNameG <<
"kRegLUTGreen" <<
DEC0N(ndx,3); regNameB <<
"kRegLUTBlue" <<
DEC0N(ndx,3);
1115 void SetupMixerKeyerRegs(
void)
1134 void SetupNTV4FrameStoreRegs(
void)
1136 for (
ULWord fsNdx(0); fsNdx < 4; fsNdx++)
1140 ostringstream regName; regName <<
"kRegNTV4FS" <<
DEC(fsNdx+1) <<
"_";
1171 regName <<
"InputSourceSelect";
1175 regName <<
DEC(regNdx);
1183 void SetupVRegs(
void)
1705 for (
ULWord ndx(1); ndx < 1024; ndx++)
1707 ostringstream oss; oss <<
"VIRTUALREG_START+" << ndx;
1708 const string regName (oss.str());
1710 if (mRegNumToStringMap.find(regNum) == mRegNumToStringMap.end())
1712 mRegNumToStringMap.insert (RegNumToStringPair(regNum, regName));
1713 mStringToRegNumMMap.insert (StringToRegNumPair(ToLower(regName), regNum));
1715 DefineRegDecoder (regNum, mDefaultRegDecoder);
1716 DefineRegReadWrite (regNum, READWRITE);
1731 const string & label (it->first);
1732 const string & value (it->second);
1735 else if (label.at(label.length()-1) !=
' ' && label.at(label.length()-1) !=
':')
1736 oss << label <<
": " << value;
1737 else if (label.at(label.length()-1) ==
':')
1738 oss << label <<
" " << value;
1740 oss << label << value;
1741 if (++it != inLabelValuePairs.end())
1750 RegNumToStringMap::const_iterator iter (mRegNumToStringMap.find (inRegNum));
1751 if (iter != mRegNumToStringMap.end())
1752 return iter->second;
1754 ostringstream oss; oss <<
"Reg ";
1756 oss <<
DEC(inRegNum);
1757 else if (inRegNum <= 0x0000FFFF)
1758 oss <<
xHEX0N(inRegNum,4);
1760 oss <<
xHEX0N(inRegNum,8);
1767 RegNumToDecoderMap::const_iterator iter(mRegNumToDecoderMap.find(inRegNum));
1769 if (iter != mRegNumToDecoderMap.end() && iter->second)
1771 const Decoder * pDecoder (iter->second);
1772 oss << (*pDecoder)(inRegNum, inRegValue, inDeviceID);
1777 bool IsRegInClass (
const uint32_t inRegNum,
const string & inClassName)
const
1780 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1781 if (it->second == inRegNum)
1792 if (mAllRegClasses.empty())
1793 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1794 if (mAllRegClasses.find(it->first) == mAllRegClasses.end())
1795 mAllRegClasses.insert(it->first);
1796 return mAllRegClasses;
1805 if (IsRegInClass (inRegNum, *it))
1810 if (result.find(str) == result.end())
1820 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1821 if (result.find(it->second) == result.end())
1822 result.insert(it->second);
1831 for (uint32_t regNum (0); regNum <= maxRegNum; regNum++)
1832 result.insert(regNum);
1841 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1843 for (
UWord num(0); num < numSpigots; num++)
1846 allChanRegs.insert(chRegs.begin(), chRegs.end());
1848 std::set_intersection (ancRegs.begin(), ancRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1856 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1858 for (
UWord num(0); num < numSpigots; num++)
1861 allChanRegs.insert(chRegs.begin(), chRegs.end());
1863 std::set_intersection (auxRegs.begin(), auxRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1869 result.insert(sdiErrRegs.begin(), sdiErrRegs.end());
1875 result.insert(regNum);
1877 result.insert(regNum);
1889 for (
UWord num(0); num < numCSCs; num++)
1892 allChanRegs.insert(chRegs.begin(), chRegs.end());
1894 std::set_intersection (ecscRegs.begin(), ecscRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1900 result.insert(LUTRegs.begin(), LUTRegs.end());
1905 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1906 result.insert(regNum);
1907 for (
ULWord regNum = 0x2500; regNum <= 0x251f; regNum++)
1908 result.insert(regNum);
1909 for (
ULWord regNum = 0x2c00; regNum <= 0x2c1f; regNum++)
1910 result.insert(regNum);
1911 for (
ULWord regNum = 0x3000; regNum <= 0x301f; regNum++)
1912 result.insert(regNum);
1916 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1917 result.insert(regNum);
1918 for (
ULWord regNum = 0x1d40; regNum <= 0x1d5f; regNum++)
1919 result.insert(regNum);
1920 for (
ULWord regNum = 0x3C00; regNum <= 0x3C0A; regNum++)
1921 result.insert(regNum);
1939 for (
UWord num(0); num < numFrameStores; num++)
1942 chanRegs.insert(chRegs.begin(), chRegs.end());
1944 std::set_intersection (ntv4FSRegs.begin(), ntv4FSRegs.end(), chanRegs.begin(), chanRegs.end(), std::inserter(result, result.begin()));
1992 result.insert(vRegs.begin(), vRegs.end());
1998 result.insert(xptMapRegs.begin(), xptMapRegs.end());
2007 string nameStr(inName);
2008 const size_t nameStrLen(
aja::lower(nameStr).length());
2009 StringToRegNumConstIter it;
2011 if (inMatchStyle == EXACTMATCH)
2013 it = mStringToRegNumMMap.find(nameStr);
2014 if (it != mStringToRegNumMMap.end())
2015 result.insert(it->second);
2019 for (it = mStringToRegNumMMap.begin(); it != mStringToRegNumMMap.end(); ++it)
2021 const size_t pos(it->first.find(nameStr));
2022 if (pos == string::npos)
2024 switch (inMatchStyle)
2026 case CONTAINS: result.insert(it->second);
break;
2027 case STARTSWITH:
if (pos == 0)
2028 {result.insert(it->second);}
2030 case ENDSWITH:
if (pos+nameStrLen == it->first.length())
2031 {result.insert(it->second);}
2042 outXptRegNum = 0xFFFFFFFF;
2043 outMaskIndex = 0xFFFFFFFF;
2044 InputXpt2XptRegNumMaskIndexMapConstIter iter (mInputXpt2XptRegNumMaskIndexMap.find (inInputXpt));
2045 if (iter == mInputXpt2XptRegNumMaskIndexMap.end())
2047 outXptRegNum = iter->second.first;
2048 outMaskIndex = iter->second.second;
2055 const XptRegNumAndMaskIndex key (inXptRegNum, inMaskIndex);
2056 XptRegNumMaskIndex2InputXptMapConstIter iter (mXptRegNumMaskIndex2InputXptMap.find (key));
2057 if (iter != mXptRegNumMaskIndex2InputXptMap.end())
2058 return iter->second;
2062 ostream &
Print (ostream & inOutStream)
const
2065 static const string sLineBreak (96,
'=');
2066 static const uint32_t
sMasks[4] = {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000};
2068 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToStringMap: " << mRegNumToStringMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2069 for (RegNumToStringMap::const_iterator it (mRegNumToStringMap.begin()); it != mRegNumToStringMap.end(); ++it)
2070 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => '" << it->second <<
"'" << endl;
2072 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToDecoderMap: " << mRegNumToDecoderMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2073 for (RegNumToDecoderMap::const_iterator it (mRegNumToDecoderMap.begin()); it != mRegNumToDecoderMap.end(); ++it)
2074 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => " << (it->second == &mDefaultRegDecoder ?
"(default decoder)" :
"Custom Decoder") << endl;
2076 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegClassToRegNumMMap: " << mRegClassToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2077 for (RegClassToRegNumMMap::const_iterator it (mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
2078 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2080 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of StringToRegNumMMap: " << mStringToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2081 for (StringToRegNumMMap::const_iterator it (mStringToRegNumMMap.begin()); it != mStringToRegNumMMap.end(); ++it)
2082 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
2084 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of InputXpt2XptRegNumMaskIndexMap: " << mInputXpt2XptRegNumMaskIndexMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2085 for (InputXpt2XptRegNumMaskIndexMap::const_iterator it (mInputXpt2XptRegNumMaskIndexMap.begin()); it != mInputXpt2XptRegNumMaskIndexMap.end(); ++it)
2087 <<
") => reg " << setw(3) << it->second.first <<
"(" <<
HEX0N(it->second.first,3) << dec <<
"|" << setw(20) << RegNameToString(it->second.first)
2088 <<
") mask " << it->second.second <<
"(" <<
HEX0N(
sMasks[it->second.second],8) <<
")" << endl;
2090 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of XptRegNumMaskIndex2InputXptMap: " << mXptRegNumMaskIndex2InputXptMap.size() <<
" mappings:" << endl << sLineBreak << endl;
2091 for (XptRegNumMaskIndex2InputXptMap::const_iterator it (mXptRegNumMaskIndex2InputXptMap.begin()); it != mXptRegNumMaskIndex2InputXptMap.end(); ++it)
2092 inOutStream <<
"reg " << setw(3) << it->first.first <<
"(" <<
HEX0N(it->first.first,4) <<
"|" << setw(20) << RegNameToString(it->first.first)
2093 <<
") mask " << it->first.second <<
"(" <<
HEX0N(
sMasks[it->first.second],8) <<
") => "
2099 typedef std::map<uint32_t, string> RegNumToStringMap;
2100 typedef std::pair<uint32_t, string> RegNumToStringPair;
2102 static string ToLower (
const string & inStr)
2104 string result (inStr);
2105 std::transform (result.begin (), result.end (), result.begin (), ::tolower);
2109 struct DecodeGlobalControlReg :
public Decoder
2111 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2128 for (
int led(0); led < 4; ++led)
2129 oss << (((inRegValue &
kRegMaskLED) >> (16 + led)) ?
"*" :
".");
2134 <<
"Color Correction: " <<
"Channel: " << ((inRegValue &
BIT(31)) ?
"2" :
"1")
2135 <<
" Bank " << ((inRegValue &
BIT (30)) ?
"1" :
"0");
2138 } mDecodeGlobalControlReg;
2141 struct DecodeGlobalControl2 :
public Decoder
2143 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2160 for (
unsigned ch(0); ch < 8; ch++)
2161 oss <<
"Audio " <<
DEC(ch+1) <<
" Play/Capture Mode: " <<
OnOff(inRegValue & playCaptModes[ch]) << endl;
2162 for (
unsigned ch(2); ch < 8; ch++)
2163 oss <<
"Ch " <<
DEC(ch+1) <<
" RP188 Output: " <<
EnabDisab(inRegValue & rp188Modes[ch]) << endl;
2164 for (
unsigned ch(0); ch < 3; ch++)
2165 oss <<
"Ch " <<
DEC(2*(ch+2)) <<
" 1080p50/p60 Link-B Mode: " <<
EnabDisab(inRegValue & BLinkModes[ch]) << endl;
2166 for (
unsigned ch(0); ch < 4; ch++)
2167 oss <<
"Ch " <<
DEC(ch+1) <<
"/" <<
DEC(ch+2) <<
" 2SI Mode: " <<
EnabDisab(inRegValue & k425Masks[ch]) << endl;
2168 oss <<
"2SI Min Align Delay 1-4: " <<
EnabDisab(inRegValue &
BIT(24)) << endl
2169 <<
"2SI Min Align Delay 5-8: " <<
EnabDisab(inRegValue &
BIT(25));
2172 } mDecodeGlobalControl2;
2175 struct DecodeGlobalControl3 :
public Decoder
2177 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2184 <<
"VU Meter Audio Select: " << (inRegValue &
kRegMaskVUMeterSelect ?
"AudMixer" :
"AudSys1") << endl
2194 } mDecodeGlobalControl3;
2197 struct DecodeGlobalControlChanReg :
public Decoder
2199 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2212 } mDecodeGlobalControlChanRegs;
2215 struct DecodeChannelControlReg :
public Decoder
2217 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2224 oss <<
"Mode: " << (inRegValue &
kRegMaskMode ?
"Capture" :
"Display") << endl
2227 <<
"Viper Squeeze: " << (inRegValue &
BIT(9) ?
"Squeeze" :
"Normal") << endl
2232 <<
"Frame Size: " << (1 << (((inRegValue &
kK2RegMaskFrameSize) >> 20) + 1)) <<
" MB" << endl;
2235 oss <<
"RGB Range: " << (inRegValue &
BIT(24) ?
"Black = 0x40" :
"Black = 0") << endl
2239 } mDecodeChannelControl;
2241 struct DecodeFBControlReg :
public Decoder
2243 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2247 const bool isOn ((inRegValue & (1 << 29)) != 0);
2248 const uint16_t format ((inRegValue >> 15) & 0x1F);
2250 oss <<
OnOff(isOn) << endl
2251 <<
"Format: " <<
xHEX0N(format,4) <<
" (" <<
DEC(format) <<
")";
2254 } mDecodeFBControlReg;
2256 struct DecodeChannelControlExtReg :
public Decoder
2258 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2263 oss <<
"Input Video 2:1 Decimate: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
2264 <<
"HDMI Rx Direct: " <<
EnabDisab(inRegValue &
BIT(1)) << endl
2265 <<
"3:2 Pulldown Mode: " <<
EnabDisab(inRegValue &
BIT(2));
2268 } mDecodeChannelControlExt;
2270 struct DecodeSysmonVccIntDieTemp :
public Decoder
2272 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2276 const UWord rawDieTemp ((inRegValue & 0x0000FFFF) >> 6);
2277 const UWord rawVoltage ((inRegValue >> 22) & 0x3FF);
2278 const double dieTempC ((
double(rawDieTemp)) * 503.975 / 1024.0 - 273.15 );
2279 const double dieTempF (dieTempC * 9.0 / 5.0 + 32.0);
2280 const double voltage (
double(rawVoltage)/ 1024.0 * 3.0);
2282 oss <<
"Die Temperature: " <<
fDEC(dieTempC,5,2) <<
" Celcius (" <<
fDEC(dieTempF,5,2) <<
" Fahrenheit)" << endl
2283 <<
"Core Voltage: " <<
fDEC(voltage,5,2) <<
" Volts DC";
2286 } mDecodeSysmonVccIntDieTemp;
2288 struct DecodeSDITransmitCtrl :
public Decoder
2290 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2295 const UWord numSpigots (numInputs > numOutputs ? numInputs : numOutputs);
2299 const uint32_t txEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
2301 for (
UWord spigot(0); spigot < numSpigots; )
2303 const uint32_t txEnabled (txEnableBits &
BIT(spigot));
2304 oss <<
"SDI " <<
DEC(++spigot) <<
": " << (txEnabled ?
"Output/Transmit" :
"Input/Receive");
2305 if (spigot < numSpigots)
2309 oss <<
"(No SDI inputs or outputs)";
2312 oss <<
"(Bi-directional SDI not supported)";
2316 } mDecodeSDITransmitCtrl;
2318 struct DecodeConversionCtrl :
public Decoder
2320 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2326 oss <<
"Bitfile ID: " <<
xHEX0N(bitfileID, 2) << endl
2327 <<
"Memory Test: Start: " <<
YesNo(inRegValue &
BIT(28)) << endl
2328 <<
"Memory Test: Done: " <<
YesNo(inRegValue &
BIT(29)) << endl
2329 <<
"Memory Test: Passed: " <<
YesNo(inRegValue &
BIT(30));
2348 <<
"Vert Filter Preload: " <<
DisabEnab(inRegValue &
BIT(7)) << endl
2355 } mConvControlRegDecoder;
2357 struct DecodeRelayCtrlStat :
public Decoder
2359 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2374 oss <<
"(SDI bypass relays not supported)";
2377 } mDecodeRelayCtrlStat;
2379 struct DecodeWatchdogTimeout :
public Decoder
2381 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2387 const uint32_t ticks8nanos (inRegValue);
2388 const double microsecs (
double(ticks8nanos) * 8.0 / 1000.0);
2389 const double millisecs (microsecs / 1000.0);
2390 oss <<
"Watchdog Timeout [8-ns ticks]: " <<
xHEX0N(ticks8nanos,8) <<
" (" <<
DEC(ticks8nanos) <<
")" << endl
2391 <<
"Watchdog Timeout [usec]: " << microsecs << endl
2392 <<
"Watchdog Timeout [msec]: " << millisecs;
2395 oss <<
"(SDI bypass relays not supported)";
2398 } mDecodeWatchdogTimeout;
2400 struct DecodeWatchdogKick :
public Decoder
2402 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2410 const uint32_t expectedValue(whichReg ? 0x01234567 : 0xA5A55A5A);
2411 oss <<
xHEX0N(inRegValue,8);
2412 if (inRegValue == expectedValue)
2415 oss <<
" (Not expected, should be " <<
xHEX0N(expectedValue,8) <<
")";
2418 oss <<
"(SDI bypass relays not supported)";
2421 } mDecodeWatchdogKick;
2423 struct DecodeInputVPID:
public Decoder
2425 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2433 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2436 } mVPIDInpRegDecoder;
2438 struct DecodeOutputVPID:
public Decoder
2440 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2447 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2450 } mVPIDOutRegDecoder;
2452 struct DecodeBitfileDateTime :
public Decoder
2454 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2460 const UWord yyyy ((inRegValue & 0xFFFF0000) >> 16);
2461 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2462 const UWord dd (inRegValue & 0x000000FF);
2463 if (yyyy > 0x2015 && mm > 0 && mm < 0x13 && dd > 0 && dd < 0x32)
2464 oss <<
"Bitfile Date: " <<
HEX0N(mm,2) <<
"/" <<
HEX0N(dd,2) <<
"/" <<
HEX0N(yyyy,4);
2466 oss <<
"Bitfile Date: " <<
xHEX0N(inRegValue, 8);
2470 const UWord hh ((inRegValue & 0x00FF0000) >> 16);
2471 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2472 const UWord ss (inRegValue & 0x000000FF);
2473 if (hh < 0x24 && mm < 0x60 && ss < 0x60)
2474 oss <<
"Bitfile Time: " <<
HEX0N(hh,2) <<
":" <<
HEX0N(mm,2) <<
":" <<
HEX0N(ss,2);
2476 oss <<
"Bitfile Time: " <<
xHEX0N(inRegValue, 8);
2481 } mDecodeBitfileDateTime;
2483 struct DecodeBoardID :
public Decoder
2485 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2486 { (
void) inRegNum; (
void) inDeviceID;
2491 <<
"Device Name: '" << str1 <<
"'";
2494 <<
"Retail Device Name: '" << str2 <<
"'";
2499 struct DecodeDynFWUpdateCounts :
public Decoder
2501 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2502 { (
void) inRegNum; (
void) inDeviceID;
2504 oss <<
"# attempts: " <<
DEC(inRegValue >> 16) << endl
2505 <<
"# successes: " <<
DEC(inRegValue & 0x0000FFFF);
2508 } mDecodeDynFWUpdateCounts;
2510 struct DecodeFWUserID :
public Decoder
2512 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2513 { (
void) inRegNum; (
void) inDeviceID;
2522 } mDecodeFirmwareUserID;
2524 struct DecodeCanDoStatus :
public Decoder
2526 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2527 { (
void) inRegNum; (
void) inDeviceID;
2529 oss <<
"Has CanConnect Xpt Route ROM: " <<
YesNo(inRegValue &
BIT(0)) << endl
2530 <<
"AudioSystems can start on VBI: " <<
YesNo(inRegValue &
BIT(1));
2533 } mDecodeCanDoStatus;
2535 struct DecodeVidControlReg :
public Decoder
2537 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2541 const bool is16x9 ((inRegValue &
BIT(31)) != 0);
2542 const bool isMono ((inRegValue &
BIT(30)) != 0);
2544 oss <<
"Aspect Ratio: " << (is16x9 ?
"16x9" :
"4x3") << endl
2545 <<
"Depth: " << (isMono ?
"Monochrome" :
"Color");
2548 } mDecodeVidControlReg;
2550 struct DecodeVidIntControl :
public Decoder
2552 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2557 oss <<
"Output 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(0)) << endl
2558 <<
"Input 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2559 <<
"Input 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2560 <<
"Audio Out Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(4)) << endl
2561 <<
"Audio In Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(5)) << endl
2562 <<
"Wrap Rate Interrupt Enable: " <<
YesNo(inRegValue &
BIT(6)) << endl
2563 <<
"UART Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(7)) << endl
2564 <<
"UART Rx Interrupt Enable" <<
YesNo(inRegValue &
BIT(8)) << endl
2565 <<
"UART Rx Interrupt Clear" <<
ActInact(inRegValue &
BIT(15)) << endl
2566 <<
"UART 2 Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(17)) << endl
2567 <<
"Output 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(18)) << endl
2568 <<
"Output 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2569 <<
"Output 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(20)) << endl
2570 <<
"Output 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(21)) << endl
2571 <<
"Output 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(22)) << endl
2572 <<
"Output 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(23)) << endl
2573 <<
"UART Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(24)) << endl
2574 <<
"Wrap Rate Interrupt Clear" <<
ActInact(inRegValue &
BIT(25)) << endl
2575 <<
"UART 2 Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(26)) << endl
2576 <<
"Audio Out Wrap Interrupt Clear" <<
ActInact(inRegValue &
BIT(27)) << endl
2577 <<
"Input 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2578 <<
"Input 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30)) << endl
2579 <<
"Output 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(31));
2582 } mDecodeVidIntControl;
2584 struct DecodeVidIntControl2 :
public Decoder
2586 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2591 oss <<
"Input 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2592 <<
"Input 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2593 <<
"Input 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(8)) << endl
2594 <<
"Input 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(9)) << endl
2595 <<
"Input 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(10)) << endl
2596 <<
"Input 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(11)) << endl
2597 <<
"Output 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
2598 <<
"Output 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(13)) << endl
2599 <<
"Output 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(14)) << endl
2600 <<
"Output 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(15)) << endl
2601 <<
"Output 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(16)) << endl
2602 <<
"Output 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(17)) << endl
2603 <<
"Output 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(18)) << endl
2604 <<
"Output 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(19)) << endl
2605 <<
"Input 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(25)) << endl
2606 <<
"Input 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(26)) << endl
2607 <<
"Input 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(27)) << endl
2608 <<
"Input 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(28)) << endl
2609 <<
"Input 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2610 <<
"Input 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30));
2613 } mDecodeVidIntControl2;
2615 struct DecodeStatusReg :
public Decoder
2617 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2622 oss <<
"Input 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(20)) << endl
2623 <<
"Input 1 Field ID: " << (inRegValue &
BIT(21) ?
"1" :
"0") << endl
2624 <<
"Input 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(30)) << endl
2625 <<
"Input 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(18)) << endl
2626 <<
"Input 2 Field ID: " << (inRegValue &
BIT(19) ?
"1" :
"0") << endl
2627 <<
"Input 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(29)) << endl
2628 <<
"Output 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(22)) << endl
2629 <<
"Output 1 Field ID: " << (inRegValue &
BIT(23) ?
"1" :
"0") << endl
2630 <<
"Output 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(31)) << endl
2631 <<
"Output 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(4)) << endl
2632 <<
"Output 2 Field ID: " << (inRegValue &
BIT(5) ?
"1" :
"0") << endl
2633 <<
"Output 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(8)) << endl;
2635 oss <<
"Output 3 Vertical Blank: " <<
ActInact(inRegValue &
BIT(2)) << endl
2636 <<
"Output 3 Field ID: " << (inRegValue &
BIT(3) ?
"1" :
"0") << endl
2637 <<
"Output 3 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(7)) << endl
2638 <<
"Output 4 Vertical Blank: " <<
ActInact(inRegValue &
BIT(0)) << endl
2639 <<
"Output 4 Field ID: " << (inRegValue &
BIT(1) ?
"1" :
"0") << endl
2640 <<
"Output 4 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(6)) << endl;
2641 oss <<
"Aux Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(12)) << endl
2642 <<
"I2C 1 Interrupt: " <<
ActInact(inRegValue &
BIT(14)) << endl
2643 <<
"I2C 2 Interrupt: " <<
ActInact(inRegValue &
BIT(13)) << endl
2644 <<
"Chunk Rate Interrupt: " <<
ActInact(inRegValue &
BIT(16)) << endl;
2646 oss <<
"Generic UART Interrupt: " <<
ActInact(inRegValue &
BIT(9)) << endl
2647 <<
"Uart 1 Rx Interrupt: " <<
ActInact(inRegValue &
BIT(15)) << endl
2648 <<
"Uart 1 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(24)) << endl;
2650 oss <<
"Uart 2 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(26)) << endl;
2652 oss <<
"LTC In 1 Present: " <<
YesNo(inRegValue &
BIT(17)) << endl;
2653 oss <<
"Wrap Rate Interrupt: " <<
ActInact(inRegValue &
BIT(25)) << endl
2654 <<
"Audio Out Wrap Interrupt: " <<
ActInact(inRegValue &
BIT(27)) << endl
2655 <<
"Audio 50Hz Interrupt: " <<
ActInact(inRegValue &
BIT(28));
2660 struct DecodeCPLDVersion :
public Decoder
2662 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2667 oss <<
"CPLD Version: " <<
DEC(inRegValue & (
BIT(0)|
BIT(1))) << endl
2668 <<
"Failsafe Bitfile Loaded: " << (inRegValue &
BIT(4) ?
"Yes" :
"No") << endl
2669 <<
"Force Reload: " <<
YesNo(inRegValue &
BIT(8));
2672 } mDecodeCPLDVersion;
2674 struct DecodeStatus2Reg :
public Decoder
2676 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2680 static const uint8_t bitNumsInputVBlank[] = {20, 18, 16, 14, 12, 10};
2681 static const uint8_t bitNumsInputFieldID[] = {21, 19, 17, 15, 13, 11};
2682 static const uint8_t bitNumsInputVertInt[] = {30, 29, 28, 27, 26, 25};
2683 static const uint8_t bitNumsOutputVBlank[] = { 8, 6, 4, 2};
2684 static const uint8_t bitNumsOutputFieldID[] = { 9, 7, 5, 3};
2685 static const uint8_t bitNumsOutputVertInt[] = {31, 24, 23, 22};
2687 for (
unsigned ndx(0); ndx < 6; ndx++)
2688 oss <<
"Input " << (ndx+3) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsInputVBlank[ndx])) << endl
2689 <<
"Input " << (ndx+3) <<
" Field ID: " << (inRegValue &
BIT(bitNumsInputFieldID[ndx]) ?
"1" :
"0") << endl
2690 <<
"Input " << (ndx+3) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsInputVertInt[ndx])) << endl;
2691 for (
unsigned ndx(0); ndx < 4; ndx++)
2692 oss <<
"Output " << (ndx+5) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVBlank[ndx])) << endl
2693 <<
"Output " << (ndx+5) <<
" Field ID: " << (inRegValue &
BIT(bitNumsOutputFieldID[ndx]) ?
"1" :
"0") << endl
2694 <<
"Output " << (ndx+5) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVertInt[ndx])) << endl;
2695 oss <<
"HDMI In Hot-Plug Detect Interrupt: " <<
ActInact(inRegValue &
BIT(0)) << endl
2696 <<
"HDMI In Chip Interrupt: " <<
ActInact(inRegValue &
BIT(1));
2699 } mDecodeStatus2Reg;
2701 struct DecodeInputStatusReg :
public Decoder
2703 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2712 <<
"Input 1 Geometry: ";
2713 if (
BIT(30) & inRegValue)
2714 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2716 case 0: oss <<
"2K x 1080";
break;
2717 case 1: oss <<
"2K x 1556";
break;
2718 default: oss <<
"Invalid HI";
break;
2721 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2723 case 0: oss <<
"Unknown";
break;
2724 case 1: oss <<
"525";
break;
2725 case 2: oss <<
"625";
break;
2726 case 3: oss <<
"750";
break;
2727 case 4: oss <<
"1125";
break;
2728 case 5: oss <<
"1250";
break;
2729 case 6:
case 7: oss <<
"Reserved";
break;
2730 default: oss <<
"Invalid LO";
break;
2733 <<
"Input 1 Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2735 <<
"Input 2 Geometry: ";
2736 if (
BIT(31) & inRegValue)
2737 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2739 case 0: oss <<
"2K x 1080";
break;
2740 case 1: oss <<
"2K x 1556";
break;
2741 default: oss <<
"Invalid HI";
break;
2744 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2746 case 0: oss <<
"Unknown";
break;
2747 case 1: oss <<
"525";
break;
2748 case 2: oss <<
"625";
break;
2749 case 3: oss <<
"750";
break;
2750 case 4: oss <<
"1125";
break;
2751 case 5: oss <<
"1250";
break;
2752 case 6:
case 7: oss <<
"Reserved";
break;
2753 default: oss <<
"Invalid LO";
break;
2756 <<
"Input 2 Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2758 <<
"Reference Geometry: ";
2759 switch (((
BIT(20)|
BIT(21)|
BIT(22)) & inRegValue) >> 20)
2761 case 0: oss <<
"NTV2_SG_UNKNOWN";
break;
2762 case 1: oss <<
"NTV2_SG_525";
break;
2763 case 2: oss <<
"NTV2_SG_625";
break;
2764 case 3: oss <<
"NTV2_SG_750";
break;
2765 case 4: oss <<
"NTV2_SG_1125";
break;
2766 case 5: oss <<
"NTV2_SG_1250";
break;
2767 default: oss <<
"Invalid";
break;
2770 <<
"Reference Scan Mode: " << ((
BIT(23) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2771 <<
"AES Channel 1-2: " << ((
BIT(24) & inRegValue) ?
"Invalid" :
"Valid") << endl
2772 <<
"AES Channel 3-4: " << ((
BIT(25) & inRegValue) ?
"Invalid" :
"Valid") << endl
2773 <<
"AES Channel 5-6: " << ((
BIT(26) & inRegValue) ?
"Invalid" :
"Valid") << endl
2774 <<
"AES Channel 7-8: " << ((
BIT(27) & inRegValue) ?
"Invalid" :
"Valid");
2777 } mDecodeInputStatusReg;
2779 struct DecodeSDIInputStatusReg :
public Decoder
2781 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2784 uint16_t numSpigots(0), startSpigot(0), doTsiMuxSync(0);
2795 for (uint16_t spigotNdx(0); spigotNdx < numSpigots; )
2797 const uint16_t spigotNum (spigotNdx + startSpigot);
2798 const uint8_t statusBits ((inRegValue >> (spigotNdx*8)) & 0xFF);
2799 const uint8_t speedBits (statusBits & 0xC1);
2800 ostringstream ossSpeed, ossSpigot;
2801 ossSpigot <<
"SDI In " << spigotNum <<
" ";
2802 const string spigotLabel (ossSpigot.str());
2803 if (speedBits & 0x01) ossSpeed <<
" 3G";
2806 if (speedBits & 0x40) ossSpeed <<
" 6G";
2807 if (speedBits & 0x80) ossSpeed <<
" 12G";
2809 if (speedBits == 0) ossSpeed <<
" 1.5G";
2810 oss << spigotLabel <<
"Link Speed:" << ossSpeed.str() << endl
2811 << spigotLabel <<
"SMPTE Level B: " <<
YesNo(statusBits & 0x02) << endl
2812 << spigotLabel <<
"Link A VPID Valid: " <<
YesNo(statusBits & 0x10) << endl
2813 << spigotLabel <<
"Link B VPID Valid: " <<
YesNo(statusBits & 0x20) << endl;
2815 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: " <<
EnabDisab(statusBits & 0x04);
2817 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: n/a";
2818 if (++spigotNdx < numSpigots)
2822 for (
UWord tsiMux(0); tsiMux < 4; ++tsiMux)
2824 <<
"TsiMux" <<
DEC(tsiMux+1) <<
" Sync Fail: " << ((inRegValue & (0x00010000UL << tsiMux)) ?
"FAILED" :
"OK");
2827 } mDecodeSDIInputStatusReg;
2829 struct DecodeSDIInputStatus2Reg :
public Decoder
2831 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2839 oss << sOdd <<
" Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2841 << sOdd <<
" Geometry: ";
2842 if (
BIT(30) & inRegValue)
switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2844 case 0: oss <<
"2K x 1080";
break;
2845 case 1: oss <<
"2K x 1556";
break;
2846 default: oss <<
"Invalid HI";
break;
2848 else switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2850 case 0: oss <<
"Unknown";
break;
2851 case 1: oss <<
"525";
break;
2852 case 2: oss <<
"625";
break;
2853 case 3: oss <<
"750";
break;
2854 case 4: oss <<
"1125";
break;
2855 case 5: oss <<
"1250";
break;
2856 case 6:
case 7: oss <<
"Reserved";
break;
2857 default: oss <<
"Invalid LO";
break;
2860 << sEven <<
" Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2862 << sEven <<
" Geometry: ";
2863 if (
BIT(31) & inRegValue)
switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2865 case 0: oss <<
"2K x 1080";
break;
2866 case 1: oss <<
"2K x 1556";
break;
2867 default: oss <<
"Invalid HI";
break;
2869 else switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2871 case 0: oss <<
"Unknown";
break;
2872 case 1: oss <<
"525";
break;
2873 case 2: oss <<
"625";
break;
2874 case 3: oss <<
"750";
break;
2875 case 4: oss <<
"1125";
break;
2876 case 5: oss <<
"1250";
break;
2877 case 6:
case 7: oss <<
"Reserved";
break;
2878 default: oss <<
"Invalid LO";
break;
2882 } mDecodeSDIInputStatus2Reg;
2884 struct DecodeFS1RefSelectReg :
public Decoder
2886 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2888 (
void) inDeviceID; (
void) inRegNum;
2890 oss <<
"BNC Select(LHi): " << (inRegValue & 0x00000010 ?
"LTCIn1" :
"Ref") << endl
2891 <<
"Ref BNC (Corvid): " <<
EnabDisab(inRegValue & 0x00000020) << endl
2892 <<
"LTC Present (also Reg 21): " <<
YesNo(inRegValue & 0x00000040) << endl
2893 <<
"LTC Emb Out Enable: " <<
YesNo(inRegValue & 0x00000080) << endl
2894 <<
"LTC Emb In Enable: " <<
YesNo(inRegValue & 0x00000100) << endl
2895 <<
"LTC Emb In Received: " <<
YesNo(inRegValue & 0x00000200) << endl
2896 <<
"LTC BNC Out Source: " << (inRegValue & 0x00000400 ?
"E-E" :
"Reg112/113");
2899 } mDecodeFS1RefSelectReg;
2901 struct DecodeLTCStatusControlReg :
public Decoder
2903 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2905 (
void) inDeviceID; (
void) inRegNum;
2906 const uint16_t LTC1InTimingSelect ((inRegValue >> 1) & 0x0000007);
2907 const uint16_t LTC2InTimingSelect ((inRegValue >> 9) & 0x0000007);
2908 const uint16_t LTC1OutTimingSelect ((inRegValue >> 16) & 0x0000007);
2909 const uint16_t LTC2OutTimingSelect ((inRegValue >> 20) & 0x0000007);
2911 oss <<
"LTC 1 Input Present: " <<
YesNo(inRegValue & 0x00000001) << endl
2912 <<
"LTC 1 Input FB Timing Select): " <<
xHEX0N(LTC1InTimingSelect,2) <<
" (" <<
DEC(LTC1InTimingSelect) <<
")" << endl
2913 <<
"LTC 1 Bypass: " <<
EnabDisab(inRegValue & 0x00000010) << endl
2914 <<
"LTC 1 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 5) & 0x00000001)) << endl
2915 <<
"LTC 2 Input Present: " <<
YesNo(inRegValue & 0x00000100) << endl
2916 <<
"LTC 2 Input FB Timing Select): " <<
xHEX0N(LTC2InTimingSelect,2) <<
" (" <<
DEC(LTC2InTimingSelect) <<
")" << endl
2917 <<
"LTC 2 Bypass: " <<
EnabDisab(inRegValue & 0x00001000) << endl
2918 <<
"LTC 2 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 13) & 0x00000001)) << endl
2919 <<
"LTC 1 Output FB Timing Select): " <<
xHEX0N(LTC1OutTimingSelect,2) <<
" (" <<
DEC(LTC1OutTimingSelect) <<
")" << endl
2920 <<
"LTC 2 Output FB Timing Select): " <<
xHEX0N(LTC2OutTimingSelect,2) <<
" (" <<
DEC(LTC2OutTimingSelect) <<
")";
2923 } mLTCStatusControlDecoder;
2925 struct DecodeAudDetectReg :
public Decoder
2927 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2935 for (uint16_t num(0); num < 8; )
2937 const uint16_t group (num / 2);
2938 const bool isChan34 (num & 1);
2939 oss <<
"Group " << group <<
" CH " << (isChan34 ?
"3-4: " :
"1-2: ") << (inRegValue &
BIT(num) ?
"Present" :
"Absent");
2950 } mDecodeAudDetectReg;
2952 struct DecodeAudControlReg :
public Decoder
2954 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2958 static const string ChStrs [] = {
"Ch 1/2",
"Ch 3/4",
"Ch 5/6",
"Ch 7/8" };
2959 uint16_t sdiOutput (0);
2969 oss <<
"Audio Capture: " <<
EnabDisab(
BIT(0) & inRegValue) << endl
2970 <<
"Audio Loopback: " <<
EnabDisab(
BIT(3) & inRegValue) << endl
2971 <<
"Audio Input: " <<
DisabEnab(
BIT(8) & inRegValue) << endl
2972 <<
"Audio Output: " <<
DisabEnab(
BIT(9) & inRegValue) << endl
2973 <<
"Output Paused: " <<
YesNo(
BIT(11) & inRegValue) << endl;
2975 oss <<
"Audio Embedder SDIOut" << sdiOutput <<
": " <<
DisabEnab(
BIT(13) & inRegValue) << endl
2976 <<
"Audio Embedder SDIOut" << (sdiOutput+1) <<
": " <<
DisabEnab(
BIT(15) & inRegValue) << endl;
2978 oss <<
"A/V Sync Mode: " <<
EnabDisab(
BIT(15) & inRegValue) << endl
2979 <<
"AES Rate Converter: " <<
DisabEnab(
BIT(19) & inRegValue) << endl
2980 <<
"Audio Buffer Format: " << (
BIT(20) & inRegValue ?
"16-Channel " : (
BIT(16) & inRegValue ?
"8-Channel " :
"6-Channel ")) << endl
2981 << (
BIT(18) & inRegValue ?
"96kHz" :
"48kHz") << endl
2982 << (
BIT(18) & inRegValue ?
"96kHz Support" :
"48kHz Support") << endl
2984 <<
"Slave Mode (64-chl): " <<
EnabDisab(
BIT(23) & inRegValue) << endl
2985 <<
"K-box, Monitor: " << ChStrs [(
BIT(24) &
BIT(25) & inRegValue) >> 24] << endl
2986 <<
"K-Box Input: " << (
BIT(26) & inRegValue ?
"XLR" :
"BNC") << endl
2987 <<
"K-Box: " << (
BIT(27) & inRegValue ?
"Present" :
"Absent") << endl
2988 <<
"Cable: " << (
BIT(28) & inRegValue ?
"XLR" :
"BNC") << endl
2989 <<
"Audio Buffer Size: " << (
BIT(31) & inRegValue ?
"4 MB" :
"1 MB");
2992 } mDecodeAudControlReg;
2994 struct DecodeAudSourceSelectReg :
public Decoder
2996 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3000 static const string SrcStrs [] = {
"AES Input",
"Embedded Groups 1 and 2",
"" };
3001 static const unsigned SrcStrMap [] = { 0, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
3002 const uint16_t vidInput = (inRegValue &
BIT(23) ? 2 : 0) + (inRegValue &
BIT(16) ? 1 : 0);
3005 oss <<
"Audio Source: " << SrcStrs [SrcStrMap [(
BIT(0) |
BIT(1) |
BIT(2) |
BIT(3)) & inRegValue]] << endl
3006 <<
"Embedded Source Select: Video Input " << (1 + vidInput) << endl
3007 <<
"AES Sync Mode bit (fib): " <<
EnabDisab(inRegValue &
BIT(18)) << endl
3008 <<
"PCM disabled: " <<
YesNo(inRegValue &
BIT(17)) << endl
3009 <<
"Erase head enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
3010 <<
"Embedded Clock Select: " << (inRegValue &
BIT(22) ?
"Video Input" :
"Board Reference") << endl
3011 <<
"3G audio source: " << (inRegValue &
BIT(21) ?
"Data stream 2" :
"Data stream 1");
3014 } mDecodeAudSourceSelectReg;
3016 struct DecodeAudOutputSrcMap :
public Decoder
3018 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3022 static const string AESOutputStrs[] = {
"AES Outputs 1-4",
"AES Outputs 5-8",
"AES Outputs 9-12",
"AES Outputs 13-16",
""};
3023 static const string SrcStrs[] = {
"AudSys1, Audio Channels 1-4",
"AudSys1, Audio Channels 5-8",
3024 "AudSys1, Audio Channels 9-12",
"AudSys1, Audio Channels 13-16",
3025 "AudSys2, Audio Channels 1-4",
"AudSys2, Audio Channels 5-8",
3026 "AudSys2, Audio Channels 9-12",
"AudSys2, Audio Channels 13-16",
3027 "AudSys3, Audio Channels 1-4",
"AudSys3, Audio Channels 5-8",
3028 "AudSys3, Audio Channels 9-12",
"AudSys3, Audio Channels 13-16",
3029 "AudSys4, Audio Channels 1-4",
"AudSys4, Audio Channels 5-8",
3030 "AudSys4, Audio Channels 9-12",
"AudSys4, Audio Channels 13-16",
""};
3031 static const unsigned AESChlMappingShifts [4] = {0, 4, 8, 12};
3034 const uint32_t AESOutMapping (inRegValue & 0x0000FFFF);
3038 for (
unsigned AESOutputQuad(0); AESOutputQuad < 4; AESOutputQuad++)
3039 oss << AESOutputStrs[AESOutputQuad] <<
" Source: " << SrcStrs[(AESOutMapping >> AESChlMappingShifts[AESOutputQuad]) & 0x0000000F] << endl;
3052 const uint32_t HDMIMon1234Info (HDMIMonInfo & 0x0F);
3055 const uint32_t HDMIMon5678Info ((HDMIMonInfo >> 4) & 0x0F);
3063 } mDecodeAudOutputSrcMap;
3065 struct DecodePCMControlReg :
public Decoder
3067 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3072 for (uint8_t audChan (0); audChan < 4; audChan++)
3074 oss <<
"Audio System " << (startAudioSystem + audChan) <<
": ";
3075 const uint8_t pcmBits (uint32_t(inRegValue >> (audChan * 8)) & 0x000000FF);
3076 if (pcmBits == 0x00)
3080 oss <<
"non-PCM channels";
3081 for (uint8_t chanPair (0); chanPair < 8; chanPair++)
3082 if (pcmBits & (0x01 << chanPair))
3083 oss <<
" " << (chanPair*2+1) <<
"-" << (chanPair*2+2);
3090 } mDecodePCMControlReg;
3092 struct DecodeAudioMixerInputSelectReg :
public Decoder
3094 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3095 { (
void) inDeviceID; (
void) inRegNum;
3096 const UWord mainInputSrc((inRegValue ) & 0x0000000F);
3097 const UWord aux1InputSrc((inRegValue >> 4) & 0x0000000F);
3098 const UWord aux2InputSrc((inRegValue >> 8) & 0x0000000F);
3105 } mAudMxrInputSelDecoder;
3107 struct DecodeAudioMixerGainRegs :
public Decoder
3111 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3112 { (
void)inRegNum; (
void)inDeviceID;
3113 static const double kUnityGain (0x00010000);
3114 const bool atUnity (inRegValue == 0x00010000);
3117 oss <<
"Gain: 0 dB (Unity)";
3120 const double dValue (inRegValue);
3121 const bool aboveUnity (inRegValue >= 0x00010000);
3122 const string plusMinus (atUnity ?
"" : (aboveUnity ?
"+" :
"-"));
3123 const string aboveBelow (atUnity ?
"at" : (aboveUnity ?
"above" :
"below"));
3124 const uint32_t unityDiff (aboveUnity ? inRegValue - 0x00010000 : 0x00010000 - inRegValue);
3125 const double dB (
double(20.0) * ::log10(dValue/kUnityGain));
3126 oss <<
"Gain: " << dB <<
" dB, " << plusMinus <<
xHEX0N(unityDiff,6)
3127 <<
" (" << plusMinus <<
DEC(unityDiff) <<
") " << aboveBelow <<
" unity gain";
3131 } mAudMxrGainDecoder;
3133 struct DecodeAudioMixerChannelSelectReg :
public Decoder
3135 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3136 { (
void) inRegNum; (
void) inDeviceID;
3141 <<
"Level Measurement Sample Count: " <<
DEC(
ULWord(1 << powerOfTwo)) <<
" (bits 8-15)";
3144 } mAudMxrChanSelDecoder;
3147 struct DecodeAudioMixerMutesReg :
public Decoder
3150 typedef std::bitset<16> AudioChannelSet16;
3151 typedef std::bitset<2> AudioChannelSet2;
3154 outSet.clear(); outClear.clear();
3155 for (
size_t ndx(0); ndx < 16; ndx++)
3156 { ostringstream oss; oss <<
DEC(ndx+1);
3157 if (inChSet.test(ndx))
3158 outSet.push_back(oss.str());
3160 outClear.push_back(oss.str());
3162 if (outSet.empty()) outSet.push_back(
"<none>");
3163 if (outClear.empty()) outClear.push_back(
"<none>");
3167 outSet.clear(); outClear.clear();
static const string LR[] = {
"L",
"R"};
3168 for (
size_t ndx(0); ndx < 2; ndx++)
3169 if (inChSet.test(ndx))
3170 outSet.push_back(LR[ndx]);
3172 outClear.push_back(LR[ndx]);
3173 if (outSet.empty()) outSet.push_back(
"<none>");
3174 if (outClear.empty()) outClear.push_back(
"<none>");
3177 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3178 { (
void) inRegNum; (
void) inDeviceID;
3184 NTV2StringList mutedMainOut, unmutedMainOut, mutedMain, unmutedMain, mutedAux1, unmutedAux1, mutedAux2, unmutedAux2;
3185 SplitAudioChannelSet16(AudioChannelSet16(mainOutputMuteBits), mutedMainOut, unmutedMainOut);
3186 SplitAudioChannelSet2(AudioChannelSet2(mainInputMuteBits), mutedMain, unmutedMain);
3187 SplitAudioChannelSet2(AudioChannelSet2(aux1InputMuteBits), mutedAux1, unmutedAux1);
3188 SplitAudioChannelSet2(AudioChannelSet2(aux2InputMuteBits), mutedAux2, unmutedAux2);
3189 oss <<
"Main Output Muted/Disabled Channels: " << mutedMainOut << endl
3190 <<
"Main Output Unmuted/Enabled Channels: " << unmutedMainOut << endl;
3191 oss <<
"Main Input Muted/Disabled Channels: " << mutedMain << endl
3192 <<
"Main Input Unmuted/Enabled Channels: " << unmutedMain << endl;
3193 oss <<
"Aux Input 1 Muted/Disabled Channels: " << mutedAux1 << endl
3194 <<
"Aux Input 1 Unmuted/Enabled Channels: " << unmutedAux1 << endl;
3195 oss <<
"Aux Input 2 Muted/Disabled Channels: " << mutedAux2 << endl
3196 <<
"Aux Input 2 Unmuted/Enabled Channels: " << unmutedAux2;
3199 } mAudMxrMutesDecoder;
3201 struct DecodeAudioMixerLevelsReg :
public Decoder
3205 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3206 { (
void) inDeviceID;
3207 static const string sLabels[] = {
"Aux Input 1",
"Aux Input 2",
"Main Input Audio Channels 1|2",
"Main Input Audio Channels 3|4",
3208 "Main Input Audio Channels 5|6",
"Main Input Audio Channels 7|8",
"Main Input Audio Channels 9|10",
3209 "Main Input Audio Channels 11|12",
"Main Input Audio Channels 13|14",
"Main Input Audio Channels 15|16",
3210 "Main Output Audio Channels 1|2",
"Main Output Audio Channels 3|4",
"Main Output Audio Channels 5|6",
3211 "Main Output Audio Channels 7|8",
"Main Output Audio Channels 9|10",
"Main Output Audio Channels 11|12",
3212 "Main Output Audio Channels 13|14",
"Main Output Audio Channels 15|16"};
3216 const string & label(sLabels[labelOffset]);
3220 oss << label <<
" Left Level:" <<
xHEX0N(leftLevel, 4) <<
" (" <<
DEC(leftLevel) <<
")" << endl
3221 << label <<
" Right Level:" <<
xHEX0N(rightLevel,4) <<
" (" <<
DEC(rightLevel) <<
")";
3224 } mAudMxrLevelDecoder;
3226 struct DecodeAncExtControlReg :
public Decoder
3228 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3233 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3234 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3235 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3236 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3237 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3238 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3239 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3240 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3241 <<
"SD Y+C Demux: " <<
EnabDisab(inRegValue &
BIT(30)) << endl
3242 <<
"Metadata from: " << (inRegValue &
BIT(31) ?
"LSBs" :
"MSBs");
3245 } mDecodeAncExtControlReg;
3247 struct DecodeAuxExtControlReg :
public Decoder
3249 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3254 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3255 oss <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3256 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3257 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3258 <<
"Filter inclusion: " <<
EnabDisab(inRegValue &
BIT(29));
3261 } mDecodeAuxExtControlReg;
3264 struct DecodeAncExtFieldLinesReg :
public Decoder
3266 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3270 const uint32_t which (inRegNum & 0x1F);
3271 const uint32_t valueLow (inRegValue & 0xFFF);
3272 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFF);
3275 case 5: oss <<
"F1 cutoff line: " << valueLow << endl
3276 <<
"F2 cutoff line: " << valueHigh;
3278 case 9: oss <<
"F1 VBL start line: " << valueLow << endl
3279 <<
"F2 VBL start line: " << valueHigh;
3281 case 11: oss <<
"Field ID high on line: " << valueLow << endl
3282 <<
"Field ID low on line: " << valueHigh;
3284 case 17: oss <<
"F1 analog start line: " << valueLow << endl
3285 <<
"F2 analog start line: " << valueHigh;
3288 oss <<
"Invalid register type";
3293 } mDecodeAncExtFieldLines;
3296 struct DecodeAncExtStatusReg :
public Decoder
3298 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3302 const uint32_t which (inRegNum & 0x1F);
3303 const uint32_t byteTotal (inRegValue & 0xFFFFFF);
3304 const bool overrun ((inRegValue &
BIT(28)) ?
true :
false);
3307 case 6: oss <<
"Total bytes: ";
break;
3308 case 7: oss <<
"Total F1 bytes: ";
break;
3309 case 8: oss <<
"Total F2 bytes: ";
break;
3310 default: oss <<
"Invalid register type";
break;
3312 oss <<
DEC(byteTotal) << endl
3313 <<
"Overrun: " <<
YesNo(overrun);
3316 } mDecodeAncExtStatus;
3319 struct DecodeAncExtIgnoreDIDReg :
public Decoder
3321 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3326 oss <<
"Ignoring DIDs " <<
HEX0N((inRegValue >> 0) & 0xFF, 2)
3327 <<
", " <<
HEX0N((inRegValue >> 8) & 0xFF, 2)
3328 <<
", " <<
HEX0N((inRegValue >> 16) & 0xFF, 2)
3329 <<
", " <<
HEX0N((inRegValue >> 24) & 0xFF, 2);
3332 } mDecodeAncExtIgnoreDIDs;
3334 struct DecodeAncExtAnalogFilterReg :
public Decoder
3336 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3341 uint32_t which (inRegNum & 0x1F);
3342 oss <<
"Each 1 bit specifies capturing ";
3345 case 18: oss <<
"F1 Y";
break;
3346 case 19: oss <<
"F2 Y";
break;
3347 case 20: oss <<
"F1 C";
break;
3348 case 21: oss <<
"F2 C";
break;
3349 default:
return "Invalid register type";
3351 oss <<
" line as analog, else digital";
3354 } mDecodeAncExtAnalogFilter;
3356 struct DecodeAncInsValuePairReg :
public Decoder
3358 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3362 const uint32_t which (inRegNum & 0x1F);
3363 const uint32_t valueLow (inRegValue & 0xFFFF);
3364 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFFF);
3368 case 0: oss <<
"F1 byte count low: " << valueLow << endl
3369 <<
"F2 byte count low: " << valueHigh;
3371 case 4: oss <<
"HANC pixel delay: " << (valueLow & 0x3FF) << endl
3372 <<
"VANC pixel delay: " << (valueHigh & 0x7FF);
3374 case 5: oss <<
"F1 first active line: " << (valueLow & 0x7FF) << endl
3375 <<
"F2 first active line: " << (valueHigh & 0x7FF);
3377 case 6: oss <<
"Active line length: " << (valueLow & 0x7FF) << endl
3378 <<
"Total line length: " << (valueHigh & 0xFFF);
3380 case 8: oss <<
"Field ID high on line: " << (valueLow & 0x7FF) << endl
3381 <<
"Field ID low on line: " << (valueHigh & 0x7FF);
3383 case 11: oss <<
"F1 chroma blnk start line: " << (valueLow & 0x7FF) << endl
3384 <<
"F2 chroma blnk start line: " << (valueHigh & 0x7FF);
3386 case 14: oss <<
"F1 byte count high: " << valueLow << endl
3387 <<
"F2 byte count high: " << valueHigh;
3389 default:
return "Invalid register type";
3393 } mDecodeAncInsValuePairReg;
3395 struct DecodeAncInsControlReg :
public Decoder
3397 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3402 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3403 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3404 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3405 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3406 <<
"Payload Y insert: " <<
YesNo(inRegValue &
BIT(16)) << endl
3407 <<
"Payload C insert: " <<
YesNo(inRegValue &
BIT(17)) << endl
3408 <<
"Payload F1 insert: " <<
YesNo(inRegValue &
BIT(20)) << endl
3409 <<
"Payload F2 insert: " <<
YesNo(inRegValue &
BIT(21)) << endl
3410 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(24)) << endl
3411 <<
"Memory reads: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3412 <<
"SD Packet Split: " <<
EnabDisab(inRegValue &
BIT(31));
3415 } mDecodeAncInsControlReg;
3417 struct DecodeAncInsChromaBlankReg :
public Decoder
3419 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3424 uint32_t which (inRegNum & 0x1F);
3426 oss <<
"Each 1 bit specifies if chroma in ";
3429 case 12: oss <<
"F1";
break;
3430 case 13: oss <<
"F2";
break;
3431 default:
return "Invalid register type";
3433 oss <<
" should be blanked or passed thru";
3436 } mDecodeAncInsChromaBlankReg;
3438 struct DecodeXptGroupReg :
public Decoder
3440 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3442 static unsigned sShifts[4] = {0, 8, 16, 24};
3444 for (
unsigned ndx(0); ndx < 4; ndx++)
3462 strs.push_back(oss.str());
3468 } mDecodeXptGroupReg;
3470 struct DecodeXptValidReg :
public Decoder
3472 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3489 ss <<
xHEX0N(outputXpt,2) <<
"(" <<
DEC(outputXpt) <<
")";
3491 ss <<
"'" << name <<
"'";
3492 outputXptNames.push_back(ss.str());
3494 if (!outputXptNames.empty())
3495 oss <<
"Valid Xpts: " << outputXptNames;
3499 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3501 } mDecodeXptValidReg;
3503 struct DecodeNTV4FSReg :
public Decoder
3505 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3506 { (
void) inDeviceID;
3507 static const string sPixClkSelects[] = {
"27",
"74.1758",
"74.25",
"148.3516",
"148.5",
"inv5",
"inv6",
"inv7"};
3508 static const string sSyncs[] = {
"Sync to Frame",
"Sync to Field",
"Immediate",
"Sync to External"};
3514 {
const ULWord sync ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3515 const ULWord pixClkSel((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18))) >> 16);
3517 if (inRegValue &
BIT(1))
3518 oss <<
"Enabled: " <<
YesNo(inRegValue &
BIT( 1)) << endl
3519 <<
"Mode: " << ((inRegValue &
BIT( 0)) ?
"Capture" :
"Display") << endl
3520 <<
"DRT_DISP: " <<
OnOff(inRegValue &
BIT( 2)) << endl
3521 <<
"Fill Bit: " <<
DEC((inRegValue &
BIT( 3)) ? 1 : 0) << endl
3522 <<
"Dither: " <<
EnabDisab(inRegValue &
BIT( 4)) << endl
3523 <<
"RGB8 Convert: " << ((inRegValue &
BIT( 5)) ?
"Use '00'" :
"Copy MSBs") << endl
3524 <<
"Progressive: " <<
YesNo(inRegValue &
BIT( 6)) << endl
3526 <<
"Pix Clk Sel: " << sPixClkSelects[pixClkSel] <<
" MHz" << endl
3527 <<
"Sync: " << sSyncs[sync];
3529 oss <<
"Enabled: " <<
YesNo(inRegValue &
BIT( 1));
3533 {
const ULWord lineCnt ((inRegValue & (0xFFFF0000)) >> 16);
3534 oss <<
"Field ID: " <<
OddEven(inRegValue &
BIT( 0)) << endl
3535 <<
"Line Count: " <<
DEC(lineCnt);
3539 {
const int32_t xferByteCnt((inRegValue & 0xFFFF0000) >> 16), linePitch(inRegValue & 0x0000FFFF);
3540 oss <<
"Line Pitch: " << linePitch << (linePitch < 0 ?
" (flipped)" :
"") << endl
3541 <<
"Xfer Byte Count: " << xferByteCnt <<
" [bytes/line]" << (linePitch < 0 ?
" (flipped)" :
"");
3545 {
const ULWord ROIVSize((inRegValue & (0x0FFF0000)) >> 16), ROIHSize(inRegValue & 0x00000FFF);
3546 oss <<
"ROI Horz Size: " <<
DEC(ROIHSize) <<
" [pixels]" << endl
3547 <<
"ROI Vert Size: " <<
DEC(ROIVSize) <<
" [lines]";
3552 {
const ULWord ROIVOff((inRegValue & (0x0FFF0000)) >> 16), ROIHOff(inRegValue & 0x00000FFF);
3554 oss <<
"ROI " << fld <<
" Horz Offset: " <<
DEC(ROIHOff) << endl
3555 <<
"ROI " << fld <<
" Vert Offset: " <<
DEC(ROIVOff);
3559 {
const ULWord tot((inRegValue & (0x0FFF0000)) >> 16), act(inRegValue & 0x00000FFF);
3560 oss <<
"Disp Horz Active: " <<
DEC(act) << endl
3561 <<
"Disp Horz Total: " <<
DEC(tot);
3565 {
const ULWord lo((inRegValue & (0x07FF0000)) >> 16), hi(inRegValue & 0x000007FF);
3566 oss <<
"Disp FID Lo: " <<
DEC(lo) << endl
3567 <<
"Disp FID Hi: " <<
DEC(hi);
3572 {
const ULWord actEnd((inRegValue & (0x07FF0000)) >> 16), actStart(inRegValue & 0x000007FF);
3574 oss <<
"Disp " << fld <<
" Active Start: " <<
DEC(actStart) << endl
3575 <<
"Disp " << fld <<
" Active End: " <<
DEC(actEnd);
3579 oss <<
"Unpacker Horz Offset: " <<
DEC(inRegValue & 0x0000FFFF);
3583 {
const ULWord hi((inRegValue & (0xFFFF0000)) >> 16), lo(inRegValue & 0x0000FFFF);
3586 oss <<
"Disp Fill " << CbBorCrR <<
": " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4) << endl
3587 <<
"Disp Fill " << YGorA <<
": " <<
DEC(hi) <<
" " <<
xHEX0N(hi,4);
3591 {
const ULWord lo(inRegValue & 0x0000FFFF);
3592 oss <<
"ROI Fill Alpha: " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4);
3596 oss <<
"Output Timing Frame Pulse Preset: " <<
DEC(inRegValue & 0x00FFFFFF) <<
" "
3597 <<
xHEX0N(inRegValue & 0x00FFFFFF,6);
3602 {
const int32_t lo (inRegValue & 0x00001FFF);
3603 oss <<
"Output Video Offset: " << lo <<
" " <<
xHEX0N(lo,6);
3607 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3613 struct DecodeHDMIOutputControl :
public Decoder
3615 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3619 static const string sHDMIStdV1[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" };
3620 static const string sHDMIStdV2V3[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3621 static const string sVidRates[] = {
"",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95",
"",
"",
"",
"",
"" };
3622 static const string sSrcSampling[] = {
"YC422",
"RGB",
"YC420",
"Unknown/invalid" };
3623 static const string sBitDepth[] = {
"8",
"10",
"12",
"Unknown/invalid" };
3626 const string hdmiVidStdStr (hdmiVers > 1 ? sHDMIStdV2V3[rawVideoStd] : (hdmiVers == 1 ? sHDMIStdV1[rawVideoStd] :
""));
3629 const uint32_t srcBPC ((inRegValue & (
BIT(16)|
BIT(17))) >> 16);
3630 const uint32_t txBitDepth ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3631 oss <<
"Video Standard: " << hdmiVidStdStr;
3632 if (hdmiVidStdStr != vidStdStr)
3633 oss <<
" (" << vidStdStr <<
")";
3635 <<
"Color Mode: " << ((inRegValue &
BIT( 8)) ?
"RGB" :
"YCbCr") << endl
3637 <<
"Scan Mode: " << ((inRegValue &
BIT(13)) ?
"Progressive" :
"Interlaced") << endl
3638 <<
"Bit Depth: " << ((inRegValue &
BIT(14)) ?
"10-bit" :
"8-bit") << endl
3639 <<
"Output Color Sampling: " << ((inRegValue &
BIT(15)) ?
"4:4:4" :
"4:2:2") << endl
3640 <<
"Output Bit Depth: " << sBitDepth[txBitDepth] << endl
3641 <<
"Src Color Sampling: " << sSrcSampling[srcSampling] << endl
3642 <<
"Src Bits Per Component: " << sBitDepth[srcBPC] << endl
3643 <<
"Output Range: " << ((inRegValue &
BIT(28)) ?
"Full" :
"SMPTE") << endl
3644 <<
"Audio Channels: " << ((inRegValue &
BIT(29)) ?
"8" :
"2") << endl
3645 <<
"Output: " << ((inRegValue &
BIT(30)) ?
"DVI" :
"HDMI");
3648 <<
"Audio Loopback: " <<
OnOff(inRegValue &
BIT(31));
3651 } mDecodeHDMIOutputControl;
3653 struct DecodeHDMIInputStatus :
public Decoder
3655 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3662 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"2K1080p",
"2K1080i",
"3840p",
"4096p"};
3663 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" };
3664 oss <<
"HDMI Input: " << (inRegValue &
BIT(0) ?
"Locked" :
"Unlocked") << endl
3665 <<
"HDMI Input: " << (inRegValue &
BIT(1) ?
"Stable" :
"Unstable") << endl
3666 <<
"Color Mode: " << (inRegValue &
BIT(2) ?
"RGB" :
"YCbCr") << endl
3667 <<
"Bitdepth: " << (inRegValue &
BIT(3) ?
"10-bit" :
"8-bit") << endl
3668 <<
"Audio Channels: " << (inRegValue &
BIT(12) ? 2 : 8) << endl
3669 <<
"Scan Mode: " << (inRegValue &
BIT(13) ?
"Progressive" :
"Interlaced") << endl
3670 <<
"Standard: " << (inRegValue &
BIT(14) ?
"SD" :
"HD") << endl
3671 <<
"Video Standard: " << sStds[vidStd] << endl
3672 <<
"Protocol: " << (inRegValue &
BIT(27) ?
"DVI" :
"HDMI") << endl
3673 <<
"Video Rate : " << (rate < 11 ? sRates[rate] :
string(
"invalid"));
3676 } mDecodeHDMIInputStatus;
3678 struct DecodeHDMIInputControl :
public Decoder
3680 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3682 (
void) inRegNum; (
void) inDeviceID;
3684 const UWord chanPair ((inRegValue & (
BIT(2) |
BIT(3))) >> 2);
3686 const UWord txCh12Sel ((inRegValue & (
BIT(29)|
BIT(30))) >> 29);
3688 oss <<
"HDMI In EDID Write-Enable: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
3689 <<
"HDMI Force Output Params: " <<
SetNotset(inRegValue &
BIT(1)) << endl
3691 <<
"hdmi_rx_8ch_src_off: " <<
YesNo(inRegValue &
BIT(4)) << endl
3692 <<
"Swap HDMI In Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(5)) << endl
3693 <<
"Swap HDMI Out Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(6)) << endl
3694 <<
"HDMI Prefer 420: " <<
SetNotset(inRegValue &
BIT(7)) << endl
3695 <<
"hdmi_rx_spdif_err: " <<
SetNotset(inRegValue &
BIT(8)) << endl
3696 <<
"hdmi_rx_afifo_under: " <<
SetNotset(inRegValue &
BIT(9)) << endl
3697 <<
"hdmi_rx_afifo_empty: " <<
SetNotset(inRegValue &
BIT(10)) << endl
3698 <<
"H polarity: " << (inRegValue &
BIT(16) ?
"Inverted" :
"Normal") << endl
3699 <<
"V polarity: " << (inRegValue &
BIT(17) ?
"Inverted" :
"Normal") << endl
3700 <<
"F polarity: " << (inRegValue &
BIT(18) ?
"Inverted" :
"Normal") << endl
3701 <<
"DE polarity: " << (inRegValue &
BIT(19) ?
"Inverted" :
"Normal") << endl
3702 <<
"Tx Src Sel: " <<
DEC(txSrcSel) <<
" (" <<
xHEX0N(txSrcSel,4) <<
")" << endl
3703 <<
"Tx Center Cut: " <<
SetNotset(inRegValue &
BIT(24)) << endl
3704 <<
"Tx 12 bit: " <<
SetNotset(inRegValue &
BIT(26)) << endl
3705 <<
"RGB Input Gamut: " << (inRegValue &
BIT(28) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3706 <<
"Tx_ch12_sel: " <<
DEC(txCh12Sel) <<
" (" <<
xHEX0N(txCh12Sel,4) <<
")" << endl
3707 <<
"Input AVI Gamut: " << (inRegValue &
BIT(31) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3711 } mDecodeHDMIInputControl;
3713 struct DecodeHDMIOutputStatus :
public Decoder
3715 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3716 { (
void) inRegNum; (
void) inDeviceID;
3722 } mDecodeHDMIOutputStatus;
3724 struct DecodeHDMIOutHDRPrimary :
public Decoder
3726 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3746 const double xFloat (
double(xPrimary) * 0.00002);
3747 const double yFloat (
double(yPrimary) * 0.00002);
3749 oss <<
"X: " <<
fDEC(xFloat,7,5) << endl;
3751 oss <<
"X: " <<
HEX0N(xPrimary, 4) <<
"(invalid)" << endl;
3753 oss <<
"Y: " <<
fDEC(yFloat,7,5);
3755 oss <<
"Y: " <<
HEX0N(yPrimary, 4) <<
"(invalid)";
3762 const double minFloat (
double(minValue) * 0.00001);
3763 const double maxFloat (maxValue);
3764 oss <<
"Min: " <<
fDEC(minFloat,7,5) << endl
3765 <<
"Max: " <<
fDEC(maxFloat,7,5);
3772 const double cntFloat (cntValue);
3773 const double frmFloat (frmValue);
3774 oss <<
"Max Content Light Level: " <<
fDEC(cntFloat,7,5) << endl
3775 <<
"Max Frame Light Level: " <<
fDEC(frmFloat,7,5);
3782 } mDecodeHDMIOutHDRPrimary;
3784 struct DecodeHDMIOutHDRControl :
public Decoder
3786 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3789 static const string sEOTFs[] = {
"Trad Gamma SDR",
"Trad Gamma HDR",
"SMPTE ST 2084",
"HLG"};
3798 <<
"EOTF: " << sEOTFs[(EOTFvalue < 3) ? EOTFvalue : 3] << endl
3799 <<
"Static MetaData Desc ID: " <<
HEX0N(staticMetaDataDescID, 2) <<
" (" <<
DEC(staticMetaDataDescID) <<
")";
3803 } mDecodeHDMIOutHDRControl;
3805 struct DecodeHDMIOutMRControl :
public Decoder
3807 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3808 { (
void) inRegNum; (
void) inDeviceID;
3810 static const string sMRStandard[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3812 const string hdmiVidStdStr (sMRStandard[rawVideoStd]);
3814 oss <<
"Video Standard: " << hdmiVidStdStr;
3815 if (hdmiVidStdStr != vidStdStr)
3816 oss <<
" (" << vidStdStr <<
")";
3818 <<
"Capture Mode: " << ((inRegValue &
kRegMaskMREnable) ?
"Enabled" :
"Disabled");
3821 } mDecodeHDMIOutMRControl;
3823 struct DecodeSDIOutputControl :
public Decoder
3825 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3830 const uint32_t vidStd (inRegValue & (
BIT(0)|
BIT(1)|
BIT(2)));
3831 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"6",
"7"};
3832 oss <<
"Video Standard: " << sStds[vidStd] << endl
3833 <<
"2Kx1080 mode: " << (inRegValue &
BIT(3) ?
"2048x1080" :
"1920x1080") << endl
3834 <<
"HBlank RGB Range: Black=" << (inRegValue &
BIT(7) ?
"0x40" :
"0x04") << endl
3835 <<
"12G enable: " <<
YesNo(inRegValue &
BIT(17)) << endl
3836 <<
"6G enable: " <<
YesNo(inRegValue &
BIT(16)) << endl
3837 <<
"3G enable: " <<
YesNo(inRegValue &
BIT(24)) << endl
3838 <<
"3G mode: " << (inRegValue &
BIT(25) ?
"b" :
"a") << endl
3839 <<
"VPID insert enable: " <<
YesNo(inRegValue &
BIT(26)) << endl
3840 <<
"VPID overwrite enable: " <<
YesNo(inRegValue &
BIT(27)) << endl
3841 <<
"DS 1 audio source: " "AudSys";
3842 switch ((inRegValue & (
BIT(28)|
BIT(30))) >> 28)
3844 case 0: oss << (inRegValue &
BIT(18) ? 5 : 1);
break;
3845 case 1: oss << (inRegValue &
BIT(18) ? 7 : 3);
break;
3846 case 4: oss << (inRegValue &
BIT(18) ? 6 : 2);
break;
3847 case 5: oss << (inRegValue &
BIT(18) ? 8 : 4);
break;
3849 oss << endl <<
"DS 2 audio source: AudSys";
3850 switch ((inRegValue & (
BIT(29)|
BIT(31))) >> 29)
3852 case 0: oss << (inRegValue &
BIT(19) ? 5 : 1);
break;
3853 case 1: oss << (inRegValue &
BIT(19) ? 7 : 3);
break;
3854 case 4: oss << (inRegValue &
BIT(19) ? 6 : 2);
break;
3855 case 5: oss << (inRegValue &
BIT(19) ? 8 : 4);
break;
3859 } mDecodeSDIOutputControl;
3861 struct DecodeDMAControl :
public Decoder
3863 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3867 const uint16_t gen ((inRegValue & (
BIT(20)|
BIT(21)|
BIT(22)|
BIT(23))) >> 20);
3868 const uint16_t lanes ((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18)|
BIT(19))) >> 16);
3869 const uint16_t fwRev ((inRegValue & 0x0000FF00) >> 8);
3871 for (uint16_t engine(0); engine < 4; engine++)
3872 oss <<
"DMA " << (engine+1) <<
" Int Active?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3873 oss <<
"Bus Error Int Active?: " <<
YesNo(inRegValue &
BIT(31)) << endl;
3874 for (uint16_t engine(0); engine < 4; engine++)
3875 oss <<
"DMA " << (engine+1) <<
" Busy?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3876 oss <<
"Strap: " << ((inRegValue &
BIT(7)) ?
"Installed" :
"Not Installed") << endl
3877 <<
"Firmware Rev: " <<
xHEX0N(fwRev, 2) <<
" (" <<
DEC(fwRev) <<
")" << endl
3878 <<
"Gen: " << gen << ((gen > 0 && gen < 4) ?
"" :
" <invalid>") << endl
3879 <<
"Lanes: " <<
DEC(lanes) << ((lanes < 9) ?
"" :
" <invalid>");
3882 } mDMAControlRegDecoder;
3884 struct DecodeDMAIntControl :
public Decoder
3886 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3891 for (uint16_t eng(0); eng < 4; eng++)
3892 oss <<
"DMA " << (eng+1) <<
" Enabled?: " <<
YesNo(inRegValue &
BIT(eng)) << endl;
3893 oss <<
"Bus Error Enabled?: " <<
YesNo(inRegValue &
BIT(4)) << endl;
3894 for (uint16_t eng(0); eng < 4; eng++)
3895 oss <<
"DMA " << (eng+1) <<
" Active?: " <<
YesNo(inRegValue &
BIT(27+eng)) << endl;
3896 oss <<
"Bus Error: " <<
YesNo(inRegValue &
BIT(31));
3899 } mDMAIntControlRegDecoder;
3901 struct DecodeDMAXferRate :
public Decoder
3903 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3904 { (
void) inRegNum; (
void) inDeviceID;
3906 oss <<
DEC(inRegValue) <<
" [MB/sec] [kB/ms] [B/us]";
3909 } mDMAXferRateRegDecoder;
3911 struct DecodeRP188InOutDBB :
public Decoder
3913 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3917 const bool isReceivingRP188 (inRegValue &
BIT(16));
3918 const bool isReceivingSelectedRP188 (inRegValue &
BIT(17));
3919 const bool isReceivingLTC (inRegValue &
BIT(18));
3920 const bool isReceivingVITC (inRegValue &
BIT(19));
3922 oss <<
"RP188: " << (isReceivingRP188 ? (isReceivingSelectedRP188 ?
"Selected" :
"Unselected") :
"No") <<
" RP-188 received"
3923 << (isReceivingLTC ?
" +LTC" :
"") << (isReceivingVITC ?
" +VITC" :
"") << endl
3924 <<
"Bypass: " << (inRegValue &
BIT(23) ? (inRegValue &
BIT(22) ?
"SDI In 2" :
"SDI In 1") :
"Disabled") << endl
3925 <<
"Filter: " <<
HEX0N((inRegValue & 0xFF000000) >> 24, 2) << endl
3926 <<
"DBB: " <<
HEX0N((inRegValue & 0x0000FF00) >> 8, 2) <<
" " <<
HEX0N(inRegValue & 0x000000FF, 2);
3929 } mRP188InOutDBBRegDecoder;
3931 struct DecodeVidProcControl :
public Decoder
3933 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3938 static const string sSplitStds [8] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"?6?",
"?7?"};
3939 oss <<
"Mode: " << (inRegValue &
kRegMaskVidProcMode ? ((inRegValue &
BIT(24)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3940 <<
"FG Control: " << (inRegValue &
kRegMaskVidProcFGControl ? ((inRegValue &
BIT(20)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3941 <<
"BG Control: " << (inRegValue &
kRegMaskVidProcBGControl ? ((inRegValue &
BIT(22)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3942 <<
"VANC Pass-Thru: " << ((inRegValue &
BIT(13)) ?
"Background" :
"Foreground") << endl
3946 <<
"Limiting: " << ((inRegValue &
BIT(11)) ?
"Off" : ((inRegValue &
BIT(12)) ?
"Legal Broadcast" :
"Legal SDI")) << endl
3950 } mVidProcControlRegDecoder;
3952 struct DecodeSplitControl :
public Decoder
3954 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3959 const uint32_t startmask (0x0000FFFF);
3960 const uint32_t slopemask (0x3FFF0000);
3961 const uint32_t fractionmask(0x00000007);
3962 oss <<
"Split Start: " <<
HEX0N((inRegValue & startmask) & ~fractionmask, 4) <<
" "
3963 <<
HEX0N((inRegValue & startmask) & fractionmask, 4) << endl
3964 <<
"Split Slope: " <<
HEX0N(((inRegValue & slopemask) >> 16) & ~fractionmask, 4) <<
" "
3965 <<
HEX0N(((inRegValue & slopemask) >> 16) & fractionmask, 4) << endl
3966 <<
"Split Type: " << ((inRegValue &
BIT(30)) ?
"Vertical" :
"Horizontal");
3969 } mSplitControlRegDecoder;
3971 struct DecodeFlatMatteValue :
public Decoder
3973 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3978 const uint32_t mask (0x000003FF);
3979 oss <<
"Flat Matte Cb: " <<
HEX0N(inRegValue & mask, 3) << endl
3980 <<
"Flat Matte Y: " <<
HEX0N(((inRegValue >> 10) & mask) - 0x40, 3) << endl
3981 <<
"Flat Matte Cr: " <<
HEX0N((inRegValue >> 20) & mask, 3);
3984 } mFlatMatteValueRegDecoder;
3986 struct DecodeEnhancedCSCMode :
public Decoder
3988 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3992 static const string sFiltSel[] = {
"Full",
"Simple",
"None",
"?"};
3993 static const string sEdgeCtrl[] = {
"black",
"extended pixels"};
3994 static const string sPixFmts[] = {
"RGB 4:4:4",
"YCbCr 4:4:4",
"YCbCr 4:2:2",
"?"};
3995 const uint32_t filterSelect ((inRegValue >> 12) & 0x3);
3996 const uint32_t edgeControl ((inRegValue >> 8) & 0x1);
3997 const uint32_t outPixFmt ((inRegValue >> 4) & 0x3);
3998 const uint32_t inpPixFmt (inRegValue & 0x3);
4000 oss <<
"Filter select: " << sFiltSel[filterSelect] << endl
4001 <<
"Filter edge control: " <<
"Filter to " << sEdgeCtrl[edgeControl] << endl
4002 <<
"Output pixel format: " << sPixFmts[outPixFmt] << endl
4003 <<
"Input pixel format: " << sPixFmts[inpPixFmt];
4006 } mEnhCSCModeDecoder;
4008 struct DecodeEnhancedCSCOffset :
public Decoder
4010 static string U10Dot6ToFloat (
const uint32_t inOffset)
4012 double result (
double((inOffset >> 6) & 0x3FF));
4013 result += double(inOffset & 0x3F) / 64.0;
4014 ostringstream oss; oss <<
fDEC(result,12,5);
string resultStr(oss.str());
4017 static string U12Dot4ToFloat (
const uint32_t inOffset)
4019 double result (
double((inOffset >> 4) & 0xFFF));
4020 result += double(inOffset & 0xF) / 16.0;
4021 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4024 static string S13Dot2ToFloat (
const uint32_t inOffset)
4026 double result (
double((inOffset >> 2) & 0x1FFF));
4027 result += double(inOffset & 0x3) / 4.0;
4028 if (inOffset &
BIT(15))
4030 ostringstream oss; oss <<
fDEC(result,12,2);
string resultStr(oss.str());
4033 static string S11Dot4ToFloat (
const uint32_t inOffset)
4035 double result (
double((inOffset >> 4) & 0x7FF));
4036 result += double(inOffset & 0xF) / 16.0;
4037 if (inOffset &
BIT(15))
4039 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
4042 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4045 const uint32_t regNum (inRegNum & 0x1F);
4046 const uint32_t lo (inRegValue & 0x0000FFFF);
4047 const uint32_t hi ((inRegValue >> 16) & 0xFFFF);
4051 case 1: oss <<
"Component 0 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4052 <<
"Component 1 input offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4054 case 2: oss <<
"Component 2 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4056 case 12: oss <<
"Component A output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
4057 <<
"Component B output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4059 case 13: oss <<
"Component C output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
4061 case 15: oss <<
"Key input offset: " << S13Dot2ToFloat(lo) <<
" (12-bit), " << S11Dot4ToFloat(lo) <<
" (10-bit)" << endl
4062 <<
"Key output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
4068 } mEnhCSCOffsetDecoder;
4070 struct DecodeEnhancedCSCKeyMode :
public Decoder
4072 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4076 static const string sSrcSel[] = {
"Key Input",
"Video Y Input"};
4077 static const string sRange[] = {
"Full Range",
"SMPTE Range"};
4078 const uint32_t keySrcSelect (inRegValue & 0x1);
4079 const uint32_t keyOutRange ((inRegValue >> 4) & 0x1);
4081 oss <<
"Key Source Select: " << sSrcSel[keySrcSelect] << endl
4082 <<
"Key Output Range: " << sRange[keyOutRange];
4085 } mEnhCSCKeyModeDecoder;
4087 struct DecodeEnhancedCSCCoefficient :
public Decoder
4089 static string S2Dot15ToFloat (
const uint32_t inCoefficient)
4091 double result = (double((inCoefficient >> 15) & 0x3));
4092 result += double(inCoefficient & 0x7FFF) / 32768.0;
4093 if (inCoefficient &
BIT(17))
4095 ostringstream oss; oss <<
fDEC(result,12,10);
string resultStr(oss.str());
4098 static string S12Dot12ToFloat (
const uint32_t inCoefficient)
4100 double result(
double((inCoefficient >> 12) & 0xFFF));
4101 result += double(inCoefficient & 0xFFF) / 4096.0;
4102 if (inCoefficient &
BIT(24))
4104 ostringstream oss; oss <<
fDEC(result,12,6);
string resultStr(oss.str());
4107 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4110 uint32_t regNum (inRegNum & 0x1F);
4112 if (regNum > 2 && regNum < 12)
4115 static const string sCoeffNames[] = {
"A0",
"A1",
"A2",
"B0",
"B1",
"B2",
"C0",
"C1",
"C2"};
4116 const uint32_t coeff ((inRegValue >> 9) & 0x0003FFFF);
4117 oss << sCoeffNames[regNum] <<
" coefficient: " << S2Dot15ToFloat(coeff) <<
" (" <<
xHEX0N(coeff,8) <<
")";
4119 else if (regNum == 16)
4121 const uint32_t gain ((inRegValue >> 4) & 0x01FFFFFF);
4122 oss <<
"Key gain: " << S12Dot12ToFloat(gain) <<
" (" <<
HEX0N(gain,8) <<
")";
4126 } mEnhCSCCoeffDecoder;
4128 struct DecodeCSCoeff1234 :
public Decoder
4130 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4133 const uint32_t coeff1 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4134 const uint32_t coeff2 ((inRegValue >> 14) & 0x00001FFF);
4135 uint16_t nCoeff1(1), nCoeff2(2);
4140 nCoeff1 = 3; nCoeff2 = 4;
break;
4156 oss <<
"Video Key Sync Status: " << (inRegValue &
BIT(28) ?
"SyncFail" :
"OK") << endl
4157 <<
"Make Alpha From Key Input: " <<
EnabDisab(inRegValue &
BIT(29)) << endl
4158 <<
"Matrix Select: " << (inRegValue &
BIT(30) ?
"Rec601" :
"Rec709") << endl
4159 <<
"Use Custom Coeffs: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4161 oss <<
"RGB Range: " << (inRegValue &
BIT(31) ?
"SMPTE (0x040-0x3C0)" :
"Full (0x000-0x3FF)") << endl;
4162 oss <<
"Coefficient" <<
DEC(nCoeff1) <<
": " <<
xHEX0N(coeff1, 4) << endl
4163 <<
"Coefficient" <<
DEC(nCoeff2) <<
": " <<
xHEX0N(coeff2, 4);
4166 } mCSCoeff1234Decoder;
4168 struct DecodeCSCoeff567890 :
public Decoder
4170 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4173 const uint32_t coeff5 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4174 const uint32_t coeff6 ((inRegValue >> 14) & 0x00001FFF);
4175 uint16_t nCoeff5(5), nCoeff6(6);
4180 nCoeff5 = 7; nCoeff6 = 8;
break;
4183 nCoeff5 = 9; nCoeff6 = 10;
break;
4193 oss <<
"Coefficient" <<
DEC(nCoeff5) <<
": " <<
xHEX0N(coeff5, 4) << endl
4194 <<
"Coefficient" <<
DEC(nCoeff6) <<
": " <<
xHEX0N(coeff6, 4);
4197 } mCSCoeff567890Decoder;
4199 struct DecodeLUTV1ControlReg :
public Decoder
4201 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4202 {
static const string sModes[] = {
"Off",
"RGB",
"YCbCr",
"3-Way",
"Invalid"};
4215 if (lutVersion != 1)
4216 oss <<
"(Register data relevant for V1 LUT, this device has V" <<
DEC(lutVersion) <<
" LUT)";
4219 oss <<
"LUT Saturation Value: " <<
xHEX0N(saturation,4) <<
" (" <<
DEC(saturation) <<
")" << endl
4220 <<
"LUT Output Bank Select: " <<
SetNotset(outBankSelect) << endl
4221 <<
"LUT Mode: " << sModes[mode] <<
" (" <<
DEC(mode) <<
")";
4224 <<
"LUT5 Host Bank Select: " <<
SetNotset(cc5HostBank) << endl
4225 <<
"LUT5 Output Bank Select: " <<
SetNotset(cc5OutputBank) << endl
4226 <<
"LUT5 Select: " <<
SetNotset(cc5Select) << endl
4227 <<
"Config 2nd LUT Set: " <<
YesNo(ccConfig2);
4230 <<
"LUT3 Bank Select: " <<
SetNotset(cc3BankSel) << endl
4231 <<
"LUT4 Bank Select: " <<
SetNotset(cc4BankSel);
4234 } mLUTV1ControlRegDecoder;
4236 struct DecodeLUTV2ControlReg :
public Decoder
4238 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4242 if (lutVersion != 2)
4243 oss <<
"(Register data relevant for V2 LUT, this device has V" <<
DEC(lutVersion) <<
"LUT)";
4246 for (
UWord lutNum(0); lutNum < 8; lutNum++)
4247 oss <<
"LUT" <<
DEC(lutNum+1) <<
" Enabled: " << (
YesNo(inRegValue & (1<<lutNum))) << endl
4248 <<
"LUT" <<
DEC(lutNum+1) <<
" Host Access Bank Select: " << (inRegValue & (1<<(lutNum+8)) ?
'1' :
'0') << endl
4249 <<
"LUT" <<
DEC(lutNum+1) <<
" Output Bank Select: " << (inRegValue & (1<<(lutNum+16)) ?
'1' :
'0') << endl;
4250 oss <<
"12-Bit LUT mode: " << ((inRegValue &
BIT(28)) ?
"12-bit" :
"10-bit") << endl
4251 <<
"12-Bit LUT page reg: " <<
DEC(
UWord((inRegValue & (
BIT(24)|
BIT(25))) >> 24));
4255 } mLUTV2ControlRegDecoder;
4257 struct DecodeLUT :
public Decoder
4259 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4263 const bool isRed(inRegNum >= RedReg && inRegNum < GreenReg), isGreen(inRegNum >= GreenReg && inRegNum < BlueReg), isBlue(inRegNum>=BlueReg);
4269 const string label(isRed ?
"Red[" : (isGreen ?
"Green[" :
"Blue["));
4270 const ULWord ndx((inRegNum - (isRed ? RedReg : (isGreen ? GreenReg : BlueReg))) * 2);
4273 oss << label <<
DEC0N(ndx+0,3) <<
"]: " <<
DEC0N(lo,3) << endl
4274 << label <<
DEC0N(ndx+1,3) <<
"]: " <<
DEC0N(hi,3);
4279 struct DecodeSDIErrorStatus :
public Decoder
4281 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4287 oss <<
"Unlock Tally: " <<
DEC(inRegValue & 0x7FFF) << endl
4288 <<
"Locked: " <<
YesNo(inRegValue &
BIT(16)) << endl
4289 <<
"Link A VPID Valid: " <<
YesNo(inRegValue &
BIT(20)) << endl
4290 <<
"Link B VPID Valid: " <<
YesNo(inRegValue &
BIT(21)) << endl
4291 <<
"TRS Error Detected: " <<
YesNo(inRegValue &
BIT(24));
4294 } mSDIErrorStatusRegDecoder;
4296 struct DecodeSDIErrorCount :
public Decoder
4298 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4304 oss <<
"Link A: " <<
DEC(inRegValue & 0x0000FFFF) << endl
4305 <<
"Link B: " <<
DEC((inRegValue & 0xFFFF0000) >> 16);
4308 } mSDIErrorCountRegDecoder;
4310 struct DecodeDriverVersion :
public Decoder
4312 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4313 { (
void) inDeviceID;
4317 ULWord buildType((inRegValue >> 30) & 0x00000003);
4318 static const string sBuildTypes[] = {
"Release",
"Beta",
"Alpha",
"Development"};
4319 static const string sBldTypes[] = {
"",
"b",
"a",
"d"};
4321 oss <<
"Driver Version: " <<
DEC(vMaj) <<
"." <<
DEC(vMin) <<
"." <<
DEC(vDot);
4322 if (buildType) oss << sBldTypes[buildType] <<
DEC(vBld);
4324 <<
"Major Version: " <<
DEC(vMaj) << endl
4325 <<
"Minor Version: " <<
DEC(vMin) << endl
4326 <<
"Point Version: " <<
DEC(vDot) << endl
4327 <<
"Build Type: " << sBuildTypes[buildType] << endl
4328 <<
"Build Number: " <<
DEC(vBld);
4331 } mDriverVersionDecoder;
4333 struct DecodeFourCC :
public Decoder
4335 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4336 { (
void) inDeviceID; (
void) inRegNum;
4337 char ch;
string str4cc;
4338 ch = char((inRegValue & 0xFF000000) >> 24);
4339 str4cc += ::isprint(ch) ? ch :
'?';
4340 ch = char((inRegValue & 0x00FF0000) >> 16);
4341 str4cc += ::isprint(ch) ? ch :
'?';
4342 ch = char((inRegValue & 0x0000FF00) >> 8);
4343 str4cc += ::isprint(ch) ? ch :
'?';
4344 ch = char((inRegValue & 0x000000FF) >> 0);
4345 str4cc += ::isprint(ch) ? ch :
'?';
4348 oss <<
"'" << str4cc <<
"'";
4353 struct DecodeDriverType :
public Decoder
4355 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4356 { (
void) inDeviceID; (
void) inRegNum;
4359 if (inRegValue == 0x44455854)
4360 oss <<
"DriverKit ('DEXT')";
4361 else if (inRegValue)
4362 oss <<
"(Unknown/Invalid " <<
xHEX0N(inRegValue,8) <<
")";
4364 oss <<
"Kernel Extension ('KEXT')";
4371 } mDecodeDriverType;
4373 struct DecodeIDSwitchStatus :
public Decoder
4375 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4380 const uint32_t switchEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
4381 for (
UWord idSwitch(0); idSwitch < 4; )
4383 const uint32_t switchEnabled (switchEnableBits &
BIT(idSwitch));
4384 oss <<
"Switch " <<
DEC(++idSwitch) <<
": " << (switchEnabled ?
"Enabled" :
"Disabled");
4391 oss <<
"(ID Switch not supported)";
4396 } mDecodeIDSwitchStatus;
4398 struct DecodePWMFanControl :
public Decoder
4400 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4408 } mDecodePWMFanControl;
4410 struct DecodePWMFanMonitor :
public Decoder
4412 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4420 } mDecodePWMFanMonitor;
4422 struct DecodeBOBStatus :
public Decoder
4424 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4428 oss <<
"BOB : " << ((inRegValue &
kRegMaskBOBAbsent) ?
"Disconnected" :
"Connected") << endl
4432 oss <<
"Device does not support a breakout board";
4437 struct DecodeBOBGPIIn :
public Decoder
4439 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4448 oss <<
"Device does not support a breakout board";
4453 struct DecodeBOBGPIInInterruptControl :
public Decoder
4455 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4464 oss <<
"Device does not support a breakout board";
4467 } mDecodeBOBGPIInInterruptControl;
4469 struct DecodeBOBGPIOut :
public Decoder
4471 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4480 oss <<
"Device does not support a breakout board";
4485 struct DecodeBOBAudioControl :
public Decoder
4487 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4496 dBuLabel =
"+24dBu";
4499 dBuLabel =
"+18dBu";
4502 dBuLabel =
"+12dBu";
4505 dBuLabel =
"+15dBu";
4510 <<
"Analog Level Control: " << dBuLabel << endl
4514 oss <<
"Device does not support a breakout board";
4517 } mDecodeBOBAudioControl;
4519 struct DecodeLEDControl :
public Decoder
4521 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4529 oss <<
"Device does not support a breakout board";
4532 } mDecodeLEDControl;
4534 static const int NOREADWRITE = 0;
4535 static const int READONLY = 1;
4536 static const int WRITEONLY = 2;
4537 static const int READWRITE = 3;
4539 static const int CONTAINS = 0;
4540 static const int STARTSWITH = 1;
4541 static const int ENDSWITH = 2;
4542 static const int EXACTMATCH = 3;
4544 typedef map <uint32_t, const Decoder *> RegNumToDecoderMap;
4545 typedef pair <uint32_t, const Decoder *> RegNumToDecoderPair;
4546 typedef multimap <string, uint32_t> RegClassToRegNumMMap, StringToRegNumMMap;
4547 typedef pair <string, uint32_t> StringToRegNumPair;
4548 typedef RegClassToRegNumMMap::const_iterator RegClassToRegNumConstIter;
4549 typedef StringToRegNumMMap::const_iterator StringToRegNumConstIter;
4551 typedef pair <uint32_t, uint32_t> XptRegNumAndMaskIndex;
4552 typedef map <NTV2InputCrosspointID, XptRegNumAndMaskIndex> InputXpt2XptRegNumMaskIndexMap;
4553 typedef map <XptRegNumAndMaskIndex, NTV2InputCrosspointID> XptRegNumMaskIndex2InputXptMap;
4554 typedef InputXpt2XptRegNumMaskIndexMap::const_iterator InputXpt2XptRegNumMaskIndexMapConstIter;
4555 typedef XptRegNumMaskIndex2InputXptMap::const_iterator XptRegNumMaskIndex2InputXptMapConstIter;
4559 RegNumToStringMap mRegNumToStringMap;
4560 RegNumToDecoderMap mRegNumToDecoderMap;
4561 RegClassToRegNumMMap mRegClassToRegNumMMap;
4562 StringToRegNumMMap mStringToRegNumMMap;
4564 InputXpt2XptRegNumMaskIndexMap mInputXpt2XptRegNumMaskIndexMap;
4565 XptRegNumMaskIndex2InputXptMap mXptRegNumMaskIndex2InputXptMap;
4595 return pInst ?
true :
false;
4602 return pInst ?
true :
false;
4609 return pInst ? pInst->DisposeInstance() :
false;
4617 return pRegExpert->RegNameToString(inRegNum);
4619 ostringstream oss; oss <<
"Reg ";
4621 oss <<
DEC(inRegNum);
4622 else if (inRegNum <= 0x0000FFFF)
4623 oss <<
xHEX0N(inRegNum,4);
4625 oss <<
xHEX0N(inRegNum,8);
4633 return pRegExpert ? pRegExpert->RegValueToString(inRegNum, inRegValue, inDeviceID) : string();
4640 return pRegExpert ? pRegExpert->IsRegInClass(inRegNum, inClassName) :
false;
4647 return pRegExpert ? pRegExpert->GetAllRegisterClasses() :
NTV2StringSet();
4654 return pRegExpert ? pRegExpert->GetRegisterClasses(inRegNum, inRemovePrefix) :
NTV2StringSet();
4661 return pRegExpert ? pRegExpert->GetRegistersForClass(inClassName) :
NTV2RegNumSet();
4675 return pRegExpert ? pRegExpert->GetRegistersForDevice(inDeviceID, inOtherRegsToInclude) :
NTV2RegNumSet();
4682 return pRegExpert ? pRegExpert->GetRegistersWithName(inName, inSearchStyle) :
NTV2RegNumSet();
4696 return pRegExpert ? pRegExpert->GetXptRegNumAndMaskIndex(inInputXpt, outXptRegNum, outMaskIndex) :
false;