video_ad7177.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * (C) Copyright 2000
  3. * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _VIDEO_AD7177_H_
  24. #define _VIDEO_AD7177_H_
  25. /* #define VIDEO_DEBUG_DISABLE_COLORS 0 */
  26. #define VIDEO_ENCODER_NAME "Analog Devices AD7177"
  27. #define VIDEO_ENCODER_I2C_RATE 100000 /* Max rate is 100 kHz */
  28. #define VIDEO_ENCODER_CB_Y_CR_Y /* Use CB Y CR Y format... */
  29. #define VIDEO_MODE_YUYV /* The only mode supported by this encoder */
  30. #undef VIDEO_MODE_RGB
  31. #define VIDEO_MODE_BPP 16
  32. #ifdef VIDEO_MODE_PAL
  33. #define VIDEO_ACTIVE_COLS 720
  34. #define VIDEO_ACTIVE_ROWS 576
  35. #define VIDEO_VISIBLE_COLS 640
  36. #define VIDEO_VISIBLE_ROWS 480
  37. #endif
  38. #ifdef VIDEO_MODE_NTSC
  39. #define VIDEO_ACTIVE_COLS 720
  40. #define VIDEO_ACTIVE_ROWS 525
  41. #define VIDEO_VISIBLE_COLS 640
  42. #define VIDEO_VISIBLE_ROWS 400
  43. #endif
  44. static unsigned char
  45. video_encoder_data[] = {
  46. #ifdef VIDEO_MODE_NTSC
  47. 0x04, /* Mode Register 0 */
  48. #ifdef VIDEO_DEBUG_COLORBARS
  49. 0xc2,
  50. #else
  51. 0x42, /* Mode Register 1 */
  52. #endif /* VIDEO_DEBUG_COLORBARS */
  53. 0x16, /* Subcarrier Freq 0 */
  54. 0x7c, /* Subcarrier Freq 1 */
  55. 0xf0, /* Subcarrier Freq 2 */
  56. 0x21, /* Subcarrier Freq 3 */
  57. 0x00, /* Subcarrier phase */
  58. 0x02, /* Timing Register 0 */
  59. 0x00, /* Extended Captioning 0 */
  60. 0x00, /* Extended Captioning 1 */
  61. 0x00, /* Closed Captioning 0 */
  62. 0x00, /* Closed Captioning 1 */
  63. 0x00, /* Timing Register 1 */
  64. 0x08, /* Mode Register 2 */
  65. 0x00, /* Pedestal Register 0 */
  66. 0x00, /* Pedestal Register 1 */
  67. 0x00, /* Pedestal Register 2 */
  68. 0x00, /* Pedestal Register 3 */
  69. 0x08, /* Mode Register 3 */
  70. #endif /* VIDEO_MODE_NTSC */
  71. #ifdef VIDEO_MODE_PAL
  72. #ifdef VIDEO_MODE_RGB_OUT
  73. 0x69, /* Mode Register 0 */
  74. #ifdef VIDEO_DEBUG_COLORBARS
  75. 0xc0, /* Mode Register 1 (c0) */
  76. #else
  77. 0x40, /* Mode Register 1 (c0) */
  78. #endif /* VIDEO_DEBUG_COLORBARS */
  79. 0xcb, /* Subcarrier Freq 0 */
  80. 0x8a, /* Subcarrier Freq 1 */
  81. 0x09, /* Subcarrier Freq 2 */
  82. 0x2a, /* Subcarrier Freq 3 */
  83. 0x00, /* Subcarrier phase */
  84. 0x02, /* Timing Register 0 */
  85. 0x00, /* Extended Captioning 0 */
  86. 0x00, /* Extended Captioning 1 */
  87. 0x00, /* Closed Captioning 0 */
  88. 0x00, /* Closed Captioning 1 */
  89. 0x00, /* Timing Register 1 */
  90. 0x28, /* Mode Register 2 */
  91. 0x00, /* Pedestal Register 0 */
  92. 0x00, /* Pedestal Register 1 */
  93. 0x00, /* Pedestal Register 2 */
  94. 0x00, /* Pedestal Register 3 */
  95. 0x08, /* Mode Register 3 */
  96. #else /* ! VIDEO_MODE_RGB_OUT */
  97. 0x09, /* Mode Register 0 (was 01) */
  98. #ifdef VIDEO_DEBUG_COLORBARS
  99. 0xd8, /* */
  100. #else
  101. 0x59, /* Mode Register 1 (was 58) */
  102. #endif /* VIDEO_DEBUG_COLORBARS */
  103. 0xcb, /* Subcarrier Freq 0 */
  104. 0x8a, /* Subcarrier Freq 1 */
  105. 0x09, /* Subcarrier Freq 2 */
  106. 0x2a, /* Subcarrier Freq 3 */
  107. 0x00, /* Subcarrier phase */
  108. 0x02, /* Timing Register 0 (was a) */
  109. 0x00, /* Extended Captioning 0 */
  110. 0x00, /* Extended Captioning 1 */
  111. 0x00, /* Closed Captioning 0 */
  112. 0x00, /* Closed Captioning 1 */
  113. 0x00, /* Timing Register 1 */
  114. #ifdef VIDEO_DEBUG_LOWPOWER
  115. #ifdef VIDEO_DEBUG_DISABLE_COLORS
  116. 0x98, /* Mode Register 2 */
  117. #else
  118. 0x88, /* Mode Register 2 */
  119. #endif /* VIDEO_DEBUG_DISABLE_COLORS */
  120. #else /* ! VIDEO_DEBUG_LOWPOWER */
  121. #ifdef VIDEO_DEBUG_DISABLE_COLORS
  122. 0x18, /* Mode Register 2 */
  123. #else
  124. 0x08, /* Mode Register 2 */
  125. #endif /* VIDEO_DEBUG_DISABLE_COLORS */
  126. #endif /* VIDEO_DEBUG_LOWPOWER */
  127. 0x00, /* Pedestal Register 0 */
  128. 0x00, /* Pedestal Register 1 */
  129. 0x00, /* Pedestal Register 2 */
  130. 0x00, /* Pedestal Register 3 */
  131. 0x08 /* Mode Register 3 */
  132. #endif /* VIDEO_MODE_RGB_OUT */
  133. #endif /* VIDEO_MODE_PAL */
  134. } ;
  135. #endif /* _VIDEO_AD7177_H_ */