tvif.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:5k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __TVIF_H
  2. #define __TVIF_H
  3. //
  4. // for supporting 2 tv-encoder you must be careful about
  5. // the hvsync.
  6. //#define SUPPORT_SP721
  7. //#define SUPPORT_ADV7176
  8. #define SUPPORT_SP8200
  9. #include "sp721.h"
  10. #include "sp8200tv.h"
  11. #include "adv7176.h"
  12. enum
  13. {
  14. TVOUT_SVIDEO1=1,
  15. TVOUT_YCbCr=0,
  16. TVOUT_RGB=1,
  17. TVOUT_YPbPr=2,
  18. TVOUT_VGA=3,
  19. #ifdef EASTWIN
  20. TVOUT_SVIDEO=4,
  21. TVOUT_OFF=5//jhuang eastwin 2004/8/16
  22. #else
  23. TVOUT_SVIDEO=4
  24. #endif
  25. };
  26. static inline void tv_setup_int(void)
  27. {
  28. #ifdef SUPPORT_SP8200
  29.   sp8200tv_setup_int();
  30. #endif
  31. }
  32. static inline void tv_setup_nint(void)
  33. {
  34. #ifdef SUPPORT_SP8200
  35.   sp8200tv_setup_nint();
  36. #endif
  37. }
  38. // NTSC systems
  39. static inline void tv_setup_ntsc(void)
  40. {
  41. #ifdef SUPPORT_SP8200
  42.   sp8200tv_setup_ntsc();
  43. #endif
  44. #ifdef SUPPORT_SP721
  45.   sp721_setup_ntsc();
  46. #endif
  47. #ifdef SUPPORT_ADV7176
  48.   adv7176_setup_ntsc();
  49. #endif
  50. }
  51. static inline void tv_setup_ntscj(void)
  52. {
  53. #ifdef SUPPORT_SP8200
  54.   sp8200tv_setup_ntscj();
  55. #endif
  56. }
  57. // PAL systems
  58. static inline void tv_setup_pal60(void)
  59. {
  60. #ifdef SUPPORT_SP8200
  61.   sp8200tv_setup_pal60();
  62. #endif
  63. #ifdef SUPPORT_SP721
  64.   sp721_setup_pal60();
  65. #endif
  66. #ifdef SUPPORT_ADV7176
  67.   adv7176_setup_pal60();
  68. #endif
  69. }
  70. static inline void tv_setup_pal(void)
  71. {
  72. #ifdef SUPPORT_SP8200
  73.   sp8200tv_setup_pal();
  74. #endif
  75. #ifdef SUPPORT_SP721
  76.   sp721_setup_pal();
  77. #endif
  78. #ifdef SUPPORT_ADV7176
  79.   adv7176_setup_pal();
  80. #endif
  81. }
  82. static inline void tv_setup_pal_m(void)
  83. {
  84. #ifdef SUPPORT_SP8200
  85.   sp8200tv_setup_pal_m();
  86. #endif
  87. }
  88. static inline void tv_setup_pal_n(void)
  89. {
  90. #ifdef SUPPORT_SP8200
  91.   sp8200tv_setup_pal_n();
  92. #endif
  93. }
  94. static inline void tv_setup_pal_nc(void)
  95. {
  96. #ifdef SUPPORT_SP8200
  97.   sp8200tv_setup_pal_nc();
  98. #endif
  99. }
  100. static inline void tv_setup_output(int opt)
  101. {
  102. #ifdef SUPPORT_SP8200
  103.   sp8200tv_setup_output(opt);
  104. #endif
  105. #ifdef SUPPORT_SP721
  106.   sp721_setup_output(opt);
  107. #endif
  108. #ifdef SUPPORT_ADV7176
  109.   adv7176_setup_output(opt);
  110. #endif
  111. }
  112. static inline void tv_setup_custom_output(int opt)
  113. {
  114.   sp8200tv_setup_custom_output(opt);
  115. }
  116. static inline void tv_setup(void)
  117. {
  118. #ifdef SUPPORT_SP8200
  119.   sp8200tv_setup();
  120. #endif
  121. #ifdef SUPPORT_SP721
  122.   sp721_setup();
  123. #endif
  124. #ifdef SUPPORT_ADV7176
  125.   adv7176_setup();
  126. #endif
  127. }
  128. static inline void tv_setup_aspect(int aspect)
  129. {
  130. #ifdef SUPPORT_SP8200
  131.     sp8200tv_setup_aspect(aspect);
  132. #endif
  133. #ifdef SUPPORT_SP721
  134.     sp721_setup_aspect(aspect);
  135. #endif
  136. }
  137. static inline void tv_l21_enable(int enable)
  138. {
  139. #ifdef  SUPPORT_SP8200
  140.     sp8200tv_setup_line21_onoff(enable);
  141. #endif
  142. #ifdef  SUPPORT_SP721
  143.     sp721_l21_enable(enable);
  144. #endif
  145. }
  146. static inline void tv_setup_misc(int type)
  147. {
  148. #ifdef SUPPORT_SP8200
  149.   sp8200tv_set_misc(type);
  150. #endif
  151. #ifdef SUPPORT_SP721
  152.   sp721_set_misc(type);
  153. #endif
  154. }
  155. static inline void tv_writel21_data(int n, unsigned d)
  156. {
  157. #ifdef SUPPORT_SP8200
  158.   n=n;
  159.   d=d;
  160. #endif
  161. #ifdef SUPPORT_SP721
  162.   sp721_writel21_data(n,d);
  163. #endif
  164. #ifdef SUPPORT_ADV7176
  165.   adv7176_writel21_data(n,d);
  166. #endif
  167. }
  168. #define TV_DAC_A    (1<<0)
  169. #define TV_DAC_B    (1<<1)
  170. #define TV_DAC_C    (1<<2)
  171. #define TV_DAC_D    (1<<3)
  172. #define TV_DAC_E    (1<<4)
  173. #define TV_DAC_F    (1<<5)
  174. #ifdef IC_8202E
  175. #define TV_DAC_A_HALF    (6<<0)
  176. #define TV_DAC_B_HALF    (6<<3)
  177. #define TV_DAC_C_HALF    (6<<6)
  178. #define TV_DAC_D_HALF    (6<<9)
  179. #define TV_DAC_E_HALF    (6<<12)
  180. #define TV_DAC_F_HALF    (6<<15)
  181. #define TV_DAC_A_QUART   (7<<0)
  182. #define TV_DAC_B_QUART   (7<<3)
  183. #define TV_DAC_C_QUART   (7<<6)
  184. #define TV_DAC_D_QUART   (7<<9)
  185. #define TV_DAC_E_QUART   (7<<12)
  186. #define TV_DAC_F_QUART   (7<<15)
  187. #endif // IC_8202E
  188. static inline void tv_dachalf(unsigned v)
  189. {
  190. #ifdef  SUPPORT_SP8200
  191.     sp8200tv_setup_dachalf(v);
  192. #endif
  193. }
  194. static inline void tv_dac_current(UINT32 v)
  195. {
  196. #ifdef  SUPPORT_SP8200
  197.     sp8200tv_setup_dac_current(v);
  198. #endif
  199. }
  200. static inline void tv_dacoff(unsigned v)
  201. {
  202. #ifdef  SUPPORT_SP8200
  203.     sp8200tv_setup_dacoff(v);
  204. #endif
  205. }
  206. static inline void tv_sleep(void)
  207. {
  208. #ifdef SUPPORT_SP721
  209. sp721_sleep();
  210. #endif
  211. #ifdef SUPPORT_ADV7176
  212. adv7176_sleep();
  213. #endif
  214. #ifdef  SUPPORT_SP8200
  215. sp8200tv_setup_dacoff(0xff);
  216. #endif
  217. }
  218. static inline void tv_resume(void)
  219. {
  220. #ifdef SUPPORT_SP721
  221.   sp721_resume();
  222. #endif
  223. #ifdef SUPPORT_ADV7176
  224.   adv7176_resume();
  225. #endif
  226. }
  227. static inline void sp8200tv_vdac_clk_54mhz_output(void){
  228. #ifdef SUPPORT_SP8200
  229.     sp8200tv_setup_54mhz_output();
  230. #endif
  231. }
  232. static inline void tv_setup_TV8202E(int val){
  233. #ifdef SUPPORT_SP8200
  234. sp8200tv_setup_TV8202E(val);
  235. #endif
  236. }
  237. #endif/*__TVIF_H*/