mid_atv_scan.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /******************************************************************************/
  2. /**
  3. *
  4. * \file mid_scan.h
  5. *
  6. * \brief middle-ware of analog TV scan.
  7. *
  8. *
  9. * \note Copyright (c) 2010 Sunplus Technology Co., Ltd. \n
  10. * All rights reserved.
  11. *
  12. * \author
  13. *
  14. ******************************************************************************/
  15. #ifndef _MID_ATV_SCAN_H_
  16. #define _MID_ATV_SCAN_H_
  17. /*******************************************************************************
  18. * Header include
  19. ******************************************************************************/
  20. #include "types.h"
  21. #include "drv_sif_interface.h"
  22. /*******************************************************************************
  23. * Marco
  24. ******************************************************************************/
  25. /*******************************************************************************
  26. * Structure
  27. ******************************************************************************/
  28. /*******************************************************************************
  29. * Constant
  30. ******************************************************************************/
  31. /*******************************************************************************
  32. * enumeration
  33. ******************************************************************************/
  34. //[Begin]hsunying, 2011/03/21
  35. typedef enum
  36. {
  37. ANA_SCAN_VIDEO_FORMAT_AUTO = 0x00,
  38. ANA_SCAN_VIDEO_FORMAT_NTSC358 = (1 << 0),
  39. ANA_SCAN_VIDEO_FORMAT_NTSC443 = (1 << 1),
  40. ANA_SCAN_VIDEO_FORMAT_PAL = (1 << 2),
  41. ANA_SCAN_VIDEO_FORMAT_PALM = (1 << 3),
  42. ANA_SCAN_VIDEO_FORMAT_PALCN = (1 << 4),
  43. ANA_SCAN_VIDEO_FORMAT_PAL60 = (1 << 5),
  44. ANA_SCAN_VIDEO_FORMAT_SECAM = (1 << 6),
  45. ANA_SCAN_VIDEO_FORMAT_SECAML = (1 << 7),
  46. } Ana_ScanVideoFormat_t;
  47. typedef enum
  48. {
  49. ANA_SCAN_AUDIO_STD_NULL = 0x00 ,
  50. ANA_SCAN_AUDIO_STD_M = (1 << 0),
  51. ANA_SCAN_AUDIO_STD_BG = (1 << 1),
  52. ANA_SCAN_AUDIO_STD_DK = (1 << 2),
  53. ANA_SCAN_AUDIO_STD_I = (1 << 3),
  54. ANA_SCAN_AUDIO_STD_L = (1 << 4),
  55. ANA_SCAN_AUDIO_STD_L1 = (1 << 5),
  56. } Ana_ScanAudioStd_t;
  57. typedef enum
  58. {
  59. ANA_SCAN_AUDIO_STD_A2BG =0,
  60. ANA_SCAN_AUDIO_STD_NICAMBG ,
  61. ANA_SCAN_AUDIO_STD_NICAML ,
  62. ANA_SCAN_AUDIO_STD_NICAMI ,
  63. ANA_SCAN_AUDIO_STD_A2DK1 ,
  64. ANA_SCAN_AUDIO_STD_A2DK2,
  65. ANA_SCAN_AUDIO_STD_A2DK3 ,
  66. ANA_SCAN_AUDIO_STD_NICAMDK ,
  67. ANA_SCAN_AUDIO_STD_A2MN ,
  68. ANA_SCAN_AUDIO_STD_EIAJ ,
  69. ANA_SCAN_AUDIO_STD_BTSC ,
  70. ANA_SCAN_AUDIO_STD_NICAML1,
  71. ANA_SCAN_AUDIO_STD_ERR ,
  72. } Ana_SaveScanAudioStd_t;
  73. //[End]
  74. //[Begin]hsunying, 2011/04/11
  75. typedef enum
  76. {
  77. ANA_SCAN_DIRECTION_POSITIVE,
  78. ANA_SCAN_DIRECTION_NEGTIVE,
  79. }Ana_ScanDirection_t;
  80. //[End]
  81. //[Begin]hsunying, 2011/06/07
  82. typedef enum
  83. {
  84. ANA_SCAN_MODE_AUTO,
  85. ANA_SCAN_MODE_MANUAL,
  86. }Ana_ScanMode_t;
  87. //[End]
  88. /**
  89. * \brief Callback type
  90. */
  91. typedef enum __MID_ScanCallbackType_e
  92. {
  93. MID_SCAN_CALLBK_TYPE_REQUEST_NEXT_CH = 0, ///> request ap layer give the next TP parameter : pParam is point to the structure MID_ScanParam_t
  94. MID_SCAN_CALLBK_TYPE_LOCKED_CH, ///> TP lock ok or failed? (*pParam) is a value of DRV_Status_t
  95. MID_SCAN_CALLBK_TYPE_EXCEED_TRUNER,
  96. MID_SCAN_CALLBK_TYPE_RESERVED,
  97. }MID_AnalogTVScanCallbkType_e;
  98. /*******************************************************************************
  99. * Structure
  100. ******************************************************************************/
  101. //[Begin]hsunying, 2011/03/21
  102. typedef struct _ana_scan_inputinfo_t
  103. {
  104. UINT8 bMaxChannelCount;
  105. UINT8 bBlueScreen;
  106. UINT32 dCurrentFreq;
  107. UINT32 dMinFreq;
  108. UINT32 dMaxFreq;
  109. UINT32 dLBoundaryFreq;
  110. Ana_ScanAudioStd_t eAudioStd_Supported;
  111. Ana_ScanVideoFormat_t eVideoFormat_Supported;
  112. Ana_ScanDirection_t eScanningDirection;
  113. Ana_ScanMode_t eScanMode;
  114. // ATS
  115. void (*ResetATS)(void);
  116. void (*GetATSData)(void*);
  117. } Ana_ScanInputInfo_t;
  118. typedef struct _al_atv_fullscan_outputinfo_t
  119. {
  120. UINT8 bCurrentChnNumber;
  121. UINT32 dCurrentFreq;
  122. Ana_SaveScanAudioStd_t eAudioStd_Result;
  123. Ana_ScanVideoFormat_t eVideoFormat_Result;
  124. UINT16 wVPS; // line 16
  125. UINT16 wFormat1; // magzine 8, page 30
  126. UINT16 wFormat2; // magzine 8, page 30
  127. } Ana_ScanOutputInfo_t;
  128. //[End]
  129. /**
  130. * \brief Scan parameter structure
  131. */
  132. typedef struct
  133. {
  134. // external parameters
  135. UINT32 dFreq;
  136. //Ana_ScanAudioStd_t eStd;
  137. } MID_ATVScanParam_t;
  138. typedef int (*ATVMidScanCallback)(MID_AnalogTVScanCallbkType_e eCallbkType, void* pParam);
  139. /*******************************************************************************
  140. * APIs
  141. ******************************************************************************/
  142. /******************************************************************************/
  143. /**
  144. * @brief If you want to search analog channles, please fill the related info and call this function first
  145. * @param Ana_ScanInputInfo_t *InitParam : Input all infomation about analog scanning.
  146. * ATVMidScanCallback pfGetScanParamCallbk : a callback function to obtain the next Ch scan parameter
  147. * @return FALSE if success
  148. * TRUE if Exception Error occurred.
  149. ******************************************************************************/
  150. BOOLEAN MID_AnalogTVScanStart(Ana_ScanInputInfo_t *InitParam, ATVMidScanCallback pfGetScanParamCallbk);
  151. /******************************************************************************/
  152. /**
  153. * @brief To stop the scan processer while scanning.
  154. * @return FALSE if success
  155. * TRUE if Exception Error occurred.
  156. ******************************************************************************/
  157. BOOLEAN MID_AnalogTVScanStop(void);
  158. /******************************************************************************/
  159. /**
  160. * @brief To suspend the scan processer while scanning.
  161. * @return TURE if success
  162. ******************************************************************************/
  163. BOOLEAN MID_AnalogTVScanPause(void);
  164. /******************************************************************************/
  165. /**
  166. * @brief To resume the scan processer after suspending.
  167. * @return TURE if success
  168. ******************************************************************************/
  169. BOOLEAN MID_AnalogTVScanResume(void);
  170. /******************************************************************************/
  171. /**
  172. * @brief To set the direction of scanning.
  173. * @param Ana_ScanDirection_t eDirection : the scanning direction.
  174. ******************************************************************************/
  175. void MID_AnalogTVScanSetDirection(Ana_ScanDirection_t eDirection);
  176. /******************************************************************************/
  177. /**
  178. * @brief To get current frequency.
  179. * @return UINT32 : current frequency.
  180. ******************************************************************************/
  181. UINT32 MID_AnalogTVScanGetCurrentFreq(void);
  182. /******************************************************************************/
  183. /**
  184. * @brief To scan boundary point freq.
  185. * @param BOOLEAN IsScanPoint: is scan this point.
  186. * @return void
  187. ******************************************************************************/
  188. void MID_AnalogTVScanSetBoundaryPointScanStatus(BOOLEAN IsScanBoundaryPoint);
  189. #endif // #ifndef _MID_ATV_SCAN_H