⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tlg1100app.h

📁 泰景的模拟电视全部驱动及MTK平台界面代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 *
 * This procedure sets the default channel map to the NTSC channel map and
 * sets up the mode to TLG_MODE_FM_RADIO, the standard to TLG_VSTD_NTSC_M
 * and the bandwidth to TLG_BW_6 (if not already set up). It will also
 * perform TLG_InitScanFMChn() to obtain slope and offset settings that will
 * be used in subsequent calls to TLGAPP_SetChannel() and TLGAPP_ScanChannels().
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_PARAM    Bad parameter value passed.
 * @retval TLG_ERR_FAIL     Error during call.
 */
TLGDLL_API int TLGAPP_SetChannelMapFM(void);

/** Switch the default channel map to the specified channel map.
 *
 * This procedure sets the default channel map to the specified map. Note that
 * the mode, video standard and bandwidth are not changed so this procedure
 * should only be called to switch maps with the same attributes (e.g.
 * a map retured from TLGAPP_ScanChannels().
 *
 * @param map       The channel map to set the default map to.
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_PARAM    Bad parameter value passed.
 * @retval TLG_ERR_FAIL     Error during call.
 */
TLGDLL_API int TLGAPP_SwitchChannelMap(p_tlg_channel_t(map));

/** Tune to the specified channel.
 *
 * This procedure will scan the default channel map for the specified channel
 * and then perform a TLG_ScanTVChn() or TLG_ScanFMChn() depending on what
 * mode has been set.
 *
 * @param chn   channel number of the entry in the channel map to change to.
 *
 * @retval  TRUE    channel change succeeded and frequency is locked.
 * @retval  FALSE   channel change failed.
 */
TLGDLL_API int TLGAPP_SetChannel(int chn);

/** Tune to the specified channel using the "fast" lock detection code.
 *
 * This procedure will scan the default channel map for the specified channel
 * and then perform a TLG_FastScanTVChn() or TLG_ScanFMChn() depending on what
 * mode has been set.
 *
 * @param chn   channel number of the entry in the channel map to change to.
 *
 * @retval  TRUE    channel change succeeded and frequency is locked.
 * @retval  FALSE   channel change failed.
 */
TLGDLL_API int TLGAPP_FastSetChannel(int chn);

/** Scan the default channel map and return the channels that locked.
 *
 * This procedure scans the default channel map and populates the supplied 
 * channel map with all entries that locked. It will terminate the map with
 * an entry with map[i].chn = 0.
 *
 * @param tlg_scan_map  map to fill with locked channels.
 * @param max_scan      total number of channel entries in tlg_scan_map
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_PARAM    Bad parameter value passed.
 * @retval TLG_ERR_FAIL     Error during call.
 *
 * @sa TLGAPP_ScanChanFound
 */ 
TLGDLL_API void TLGAPP_ScanChannels(p_tlg_channel_t(tlg_scan_map), int max_scan);

/** Scan the default channel map upwards starting from the given channel 
 * and stop at first channel that locked.
 *
 * This procedure seeks the next available channel in the default channel
 * map starting from the supplied channel number. Calling this procedure
 * will automatically tune to the next available channel.
 *
 * @param chn               starting channel number
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_PARAM    Bad parameter value passed.
 * @retval TLG_ERR_FAIL     Error during call.
 *
 */
TLGDLL_API void TLGAPP_SeekNextChn(int chn);

/** Scan the default channel map downwards starting from the given channel
 * and stop at first channel that locked.
 *
 * This procedure seeks the previous available channel in the default channel
 * map starting from the supplied channel number. Calling this procedure
 * will automatically tune to the previous available channel.
 *
 * @param chn               starting channel number
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_PARAM    Bad parameter value passed.
 * @retval TLG_ERR_FAIL     Error during call.
 *
 */
TLGDLL_API void TLGAPP_SeekPrevChn(int chn);

/** Turn on Test Pattern.
 *
 * This procedure will turn on the test pattern after making sure the TLG1100
 * is properly initialized.
 */
TLGDLL_API void TLGAPP_TurnOnTestPattern(void);

/** Turn off Test Pattern.
 *
 * This procedure will turn off the test pattern.
 */
TLGDLL_API void TLGAPP_TurnOffTestPattern(void);

