📄 drv2005.h
字号:
*
* NxtGetRegister
*
* Obtains a copy of register data from NXT200X
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* Data16 deviceRegister - first NXT200X register to read
* Data8 byteCount - number of bytes to read
*
* Outputs:
* Data8 *pBuffer - register data copied to user-provided buffer
*
* Returns:
* Data16
*
* Notes:
* Use this API instead of the IIC driver equivalent to get critical
* section protection.
*
* deviceRegister is a 16 bit value- the upper byte is the IIC device
* ID (00 or 01) and the lower byte is the register offset. These two
* bytes are appended to generate 16-bit deviceRegister.
*
**********************************************************************/
DRV2_API Data16 NxtGetRegister(void *pContext,
Data16 deviceRegister,
Data8 byteCount,
Data8 *pBuffer);
/**********************************************************************
*
* NxtGetFatSQI
*
* Obtains the cluster variance, a measure of signal quality in FAT channel
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* Data16 *pFatSQI - register data copied to user-provided buffer
*
* Returns:
* Data16
*
* Notes:
* SQI is only valid if frame/mpeg lock has been achieved.
*
**********************************************************************/
DRV2_API Data16 NxtGetFatSQI(void *pContext,
Data16 *pFatSQI);
/**********************************************************************
*
* NxtGetFatSignalStatus
*
* Obtains a state indicating signal power, and a measure of quality
* in FAT channel
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* NxtSignalState_t *pFatSignalState - a state indicating signal power
* Data8 *pFatSignalMetric - value 0-10, relative quality in given state
*
* Returns:
* Data16
*
**********************************************************************/
DRV2_API Data16 NxtGetFatSignalStatus(void *pContext,
NxtSignalState_t *pFatSignalState,
Data8 *pFatSignalMetric);
/**********************************************************************
*
* NxtGetFatFreqOffset
*
* Obtains the value, in Hz, of FAT IF frequency offset from nominal.
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* Data32 *pFatFreqOffset - frequency offset, Hz
*
* Returns:
* Data16
*
* Notes:
* Offset is only valid if frame/mpeg lock has been achieved.
*
**********************************************************************/
DRV2_API Data16 NxtGetFatFreqOffset(void *pContext,
Data32 *pFatFreqOffset);
/**********************************************************************
*
* NxtGetFatModFormat
*
* Obtains the current modulation format used by the NXT200X
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* NxtModFormat_t *pFatModFormat - current modulation format.
*
* Returns:
* Data16
*
* Notes:
* Modulation format setting is valid regardless of the state of the
* NXT200X ASIC -- this is not an indication of the type of signal
* being received, but of the type that is (or would be) being attempted
* for reception by the ASIC.
*
**********************************************************************/
DRV2_API Data16 NxtGetFatModFormat(void *pContext,
NxtModFormat_t *pFatModFormat);
/**********************************************************************
*
* NxtGetBertData
*
* Obtains the accumulated error count in BERT.
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* Bool bWait - Wait till there in new BERT data
*
* Outputs:
* Data32 *pErrorCount -- BERT data accumulated since the last read.
*
* Returns:
* NXT_NO_ERROR - No error
* NXT_ERR_MODE - BERT is not running
* NXT_ERR_NOT_READY - No new error data in the registers
* If bWait is specified as TRUE, this error code will never be returned.
* NXT_ERR_NO_LOCK - BERT is not locked,
* OR BERT is not synchronized,
* OR equalizer is in "acquire" state (if mod format is VSB),
* OR FEC is not locked (if mod format is QAM)
*
* Notes:
* The user can specify if they want to wait till the error data is
* ready. If the user doesn't specify that, and the data is not ready
* then the function will return error.
*
**********************************************************************/
DRV2_API Data16 NxtGetBertData(void *pContext,
Data32 *pErrorCount,
Bool bWait);
/**********************************************************************
*
* NxtGetDriverVersion
*
* Obtains the version of DRV200X currently executing.
*
* Inputs:
* none -- one DRV200X instance serves all contexts!
*
* Outputs:
* CodeVersion_s *pCodeVersion -- structure containing version info
*
* Returns:
* NXT_NO_ERROR
*
**********************************************************************/
DRV2_API Data16 NxtGetDriverVersion(CodeVersion_s *pCodeVersion);
/**********************************************************************
*
* NxtGetAsicVersion
*
* Obtains the version of the referenced NXT200X ASIC.
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* AsicVersion_s *pAsicVersion -- structure containing version info
*
* Returns:
* Data16
*
**********************************************************************/
DRV2_API Data16 NxtGetAsicVersion(void *pContext,
AsicVersion_s *pAsicVersion);
/**********************************************************************
*
* NxtGetRomVersion
*
* Obtains the version of the ROM Code in the referenced NXT200X ASIC.
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* CodeVersion_s *pCodeVersion -- structure containing version info
*
* Returns:
* Data16
*
**********************************************************************/
DRV2_API Data16 NxtGetRomVersion(void *pContext,
CodeVersion_s *pCodeVersion);
/**********************************************************************
*
* NxtGetRamVersion
*
* Obtains the version of the RAM Code running in the referenced NXT200X.
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* CodeVersion_s *pCodeVersion -- structure containing version info
*
* Returns:
* Data16
*
* Notes:
* This API is only valid if the NXT200X is actually executing RAM Code.
*
**********************************************************************/
DRV2_API Data16 NxtGetRamVersion(void *pContext,
CodeVersion_s *pCodeVersion);
/**********************************************************************
*
* NxtGetNtscStatus
*
* Determines if the current channel has an NTSC signal present
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
*
* Outputs:
* Bool *pbNtsc - TRUE if NTSC is present, FALSE otherwise
*
* Returns:
* Data16
*
* Notes:
* The NTSC detection feature cannot be used while acquiring a
* digital signal. Using NxtGetNtscStatus while acquiring or
* locked on a digital signal will stop acquisition of digital
* data. Use NxtStart() to re-start acquisition.
*
**********************************************************************/
DRV2_API Data16 NxtGetNtscStatus(void *pContext,
Bool *pbNtsc);
/**********************************************************************/
/* Configuration APIs */
/**********************************************************************/
/**********************************************************************
*
* NxtIicBypass
*
* Sets the NXT200X IIC Bypass Switch position
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* NxtBypass_t bypass - NXT_IIC_BYPASS or NXT_IIC_UC_CONTROL
*
* Returns:
* Data16
*
* Notes:
* The user must insure any microcontroller use of the auxiliary
* IIC bus has completed before using this API.
*
**********************************************************************/
DRV2_API Data16 NxtIicBypass(void *pContext,
NxtBypass_t bypass);
/**********************************************************************
*
* NxtIicXfer
*
* Initiates IIC data transfer controlled by the NXT200X microcontroller
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* NxtIicXferMode_t mode - NXT_IIC_READ or NXT_IIC_WRITE
* Data8 speed - value from 0x00 (fastest) to 0xFF (slowest); see notes
* Data8 byteCount - number of bytes to transfer
* Data8 deviceAddress - IIC device address (LSB ignored)
* Data8 *pBuffer - for NXT_IIC_WRITE, buffer contains write data
*
* Outputs:
* Data8 *pBuffer - for NXT_IIC_READ, buffer contains read data
*
* Returns:
* Data16
*
* Notes:
* The following speed values are pre-defined for convenience:
* NXT_IIC_SPEED_FASTEST = 0x00 - approximately 238 KHz
* NXT_IIC_SPEED_STANDARD = 0x03 - approximately 100 KHz
* NXT_IIC_SPEED_SLOWEST = 0x7F - approximately 4.9 KHz
* The user is free to choose any Data8 value <= 0x7F. Note that the
* speed settings do not relate to the bus speed in a linear fashion.
*
* This API is inhibited if NxtIicBypass() has set the NXT_IIC_BYPASS
* mode.
*
* This API does not interfere with NXT200X digital signal acquisition.
*
* If the NXT_INT_XFER is enabled, this API returns immediately. Use
* NxtReadIicXferData() to complete a NXT_IIC_READ operation, following
* the transfer completion interrupt.
*
* Due to I/O constraints, this API will not operate properly if the
* NXT200X is in low-power mode. The transfer will be attempted, but
* an error will result.
*
**********************************************************************/
DRV2_API Data16 NxtIicXfer( void *pContext,
NxtIicXferMode_t mode,
Data8 speed,
Data8 byteCount,
Data8 deviceAddress,
Data8 *pBuffer);
/**********************************************************************
*
* NxtSetMpegPolarity
*
* Sets the polarity of MPEG outputs
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* NxtPolarity_t dataEnablePolarity - data enable INVERTED or NON_INVERTED
* NxtPolarity_t pktSyncPolarity - packet sync INVERTED or NON_INVERTED
* NxtPolarity_t errorPolarity - MPEG error INVERTED or NON_INVERTED
* NxtPolarity_t clockPolarity - byte/bit clock INVERTED or NON_INVERTED
*
* Returns:
* Data16
*
* Notes:
* All outputs default to NON_INVERTED if this call is never made.
*
**********************************************************************/
DRV2_API Data16 NxtSetMpegPolarity(void *pContext,
NxtPolarity_t dataEnablePolarity,
NxtPolarity_t pktSyncPolarity,
NxtPolarity_t errorPolarity,
NxtPolarity_t clockPolarity);
/**********************************************************************
*
* NxtSetMpegMode
*
* Sets the MPEG output format
*
* Inputs:
* void *pContext - NULL, or user-defined ID for multiple NXT200Xs
* Bool bGatedOutputEnable - TRUE for gated output, FALSE for clocked
* Bool bContinuousRateEnable - TRUE enables continuous rate, FALSE disables
* Bool bParallelOutputEnable - TRUE for parallel, FALSE for serial
* Bool bHeaderEnable - TRUE enables MPEG header, etc., FALSE disables
*
* Returns:
* Data16
*
* Notes:
* bGatedOutputEnable, bParallelOutputEnable and bHeaderEnable values
* default to TRUE, and bContinuousRateEnable defaults to FALSE if this
* call is never made.
*
* bHeaderEnable affects not only the MPEG header, but also whether the
* checksum is replaced with a sync byte, and whether the packet error
* flag is set in the output packet. The purpose of bHeaderEnable = FALSE
* is to allow bit-error-rate testing.
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -