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);
146 SetupMixerKeyerRegs();
154 SetupNTV4FrameStoreRegs();
159 REiDBG(
"RegsToStrsMap=" << mRegNumToStringMap.size()
160 <<
" RegsToDecodersMap=" << mRegNumToDecoderMap.size()
161 <<
" ClassToRegsMMap=" << mRegClassToRegNumMMap.size()
162 <<
" StrToRegsMMap=" << mStringToRegNumMMap.size()
163 <<
" InpXptsToXptRegInfoMap=" << mInputXpt2XptRegNumMaskIndexMap.size()
164 <<
" XptRegInfoToInpXptsMap=" << mXptRegNumMaskIndex2InputXptMap.size()
165 <<
" RegClasses=" << mAllRegClasses.size());
181 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
188 } mDefaultRegDecoder;
190 void DefineRegName(
const uint32_t regNumber,
const string & regName)
192 if (!regName.empty())
195 if (mRegNumToStringMap.find(regNumber) == mRegNumToStringMap.end())
197 mRegNumToStringMap.insert (RegNumToStringPair(regNumber, regName));
198 string lowerCaseRegName(regName);
199 mStringToRegNumMMap.insert (StringToRegNumPair(
aja::lower(lowerCaseRegName), regNumber));
203 inline void DefineRegDecoder(
const uint32_t inRegNum,
const Decoder & dec)
206 mRegNumToDecoderMap.insert (RegNumToDecoderPair(inRegNum, &dec));
208 inline void DefineRegClass (
const uint32_t inRegNum,
const string & className)
210 if (!className.empty())
213 mRegClassToRegNumMMap.insert(StringToRegNumPair(className, inRegNum));
216 void DefineRegReadWrite(
const uint32_t inRegNum,
const int rdWrt)
219 if (rdWrt == READONLY)
224 if (rdWrt == WRITEONLY)
230 void DefineRegister(
const uint32_t inRegNum,
const string & regName,
const Decoder & dec,
const int rdWrt,
const string & className1,
const string & className2,
const string & className3)
232 DefineRegName (inRegNum, regName);
233 DefineRegDecoder (inRegNum, dec);
234 DefineRegReadWrite (inRegNum, rdWrt);
235 DefineRegClass (inRegNum, className1);
236 DefineRegClass (inRegNum, className2);
237 DefineRegClass (inRegNum, className3);
243 for (
int ndx(0); ndx < 4; ndx++)
247 const XptRegNumAndMaskIndex regNumAndNdx(inRegNum, ndx);
248 if (mXptRegNumMaskIndex2InputXptMap.find(regNumAndNdx) == mXptRegNumMaskIndex2InputXptMap.end())
249 mXptRegNumMaskIndex2InputXptMap [regNumAndNdx] = indexes[ndx];
250 if (mInputXpt2XptRegNumMaskIndexMap.find(indexes[ndx]) == mInputXpt2XptRegNumMaskIndexMap.end())
251 mInputXpt2XptRegNumMaskIndexMap[indexes[ndx]] = regNumAndNdx;
255 void SetupBasicRegs(
void)
276 #if 1 // PCIAccessFrame regs are obsolete
285 #endif // PCIAccessFrame regs are obsolete
362 void SetupBOBRegs(
void)
371 void SetupLEDRegs(
void)
383 void SetupCMWRegs(
void)
393 void SetupVPIDRegs(
void)
429 void SetupTimecodeRegs(
void)
495 void SetupAudioRegs(
void)
581 void SetupMRRegs(
void)
592 void SetupDMARegs(
void)
623 void SetupXptSelect(
void)
635 if (mXptRegNumMaskIndex2InputXptMap.find (regNumAndNdx) == mXptRegNumMaskIndex2InputXptMap.end())
637 if (mInputXpt2XptRegNumMaskIndexMap.find (
NTV2_XptHDMIOutQ1Input) == mInputXpt2XptRegNumMaskIndexMap.end())
673 { ostringstream regName;
680 if (inputXptEnumName.empty())
681 regName <<
"kRegXptValid" <<
DEC0N(rawInputXpt,3) <<
"N" <<
DEC(ndx);
683 regName <<
"kRegXptValid" <<
aja::replace(inputXptEnumName,
"NTV2_Xpt",
"") <<
DEC(ndx);
686 regName <<
"kRegXptValue" <<
HEX0N(regNum,4);
691 void SetupAncInsExt(
void)
693 static const string AncExtRegNames [] = {
"Control",
"F1 Start Address",
"F1 End Address",
694 "F2 Start Address",
"F2 End Address",
"Field Cutoff Lines",
695 "Memory Total",
"F1 Memory Usage",
"F2 Memory Usage",
696 "V Blank Lines",
"Lines Per Frame",
"Field ID Lines",
697 "Ignore DID 1-4",
"Ignore DID 5-8",
"Ignore DID 9-12",
698 "Ignore DID 13-16",
"Ignore DID 17-20",
"Analog Start Line",
699 "Analog F1 Y Filter",
"Analog F2 Y Filter",
"Analog F1 C Filter",
700 "Analog F2 C Filter",
"",
"",
702 "Analog Act Line Len"};
703 static const string AncInsRegNames [] = {
"Field Bytes",
"Control",
"F1 Start Address",
704 "F2 Start Address",
"Pixel Delay",
"Active Start",
705 "Pixels Per Line",
"Lines Per Frame",
"Field ID Lines",
706 "Payload ID Control",
"Payload ID",
"Chroma Blank Lines",
707 "F1 C Blanking Mask",
"F2 C Blanking Mask",
"Field Bytes High",
708 "Reserved 15",
"RTP Payload ID",
"RTP SSRC",
710 static const uint32_t AncExtPerChlRegBase [] = { 0x1000, 0x1040, 0x1080, 0x10C0, 0x1100, 0x1140, 0x1180, 0x11C0 };
711 static const uint32_t AncInsPerChlRegBase [] = { 0x1200, 0x1240, 0x1280, 0x12C0, 0x1300, 0x1340, 0x1380, 0x13C0 };
713 NTV2_ASSERT(
sizeof(AncExtRegNames[0]) ==
sizeof(AncExtRegNames[1]));
718 for (
ULWord offsetNdx (0); offsetNdx < 8; offsetNdx++)
722 if (AncExtRegNames[reg].empty())
continue;
723 ostringstream oss; oss <<
"Extract " << (offsetNdx+1) <<
" " << AncExtRegNames[reg];
724 DefineRegName (AncExtPerChlRegBase[offsetNdx] + reg, oss.str());
728 ostringstream oss; oss <<
"Insert " << (offsetNdx+1) <<
" " << AncInsRegNames[reg];
729 DefineRegName (AncInsPerChlRegBase[offsetNdx] + reg, oss.str());
732 for (
ULWord ndx (0); ndx < 8; ndx++)
779 void SetupHDMIRegs(
void)
933 void SetupSDIErrorRegs(
void)
936 static const string suffixes [] = {
"Status",
"CRCErrorCount",
"FrameCountLow",
"FrameCountHigh",
"FrameRefCountLow",
"FrameRefCountHigh"};
937 static const int perms [] = {READWRITE, READWRITE, READWRITE, READWRITE, READONLY, READONLY};
940 for (
ULWord chan (0); chan < 8; chan++)
941 for (
UWord ndx(0); ndx < 6; ndx++)
943 ostringstream ossName; ossName <<
"kRegRXSDI" <<
DEC(chan+1) << suffixes[ndx];
944 const string & regName (ossName.str());
945 const uint32_t regNum (baseNum[chan] + ndx);
946 const int perm (perms[ndx]);
958 void SetupLUTRegs (
void)
963 void SetupCSCRegs(
void)
968 for (
unsigned num(0); num < 8; num++)
970 ostringstream ossRegName; ossRegName <<
"kRegEnhancedCSC" << (num+1);
971 const string & chanClass (sChan[num]);
const string rootName (ossRegName.str());
972 const string modeName (rootName +
"Mode");
const string inOff01Name (rootName +
"InOffset0_1");
const string inOff2Name (rootName +
"InOffset2");
973 const string coeffA0Name (rootName +
"CoeffA0");
const string coeffA1Name (rootName +
"CoeffA1");
const string coeffA2Name (rootName +
"CoeffA2");
974 const string coeffB0Name (rootName +
"CoeffB0");
const string coeffB1Name (rootName +
"CoeffB1");
const string coeffB2Name (rootName +
"CoeffB2");
975 const string coeffC0Name (rootName +
"CoeffC0");
const string coeffC1Name (rootName +
"CoeffC1");
const string coeffC2Name (rootName +
"CoeffC2");
976 const string outOffABName(rootName +
"OutOffsetA_B");
const string outOffCName (rootName +
"OutOffsetC");
977 const string keyModeName (rootName +
"KeyMode");
const string keyClipOffName (rootName +
"KeyClipOffset");
const string keyGainName (rootName +
"KeyGain");
1004 for (
unsigned chan(0); chan < 8; chan++)
1006 const string & chanClass (sChan[chan]);
1019 #if 1 // V2 tables need the appropriate Enable & Bank bits set in kRegLUTV2Control, otherwise they'll always readback zero!
1022 for (
ULWord ndx(0); ndx < 512; ndx++)
1024 ostringstream regNameR, regNameG, regNameB;
1025 regNameR <<
"kRegLUTRed" <<
DEC0N(ndx,3); regNameG <<
"kRegLUTGreen" <<
DEC0N(ndx,3); regNameB <<
"kRegLUTBlue" <<
DEC0N(ndx,3);
1033 void SetupMixerKeyerRegs(
void)
1052 void SetupNTV4FrameStoreRegs(
void)
1054 for (
ULWord fsNdx(0); fsNdx < 4; fsNdx++)
1058 ostringstream regName; regName <<
"kRegNTV4FS" <<
DEC(fsNdx+1) <<
"_";
1089 regName <<
"InputSourceSelect";
1093 regName <<
DEC(regNdx);
1101 void SetupVRegs(
void)
1623 for (
ULWord ndx(1); ndx < 1024; ndx++)
1625 ostringstream oss; oss <<
"VIRTUALREG_START+" << ndx;
1626 const string regName (oss.str());
1628 if (mRegNumToStringMap.find(regNum) == mRegNumToStringMap.end())
1630 mRegNumToStringMap.insert (RegNumToStringPair(regNum, regName));
1631 mStringToRegNumMMap.insert (StringToRegNumPair(
ToLower(regName), regNum));
1633 DefineRegDecoder (regNum, mDefaultRegDecoder);
1634 DefineRegReadWrite (regNum, READWRITE);
1649 const string & label (it->first);
1650 const string & value (it->second);
1653 else if (label.at(label.length()-1) !=
' ' && label.at(label.length()-1) !=
':')
1654 oss << label <<
": " << value;
1655 else if (label.at(label.length()-1) ==
':')
1656 oss << label <<
" " << value;
1658 oss << label << value;
1659 if (++it != inLabelValuePairs.end())
1668 RegNumToStringMap::const_iterator iter (mRegNumToStringMap.find (inRegNum));
1669 if (iter != mRegNumToStringMap.end())
1670 return iter->second;
1672 ostringstream oss; oss <<
"Reg ";
1674 oss <<
DEC(inRegNum);
1675 else if (inRegNum <= 0x0000FFFF)
1676 oss <<
xHEX0N(inRegNum,4);
1678 oss <<
xHEX0N(inRegNum,8);
1685 RegNumToDecoderMap::const_iterator iter(mRegNumToDecoderMap.find(inRegNum));
1687 if (iter != mRegNumToDecoderMap.end() && iter->second)
1689 const Decoder * pDecoder (iter->second);
1690 oss << (*pDecoder)(inRegNum, inRegValue, inDeviceID);
1695 bool IsRegInClass (
const uint32_t inRegNum,
const string & inClassName)
const
1698 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1699 if (it->second == inRegNum)
1710 if (mAllRegClasses.empty())
1711 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1712 if (mAllRegClasses.find(it->first) == mAllRegClasses.end())
1713 mAllRegClasses.insert(it->first);
1714 return mAllRegClasses;
1723 if (IsRegInClass (inRegNum, *it))
1728 if (result.find(str) == result.end())
1738 for (RegClassToRegNumConstIter it(mRegClassToRegNumMMap.find(inClassName)); it != mRegClassToRegNumMMap.end() && it->first == inClassName; ++it)
1739 if (result.find(it->second) == result.end())
1740 result.insert(it->second);
1749 for (uint32_t regNum (0); regNum <= maxRegNum; regNum++)
1750 result.insert(regNum);
1759 const UWord numSpigots(numVideoInputs > numVideoOutputs ? numVideoInputs : numVideoOutputs);
1761 for (
UWord num(0); num < numSpigots; num++)
1764 allChanRegs.insert(chRegs.begin(), chRegs.end());
1766 std::set_intersection (ancRegs.begin(), ancRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1772 result.insert(sdiErrRegs.begin(), sdiErrRegs.end());
1778 result.insert(regNum);
1780 result.insert(regNum);
1792 for (
UWord num(0); num < numCSCs; num++)
1795 allChanRegs.insert(chRegs.begin(), chRegs.end());
1797 std::set_intersection (ecscRegs.begin(), ecscRegs.end(), allChanRegs.begin(), allChanRegs.end(), std::inserter(result, result.begin()));
1803 result.insert(LUTRegs.begin(), LUTRegs.end());
1808 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1809 result.insert(regNum);
1810 for (
ULWord regNum = 0x2500; regNum <= 0x251f; regNum++)
1811 result.insert(regNum);
1812 for (
ULWord regNum = 0x2c00; regNum <= 0x2c1f; regNum++)
1813 result.insert(regNum);
1814 for (
ULWord regNum = 0x3000; regNum <= 0x301f; regNum++)
1815 result.insert(regNum);
1819 for (
ULWord regNum = 0x1d00; regNum <= 0x1d1f; regNum++)
1820 result.insert(regNum);
1821 for (
ULWord regNum = 0x1d40; regNum <= 0x1d5f; regNum++)
1822 result.insert(regNum);
1823 for (
ULWord regNum = 0x3C00; regNum <= 0x3C0A; regNum++)
1824 result.insert(regNum);
1842 for (
UWord num(0); num < numFrameStores; num++)
1845 chanRegs.insert(chRegs.begin(), chRegs.end());
1847 std::set_intersection (ntv4FSRegs.begin(), ntv4FSRegs.end(), chanRegs.begin(), chanRegs.end(), std::inserter(result, result.begin()));
1895 result.insert(vRegs.begin(), vRegs.end());
1901 result.insert(xptMapRegs.begin(), xptMapRegs.end());
1910 string nameStr(inName);
1911 const size_t nameStrLen(
aja::lower(nameStr).length());
1912 StringToRegNumConstIter it;
1914 if (inMatchStyle == EXACTMATCH)
1916 it = mStringToRegNumMMap.find(nameStr);
1917 if (it != mStringToRegNumMMap.end())
1918 result.insert(it->second);
1922 for (it = mStringToRegNumMMap.begin(); it != mStringToRegNumMMap.end(); ++it)
1924 const size_t pos(it->first.find(nameStr));
1925 if (pos == string::npos)
1927 switch (inMatchStyle)
1929 case CONTAINS: result.insert(it->second);
break;
1930 case STARTSWITH:
if (pos == 0)
1931 {result.insert(it->second);}
1933 case ENDSWITH:
if (pos+nameStrLen == it->first.length())
1934 {result.insert(it->second);}
1945 outXptRegNum = 0xFFFFFFFF;
1946 outMaskIndex = 0xFFFFFFFF;
1947 InputXpt2XptRegNumMaskIndexMapConstIter iter (mInputXpt2XptRegNumMaskIndexMap.find (inInputXpt));
1948 if (iter == mInputXpt2XptRegNumMaskIndexMap.end())
1950 outXptRegNum = iter->second.first;
1951 outMaskIndex = iter->second.second;
1958 const XptRegNumAndMaskIndex key (inXptRegNum, inMaskIndex);
1959 XptRegNumMaskIndex2InputXptMapConstIter iter (mXptRegNumMaskIndex2InputXptMap.find (key));
1960 if (iter != mXptRegNumMaskIndex2InputXptMap.end())
1961 return iter->second;
1965 ostream &
Print (ostream & inOutStream)
const
1968 static const string sLineBreak (96,
'=');
1969 static const uint32_t
sMasks[4] = {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000};
1971 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToStringMap: " << mRegNumToStringMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1972 for (RegNumToStringMap::const_iterator it (mRegNumToStringMap.begin()); it != mRegNumToStringMap.end(); ++it)
1973 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => '" << it->second <<
"'" << endl;
1975 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegNumToDecoderMap: " << mRegNumToDecoderMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1976 for (RegNumToDecoderMap::const_iterator it (mRegNumToDecoderMap.begin()); it != mRegNumToDecoderMap.end(); ++it)
1977 inOutStream <<
"reg " << setw(5) << it->first <<
"(" <<
HEX0N(it->first,8) << dec <<
") => " << (it->second == &mDefaultRegDecoder ?
"(default decoder)" :
"Custom Decoder") << endl;
1979 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of RegClassToRegNumMMap: " << mRegClassToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1980 for (RegClassToRegNumMMap::const_iterator it (mRegClassToRegNumMMap.begin()); it != mRegClassToRegNumMMap.end(); ++it)
1981 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
1983 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of StringToRegNumMMap: " << mStringToRegNumMMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1984 for (StringToRegNumMMap::const_iterator it (mStringToRegNumMMap.begin()); it != mStringToRegNumMMap.end(); ++it)
1985 inOutStream << setw(32) << it->first <<
" => reg " << setw(5) << it->second <<
"(" <<
HEX0N(it->second,8) << dec <<
") " << RegNameToString(it->second) << endl;
1987 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of InputXpt2XptRegNumMaskIndexMap: " << mInputXpt2XptRegNumMaskIndexMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1988 for (InputXpt2XptRegNumMaskIndexMap::const_iterator it (mInputXpt2XptRegNumMaskIndexMap.begin()); it != mInputXpt2XptRegNumMaskIndexMap.end(); ++it)
1990 <<
") => reg " << setw(3) << it->second.first <<
"(" <<
HEX0N(it->second.first,3) << dec <<
"|" << setw(20) << RegNameToString(it->second.first)
1991 <<
") mask " << it->second.second <<
"(" <<
HEX0N(
sMasks[it->second.second],8) <<
")" << endl;
1993 inOutStream << endl << sLineBreak << endl <<
"RegisterExpert: Dump of XptRegNumMaskIndex2InputXptMap: " << mXptRegNumMaskIndex2InputXptMap.size() <<
" mappings:" << endl << sLineBreak << endl;
1994 for (XptRegNumMaskIndex2InputXptMap::const_iterator it (mXptRegNumMaskIndex2InputXptMap.begin()); it != mXptRegNumMaskIndex2InputXptMap.end(); ++it)
1995 inOutStream <<
"reg " << setw(3) << it->first.first <<
"(" <<
HEX0N(it->first.first,4) <<
"|" << setw(20) << RegNameToString(it->first.first)
1996 <<
") mask " << it->first.second <<
"(" <<
HEX0N(
sMasks[it->first.second],8) <<
") => "
2002 typedef std::map<uint32_t, string> RegNumToStringMap;
2003 typedef std::pair<uint32_t, string> RegNumToStringPair;
2005 static string ToLower (
const string & inStr)
2007 string result (inStr);
2008 std::transform (result.begin (), result.end (), result.begin (), ::tolower);
2012 struct DecodeGlobalControlReg :
public Decoder
2014 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2031 for (
int led(0); led < 4; ++led)
2032 oss << (((inRegValue &
kRegMaskLED) >> (16 + led)) ?
"*" :
".");
2037 <<
"Color Correction: " <<
"Channel: " << ((inRegValue &
BIT(31)) ?
"2" :
"1")
2038 <<
" Bank " << ((inRegValue &
BIT (30)) ?
"1" :
"0");
2041 } mDecodeGlobalControlReg;
2044 struct DecodeGlobalControl2 :
public Decoder
2046 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2063 for (
unsigned ch(0); ch < 8; ch++)
2064 oss <<
"Audio " <<
DEC(ch+1) <<
" Play/Capture Mode: " <<
OnOff(inRegValue & playCaptModes[ch]) << endl;
2065 for (
unsigned ch(2); ch < 8; ch++)
2066 oss <<
"Ch " <<
DEC(ch+1) <<
" RP188 Output: " <<
EnabDisab(inRegValue & rp188Modes[ch]) << endl;
2067 for (
unsigned ch(0); ch < 3; ch++)
2068 oss <<
"Ch " <<
DEC(2*(ch+2)) <<
" 1080p50/p60 Link-B Mode: " <<
EnabDisab(inRegValue & BLinkModes[ch]) << endl;
2069 for (
unsigned ch(0); ch < 4; ch++)
2070 oss <<
"Ch " <<
DEC(ch+1) <<
"/" <<
DEC(ch+2) <<
" 2SI Mode: " <<
EnabDisab(inRegValue & k425Masks[ch]) << endl;
2071 oss <<
"2SI Min Align Delay 1-4: " <<
EnabDisab(inRegValue &
BIT(24)) << endl
2072 <<
"2SI Min Align Delay 5-8: " <<
EnabDisab(inRegValue &
BIT(25));
2075 } mDecodeGlobalControl2;
2078 struct DecodeGlobalControl3 :
public Decoder
2080 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2087 <<
"VU Meter Audio Select: " << (inRegValue &
kRegMaskVUMeterSelect ?
"AudMixer" :
"AudSys1") << endl
2097 } mDecodeGlobalControl3;
2100 struct DecodeGlobalControlChanReg :
public Decoder
2102 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2115 } mDecodeGlobalControlChanRegs;
2118 struct DecodeChannelControlReg :
public Decoder
2120 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2127 oss <<
"Mode: " << (inRegValue &
kRegMaskMode ?
"Capture" :
"Display") << endl
2130 <<
"Viper Squeeze: " << (inRegValue &
BIT(9) ?
"Squeeze" :
"Normal") << endl
2135 <<
"Frame Size: " << (1 << (((inRegValue &
kK2RegMaskFrameSize) >> 20) + 1)) <<
" MB" << endl;
2138 oss <<
"RGB Range: " << (inRegValue &
BIT(24) ?
"Black = 0x40" :
"Black = 0") << endl
2142 } mDecodeChannelControl;
2144 struct DecodeFBControlReg :
public Decoder
2146 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2150 const bool isOn ((inRegValue & (1 << 29)) != 0);
2151 const uint16_t format ((inRegValue >> 15) & 0x1F);
2153 oss <<
OnOff(isOn) << endl
2154 <<
"Format: " <<
xHEX0N(format,4) <<
" (" <<
DEC(format) <<
")";
2157 } mDecodeFBControlReg;
2159 struct DecodeChannelControlExtReg :
public Decoder
2161 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2166 oss <<
"Input Video 2:1 Decimate: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
2167 <<
"HDMI Rx Direct: " <<
EnabDisab(inRegValue &
BIT(1)) << endl
2168 <<
"3:2 Pulldown Mode: " <<
EnabDisab(inRegValue &
BIT(2));
2171 } mDecodeChannelControlExt;
2173 struct DecodeSysmonVccIntDieTemp :
public Decoder
2175 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2179 const UWord rawDieTemp ((inRegValue & 0x0000FFFF) >> 6);
2180 const UWord rawVoltage ((inRegValue >> 22) & 0x3FF);
2181 const double dieTempC ((
double(rawDieTemp)) * 503.975 / 1024.0 - 273.15 );
2182 const double dieTempF (dieTempC * 9.0 / 5.0 + 32.0);
2183 const double voltage (
double(rawVoltage)/ 1024.0 * 3.0);
2185 oss <<
"Die Temperature: " <<
fDEC(dieTempC,5,2) <<
" Celcius (" <<
fDEC(dieTempF,5,2) <<
" Fahrenheit)" << endl
2186 <<
"Core Voltage: " <<
fDEC(voltage,5,2) <<
" Volts DC";
2189 } mDecodeSysmonVccIntDieTemp;
2191 struct DecodeSDITransmitCtrl :
public Decoder
2193 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2198 const UWord numSpigots (numInputs > numOutputs ? numInputs : numOutputs);
2202 const uint32_t txEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
2204 for (
UWord spigot(0); spigot < numSpigots; )
2206 const uint32_t txEnabled (txEnableBits &
BIT(spigot));
2207 oss <<
"SDI " <<
DEC(++spigot) <<
": " << (txEnabled ?
"Output/Transmit" :
"Input/Receive");
2208 if (spigot < numSpigots)
2212 oss <<
"(No SDI inputs or outputs)";
2215 oss <<
"(Bi-directional SDI not supported)";
2219 } mDecodeSDITransmitCtrl;
2221 struct DecodeConversionCtrl :
public Decoder
2223 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2229 oss <<
"Bitfile ID: " <<
xHEX0N(bitfileID, 2) << endl
2230 <<
"Memory Test: Start: " <<
YesNo(inRegValue &
BIT(28)) << endl
2231 <<
"Memory Test: Done: " <<
YesNo(inRegValue &
BIT(29)) << endl
2232 <<
"Memory Test: Passed: " <<
YesNo(inRegValue &
BIT(30));
2251 <<
"Vert Filter Preload: " <<
DisabEnab(inRegValue &
BIT(7)) << endl
2258 } mConvControlRegDecoder;
2260 struct DecodeRelayCtrlStat :
public Decoder
2262 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2277 oss <<
"(SDI bypass relays not supported)";
2280 } mDecodeRelayCtrlStat;
2282 struct DecodeWatchdogTimeout :
public Decoder
2284 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2290 const uint32_t ticks8nanos (inRegValue);
2291 const double microsecs (
double(ticks8nanos) * 8.0 / 1000.0);
2292 const double millisecs (microsecs / 1000.0);
2293 oss <<
"Watchdog Timeout [8-ns ticks]: " <<
xHEX0N(ticks8nanos,8) <<
" (" <<
DEC(ticks8nanos) <<
")" << endl
2294 <<
"Watchdog Timeout [usec]: " << microsecs << endl
2295 <<
"Watchdog Timeout [msec]: " << millisecs;
2298 oss <<
"(SDI bypass relays not supported)";
2301 } mDecodeWatchdogTimeout;
2303 struct DecodeWatchdogKick :
public Decoder
2305 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2313 const uint32_t expectedValue(whichReg ? 0x01234567 : 0xA5A55A5A);
2314 oss <<
xHEX0N(inRegValue,8);
2315 if (inRegValue == expectedValue)
2318 oss <<
" (Not expected, should be " <<
xHEX0N(expectedValue,8) <<
")";
2321 oss <<
"(SDI bypass relays not supported)";
2324 } mDecodeWatchdogKick;
2326 struct DecodeInputVPID:
public Decoder
2328 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2336 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2339 } mVPIDInpRegDecoder;
2341 struct DecodeOutputVPID:
public Decoder
2343 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2350 PrintLabelValuePairs(oss, ntv2vpid.GetInfo(info));
2353 } mVPIDOutRegDecoder;
2355 struct DecodeBitfileDateTime :
public Decoder
2357 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2363 const UWord yyyy ((inRegValue & 0xFFFF0000) >> 16);
2364 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2365 const UWord dd (inRegValue & 0x000000FF);
2366 if (yyyy > 0x2015 && mm > 0 && mm < 0x13 && dd > 0 && dd < 0x32)
2367 oss <<
"Bitfile Date: " <<
HEX0N(mm,2) <<
"/" <<
HEX0N(dd,2) <<
"/" <<
HEX0N(yyyy,4);
2369 oss <<
"Bitfile Date: " <<
xHEX0N(inRegValue, 8);
2373 const UWord hh ((inRegValue & 0x00FF0000) >> 16);
2374 const UWord mm ((inRegValue & 0x0000FF00) >> 8);
2375 const UWord ss (inRegValue & 0x000000FF);
2376 if (hh < 0x24 && mm < 0x60 && ss < 0x60)
2377 oss <<
"Bitfile Time: " <<
HEX0N(hh,2) <<
":" <<
HEX0N(mm,2) <<
":" <<
HEX0N(ss,2);
2379 oss <<
"Bitfile Time: " <<
xHEX0N(inRegValue, 8);
2384 } mDecodeBitfileDateTime;
2386 struct DecodeBoardID :
public Decoder
2388 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2389 { (void) inRegNum; (void) inDeviceID;
2394 <<
"Device Name: '" << str1 <<
"'";
2397 <<
"Retail Device Name: '" << str2 <<
"'";
2402 struct DecodeDynFWUpdateCounts :
public Decoder
2404 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2405 { (void) inRegNum; (void) inDeviceID;
2407 oss <<
"# attempts: " <<
DEC(inRegValue >> 16) << endl
2408 <<
"# successes: " <<
DEC(inRegValue & 0x0000FFFF);
2411 } mDecodeDynFWUpdateCounts;
2413 struct DecodeFWUserID :
public Decoder
2415 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2416 { (void) inRegNum; (void) inDeviceID;
2425 } mDecodeFirmwareUserID;
2427 struct DecodeCanDoStatus :
public Decoder
2429 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2430 { (void) inRegNum; (void) inDeviceID;
2432 oss <<
"Has CanConnect Xpt Route ROM: " <<
YesNo(inRegValue &
BIT(0)) << endl
2433 <<
"AudioSystems can start on VBI: " <<
YesNo(inRegValue &
BIT(1));
2436 } mDecodeCanDoStatus;
2438 struct DecodeVidControlReg :
public Decoder
2440 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2444 const bool is16x9 ((inRegValue &
BIT(31)) != 0);
2445 const bool isMono ((inRegValue &
BIT(30)) != 0);
2447 oss <<
"Aspect Ratio: " << (is16x9 ?
"16x9" :
"4x3") << endl
2448 <<
"Depth: " << (isMono ?
"Monochrome" :
"Color");
2451 } mDecodeVidControlReg;
2453 struct DecodeVidIntControl :
public Decoder
2455 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2460 oss <<
"Output 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(0)) << endl
2461 <<
"Input 1 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2462 <<
"Input 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2463 <<
"Audio Out Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(4)) << endl
2464 <<
"Audio In Wrap Interrupt Enable: " <<
YesNo(inRegValue &
BIT(5)) << endl
2465 <<
"Wrap Rate Interrupt Enable: " <<
YesNo(inRegValue &
BIT(6)) << endl
2466 <<
"UART Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(7)) << endl
2467 <<
"UART Rx Interrupt Enable" <<
YesNo(inRegValue &
BIT(8)) << endl
2468 <<
"UART Rx Interrupt Clear" <<
ActInact(inRegValue &
BIT(15)) << endl
2469 <<
"UART 2 Tx Interrupt Enable" <<
YesNo(inRegValue &
BIT(17)) << endl
2470 <<
"Output 2 Vertical Enable: " <<
YesNo(inRegValue &
BIT(18)) << endl
2471 <<
"Output 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2472 <<
"Output 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(20)) << endl
2473 <<
"Output 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(21)) << endl
2474 <<
"Output 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(22)) << endl
2475 <<
"Output 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(23)) << endl
2476 <<
"UART Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(24)) << endl
2477 <<
"Wrap Rate Interrupt Clear" <<
ActInact(inRegValue &
BIT(25)) << endl
2478 <<
"UART 2 Tx Interrupt Clear" <<
ActInact(inRegValue &
BIT(26)) << endl
2479 <<
"Audio Out Wrap Interrupt Clear" <<
ActInact(inRegValue &
BIT(27)) << endl
2480 <<
"Input 2 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2481 <<
"Input 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30)) << endl
2482 <<
"Output 1 Vertical Clear: " <<
ActInact(inRegValue &
BIT(31));
2485 } mDecodeVidIntControl;
2487 struct DecodeVidIntControl2 :
public Decoder
2489 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2494 oss <<
"Input 3 Vertical Enable: " <<
YesNo(inRegValue &
BIT(1)) << endl
2495 <<
"Input 4 Vertical Enable: " <<
YesNo(inRegValue &
BIT(2)) << endl
2496 <<
"Input 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(8)) << endl
2497 <<
"Input 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(9)) << endl
2498 <<
"Input 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(10)) << endl
2499 <<
"Input 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(11)) << endl
2500 <<
"Output 5 Vertical Enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
2501 <<
"Output 6 Vertical Enable: " <<
YesNo(inRegValue &
BIT(13)) << endl
2502 <<
"Output 7 Vertical Enable: " <<
YesNo(inRegValue &
BIT(14)) << endl
2503 <<
"Output 8 Vertical Enable: " <<
YesNo(inRegValue &
BIT(15)) << endl
2504 <<
"Output 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(16)) << endl
2505 <<
"Output 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(17)) << endl
2506 <<
"Output 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(18)) << endl
2507 <<
"Output 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(19)) << endl
2508 <<
"Input 8 Vertical Clear: " <<
ActInact(inRegValue &
BIT(25)) << endl
2509 <<
"Input 7 Vertical Clear: " <<
ActInact(inRegValue &
BIT(26)) << endl
2510 <<
"Input 6 Vertical Clear: " <<
ActInact(inRegValue &
BIT(27)) << endl
2511 <<
"Input 5 Vertical Clear: " <<
ActInact(inRegValue &
BIT(28)) << endl
2512 <<
"Input 4 Vertical Clear: " <<
ActInact(inRegValue &
BIT(29)) << endl
2513 <<
"Input 3 Vertical Clear: " <<
ActInact(inRegValue &
BIT(30));
2516 } mDecodeVidIntControl2;
2518 struct DecodeStatusReg :
public Decoder
2520 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2525 oss <<
"Input 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(20)) << endl
2526 <<
"Input 1 Field ID: " << (inRegValue &
BIT(21) ?
"1" :
"0") << endl
2527 <<
"Input 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(30)) << endl
2528 <<
"Input 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(18)) << endl
2529 <<
"Input 2 Field ID: " << (inRegValue &
BIT(19) ?
"1" :
"0") << endl
2530 <<
"Input 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(29)) << endl
2531 <<
"Output 1 Vertical Blank: " <<
ActInact(inRegValue &
BIT(22)) << endl
2532 <<
"Output 1 Field ID: " << (inRegValue &
BIT(23) ?
"1" :
"0") << endl
2533 <<
"Output 1 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(31)) << endl
2534 <<
"Output 2 Vertical Blank: " <<
ActInact(inRegValue &
BIT(4)) << endl
2535 <<
"Output 2 Field ID: " << (inRegValue &
BIT(5) ?
"1" :
"0") << endl
2536 <<
"Output 2 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(8)) << endl;
2538 oss <<
"Output 3 Vertical Blank: " <<
ActInact(inRegValue &
BIT(2)) << endl
2539 <<
"Output 3 Field ID: " << (inRegValue &
BIT(3) ?
"1" :
"0") << endl
2540 <<
"Output 3 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(7)) << endl
2541 <<
"Output 4 Vertical Blank: " <<
ActInact(inRegValue &
BIT(0)) << endl
2542 <<
"Output 4 Field ID: " << (inRegValue &
BIT(1) ?
"1" :
"0") << endl
2543 <<
"Output 4 Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(6)) << endl;
2544 oss <<
"Aux Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(12)) << endl
2545 <<
"I2C 1 Interrupt: " <<
ActInact(inRegValue &
BIT(14)) << endl
2546 <<
"I2C 2 Interrupt: " <<
ActInact(inRegValue &
BIT(13)) << endl
2547 <<
"Chunk Rate Interrupt: " <<
ActInact(inRegValue &
BIT(16)) << endl;
2549 oss <<
"Generic UART Interrupt: " <<
ActInact(inRegValue &
BIT(9)) << endl
2550 <<
"Uart 1 Rx Interrupt: " <<
ActInact(inRegValue &
BIT(15)) << endl
2551 <<
"Uart 1 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(24)) << endl;
2553 oss <<
"Uart 2 Tx Interrupt: " <<
ActInact(inRegValue &
BIT(26)) << endl;
2555 oss <<
"LTC In 1 Present: " <<
YesNo(inRegValue &
BIT(17)) << endl;
2556 oss <<
"Wrap Rate Interrupt: " <<
ActInact(inRegValue &
BIT(25)) << endl
2557 <<
"Audio Out Wrap Interrupt: " <<
ActInact(inRegValue &
BIT(27)) << endl
2558 <<
"Audio 50Hz Interrupt: " <<
ActInact(inRegValue &
BIT(28));
2563 struct DecodeCPLDVersion :
public Decoder
2565 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2570 oss <<
"CPLD Version: " <<
DEC(inRegValue & (
BIT(0)|
BIT(1))) << endl
2571 <<
"Failsafe Bitfile Loaded: " << (inRegValue &
BIT(4) ?
"Yes" :
"No") << endl
2572 <<
"Force Reload: " <<
YesNo(inRegValue &
BIT(8));
2575 } mDecodeCPLDVersion;
2577 struct DecodeStatus2Reg :
public Decoder
2579 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2583 static const uint8_t bitNumsInputVBlank[] = {20, 18, 16, 14, 12, 10};
2584 static const uint8_t bitNumsInputFieldID[] = {21, 19, 17, 15, 13, 11};
2585 static const uint8_t bitNumsInputVertInt[] = {30, 29, 28, 27, 26, 25};
2586 static const uint8_t bitNumsOutputVBlank[] = { 8, 6, 4, 2};
2587 static const uint8_t bitNumsOutputFieldID[] = { 9, 7, 5, 3};
2588 static const uint8_t bitNumsOutputVertInt[] = {31, 24, 23, 22};
2590 for (
unsigned ndx(0); ndx < 6; ndx++)
2591 oss <<
"Input " << (ndx+3) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsInputVBlank[ndx])) << endl
2592 <<
"Input " << (ndx+3) <<
" Field ID: " << (inRegValue &
BIT(bitNumsInputFieldID[ndx]) ?
"1" :
"0") << endl
2593 <<
"Input " << (ndx+3) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsInputVertInt[ndx])) << endl;
2594 for (
unsigned ndx(0); ndx < 4; ndx++)
2595 oss <<
"Output " << (ndx+5) <<
" Vertical Blank: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVBlank[ndx])) << endl
2596 <<
"Output " << (ndx+5) <<
" Field ID: " << (inRegValue &
BIT(bitNumsOutputFieldID[ndx]) ?
"1" :
"0") << endl
2597 <<
"Output " << (ndx+5) <<
" Vertical Interrupt: " <<
ActInact(inRegValue &
BIT(bitNumsOutputVertInt[ndx])) << endl;
2598 oss <<
"HDMI In Hot-Plug Detect Interrupt: " <<
ActInact(inRegValue &
BIT(0)) << endl
2599 <<
"HDMI In Chip Interrupt: " <<
ActInact(inRegValue &
BIT(1));
2602 } mDecodeStatus2Reg;
2604 struct DecodeInputStatusReg :
public Decoder
2606 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2615 <<
"Input 1 Geometry: ";
2616 if (
BIT(30) & inRegValue)
2617 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2619 case 0: oss <<
"2K x 1080";
break;
2620 case 1: oss <<
"2K x 1556";
break;
2621 default: oss <<
"Invalid HI";
break;
2624 switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2626 case 0: oss <<
"Unknown";
break;
2627 case 1: oss <<
"525";
break;
2628 case 2: oss <<
"625";
break;
2629 case 3: oss <<
"750";
break;
2630 case 4: oss <<
"1125";
break;
2631 case 5: oss <<
"1250";
break;
2632 case 6:
case 7: oss <<
"Reserved";
break;
2633 default: oss <<
"Invalid LO";
break;
2636 <<
"Input 1 Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2638 <<
"Input 2 Geometry: ";
2639 if (
BIT(31) & inRegValue)
2640 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2642 case 0: oss <<
"2K x 1080";
break;
2643 case 1: oss <<
"2K x 1556";
break;
2644 default: oss <<
"Invalid HI";
break;
2647 switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2649 case 0: oss <<
"Unknown";
break;
2650 case 1: oss <<
"525";
break;
2651 case 2: oss <<
"625";
break;
2652 case 3: oss <<
"750";
break;
2653 case 4: oss <<
"1125";
break;
2654 case 5: oss <<
"1250";
break;
2655 case 6:
case 7: oss <<
"Reserved";
break;
2656 default: oss <<
"Invalid LO";
break;
2659 <<
"Input 2 Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2661 <<
"Reference Geometry: ";
2662 switch (((
BIT(20)|
BIT(21)|
BIT(22)) & inRegValue) >> 20)
2664 case 0: oss <<
"NTV2_SG_UNKNOWN";
break;
2665 case 1: oss <<
"NTV2_SG_525";
break;
2666 case 2: oss <<
"NTV2_SG_625";
break;
2667 case 3: oss <<
"NTV2_SG_750";
break;
2668 case 4: oss <<
"NTV2_SG_1125";
break;
2669 case 5: oss <<
"NTV2_SG_1250";
break;
2670 default: oss <<
"Invalid";
break;
2673 <<
"Reference Scan Mode: " << ((
BIT(23) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2674 <<
"AES Channel 1-2: " << ((
BIT(24) & inRegValue) ?
"Invalid" :
"Valid") << endl
2675 <<
"AES Channel 3-4: " << ((
BIT(25) & inRegValue) ?
"Invalid" :
"Valid") << endl
2676 <<
"AES Channel 5-6: " << ((
BIT(26) & inRegValue) ?
"Invalid" :
"Valid") << endl
2677 <<
"AES Channel 7-8: " << ((
BIT(27) & inRegValue) ?
"Invalid" :
"Valid");
2680 } mDecodeInputStatusReg;
2682 struct DecodeSDIInputStatusReg :
public Decoder
2684 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2687 uint16_t numSpigots(0), startSpigot(0), doTsiMuxSync(0);
2698 for (uint16_t spigotNdx(0); spigotNdx < numSpigots; )
2700 const uint16_t spigotNum (spigotNdx + startSpigot);
2701 const uint8_t statusBits ((inRegValue >> (spigotNdx*8)) & 0xFF);
2702 const uint8_t speedBits (statusBits & 0xC1);
2703 ostringstream ossSpeed, ossSpigot;
2704 ossSpigot <<
"SDI In " << spigotNum <<
" ";
2705 const string spigotLabel (ossSpigot.str());
2706 if (speedBits & 0x01) ossSpeed <<
" 3G";
2709 if (speedBits & 0x40) ossSpeed <<
" 6G";
2710 if (speedBits & 0x80) ossSpeed <<
" 12G";
2712 if (speedBits == 0) ossSpeed <<
" 1.5G";
2713 oss << spigotLabel <<
"Link Speed:" << ossSpeed.str() << endl
2714 << spigotLabel <<
"SMPTE Level B: " <<
YesNo(statusBits & 0x02) << endl
2715 << spigotLabel <<
"Link A VPID Valid: " <<
YesNo(statusBits & 0x10) << endl
2716 << spigotLabel <<
"Link B VPID Valid: " <<
YesNo(statusBits & 0x20) << endl;
2718 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: " <<
EnabDisab(statusBits & 0x04);
2720 oss << spigotLabel <<
"3Gb-to-3Ga Conversion: n/a";
2721 if (++spigotNdx < numSpigots)
2725 for (
UWord tsiMux(0); tsiMux < 4; ++tsiMux)
2727 <<
"TsiMux" <<
DEC(tsiMux+1) <<
" Sync Fail: " << ((inRegValue & (0x00010000UL << tsiMux)) ?
"FAILED" :
"OK");
2730 } mDecodeSDIInputStatusReg;
2732 struct DecodeSDIInputStatus2Reg :
public Decoder
2734 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2742 oss << sOdd <<
" Scan Mode: " << ((
BIT(7) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2744 << sOdd <<
" Geometry: ";
2745 if (
BIT(30) & inRegValue)
switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2747 case 0: oss <<
"2K x 1080";
break;
2748 case 1: oss <<
"2K x 1556";
break;
2749 default: oss <<
"Invalid HI";
break;
2751 else switch (((
BIT(4)|
BIT(5)|
BIT(6)) & inRegValue) >> 4)
2753 case 0: oss <<
"Unknown";
break;
2754 case 1: oss <<
"525";
break;
2755 case 2: oss <<
"625";
break;
2756 case 3: oss <<
"750";
break;
2757 case 4: oss <<
"1125";
break;
2758 case 5: oss <<
"1250";
break;
2759 case 6:
case 7: oss <<
"Reserved";
break;
2760 default: oss <<
"Invalid LO";
break;
2763 << sEven <<
" Scan Mode: " << ((
BIT(15) & inRegValue) ?
"Progressive" :
"Interlaced") << endl
2765 << sEven <<
" Geometry: ";
2766 if (
BIT(31) & inRegValue)
switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2768 case 0: oss <<
"2K x 1080";
break;
2769 case 1: oss <<
"2K x 1556";
break;
2770 default: oss <<
"Invalid HI";
break;
2772 else switch (((
BIT(12)|
BIT(13)|
BIT(14)) & inRegValue) >> 12)
2774 case 0: oss <<
"Unknown";
break;
2775 case 1: oss <<
"525";
break;
2776 case 2: oss <<
"625";
break;
2777 case 3: oss <<
"750";
break;
2778 case 4: oss <<
"1125";
break;
2779 case 5: oss <<
"1250";
break;
2780 case 6:
case 7: oss <<
"Reserved";
break;
2781 default: oss <<
"Invalid LO";
break;
2785 } mDecodeSDIInputStatus2Reg;
2787 struct DecodeFS1RefSelectReg :
public Decoder
2789 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2791 (void) inDeviceID; (void) inRegNum;
2793 oss <<
"BNC Select(LHi): " << (inRegValue & 0x00000010 ?
"LTCIn1" :
"Ref") << endl
2794 <<
"Ref BNC (Corvid): " <<
EnabDisab(inRegValue & 0x00000020) << endl
2795 <<
"LTC Present (also Reg 21): " <<
YesNo(inRegValue & 0x00000040) << endl
2796 <<
"LTC Emb Out Enable: " <<
YesNo(inRegValue & 0x00000080) << endl
2797 <<
"LTC Emb In Enable: " <<
YesNo(inRegValue & 0x00000100) << endl
2798 <<
"LTC Emb In Received: " <<
YesNo(inRegValue & 0x00000200) << endl
2799 <<
"LTC BNC Out Source: " << (inRegValue & 0x00000400 ?
"E-E" :
"Reg112/113");
2802 } mDecodeFS1RefSelectReg;
2804 struct DecodeLTCStatusControlReg :
public Decoder
2806 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2808 (void) inDeviceID; (void) inRegNum;
2809 const uint16_t LTC1InTimingSelect ((inRegValue >> 1) & 0x0000007);
2810 const uint16_t LTC2InTimingSelect ((inRegValue >> 9) & 0x0000007);
2811 const uint16_t LTC1OutTimingSelect ((inRegValue >> 16) & 0x0000007);
2812 const uint16_t LTC2OutTimingSelect ((inRegValue >> 20) & 0x0000007);
2814 oss <<
"LTC 1 Input Present: " <<
YesNo(inRegValue & 0x00000001) << endl
2815 <<
"LTC 1 Input FB Timing Select): " <<
xHEX0N(LTC1InTimingSelect,2) <<
" (" <<
DEC(LTC1InTimingSelect) <<
")" << endl
2816 <<
"LTC 1 Bypass: " <<
EnabDisab(inRegValue & 0x00000010) << endl
2817 <<
"LTC 1 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 5) & 0x00000001)) << endl
2818 <<
"LTC 2 Input Present: " <<
YesNo(inRegValue & 0x00000100) << endl
2819 <<
"LTC 2 Input FB Timing Select): " <<
xHEX0N(LTC2InTimingSelect,2) <<
" (" <<
DEC(LTC2InTimingSelect) <<
")" << endl
2820 <<
"LTC 2 Bypass: " <<
EnabDisab(inRegValue & 0x00001000) << endl
2821 <<
"LTC 2 Bypass Select: " <<
DEC(
ULWord((inRegValue >> 13) & 0x00000001)) << endl
2822 <<
"LTC 1 Output FB Timing Select): " <<
xHEX0N(LTC1OutTimingSelect,2) <<
" (" <<
DEC(LTC1OutTimingSelect) <<
")" << endl
2823 <<
"LTC 2 Output FB Timing Select): " <<
xHEX0N(LTC2OutTimingSelect,2) <<
" (" <<
DEC(LTC2OutTimingSelect) <<
")";
2826 } mLTCStatusControlDecoder;
2828 struct DecodeAudDetectReg :
public Decoder
2830 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2838 for (uint16_t num(0); num < 8; )
2840 const uint16_t group (num / 2);
2841 const bool isChan34 (num & 1);
2842 oss <<
"Group " << group <<
" CH " << (isChan34 ?
"3-4: " :
"1-2: ") << (inRegValue &
BIT(num) ?
"Present" :
"Absent");
2853 } mDecodeAudDetectReg;
2855 struct DecodeAudControlReg :
public Decoder
2857 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2861 static const string ChStrs [] = {
"Ch 1/2",
"Ch 3/4",
"Ch 5/6",
"Ch 7/8" };
2862 uint16_t sdiOutput (0);
2872 oss <<
"Audio Capture: " <<
EnabDisab(
BIT(0) & inRegValue) << endl
2873 <<
"Audio Loopback: " <<
EnabDisab(
BIT(3) & inRegValue) << endl
2874 <<
"Audio Input: " <<
DisabEnab(
BIT(8) & inRegValue) << endl
2875 <<
"Audio Output: " <<
DisabEnab(
BIT(9) & inRegValue) << endl
2876 <<
"Output Paused: " <<
YesNo(
BIT(11) & inRegValue) << endl;
2878 oss <<
"Audio Embedder SDIOut" << sdiOutput <<
": " <<
DisabEnab(
BIT(13) & inRegValue) << endl
2879 <<
"Audio Embedder SDIOut" << (sdiOutput+1) <<
": " <<
DisabEnab(
BIT(15) & inRegValue) << endl;
2881 oss <<
"A/V Sync Mode: " <<
EnabDisab(
BIT(15) & inRegValue) << endl
2882 <<
"AES Rate Converter: " <<
DisabEnab(
BIT(19) & inRegValue) << endl
2883 <<
"Audio Buffer Format: " << (
BIT(20) & inRegValue ?
"16-Channel " : (
BIT(16) & inRegValue ?
"8-Channel " :
"6-Channel ")) << endl
2884 << (
BIT(18) & inRegValue ?
"96kHz" :
"48kHz") << endl
2885 << (
BIT(18) & inRegValue ?
"96kHz Support" :
"48kHz Support") << endl
2887 <<
"Slave Mode (64-chl): " <<
EnabDisab(
BIT(23) & inRegValue) << endl
2888 <<
"K-box, Monitor: " << ChStrs [(
BIT(24) &
BIT(25) & inRegValue) >> 24] << endl
2889 <<
"K-Box Input: " << (
BIT(26) & inRegValue ?
"XLR" :
"BNC") << endl
2890 <<
"K-Box: " << (
BIT(27) & inRegValue ?
"Present" :
"Absent") << endl
2891 <<
"Cable: " << (
BIT(28) & inRegValue ?
"XLR" :
"BNC") << endl
2892 <<
"Audio Buffer Size: " << (
BIT(31) & inRegValue ?
"4 MB" :
"1 MB");
2895 } mDecodeAudControlReg;
2897 struct DecodeAudSourceSelectReg :
public Decoder
2899 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2903 static const string SrcStrs [] = {
"AES Input",
"Embedded Groups 1 and 2",
"" };
2904 static const unsigned SrcStrMap [] = { 0, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
2905 const uint16_t vidInput = (inRegValue &
BIT(23) ? 2 : 0) + (inRegValue &
BIT(16) ? 1 : 0);
2908 oss <<
"Audio Source: " << SrcStrs [SrcStrMap [(
BIT(0) |
BIT(1) |
BIT(2) |
BIT(3)) & inRegValue]] << endl
2909 <<
"Embedded Source Select: Video Input " << (1 + vidInput) << endl
2910 <<
"AES Sync Mode bit (fib): " <<
EnabDisab(inRegValue &
BIT(18)) << endl
2911 <<
"PCM disabled: " <<
YesNo(inRegValue &
BIT(17)) << endl
2912 <<
"Erase head enable: " <<
YesNo(inRegValue &
BIT(19)) << endl
2913 <<
"Embedded Clock Select: " << (inRegValue &
BIT(22) ?
"Video Input" :
"Board Reference") << endl
2914 <<
"3G audio source: " << (inRegValue &
BIT(21) ?
"Data stream 2" :
"Data stream 1");
2917 } mDecodeAudSourceSelectReg;
2919 struct DecodeAudOutputSrcMap :
public Decoder
2921 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2925 static const string AESOutputStrs[] = {
"AES Outputs 1-4",
"AES Outputs 5-8",
"AES Outputs 9-12",
"AES Outputs 13-16",
""};
2926 static const string SrcStrs[] = {
"AudSys1, Audio Channels 1-4",
"AudSys1, Audio Channels 5-8",
2927 "AudSys1, Audio Channels 9-12",
"AudSys1, Audio Channels 13-16",
2928 "AudSys2, Audio Channels 1-4",
"AudSys2, Audio Channels 5-8",
2929 "AudSys2, Audio Channels 9-12",
"AudSys2, Audio Channels 13-16",
2930 "AudSys3, Audio Channels 1-4",
"AudSys3, Audio Channels 5-8",
2931 "AudSys3, Audio Channels 9-12",
"AudSys3, Audio Channels 13-16",
2932 "AudSys4, Audio Channels 1-4",
"AudSys4, Audio Channels 5-8",
2933 "AudSys4, Audio Channels 9-12",
"AudSys4, Audio Channels 13-16",
""};
2934 static const unsigned AESChlMappingShifts [4] = {0, 4, 8, 12};
2937 const uint32_t AESOutMapping (inRegValue & 0x0000FFFF);
2941 for (
unsigned AESOutputQuad(0); AESOutputQuad < 4; AESOutputQuad++)
2942 oss << AESOutputStrs[AESOutputQuad] <<
" Source: " << SrcStrs[(AESOutMapping >> AESChlMappingShifts[AESOutputQuad]) & 0x0000000F] << endl;
2955 const uint32_t HDMIMon1234Info (HDMIMonInfo & 0x0F);
2958 const uint32_t HDMIMon5678Info ((HDMIMonInfo >> 4) & 0x0F);
2966 } mDecodeAudOutputSrcMap;
2968 struct DecodePCMControlReg :
public Decoder
2970 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2975 for (uint8_t audChan (0); audChan < 4; audChan++)
2977 oss <<
"Audio System " << (startAudioSystem + audChan) <<
": ";
2978 const uint8_t pcmBits (uint32_t(inRegValue >> (audChan * 8)) & 0x000000FF);
2979 if (pcmBits == 0x00)
2983 oss <<
"non-PCM channels";
2984 for (uint8_t chanPair (0); chanPair < 8; chanPair++)
2985 if (pcmBits & (0x01 << chanPair))
2986 oss <<
" " << (chanPair*2+1) <<
"-" << (chanPair*2+2);
2993 } mDecodePCMControlReg;
2995 struct DecodeAudioMixerInputSelectReg :
public Decoder
2997 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
2998 { (void) inDeviceID; (void) inRegNum;
2999 const UWord mainInputSrc((inRegValue ) & 0x0000000F);
3000 const UWord aux1InputSrc((inRegValue >> 4) & 0x0000000F);
3001 const UWord aux2InputSrc((inRegValue >> 8) & 0x0000000F);
3008 } mAudMxrInputSelDecoder;
3010 struct DecodeAudioMixerGainRegs :
public Decoder
3014 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3015 { (void)inRegNum; (void)inDeviceID;
3016 static const double kUnityGain (0x00010000);
3017 const bool atUnity (inRegValue == 0x00010000);
3020 oss <<
"Gain: 0 dB (Unity)";
3023 const double dValue (inRegValue);
3024 const bool aboveUnity (inRegValue >= 0x00010000);
3025 const string plusMinus (atUnity ?
"" : (aboveUnity ?
"+" :
"-"));
3026 const string aboveBelow (atUnity ?
"at" : (aboveUnity ?
"above" :
"below"));
3027 const uint32_t unityDiff (aboveUnity ? inRegValue - 0x00010000 : 0x00010000 - inRegValue);
3028 const double dB (
double(20.0) * ::log10(dValue/kUnityGain));
3029 oss <<
"Gain: " << dB <<
" dB, " << plusMinus <<
xHEX0N(unityDiff,6)
3030 <<
" (" << plusMinus <<
DEC(unityDiff) <<
") " << aboveBelow <<
" unity gain";
3034 } mAudMxrGainDecoder;
3036 struct DecodeAudioMixerChannelSelectReg :
public Decoder
3038 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3039 { (void) inRegNum; (void) inDeviceID;
3044 <<
"Level Measurement Sample Count: " <<
DEC(
ULWord(1 << powerOfTwo)) <<
" (bits 8-15)";
3047 } mAudMxrChanSelDecoder;
3050 struct DecodeAudioMixerMutesReg :
public Decoder
3053 typedef std::bitset<16> AudioChannelSet16;
3054 typedef std::bitset<2> AudioChannelSet2;
3057 outSet.clear(); outClear.clear();
3058 for (
size_t ndx(0); ndx < 16; ndx++)
3059 { ostringstream oss; oss <<
DEC(ndx+1);
3060 if (inChSet.test(ndx))
3061 outSet.push_back(oss.str());
3063 outClear.push_back(oss.str());
3065 if (outSet.empty()) outSet.push_back(
"<none>");
3066 if (outClear.empty()) outClear.push_back(
"<none>");
3070 outSet.clear(); outClear.clear();
static const string LR[] = {
"L",
"R"};
3071 for (
size_t ndx(0); ndx < 2; ndx++)
3072 if (inChSet.test(ndx))
3073 outSet.push_back(LR[ndx]);
3075 outClear.push_back(LR[ndx]);
3076 if (outSet.empty()) outSet.push_back(
"<none>");
3077 if (outClear.empty()) outClear.push_back(
"<none>");
3080 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3081 { (void) inRegNum; (void) inDeviceID;
3087 NTV2StringList mutedMainOut, unmutedMainOut, mutedMain, unmutedMain, mutedAux1, unmutedAux1, mutedAux2, unmutedAux2;
3088 SplitAudioChannelSet16(AudioChannelSet16(mainOutputMuteBits), mutedMainOut, unmutedMainOut);
3089 SplitAudioChannelSet2(AudioChannelSet2(mainInputMuteBits), mutedMain, unmutedMain);
3090 SplitAudioChannelSet2(AudioChannelSet2(aux1InputMuteBits), mutedAux1, unmutedAux1);
3091 SplitAudioChannelSet2(AudioChannelSet2(aux2InputMuteBits), mutedAux2, unmutedAux2);
3092 oss <<
"Main Output Muted/Disabled Channels: " << mutedMainOut << endl
3093 <<
"Main Output Unmuted/Enabled Channels: " << unmutedMainOut << endl;
3094 oss <<
"Main Input Muted/Disabled Channels: " << mutedMain << endl
3095 <<
"Main Input Unmuted/Enabled Channels: " << unmutedMain << endl;
3096 oss <<
"Aux Input 1 Muted/Disabled Channels: " << mutedAux1 << endl
3097 <<
"Aux Input 1 Unmuted/Enabled Channels: " << unmutedAux1 << endl;
3098 oss <<
"Aux Input 2 Muted/Disabled Channels: " << mutedAux2 << endl
3099 <<
"Aux Input 2 Unmuted/Enabled Channels: " << unmutedAux2;
3102 } mAudMxrMutesDecoder;
3104 struct DecodeAudioMixerLevelsReg :
public Decoder
3108 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3109 { (void) inDeviceID;
3110 static const string sLabels[] = {
"Aux Input 1",
"Aux Input 2",
"Main Input Audio Channels 1|2",
"Main Input Audio Channels 3|4",
3111 "Main Input Audio Channels 5|6",
"Main Input Audio Channels 7|8",
"Main Input Audio Channels 9|10",
3112 "Main Input Audio Channels 11|12",
"Main Input Audio Channels 13|14",
"Main Input Audio Channels 15|16",
3113 "Main Output Audio Channels 1|2",
"Main Output Audio Channels 3|4",
"Main Output Audio Channels 5|6",
3114 "Main Output Audio Channels 7|8",
"Main Output Audio Channels 9|10",
"Main Output Audio Channels 11|12",
3115 "Main Output Audio Channels 13|14",
"Main Output Audio Channels 15|16"};
3119 const string & label(sLabels[labelOffset]);
3123 oss << label <<
" Left Level:" <<
xHEX0N(leftLevel, 4) <<
" (" <<
DEC(leftLevel) <<
")" << endl
3124 << label <<
" Right Level:" <<
xHEX0N(rightLevel,4) <<
" (" <<
DEC(rightLevel) <<
")";
3127 } mAudMxrLevelDecoder;
3129 struct DecodeAncExtControlReg :
public Decoder
3131 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3136 static const string SyncStrs [] = {
"field",
"frame",
"immediate",
"unknown" };
3137 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3138 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3139 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3140 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3141 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(16)) << endl
3142 <<
"Synchronize: " << SyncStrs [(inRegValue & (
BIT(24) |
BIT(25))) >> 24] << endl
3143 <<
"Memory writes: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3144 <<
"SD Y+C Demux: " <<
EnabDisab(inRegValue &
BIT(30)) << endl
3145 <<
"Metadata from: " << (inRegValue &
BIT(31) ?
"LSBs" :
"MSBs");
3148 } mDecodeAncExtControlReg;
3150 struct DecodeAncExtFieldLinesReg :
public Decoder
3152 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3156 const uint32_t which (inRegNum & 0x1F);
3157 const uint32_t valueLow (inRegValue & 0xFFF);
3158 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFF);
3161 case 5: oss <<
"F1 cutoff line: " << valueLow << endl
3162 <<
"F2 cutoff line: " << valueHigh;
3164 case 9: oss <<
"F1 VBL start line: " << valueLow << endl
3165 <<
"F2 VBL start line: " << valueHigh;
3167 case 11: oss <<
"Field ID high on line: " << valueLow << endl
3168 <<
"Field ID low on line: " << valueHigh;
3170 case 17: oss <<
"F1 analog start line: " << valueLow << endl
3171 <<
"F2 analog start line: " << valueHigh;
3174 oss <<
"Invalid register type";
3179 } mDecodeAncExtFieldLines;
3181 struct DecodeAncExtStatusReg :
public Decoder
3183 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3187 const uint32_t which (inRegNum & 0x1F);
3188 const uint32_t byteTotal (inRegValue & 0xFFFFFF);
3189 const bool overrun ((inRegValue &
BIT(28)) ?
true :
false);
3192 case 6: oss <<
"Total bytes: ";
break;
3193 case 7: oss <<
"Total F1 bytes: ";
break;
3194 case 8: oss <<
"Total F2 bytes: ";
break;
3195 default: oss <<
"Invalid register type";
break;
3197 oss <<
DEC(byteTotal) << endl
3198 <<
"Overrun: " <<
YesNo(overrun);
3201 } mDecodeAncExtStatus;
3203 struct DecodeAncExtIgnoreDIDReg :
public Decoder
3205 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3210 oss <<
"Ignoring DIDs " <<
HEX0N((inRegValue >> 0) & 0xFF, 2)
3211 <<
", " <<
HEX0N((inRegValue >> 8) & 0xFF, 2)
3212 <<
", " <<
HEX0N((inRegValue >> 16) & 0xFF, 2)
3213 <<
", " <<
HEX0N((inRegValue >> 24) & 0xFF, 2);
3216 } mDecodeAncExtIgnoreDIDs;
3218 struct DecodeAncExtAnalogFilterReg :
public Decoder
3220 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3225 uint32_t which (inRegNum & 0x1F);
3226 oss <<
"Each 1 bit specifies capturing ";
3229 case 18: oss <<
"F1 Y";
break;
3230 case 19: oss <<
"F2 Y";
break;
3231 case 20: oss <<
"F1 C";
break;
3232 case 21: oss <<
"F2 C";
break;
3233 default:
return "Invalid register type";
3235 oss <<
" line as analog, else digital";
3238 } mDecodeAncExtAnalogFilter;
3240 struct DecodeAncInsValuePairReg :
public Decoder
3242 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3246 const uint32_t which (inRegNum & 0x1F);
3247 const uint32_t valueLow (inRegValue & 0xFFFF);
3248 const uint32_t valueHigh ((inRegValue >> 16) & 0xFFFF);
3252 case 0: oss <<
"F1 byte count low: " << valueLow << endl
3253 <<
"F2 byte count low: " << valueHigh;
3255 case 4: oss <<
"HANC pixel delay: " << (valueLow & 0x3FF) << endl
3256 <<
"VANC pixel delay: " << (valueHigh & 0x7FF);
3258 case 5: oss <<
"F1 first active line: " << (valueLow & 0x7FF) << endl
3259 <<
"F2 first active line: " << (valueHigh & 0x7FF);
3261 case 6: oss <<
"Active line length: " << (valueLow & 0x7FF) << endl
3262 <<
"Total line length: " << (valueHigh & 0xFFF);
3264 case 8: oss <<
"Field ID high on line: " << (valueLow & 0x7FF) << endl
3265 <<
"Field ID low on line: " << (valueHigh & 0x7FF);
3267 case 11: oss <<
"F1 chroma blnk start line: " << (valueLow & 0x7FF) << endl
3268 <<
"F2 chroma blnk start line: " << (valueHigh & 0x7FF);
3270 case 14: oss <<
"F1 byte count high: " << valueLow << endl
3271 <<
"F2 byte count high: " << valueHigh;
3273 default:
return "Invalid register type";
3277 } mDecodeAncInsValuePairReg;
3279 struct DecodeAncInsControlReg :
public Decoder
3281 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3286 oss <<
"HANC Y enable: " <<
YesNo(inRegValue &
BIT( 0)) << endl
3287 <<
"VANC Y enable: " <<
YesNo(inRegValue &
BIT( 4)) << endl
3288 <<
"HANC C enable: " <<
YesNo(inRegValue &
BIT( 8)) << endl
3289 <<
"VANC C enable: " <<
YesNo(inRegValue &
BIT(12)) << endl
3290 <<
"Payload Y insert: " <<
YesNo(inRegValue &
BIT(16)) << endl
3291 <<
"Payload C insert: " <<
YesNo(inRegValue &
BIT(17)) << endl
3292 <<
"Payload F1 insert: " <<
YesNo(inRegValue &
BIT(20)) << endl
3293 <<
"Payload F2 insert: " <<
YesNo(inRegValue &
BIT(21)) << endl
3294 <<
"Progressive video: " <<
YesNo(inRegValue &
BIT(24)) << endl
3295 <<
"Memory reads: " <<
EnabDisab(!(inRegValue &
BIT(28))) << endl
3296 <<
"SD Packet Split: " <<
EnabDisab(inRegValue &
BIT(31));
3299 } mDecodeAncInsControlReg;
3301 struct DecodeAncInsChromaBlankReg :
public Decoder
3303 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3308 uint32_t which (inRegNum & 0x1F);
3310 oss <<
"Each 1 bit specifies if chroma in ";
3313 case 12: oss <<
"F1";
break;
3314 case 13: oss <<
"F2";
break;
3315 default:
return "Invalid register type";
3317 oss <<
" should be blanked or passed thru";
3320 } mDecodeAncInsChromaBlankReg;
3322 struct DecodeXptGroupReg :
public Decoder
3324 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3326 static unsigned sShifts[4] = {0, 8, 16, 24};
3328 for (
unsigned ndx(0); ndx < 4; ndx++)
3346 strs.push_back(oss.str());
3352 } mDecodeXptGroupReg;
3354 struct DecodeXptValidReg :
public Decoder
3356 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3373 ss <<
xHEX0N(outputXpt,2) <<
"(" <<
DEC(outputXpt) <<
")";
3375 ss <<
"'" << name <<
"'";
3376 outputXptNames.push_back(ss.str());
3378 if (!outputXptNames.empty())
3379 oss <<
"Valid Xpts: " << outputXptNames;
3383 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3385 } mDecodeXptValidReg;
3387 struct DecodeNTV4FSReg :
public Decoder
3389 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3390 { (void) inDeviceID;
3391 static const string sPixClkSelects[] = {
"27",
"74.1758",
"74.25",
"148.3516",
"148.5",
"inv5",
"inv6",
"inv7"};
3392 static const string sSyncs[] = {
"Sync to Frame",
"Sync to Field",
"Immediate",
"Sync to External"};
3398 {
const ULWord sync ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3399 const ULWord pixClkSel((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18))) >> 16);
3401 if (inRegValue &
BIT(1))
3402 oss <<
"Enabled: " <<
YesNo(inRegValue &
BIT( 1)) << endl
3403 <<
"Mode: " << ((inRegValue &
BIT( 0)) ?
"Capture" :
"Display") << endl
3404 <<
"DRT_DISP: " <<
OnOff(inRegValue &
BIT( 2)) << endl
3405 <<
"Fill Bit: " <<
DEC((inRegValue &
BIT( 3)) ? 1 : 0) << endl
3406 <<
"Dither: " <<
EnabDisab(inRegValue &
BIT( 4)) << endl
3407 <<
"RGB8 Convert: " << ((inRegValue &
BIT( 5)) ?
"Use '00'" :
"Copy MSBs") << endl
3408 <<
"Progressive: " <<
YesNo(inRegValue &
BIT( 6)) << endl
3410 <<
"Pix Clk Sel: " << sPixClkSelects[pixClkSel] <<
" MHz" << endl
3411 <<
"Sync: " << sSyncs[sync];
3413 oss <<
"Enabled: " <<
YesNo(inRegValue &
BIT( 1));
3417 {
const ULWord lineCnt ((inRegValue & (0xFFFF0000)) >> 16);
3418 oss <<
"Field ID: " <<
OddEven(inRegValue &
BIT( 0)) << endl
3419 <<
"Line Count: " <<
DEC(lineCnt);
3423 {
const int32_t xferByteCnt((inRegValue & 0xFFFF0000) >> 16), linePitch(inRegValue & 0x0000FFFF);
3424 oss <<
"Line Pitch: " << linePitch << (linePitch < 0 ?
" (flipped)" :
"") << endl
3425 <<
"Xfer Byte Count: " << xferByteCnt <<
" [bytes/line]" << (linePitch < 0 ?
" (flipped)" :
"");
3429 {
const ULWord ROIVSize((inRegValue & (0x0FFF0000)) >> 16), ROIHSize(inRegValue & 0x00000FFF);
3430 oss <<
"ROI Horz Size: " <<
DEC(ROIHSize) <<
" [pixels]" << endl
3431 <<
"ROI Vert Size: " <<
DEC(ROIVSize) <<
" [lines]";
3436 {
const ULWord ROIVOff((inRegValue & (0x0FFF0000)) >> 16), ROIHOff(inRegValue & 0x00000FFF);
3438 oss <<
"ROI " << fld <<
" Horz Offset: " <<
DEC(ROIHOff) << endl
3439 <<
"ROI " << fld <<
" Vert Offset: " <<
DEC(ROIVOff);
3443 {
const ULWord tot((inRegValue & (0x0FFF0000)) >> 16), act(inRegValue & 0x00000FFF);
3444 oss <<
"Disp Horz Active: " <<
DEC(act) << endl
3445 <<
"Disp Horz Total: " <<
DEC(tot);
3449 {
const ULWord lo((inRegValue & (0x07FF0000)) >> 16), hi(inRegValue & 0x000007FF);
3450 oss <<
"Disp FID Lo: " <<
DEC(lo) << endl
3451 <<
"Disp FID Hi: " <<
DEC(hi);
3456 {
const ULWord actEnd((inRegValue & (0x07FF0000)) >> 16), actStart(inRegValue & 0x000007FF);
3458 oss <<
"Disp " << fld <<
" Active Start: " <<
DEC(actStart) << endl
3459 <<
"Disp " << fld <<
" Active End: " <<
DEC(actEnd);
3463 oss <<
"Unpacker Horz Offset: " <<
DEC(inRegValue & 0x0000FFFF);
3467 {
const ULWord hi((inRegValue & (0xFFFF0000)) >> 16), lo(inRegValue & 0x0000FFFF);
3470 oss <<
"Disp Fill " << CbBorCrR <<
": " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4) << endl
3471 <<
"Disp Fill " << YGorA <<
": " <<
DEC(hi) <<
" " <<
xHEX0N(hi,4);
3475 {
const ULWord lo(inRegValue & 0x0000FFFF);
3476 oss <<
"ROI Fill Alpha: " <<
DEC(lo) <<
" " <<
xHEX0N(lo,4);
3480 oss <<
"Output Timing Frame Pulse Preset: " <<
DEC(inRegValue & 0x00FFFFFF) <<
" "
3481 <<
xHEX0N(inRegValue & 0x00FFFFFF,6);
3486 {
const int32_t lo (inRegValue & 0x00001FFF);
3487 oss <<
"Output Video Offset: " << lo <<
" " <<
xHEX0N(lo,6);
3491 return Decoder::operator()(inRegNum, inRegValue, inDeviceID);
3497 struct DecodeHDMIOutputControl :
public Decoder
3499 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3503 static const string sHDMIStdV1[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" };
3504 static const string sHDMIStdV2V3[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3505 static const string sVidRates[] = {
"",
"60.00",
"59.94",
"30.00",
"29.97",
"25.00",
"24.00",
"23.98",
"50.00",
"48.00",
"47.95",
"",
"",
"",
"",
"" };
3506 static const string sSrcSampling[] = {
"YC422",
"RGB",
"YC420",
"Unknown/invalid" };
3507 static const string sBitDepth[] = {
"8",
"10",
"12",
"Unknown/invalid" };
3510 const string hdmiVidStdStr (hdmiVers > 1 ? sHDMIStdV2V3[rawVideoStd] : (hdmiVers == 1 ? sHDMIStdV1[rawVideoStd] :
""));
3513 const uint32_t srcBPC ((inRegValue & (
BIT(16)|
BIT(17))) >> 16);
3514 const uint32_t txBitDepth ((inRegValue & (
BIT(20)|
BIT(21))) >> 20);
3515 oss <<
"Video Standard: " << hdmiVidStdStr;
3516 if (hdmiVidStdStr != vidStdStr)
3517 oss <<
" (" << vidStdStr <<
")";
3519 <<
"Color Mode: " << ((inRegValue &
BIT( 8)) ?
"RGB" :
"YCbCr") << endl
3521 <<
"Scan Mode: " << ((inRegValue &
BIT(13)) ?
"Progressive" :
"Interlaced") << endl
3522 <<
"Bit Depth: " << ((inRegValue &
BIT(14)) ?
"10-bit" :
"8-bit") << endl
3523 <<
"Output Color Sampling: " << ((inRegValue &
BIT(15)) ?
"4:4:4" :
"4:2:2") << endl
3524 <<
"Output Bit Depth: " << sBitDepth[txBitDepth] << endl
3525 <<
"Src Color Sampling: " << sSrcSampling[srcSampling] << endl
3526 <<
"Src Bits Per Component: " << sBitDepth[srcBPC] << endl
3527 <<
"Output Range: " << ((inRegValue &
BIT(28)) ?
"Full" :
"SMPTE") << endl
3528 <<
"Audio Channels: " << ((inRegValue &
BIT(29)) ?
"8" :
"2") << endl
3529 <<
"Output: " << ((inRegValue &
BIT(30)) ?
"DVI" :
"HDMI");
3532 <<
"Audio Loopback: " <<
OnOff(inRegValue &
BIT(31));
3535 } mDecodeHDMIOutputControl;
3537 struct DecodeHDMIInputStatus :
public Decoder
3539 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3546 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"SXGA",
"2K1080p",
"2K1080i",
"3840p",
"4096p"};
3547 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" };
3548 oss <<
"HDMI Input: " << (inRegValue &
BIT(0) ?
"Locked" :
"Unlocked") << endl
3549 <<
"HDMI Input: " << (inRegValue &
BIT(1) ?
"Stable" :
"Unstable") << endl
3550 <<
"Color Mode: " << (inRegValue &
BIT(2) ?
"RGB" :
"YCbCr") << endl
3551 <<
"Bitdepth: " << (inRegValue &
BIT(3) ?
"10-bit" :
"8-bit") << endl
3552 <<
"Audio Channels: " << (inRegValue &
BIT(12) ? 2 : 8) << endl
3553 <<
"Scan Mode: " << (inRegValue &
BIT(13) ?
"Progressive" :
"Interlaced") << endl
3554 <<
"Standard: " << (inRegValue &
BIT(14) ?
"SD" :
"HD") << endl
3555 <<
"Video Standard: " << sStds[vidStd] << endl
3556 <<
"Protocol: " << (inRegValue &
BIT(27) ?
"DVI" :
"HDMI") << endl
3557 <<
"Video Rate : " << (rate < 11 ? sRates[rate] :
string(
"invalid"));
3560 } mDecodeHDMIInputStatus;
3562 struct DecodeHDMIInputControl :
public Decoder
3564 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3566 (void) inRegNum; (void) inDeviceID;
3568 const UWord chanPair ((inRegValue & (
BIT(2) |
BIT(3))) >> 2);
3570 const UWord txCh12Sel ((inRegValue & (
BIT(29)|
BIT(30))) >> 29);
3572 oss <<
"HDMI In EDID Write-Enable: " <<
EnabDisab(inRegValue &
BIT(0)) << endl
3573 <<
"HDMI Force Output Params: " <<
SetNotset(inRegValue &
BIT(1)) << endl
3575 <<
"hdmi_rx_8ch_src_off: " <<
YesNo(inRegValue &
BIT(4)) << endl
3576 <<
"Swap HDMI In Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(5)) << endl
3577 <<
"Swap HDMI Out Audio Ch. 3/4: " <<
YesNo(inRegValue &
BIT(6)) << endl
3578 <<
"HDMI Prefer 420: " <<
SetNotset(inRegValue &
BIT(7)) << endl
3579 <<
"hdmi_rx_spdif_err: " <<
SetNotset(inRegValue &
BIT(8)) << endl
3580 <<
"hdmi_rx_afifo_under: " <<
SetNotset(inRegValue &
BIT(9)) << endl
3581 <<
"hdmi_rx_afifo_empty: " <<
SetNotset(inRegValue &
BIT(10)) << endl
3582 <<
"H polarity: " << (inRegValue &
BIT(16) ?
"Inverted" :
"Normal") << endl
3583 <<
"V polarity: " << (inRegValue &
BIT(17) ?
"Inverted" :
"Normal") << endl
3584 <<
"F polarity: " << (inRegValue &
BIT(18) ?
"Inverted" :
"Normal") << endl
3585 <<
"DE polarity: " << (inRegValue &
BIT(19) ?
"Inverted" :
"Normal") << endl
3586 <<
"Tx Src Sel: " <<
DEC(txSrcSel) <<
" (" <<
xHEX0N(txSrcSel,4) <<
")" << endl
3587 <<
"Tx Center Cut: " <<
SetNotset(inRegValue &
BIT(24)) << endl
3588 <<
"Tx 12 bit: " <<
SetNotset(inRegValue &
BIT(26)) << endl
3589 <<
"RGB Input Gamut: " << (inRegValue &
BIT(28) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3590 <<
"Tx_ch12_sel: " <<
DEC(txCh12Sel) <<
" (" <<
xHEX0N(txCh12Sel,4) <<
")" << endl
3591 <<
"Input AVI Gamut: " << (inRegValue &
BIT(31) ?
"Full Range" :
"Narrow Range (SMPTE)") << endl
3595 } mDecodeHDMIInputControl;
3597 struct DecodeHDMIOutputStatus :
public Decoder
3599 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3600 { (void) inRegNum; (void) inDeviceID;
3606 } mDecodeHDMIOutputStatus;
3608 struct DecodeHDMIOutHDRPrimary :
public Decoder
3610 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3630 const double xFloat (
double(xPrimary) * 0.00002);
3631 const double yFloat (
double(yPrimary) * 0.00002);
3633 oss <<
"X: " <<
fDEC(xFloat,7,5) << endl;
3635 oss <<
"X: " <<
HEX0N(xPrimary, 4) <<
"(invalid)" << endl;
3637 oss <<
"Y: " <<
fDEC(yFloat,7,5);
3639 oss <<
"Y: " <<
HEX0N(yPrimary, 4) <<
"(invalid)";
3646 const double minFloat (
double(minValue) * 0.00001);
3647 const double maxFloat (maxValue);
3648 oss <<
"Min: " <<
fDEC(minFloat,7,5) << endl
3649 <<
"Max: " <<
fDEC(maxFloat,7,5);
3656 const double cntFloat (cntValue);
3657 const double frmFloat (frmValue);
3658 oss <<
"Max Content Light Level: " <<
fDEC(cntFloat,7,5) << endl
3659 <<
"Max Frame Light Level: " <<
fDEC(frmFloat,7,5);
3666 } mDecodeHDMIOutHDRPrimary;
3668 struct DecodeHDMIOutHDRControl :
public Decoder
3670 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3673 static const string sEOTFs[] = {
"Trad Gamma SDR",
"Trad Gamma HDR",
"SMPTE ST 2084",
"HLG"};
3682 <<
"EOTF: " << sEOTFs[(EOTFvalue < 3) ? EOTFvalue : 3] << endl
3683 <<
"Static MetaData Desc ID: " <<
HEX0N(staticMetaDataDescID, 2) <<
" (" <<
DEC(staticMetaDataDescID) <<
")";
3687 } mDecodeHDMIOutHDRControl;
3689 struct DecodeHDMIOutMRControl :
public Decoder
3691 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3692 { (void) inRegNum; (void) inDeviceID;
3694 static const string sMRStandard[] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"2Kx1080p",
"2Kx1080i",
"UHD",
"4K",
"",
"",
"",
"",
"",
"" };
3696 const string hdmiVidStdStr (sMRStandard[rawVideoStd]);
3698 oss <<
"Video Standard: " << hdmiVidStdStr;
3699 if (hdmiVidStdStr != vidStdStr)
3700 oss <<
" (" << vidStdStr <<
")";
3702 <<
"Capture Mode: " << ((inRegValue &
kRegMaskMREnable) ?
"Enabled" :
"Disabled");
3705 } mDecodeHDMIOutMRControl;
3707 struct DecodeSDIOutputControl :
public Decoder
3709 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3714 const uint32_t vidStd (inRegValue & (
BIT(0)|
BIT(1)|
BIT(2)));
3715 static const string sStds[32] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"6",
"7"};
3716 oss <<
"Video Standard: " << sStds[vidStd] << endl
3717 <<
"2Kx1080 mode: " << (inRegValue &
BIT(3) ?
"2048x1080" :
"1920x1080") << endl
3718 <<
"HBlank RGB Range: Black=" << (inRegValue &
BIT(7) ?
"0x40" :
"0x04") << endl
3719 <<
"12G enable: " <<
YesNo(inRegValue &
BIT(17)) << endl
3720 <<
"6G enable: " <<
YesNo(inRegValue &
BIT(16)) << endl
3721 <<
"3G enable: " <<
YesNo(inRegValue &
BIT(24)) << endl
3722 <<
"3G mode: " << (inRegValue &
BIT(25) ?
"b" :
"a") << endl
3723 <<
"VPID insert enable: " <<
YesNo(inRegValue &
BIT(26)) << endl
3724 <<
"VPID overwrite enable: " <<
YesNo(inRegValue &
BIT(27)) << endl
3725 <<
"DS 1 audio source: " "AudSys";
3726 switch ((inRegValue & (
BIT(28)|
BIT(30))) >> 28)
3728 case 0: oss << (inRegValue &
BIT(18) ? 5 : 1);
break;
3729 case 1: oss << (inRegValue &
BIT(18) ? 7 : 3);
break;
3730 case 4: oss << (inRegValue &
BIT(18) ? 6 : 2);
break;
3731 case 5: oss << (inRegValue &
BIT(18) ? 8 : 4);
break;
3733 oss << endl <<
"DS 2 audio source: AudSys";
3734 switch ((inRegValue & (
BIT(29)|
BIT(31))) >> 29)
3736 case 0: oss << (inRegValue &
BIT(19) ? 5 : 1);
break;
3737 case 1: oss << (inRegValue &
BIT(19) ? 7 : 3);
break;
3738 case 4: oss << (inRegValue &
BIT(19) ? 6 : 2);
break;
3739 case 5: oss << (inRegValue &
BIT(19) ? 8 : 4);
break;
3743 } mDecodeSDIOutputControl;
3745 struct DecodeDMAControl :
public Decoder
3747 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3751 const uint16_t gen ((inRegValue & (
BIT(20)|
BIT(21)|
BIT(22)|
BIT(23))) >> 20);
3752 const uint16_t lanes ((inRegValue & (
BIT(16)|
BIT(17)|
BIT(18)|
BIT(19))) >> 16);
3753 const uint16_t fwRev ((inRegValue & 0x0000FF00) >> 8);
3755 for (uint16_t engine(0); engine < 4; engine++)
3756 oss <<
"DMA " << (engine+1) <<
" Int Active?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3757 oss <<
"Bus Error Int Active?: " <<
YesNo(inRegValue &
BIT(31)) << endl;
3758 for (uint16_t engine(0); engine < 4; engine++)
3759 oss <<
"DMA " << (engine+1) <<
" Busy?: " <<
YesNo(inRegValue &
BIT(27+engine)) << endl;
3760 oss <<
"Strap: " << ((inRegValue &
BIT(7)) ?
"Installed" :
"Not Installed") << endl
3761 <<
"Firmware Rev: " <<
xHEX0N(fwRev, 2) <<
" (" <<
DEC(fwRev) <<
")" << endl
3762 <<
"Gen: " << gen << ((gen > 0 && gen < 4) ?
"" :
" <invalid>") << endl
3763 <<
"Lanes: " <<
DEC(lanes) << ((lanes < 9) ?
"" :
" <invalid>");
3766 } mDMAControlRegDecoder;
3768 struct DecodeDMAIntControl :
public Decoder
3770 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3775 for (uint16_t eng(0); eng < 4; eng++)
3776 oss <<
"DMA " << (eng+1) <<
" Enabled?: " <<
YesNo(inRegValue &
BIT(eng)) << endl;
3777 oss <<
"Bus Error Enabled?: " <<
YesNo(inRegValue &
BIT(4)) << endl;
3778 for (uint16_t eng(0); eng < 4; eng++)
3779 oss <<
"DMA " << (eng+1) <<
" Active?: " <<
YesNo(inRegValue &
BIT(27+eng)) << endl;
3780 oss <<
"Bus Error: " <<
YesNo(inRegValue &
BIT(31));
3783 } mDMAIntControlRegDecoder;
3785 struct DecodeDMAXferRate :
public Decoder
3787 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3788 { (void) inRegNum; (void) inDeviceID;
3790 oss <<
DEC(inRegValue) <<
" [MB/sec] [kB/ms] [B/us]";
3793 } mDMAXferRateRegDecoder;
3795 struct DecodeRP188InOutDBB :
public Decoder
3797 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3801 const bool isReceivingRP188 (inRegValue &
BIT(16));
3802 const bool isReceivingSelectedRP188 (inRegValue &
BIT(17));
3803 const bool isReceivingLTC (inRegValue &
BIT(18));
3804 const bool isReceivingVITC (inRegValue &
BIT(19));
3806 oss <<
"RP188: " << (isReceivingRP188 ? (isReceivingSelectedRP188 ?
"Selected" :
"Unselected") :
"No") <<
" RP-188 received"
3807 << (isReceivingLTC ?
" +LTC" :
"") << (isReceivingVITC ?
" +VITC" :
"") << endl
3808 <<
"Bypass: " << (inRegValue &
BIT(23) ? (inRegValue &
BIT(22) ?
"SDI In 2" :
"SDI In 1") :
"Disabled") << endl
3809 <<
"Filter: " <<
HEX0N((inRegValue & 0xFF000000) >> 24, 2) << endl
3810 <<
"DBB: " <<
HEX0N((inRegValue & 0x0000FF00) >> 8, 2) <<
" " <<
HEX0N(inRegValue & 0x000000FF, 2);
3813 } mRP188InOutDBBRegDecoder;
3815 struct DecodeVidProcControl :
public Decoder
3817 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3822 static const string sSplitStds [8] = {
"1080i",
"720p",
"480i",
"576i",
"1080p",
"1556i",
"?6?",
"?7?"};
3823 oss <<
"Mode: " << (inRegValue &
kRegMaskVidProcMode ? ((inRegValue &
BIT(24)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3824 <<
"FG Control: " << (inRegValue &
kRegMaskVidProcFGControl ? ((inRegValue &
BIT(20)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3825 <<
"BG Control: " << (inRegValue &
kRegMaskVidProcBGControl ? ((inRegValue &
BIT(22)) ?
"Shaped" :
"Unshaped") :
"Full Raster") << endl
3826 <<
"VANC Pass-Thru: " << ((inRegValue &
BIT(13)) ?
"Background" :
"Foreground") << endl
3830 <<
"Limiting: " << ((inRegValue &
BIT(11)) ?
"Off" : ((inRegValue &
BIT(12)) ?
"Legal Broadcast" :
"Legal SDI")) << endl
3834 } mVidProcControlRegDecoder;
3836 struct DecodeSplitControl :
public Decoder
3838 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3843 const uint32_t startmask (0x0000FFFF);
3844 const uint32_t slopemask (0x3FFF0000);
3845 const uint32_t fractionmask(0x00000007);
3846 oss <<
"Split Start: " <<
HEX0N((inRegValue & startmask) & ~fractionmask, 4) <<
" "
3847 <<
HEX0N((inRegValue & startmask) & fractionmask, 4) << endl
3848 <<
"Split Slope: " <<
HEX0N(((inRegValue & slopemask) >> 16) & ~fractionmask, 4) <<
" "
3849 <<
HEX0N(((inRegValue & slopemask) >> 16) & fractionmask, 4) << endl
3850 <<
"Split Type: " << ((inRegValue &
BIT(30)) ?
"Vertical" :
"Horizontal");
3853 } mSplitControlRegDecoder;
3855 struct DecodeFlatMatteValue :
public Decoder
3857 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3862 const uint32_t mask (0x000003FF);
3863 oss <<
"Flat Matte Cb: " <<
HEX0N(inRegValue & mask, 3) << endl
3864 <<
"Flat Matte Y: " <<
HEX0N(((inRegValue >> 10) & mask) - 0x40, 3) << endl
3865 <<
"Flat Matte Cr: " <<
HEX0N((inRegValue >> 20) & mask, 3);
3868 } mFlatMatteValueRegDecoder;
3870 struct DecodeEnhancedCSCMode :
public Decoder
3872 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3876 static const string sFiltSel[] = {
"Full",
"Simple",
"None",
"?"};
3877 static const string sEdgeCtrl[] = {
"black",
"extended pixels"};
3878 static const string sPixFmts[] = {
"RGB 4:4:4",
"YCbCr 4:4:4",
"YCbCr 4:2:2",
"?"};
3879 const uint32_t filterSelect ((inRegValue >> 12) & 0x3);
3880 const uint32_t edgeControl ((inRegValue >> 8) & 0x1);
3881 const uint32_t outPixFmt ((inRegValue >> 4) & 0x3);
3882 const uint32_t inpPixFmt (inRegValue & 0x3);
3884 oss <<
"Filter select: " << sFiltSel[filterSelect] << endl
3885 <<
"Filter edge control: " <<
"Filter to " << sEdgeCtrl[edgeControl] << endl
3886 <<
"Output pixel format: " << sPixFmts[outPixFmt] << endl
3887 <<
"Input pixel format: " << sPixFmts[inpPixFmt];
3890 } mEnhCSCModeDecoder;
3892 struct DecodeEnhancedCSCOffset :
public Decoder
3894 static string U10Dot6ToFloat (
const uint32_t inOffset)
3896 double result (
double((inOffset >> 6) & 0x3FF));
3897 result += double(inOffset & 0x3F) / 64.0;
3898 ostringstream oss; oss <<
fDEC(result,12,5);
string resultStr(oss.str());
3901 static string U12Dot4ToFloat (
const uint32_t inOffset)
3903 double result (
double((inOffset >> 4) & 0xFFF));
3904 result += double(inOffset & 0xF) / 16.0;
3905 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
3908 static string S13Dot2ToFloat (
const uint32_t inOffset)
3910 double result (
double((inOffset >> 2) & 0x1FFF));
3911 result += double(inOffset & 0x3) / 4.0;
3912 if (inOffset &
BIT(15))
3914 ostringstream oss; oss <<
fDEC(result,12,2);
string resultStr(oss.str());
3917 static string S11Dot4ToFloat (
const uint32_t inOffset)
3919 double result (
double((inOffset >> 4) & 0x7FF));
3920 result += double(inOffset & 0xF) / 16.0;
3921 if (inOffset &
BIT(15))
3923 ostringstream oss; oss <<
fDEC(result,12,4);
string resultStr(oss.str());
3926 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3929 const uint32_t regNum (inRegNum & 0x1F);
3930 const uint32_t lo (inRegValue & 0x0000FFFF);
3931 const uint32_t hi ((inRegValue >> 16) & 0xFFFF);
3935 case 1: oss <<
"Component 0 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
3936 <<
"Component 1 input offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
3938 case 2: oss <<
"Component 2 input offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
3940 case 12: oss <<
"Component A output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)" << endl
3941 <<
"Component B output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
3943 case 13: oss <<
"Component C output offset: " << U12Dot4ToFloat(lo) <<
" (12-bit), " << U10Dot6ToFloat(lo) <<
" (10-bit)";
3945 case 15: oss <<
"Key input offset: " << S13Dot2ToFloat(lo) <<
" (12-bit), " << S11Dot4ToFloat(lo) <<
" (10-bit)" << endl
3946 <<
"Key output offset: " << U12Dot4ToFloat(hi) <<
" (12-bit), " << U10Dot6ToFloat(hi) <<
" (10-bit)";
3952 } mEnhCSCOffsetDecoder;
3954 struct DecodeEnhancedCSCKeyMode :
public Decoder
3956 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3960 static const string sSrcSel[] = {
"Key Input",
"Video Y Input"};
3961 static const string sRange[] = {
"Full Range",
"SMPTE Range"};
3962 const uint32_t keySrcSelect (inRegValue & 0x1);
3963 const uint32_t keyOutRange ((inRegValue >> 4) & 0x1);
3965 oss <<
"Key Source Select: " << sSrcSel[keySrcSelect] << endl
3966 <<
"Key Output Range: " << sRange[keyOutRange];
3969 } mEnhCSCKeyModeDecoder;
3971 struct DecodeEnhancedCSCCoefficient :
public Decoder
3973 static string S2Dot15ToFloat (
const uint32_t inCoefficient)
3975 double result = (double((inCoefficient >> 15) & 0x3));
3976 result += double(inCoefficient & 0x7FFF) / 32768.0;
3977 if (inCoefficient &
BIT(17))
3979 ostringstream oss; oss <<
fDEC(result,12,10);
string resultStr(oss.str());
3982 static string S12Dot12ToFloat (
const uint32_t inCoefficient)
3984 double result(
double((inCoefficient >> 12) & 0xFFF));
3985 result += double(inCoefficient & 0xFFF) / 4096.0;
3986 if (inCoefficient &
BIT(24))
3988 ostringstream oss; oss <<
fDEC(result,12,6);
string resultStr(oss.str());
3991 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
3994 uint32_t regNum (inRegNum & 0x1F);
3996 if (regNum > 2 && regNum < 12)
3999 static const string sCoeffNames[] = {
"A0",
"A1",
"A2",
"B0",
"B1",
"B2",
"C0",
"C1",
"C2"};
4000 const uint32_t coeff ((inRegValue >> 9) & 0x0003FFFF);
4001 oss << sCoeffNames[regNum] <<
" coefficient: " << S2Dot15ToFloat(coeff) <<
" (" <<
xHEX0N(coeff,8) <<
")";
4003 else if (regNum == 16)
4005 const uint32_t gain ((inRegValue >> 4) & 0x01FFFFFF);
4006 oss <<
"Key gain: " << S12Dot12ToFloat(gain) <<
" (" <<
HEX0N(gain,8) <<
")";
4010 } mEnhCSCCoeffDecoder;
4012 struct DecodeCSCoeff1234 :
public Decoder
4014 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4017 const uint32_t coeff1 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4018 const uint32_t coeff2 ((inRegValue >> 14) & 0x00001FFF);
4019 uint16_t nCoeff1(1), nCoeff2(2);
4024 nCoeff1 = 3; nCoeff2 = 4;
break;
4040 oss <<
"Video Key Sync Status: " << (inRegValue &
BIT(28) ?
"SyncFail" :
"OK") << endl
4041 <<
"Make Alpha From Key Input: " <<
EnabDisab(inRegValue &
BIT(29)) << endl
4042 <<
"Matrix Select: " << (inRegValue &
BIT(30) ?
"Rec601" :
"Rec709") << endl
4043 <<
"Use Custom Coeffs: " <<
YesNo(inRegValue &
BIT(31)) << endl;
4045 oss <<
"RGB Range: " << (inRegValue &
BIT(31) ?
"SMPTE (0x040-0x3C0)" :
"Full (0x000-0x3FF)") << endl;
4046 oss <<
"Coefficient" <<
DEC(nCoeff1) <<
": " <<
xHEX0N(coeff1, 4) << endl
4047 <<
"Coefficient" <<
DEC(nCoeff2) <<
": " <<
xHEX0N(coeff2, 4);
4050 } mCSCoeff1234Decoder;
4052 struct DecodeCSCoeff567890 :
public Decoder
4054 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4057 const uint32_t coeff5 (((inRegValue >> 11) & 0x00000003) | uint32_t(inRegValue & 0x000007FF));
4058 const uint32_t coeff6 ((inRegValue >> 14) & 0x00001FFF);
4059 uint16_t nCoeff5(5), nCoeff6(6);
4064 nCoeff5 = 7; nCoeff6 = 8;
break;
4067 nCoeff5 = 9; nCoeff6 = 10;
break;
4077 oss <<
"Coefficient" <<
DEC(nCoeff5) <<
": " <<
xHEX0N(coeff5, 4) << endl
4078 <<
"Coefficient" <<
DEC(nCoeff6) <<
": " <<
xHEX0N(coeff6, 4);
4081 } mCSCoeff567890Decoder;
4083 struct DecodeLUTV1ControlReg :
public Decoder
4085 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4086 {
static const string sModes[] = {
"Off",
"RGB",
"YCbCr",
"3-Way",
"Invalid"};
4099 if (lutVersion != 1)
4100 oss <<
"(Register data relevant for V1 LUT, this device has V" <<
DEC(lutVersion) <<
" LUT)";
4103 oss <<
"LUT Saturation Value: " <<
xHEX0N(saturation,4) <<
" (" <<
DEC(saturation) <<
")" << endl
4104 <<
"LUT Output Bank Select: " <<
SetNotset(outBankSelect) << endl
4105 <<
"LUT Mode: " << sModes[mode] <<
" (" <<
DEC(mode) <<
")";
4108 <<
"LUT5 Host Bank Select: " <<
SetNotset(cc5HostBank) << endl
4109 <<
"LUT5 Output Bank Select: " <<
SetNotset(cc5OutputBank) << endl
4110 <<
"LUT5 Select: " <<
SetNotset(cc5Select) << endl
4111 <<
"Config 2nd LUT Set: " <<
YesNo(ccConfig2);
4114 <<
"LUT3 Bank Select: " <<
SetNotset(cc3BankSel) << endl
4115 <<
"LUT4 Bank Select: " <<
SetNotset(cc4BankSel);
4118 } mLUTV1ControlRegDecoder;
4120 struct DecodeLUTV2ControlReg :
public Decoder
4122 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4126 if (lutVersion != 2)
4127 oss <<
"(Register data relevant for V2 LUT, this device has V" <<
DEC(lutVersion) <<
"LUT)";
4130 for (
UWord lutNum(0); lutNum < 8; lutNum++)
4131 oss <<
"LUT" <<
DEC(lutNum+1) <<
" Enabled: " << (
YesNo(inRegValue & (1<<lutNum))) << endl
4132 <<
"LUT" <<
DEC(lutNum+1) <<
" Host Access Bank Select: " << (inRegValue & (1<<(lutNum+8)) ?
'1' :
'0') << endl
4133 <<
"LUT" <<
DEC(lutNum+1) <<
" Output Bank Select: " << (inRegValue & (1<<(lutNum+16)) ?
'1' :
'0') << endl;
4134 oss <<
"12-Bit LUT mode: " << ((inRegValue &
BIT(28)) ?
"12-bit" :
"10-bit") << endl
4135 <<
"12-Bit LUT page reg: " <<
DEC(
UWord((inRegValue & (
BIT(24)|
BIT(25))) >> 24));
4139 } mLUTV2ControlRegDecoder;
4141 struct DecodeLUT :
public Decoder
4143 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4147 const bool isRed(inRegNum >= RedReg && inRegNum < GreenReg), isGreen(inRegNum >= GreenReg && inRegNum < BlueReg), isBlue(inRegNum>=BlueReg);
4153 const string label(isRed ?
"Red[" : (isGreen ?
"Green[" :
"Blue["));
4154 const ULWord ndx((inRegNum - (isRed ? RedReg : (isGreen ? GreenReg : BlueReg))) * 2);
4157 oss << label <<
DEC0N(ndx+0,3) <<
"]: " <<
DEC0N(lo,3) << endl
4158 << label <<
DEC0N(ndx+1,3) <<
"]: " <<
DEC0N(hi,3);
4163 struct DecodeSDIErrorStatus :
public Decoder
4165 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4171 oss <<
"Unlock Tally: " <<
DEC(inRegValue & 0x7FFF) << endl
4172 <<
"Locked: " <<
YesNo(inRegValue &
BIT(16)) << endl
4173 <<
"Link A VPID Valid: " <<
YesNo(inRegValue &
BIT(20)) << endl
4174 <<
"Link B VPID Valid: " <<
YesNo(inRegValue &
BIT(21)) << endl
4175 <<
"TRS Error Detected: " <<
YesNo(inRegValue &
BIT(24));
4178 } mSDIErrorStatusRegDecoder;
4180 struct DecodeSDIErrorCount :
public Decoder
4182 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4188 oss <<
"Link A: " <<
DEC(inRegValue & 0x0000FFFF) << endl
4189 <<
"Link B: " <<
DEC((inRegValue & 0xFFFF0000) >> 16);
4192 } mSDIErrorCountRegDecoder;
4194 struct DecodeDriverVersion :
public Decoder
4196 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4197 { (void) inDeviceID;
4201 ULWord buildType((inRegValue >> 30) & 0x00000003);
4202 static const string sBuildTypes[] = {
"Release",
"Beta",
"Alpha",
"Development"};
4203 static const string sBldTypes[] = {
"",
"b",
"a",
"d"};
4205 oss <<
"Driver Version: " <<
DEC(vMaj) <<
"." <<
DEC(vMin) <<
"." <<
DEC(vDot);
4206 if (buildType) oss << sBldTypes[buildType] <<
DEC(vBld);
4208 <<
"Major Version: " <<
DEC(vMaj) << endl
4209 <<
"Minor Version: " <<
DEC(vMin) << endl
4210 <<
"Point Version: " <<
DEC(vDot) << endl
4211 <<
"Build Type: " << sBuildTypes[buildType] << endl
4212 <<
"Build Number: " <<
DEC(vBld);
4215 } mDriverVersionDecoder;
4217 struct DecodeFourCC :
public Decoder
4219 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4220 { (void) inDeviceID; (void) inRegNum;
4221 char ch;
string str4cc;
4222 ch = char((inRegValue & 0xFF000000) >> 24);
4223 str4cc += ::isprint(ch) ? ch :
'?';
4224 ch = char((inRegValue & 0x00FF0000) >> 16);
4225 str4cc += ::isprint(ch) ? ch :
'?';
4226 ch = char((inRegValue & 0x0000FF00) >> 8);
4227 str4cc += ::isprint(ch) ? ch :
'?';
4228 ch = char((inRegValue & 0x000000FF) >> 0);
4229 str4cc += ::isprint(ch) ? ch :
'?';
4232 oss <<
"'" << str4cc <<
"'";
4237 struct DecodeDriverType :
public Decoder
4239 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4240 { (void) inDeviceID; (void) inRegNum;
4243 if (inRegValue == 0x44455854)
4244 oss <<
"DriverKit ('DEXT')";
4245 else if (inRegValue)
4246 oss <<
"(Unknown/Invalid " <<
xHEX0N(inRegValue,8) <<
")";
4248 oss <<
"Kernel Extension ('KEXT')";
4254 } mDecodeDriverType;
4256 struct DecodeIDSwitchStatus :
public Decoder
4258 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4263 const uint32_t switchEnableBits (((inRegValue & 0x0F000000) >> 20) | ((inRegValue & 0xF0000000) >> 28));
4264 for (
UWord idSwitch(0); idSwitch < 4; )
4266 const uint32_t switchEnabled (switchEnableBits &
BIT(idSwitch));
4267 oss <<
"Switch " <<
DEC(++idSwitch) <<
": " << (switchEnabled ?
"Enabled" :
"Disabled");
4274 oss <<
"(ID Switch not supported)";
4279 } mDecodeIDSwitchStatus;
4281 struct DecodePWMFanControl :
public Decoder
4283 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4291 } mDecodePWMFanControl;
4293 struct DecodePWMFanMonitor :
public Decoder
4295 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4303 } mDecodePWMFanMonitor;
4305 struct DecodeBOBStatus :
public Decoder
4307 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4311 oss <<
"BOB : " << ((inRegValue &
kRegMaskBOBAbsent) ?
"Disconnected" :
"Connected") << endl
4315 oss <<
"Device does not support a breakout board";
4320 struct DecodeBOBGPIIn :
public Decoder
4322 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4331 oss <<
"Device does not support a breakout board";
4336 struct DecodeBOBGPIInInterruptControl :
public Decoder
4338 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4347 oss <<
"Device does not support a breakout board";
4350 } mDecodeBOBGPIInInterruptControl;
4352 struct DecodeBOBGPIOut :
public Decoder
4354 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4363 oss <<
"Device does not support a breakout board";
4368 struct DecodeBOBAudioControl :
public Decoder
4370 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4379 dBuLabel =
"+24dBu";
4382 dBuLabel =
"+18dBu";
4385 dBuLabel =
"+12dBu";
4388 dBuLabel =
"+15dBu";
4393 <<
"Analog Level Control: " << dBuLabel << endl
4397 oss <<
"Device does not support a breakout board";
4400 } mDecodeBOBAudioControl;
4402 struct DecodeLEDControl :
public Decoder
4404 virtual string operator()(
const uint32_t inRegNum,
const uint32_t inRegValue,
const NTV2DeviceID inDeviceID)
const
4412 oss <<
"Device does not support a breakout board";
4415 } mDecodeLEDControl;
4417 static const int NOREADWRITE = 0;
4418 static const int READONLY = 1;
4419 static const int WRITEONLY = 2;
4420 static const int READWRITE = 3;
4422 static const int CONTAINS = 0;
4423 static const int STARTSWITH = 1;
4424 static const int ENDSWITH = 2;
4425 static const int EXACTMATCH = 3;
4427 typedef map <uint32_t, const Decoder *> RegNumToDecoderMap;
4428 typedef pair <uint32_t, const Decoder *> RegNumToDecoderPair;
4429 typedef multimap <string, uint32_t> RegClassToRegNumMMap, StringToRegNumMMap;
4430 typedef pair <string, uint32_t> StringToRegNumPair;
4431 typedef RegClassToRegNumMMap::const_iterator RegClassToRegNumConstIter;
4432 typedef StringToRegNumMMap::const_iterator StringToRegNumConstIter;
4434 typedef pair <uint32_t, uint32_t> XptRegNumAndMaskIndex;
4435 typedef map <NTV2InputCrosspointID, XptRegNumAndMaskIndex> InputXpt2XptRegNumMaskIndexMap;
4436 typedef map <XptRegNumAndMaskIndex, NTV2InputCrosspointID> XptRegNumMaskIndex2InputXptMap;
4437 typedef InputXpt2XptRegNumMaskIndexMap::const_iterator InputXpt2XptRegNumMaskIndexMapConstIter;
4438 typedef XptRegNumMaskIndex2InputXptMap::const_iterator XptRegNumMaskIndex2InputXptMapConstIter;
4442 RegNumToStringMap mRegNumToStringMap;
4443 RegNumToDecoderMap mRegNumToDecoderMap;
4444 RegClassToRegNumMMap mRegClassToRegNumMMap;
4445 StringToRegNumMMap mStringToRegNumMMap;
4447 InputXpt2XptRegNumMaskIndexMap mInputXpt2XptRegNumMaskIndexMap;
4448 XptRegNumMaskIndex2InputXptMap mXptRegNumMaskIndex2InputXptMap;
4478 return pInst ?
true :
false;
4485 return pInst ?
true :
false;
4492 return pInst ? pInst->DisposeInstance() :
false;
4500 return pRegExpert->RegNameToString(inRegNum);
4502 ostringstream oss; oss <<
"Reg ";
4504 oss <<
DEC(inRegNum);
4505 else if (inRegNum <= 0x0000FFFF)
4506 oss <<
xHEX0N(inRegNum,4);
4508 oss <<
xHEX0N(inRegNum,8);
4516 return pRegExpert ? pRegExpert->RegValueToString(inRegNum, inRegValue, inDeviceID) : string();
4523 return pRegExpert ? pRegExpert->IsRegInClass(inRegNum, inClassName) :
false;
4530 return pRegExpert ? pRegExpert->GetAllRegisterClasses() :
NTV2StringSet();
4537 return pRegExpert ? pRegExpert->GetRegisterClasses(inRegNum, inRemovePrefix) :
NTV2StringSet();
4544 return pRegExpert ? pRegExpert->GetRegistersForClass(inClassName) :
NTV2RegNumSet();
4558 return pRegExpert ? pRegExpert->GetRegistersForDevice(inDeviceID, inOtherRegsToInclude) :
NTV2RegNumSet();
4565 return pRegExpert ? pRegExpert->GetRegistersWithName(inName, inSearchStyle) :
NTV2RegNumSet();
4579 return pRegExpert ? pRegExpert->GetXptRegNumAndMaskIndex(inInputXpt, outXptRegNum, outMaskIndex) :
false;