/** Turn on Test Tone Mode and set Gain to minimum.
 *
 * This procedure will turn on the Audio Test Tone Mode if the mode is set
 * to a digital mode (TLG_MASTER, TLG_SLAVE). It will also temporarily set
 * the Audio Gain to the mininum (TLG_MIN_AUD_GAIN). Once Test Tone Mode
 * has been enabled the calls TLG_GetAudioTestToneL(), TLG_SetAudioTestToneL()
 * TLG_GetAudioTestToneR(), TLG_SetAudioTestToneR() may be used to manipulate
 * the test tones. When Test Tone Mode is disabled 
 * (TLGAPP_TurnOffTestToneMode()) the gain will be restored.
 * 
 *
 * @sa TLG_GetAudioTestToneL
 * @sa TLG_SetAudioTestToneL
 * @sa TLG_GetAudioTestToneR
 * @sa TLG_SetAudioTestToneR
 * @sa TLGAPP_TurnOffTestToneMode
 */
TLGDLL_API void TLGAPP_TurnOnTestToneMode(void);

/** Turn off Test Tone Mode and restore the Audio Gain.
 * 
 * This procedure turns the Test Tone Mode off and restores the Audio Gain to
 * the value that was set in TLGAPP_Init().
 *
 * @sa TLGAPP_Init
 */
TLGDLL_API void TLGAPP_TurnOffTestToneMode(void);

/** Switch the antenna to the proper LNA.
 *
 * This procedure provides a framework to manage an antenna switch. This may
 * be done through the GPIOs available on the TLG1100, or by some other means.
 * THIS PROCEDURE REQUIRES CUSTIMIZATION TO WORK PROPERLY.
 *
 * @param hz    The frequency, in hertz, of the channel being tuned.
 *
 * @sa TLGAPP_SetChannel
 */
TLGDLL_API void TLGAPP_SetLnaGpio(uint32 hz);

/** Perform custom actions when TLGAPP_ScanChannels() has found a new channel.
 *
 * This procedure is called by TLGAPP_ScanChannels() when it has encounterd a
 * new channel. It is intended to be customized for a given customer's product
 * implementation.
 * THIS PROCEDURE REQUIRES CUSTIMIZATION TO WORK PROPERLY.
 *
 * @param chn   The channel number of the channel that has passed scan.
 *
 * @sa TLGAPP_ScanChannels
 */
TLGDLL_API void TLGAPP_ScanChanFound(int chn);

/** Put the TLG1100 into low power mode.
 *
 * This procedure may be called to put the TLG1100 into low power mode
 * also called "Deep Sleep" mode. To return from this mode
 * TLGAPP_ReInitFromPowerDown() should be called. Note these calls are only
 * supported in chip revision 1.3 and later and the I2C must be configured
 * for Asynchronous mode (GPIO5 tied to ground).
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_FAIL     Error during call.
 *
 * @sa TLG_DeepSleep
 * @sa TLG_ReturnFromDeepSleep
 * @sa TLG_ReInitFromDeepSleep
 */
TLGDLL_API int TLGAPP_PowerDown(void);

/** Return from the Power Down (Deep Sleep) state.
 *
 * This procedure powers up and re-initializes the TLG1100 after it has been
 * put into its low power state with TLGAPP_PowerDown().
 *
 * @retval TLG_ERR_SUCCESS  Call succeeded.
 * @retval TLG_ERR_FAIL     Error during call.
 *
 * @sa TLG_DeepSleep
 * @sa TLG_ReturnFromDeepSleep
 * @sa TLG_ReInitFromDeepSleep
 */
TLGDLL_API int TLGAPP_ReInitFromPowerDown(void);
TLGDLL_API int TLGAPP_Init_Aux(uint32 base_addr, int start);

extern TLGDLL_API p_tlg_channel_t(p_tlg_cur_map);/*!< Current Default Channel Map*/
extern int              tlg_cur_bw;         /*!< Current Bandwidth          */
extern int              tlg_cur_mode;       /*!< current Mode               */
extern int              tlg_cur_std;        /*!< Current Video Std          */
extern int32            tlg_slope;          /*!< Current FM Slope           */
extern int32            tlg_offset;         /*!< Current FM Offset          */
extern int              tlg_init_done;      /*!< Flag Init called           */
extern int              tlg_cur_lna;        /*!< LNA Setting                */
extern uint16           tlg_cur_gain;       /*!< audio gain                 */
extern uint16           tlg_cur_aud_mode;   /*!< audio mode                 */
extern uint32           tlg_i2c_addr;       /*!< i2c address of TLG1100     */
extern tlg_statep       tlg_power_state;    /*!< state for Deep Sleep       */

/*@}*/

#ifdef __cplusplus
};
#endif
#endif /* TLG_CHIP_TYPE */


#endif /* _TLG1100APP_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -