📄 tmdlfe.h
字号:
\brief Satellite specific configuration of signal for scanning
\note NA
\sa NA
*/
typedef tmdlFeSatSignalSpecification_t tmdlFeSatSearchConfig_t;
/**
\brief Satellite specific configuration of signal to get the status
of the signal
\note NA
\sa NA
*/
typedef tmdlFeSatSignalSpecification_t tmdlFeSatStatus_t;
/**
\brief Tuning media specific configuration
All necessary information media specific to tune
\note NA
\sa NA
*/
typedef union _tmdlFeSpecificTuningConfig_t
{
/** Satellite tuning configuration */
tmdlFeSatTuningConfig_t Sat_S;
/** Cable tuning configuration */
tmdlFeCblTuningConfig_t Cbl_S;
/** Terrestrial tuning configuration */
tmdlFeTerTuningConfig_t Ter_S;
}tmdlFeSpecificTuningConfig_t;
/**
\brief Scanning media specific configuration
All necessary information media specific to scan
\note NA
\sa NA
*/
typedef union _tmdlFeSpecificSearchConfig_t
{
/** Satellite scanning configuration */
tmdlFeSatSearchConfig_t Sat_S;
/** Cable scanning configuration */
tmdlFeCblSearchConfig_t Cbl_S;
/** Terrestrial scanning configuration */
tmdlFeTerSearchConfig_t Ter_S;
}tmdlFeSpecificSearchConfig_t;
/**
\brief To be reworked or removed
used to return status of the signal
\note NA
\sa NA
*/
typedef union _tmdlFeSpecificStatus_t
{
/** Satellite status */
tmdlFeSatStatus_t Sat_S;
/** Cable status */
tmdlFeCblStatus_t Cbl_S;
/** Terrestrial status */
tmdlFeTerStatus_t Ter_S;
}tmdlFeSpecificStatus_t;
/**
\brief Tuning complete configuration
All necessary information to tune
\note NA
\sa NA
*/
typedef struct _tmdlFeTuningConfig_t
{
/** Frequency in Hz*/
tmdlFeFrequency_t Frequency_U;
/** Symbol rate in symbol per second*/
tmdlFeSrBw_t Fsymb_BW_U;
/**Spectral inversion */
tmdlFeSpectrum_t SpecInv_E;
/** Constellation choosen*/
tmdlFeConstellation_t Const_E;
/** Media specific configuration */
tmdlFeSpecificTuningConfig_t Specific_S;
}tmdlFeTuningConfig_t;
/**
\brief Scanning configuration
All necessary information to scan
\note NA
\sa NA
*/
typedef struct _tmdlFeSearchConfig_t
{
/** Frequency where to start the scanning */
tmdlFeFrequency_t StartFrequency_U;
/** Frequency where to stop the scanning */
tmdlFeFrequency_t StopFrequency_U;
/** Symbol rate */
tmdlFeSrBw_t Fsymb_BW_U;
/** Spectrum inversion */
tmdlFeSpectrum_t SpecInv_E;
/** Constellation */
tmdlFeConstellation_t Const_E;
/** Media Specific parameter */
tmdlFeSpecificSearchConfig_t Specific_S;
}tmdlFeSearchConfig_t;
/**
\brief Status of the demodulator
This is a mask of the following defines:
\note NA
\sa NA
*/
typedef UInt32 tmdlFeStatusMask_t;
/** Bit 0: Frequency */
#define DEMOD_STATUS_FREQ (0x01<<0)
/** Bit 1: FSymb_BW */
#define DEMOD_FSYMB_BW (0x01<<1)
/** Bit 2: Constellation */
#define DEMOD_CONST (0x01<<2)
/** Bit 3: CarrierStatus */
#define DEMOD_STATUS_CARRIER_STS (0x01<<3)
/** Bit 4: Level in dBm */
#define DEMOD_STATUS_LVL (0x01<<4)
/** Bit 5: VBer Value (TER, SAT) */
#define DEMOD_STATUS_VBER (0x01<<5)
/** Bit 6: ScanProgress */
#define DEMOD_STATUS_SCANPROG (0x01<<6)
/** Bit 7: Specific Status */
#define DEMOD_STATUS_SPECIFIC (0x01<<7)
/** Bit 8: spectral inversion */
#define DEMOD_STATUS_SI (0x01<<8)
/** Bit 9: DVB-T */
#define DEMOD_STANDARD (0x01<<9)
/** Bit 10: uncor Value */
#define DEMOD_STATUS_UBK (0x01<<10)
/** Bit 11: CBer Value (TER, SAT, CAB) */
#define DEMOD_STATUS_CBER (0x01<<11)
/** Bit 12: AGC Value */
#define DEMOD_STATUS_AGC (0x01<<12)
/** Bit 13: SNR */
#define DEMOD_STATUS_SNR (0x01<<13)
/** Bit 14: AFC */
#define DEMOD_STATUS_AFC (0x01<<14)
/** Bit 15: ACC */
#define DEMOD_STATUS_ACC (0x01<<15)
/**
\brief Signal status
Frequency
symbol rate,...
All kind of levels, status interesting to monitor on the demodulator
\note NA
\sa NA
*/
typedef struct _tmdlFeStatus_t
{
/** Frequency in Hz*/
tmdlFeFrequency_t Frequency_U;
/** Symbol rate in symbol per second*/
tmdlFeSrBw_t Fsymb_BW_U;
/** Constellation of the signal*/
tmdlFeConstellation_t Const_E;
/**Spectral inversion */
tmdlFeSpectrum_t SpecInv_E;
/** Carrier status (e.g. lock or unlock...)*/
tmdlFeCarrierStatus_t CarrierStatus_E;
/** Level of the signal */
tmdlFeLvl_t LvlValue;
/** AGC level*/
tmdlFeAgc_t AgcValue_B;
/** Viterbi Bit Error Rate (Not Applicable in cable as there is no Viterbi in the cable transmission) */
Int32 VBerValue_U;
/** Corected Bit Error Rate */
Int32 CBerValue_U;
/** Uncorrected blocks number*/
Int32 UbkValue_U;
/** status of the scanning state machine */
tmdlFeScanProgress_t ScanProgress_B;
/** Signal to noise ratio*/
Int8 SnrValue;
/** Automatic Forward Control loop value*/
Int32 AfcValue;
/** Acc value*/
Int32 AccValue;
/** Media specific configuration */
tmdlFeSpecificStatus_t Specific_S;
/** reserved for future use */
UInt32 NotUsed1;
/** reserved for future use */
UInt32 NotUsed2;
/** reserved for future use */
UInt32 NotUsed3;
}tmdlFeStatus_t;
/**
\brief Configuration of the front-end
to be detailed
\note NA
\sa NA
*/
typedef union _tmdlFeConfig_t
{
/** Satellite configuration */
tmdlFeSatConfig_t Sat_S;
/** Cable configuration */
tmdlFeCblConfig_t Cbl_S;
/** Terrestrial configuration */
tmdlFeTerConfig_t Ter_S;
}tmdlFeConfig_t;
/**
\brief Function error codes
See descriptions of each error code
\note NA
\sa NA
*/
typedef enum _tmdlFeErr_t
{
/** no error, should be replaced by TM_OK */
tmdlFeNoError_E,
/** tmdlFe not opened */
tmdlFeNotOpen_E,
/** function call failed*/
tmdlFeCallFailed_E,
/** Invalid parameters */
tmdlFeInvalidValue_E,
/** Not supported */
tmdlFeNotSupported_E
}tmdlFeErr_t;
/**
\brief Call back type definition
\note NA
\sa NA
*/
typedef Void (*tmdlCallback_t) (UInt32 events, Void* pData, UInt32 userData);
/**
\brief video mode
used to remodulate signal to analog format
\note NA
\sa NA
*/
typedef enum _tmdlFeVideoMode_t{
/**
* PAL I mode - UK and Ireland
*/
tmdlFeVideoModePalI = 0x01,
/**
* PAL B, G, and H modes - Europe, Asia
*/
tmdlFeVideoModePalBgh = 0x02,
/**
* PAL D mode - China
*/
tmdlFeVideoModePalD = 0x04,
/**
* PAL N mode - Paraguay, Argentina
*/
tmdlFeVideoModePalN = 0x08,
/**
* PAL M mode - Brazil
*/
tmdlFeVideoModePalM = 0x10,
/**
* NTSC M mode - North America, Taiwan, Japan, Mexico,
* Canada, Korea, Philippines
*/
tmdlFeVideoModeNtscN = 0x20,
/**
* SECAM B, G and H mode - Middle East, N. Africa
*/
tmdlFeVideoModeSecamBgh = 0x40,
/**
* SECAM D, K, K1 and L mode - East Europe, Russia
*/
tmdlFeVideoModeSecamDkk1l = 0x80
}tmdlFeVideoMode_t, *ptmdlFeVideoMode_t;
/** Status of the scanning algorithm */
/** Signal recovered after a loss of signal */
#define TMDL_FE_EVENT_CARRIER_TUNED (0x01<<0)
/** channel found during a scanning */
#define TMDL_FE_EVENT_CARRIER_FOUND (0x01<<1)
/** Signal lost after a successful tuning */
#define TMDL_FE_EVENT_CARRIER_LOST (0x01<<2)
/** End of a scanning algorithm */
#define TMDL_FE_EVENT_END_OF_SEARCH (0x01<<3)
/** No carrier found after a number of retry > 1 */
#define TMDL_FE_EVENT_NO_CARRIER (0x01<<5)
/** tune failed at first try (number of retry = 0) */
#define TMDL_FE_EVENT_TUNE_FAILED (0x01<<6)
/** No control through PIO */
#define TMDL_FE_NO_PIO_CTL 0xFF
/**************************************************************************/
/**************************** Public Functions ****************************/
/**************************************************************************/
/*********** information functions ***********/
/**
\brief Get the number of hardware units
\param pNbOfUnits_U: pointer to the number of units
\return The call results.
- TM_OK means the call is successful
\note NA
\sa NA
*/
tmdlFeErr_t tmdlFeGetNumberOfUnits( UInt32* pNbOfUnits_U );
/**
\brief Get the SW version of the software
\param pSwVersion: pointer on the sw version
\return The call results.\n
- TM_OK means the call is successful
\note NA
\sa NA
*/
tmdlFeErr_t tmdlFeGetSWVersion( ptmSWVersion_t pSwVersion );
/*********** open/close functions ***********/
/**
\brief Open the device library tmdlFe
\param FeType_E: type of media (terrestrial, satellite, cable)
\param pFeInstance_U: pointer to recover the instance number
\return
- TM_OK means the call is successful
- else a problem has been detected
-tmdlFeNotOpen_E: The opening of the driver has been aborted
-tmdlFeCallFailed_E: the OS ressource are unsufficient
\note: NA
\sa: NA
*/
tmdlFeErr_t tmdlFeOpen(
tmdlFeType_t FeType_E,
tmdlFeInstance_t* pFeInstance_U
);
/**
\brief Close the device library tmdlFe
\param FeInstance_U: the instance number to close
\return The call results.
- TM_OK means the call is successful
- else a problem has been detected
- tmdlFeNotOpen_E: The opening of the driver was not done
- tmdlFeCallFailed_E:
- problem of deallocation of memory or OS resources,
- problem with IIC driver closure
- others
\note: NA
\sa: NA
*/
tmdlFeErr_t tmdlFeClose(
tmdlFeInstance_t FeInstance_U
);
/*********** Instance Setup functions ***********/
/**
\brief This function sets up the demodulator instance passed as input.
The function must be called after the tmdlFeOpen function
and before any other control/configuration functions.
\param FeInstance_U: the instance number
\param pInstanceSetup_S: pointer on the instance configuration
Especially:
the tuner type and name
the demodulator type and name
the pointers on IIC function to write/read tuner or demod registers
the IIC unit id
the stupid board ID (this should be rework as it has no actual meaning)
the Pio to get interrupt
\return
- TM_OK means the call is successful
- else a problem has been detected
- tmdlFeNotOpen_E: The opening of the driver was not done
- tmdlFeCallFailed_E:
- front end Type uncorrect
- problem with IIC driver
- problem with Pio driver
- others
- tmdlFeInvalidValue_E
- impossible to use tuner or demodulator
\note At the end of a successful call to this function the driver is in state configured
\sa NA
*/
tmdlFeErr_t tmdlFeSetInstanceSetup(
tmdlFeInstance_t FeInstance_U,
tmdlFeInstanceSetup_t* pInstanceSetup_S
);
/**
\brief This function allow to recover the set-up of the instance
\param FeInstance_U: the instance number
\param pInstanceSetup_S: pointer on the instance configuration to recover
Especially:
the tuner type and name
the demodulator type and name
the pointers on IIC function to write/read tuner or demod registers
the IIC unit id
the stupid board ID (this should be rework as it has no actual meaning)
the Pio to get interrupt
\return
- TM_OK means the call is successful
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -