blob: de3863d0896cc510f469c0fc799e554de25378f7 [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001/*
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
wdenk8564acf2003-07-14 22:13:32 +000015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wdenkfe8c2802002-11-03 00:38:21 +000016 * 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
24#ifndef _VIDEO_AD7177_H_
25#define _VIDEO_AD7177_H_
26
wdenk8564acf2003-07-14 22:13:32 +000027/* #define VIDEO_DEBUG_DISABLE_COLORS 0 */
wdenkfe8c2802002-11-03 00:38:21 +000028
29#define VIDEO_ENCODER_NAME "Analog Devices AD7177"
30
wdenk8564acf2003-07-14 22:13:32 +000031#define VIDEO_ENCODER_I2C_RATE 100000 /* Max rate is 100 kHz */
32#define VIDEO_ENCODER_CB_Y_CR_Y /* Use CB Y CR Y format... */
wdenkfe8c2802002-11-03 00:38:21 +000033
34#define VIDEO_MODE_YUYV /* The only mode supported by this encoder */
wdenk8564acf2003-07-14 22:13:32 +000035#undef VIDEO_MODE_RGB
wdenkfe8c2802002-11-03 00:38:21 +000036#define VIDEO_MODE_BPP 16
37
wdenk8564acf2003-07-14 22:13:32 +000038#ifdef VIDEO_MODE_PAL
wdenkfe8c2802002-11-03 00:38:21 +000039#define VIDEO_ACTIVE_COLS 720
40#define VIDEO_ACTIVE_ROWS 576
41#define VIDEO_VISIBLE_COLS 640
42#define VIDEO_VISIBLE_ROWS 480
43#endif
44
wdenk8564acf2003-07-14 22:13:32 +000045#ifdef VIDEO_MODE_NTSC
wdenkfe8c2802002-11-03 00:38:21 +000046#define VIDEO_ACTIVE_COLS 720
47#define VIDEO_ACTIVE_ROWS 525
48#define VIDEO_VISIBLE_COLS 640
49#define VIDEO_VISIBLE_ROWS 400
50#endif
51
52static unsigned char
53 video_encoder_data[] = {
54#ifdef VIDEO_MODE_NTSC
wdenk8564acf2003-07-14 22:13:32 +000055 0x04, /* Mode Register 0 */
wdenkfe8c2802002-11-03 00:38:21 +000056#ifdef VIDEO_DEBUG_COLORBARS
57 0xc2,
58#else
wdenk8564acf2003-07-14 22:13:32 +000059 0x42, /* Mode Register 1 */
60#endif /* VIDEO_DEBUG_COLORBARS */
61 0x16, /* Subcarrier Freq 0 */
62 0x7c, /* Subcarrier Freq 1 */
63 0xf0, /* Subcarrier Freq 2 */
64 0x21, /* Subcarrier Freq 3 */
65 0x00, /* Subcarrier phase */
66 0x02, /* Timing Register 0 */
67 0x00, /* Extended Captioning 0 */
68 0x00, /* Extended Captioning 1 */
69 0x00, /* Closed Captioning 0 */
70 0x00, /* Closed Captioning 1 */
71 0x00, /* Timing Register 1 */
72 0x08, /* Mode Register 2 */
73 0x00, /* Pedestal Register 0 */
74 0x00, /* Pedestal Register 1 */
75 0x00, /* Pedestal Register 2 */
76 0x00, /* Pedestal Register 3 */
77 0x08, /* Mode Register 3 */
wdenkfe8c2802002-11-03 00:38:21 +000078
wdenk8564acf2003-07-14 22:13:32 +000079#endif /* VIDEO_MODE_NTSC */
80
wdenkfe8c2802002-11-03 00:38:21 +000081#ifdef VIDEO_MODE_PAL
82#ifdef VIDEO_MODE_RGB_OUT
83
wdenk8564acf2003-07-14 22:13:32 +000084 0x69, /* Mode Register 0 */
wdenkfe8c2802002-11-03 00:38:21 +000085#ifdef VIDEO_DEBUG_COLORBARS
wdenk8564acf2003-07-14 22:13:32 +000086 0xc0, /* Mode Register 1 (c0) */
wdenkfe8c2802002-11-03 00:38:21 +000087#else
wdenk8564acf2003-07-14 22:13:32 +000088 0x40, /* Mode Register 1 (c0) */
89#endif /* VIDEO_DEBUG_COLORBARS */
90 0xcb, /* Subcarrier Freq 0 */
91 0x8a, /* Subcarrier Freq 1 */
92 0x09, /* Subcarrier Freq 2 */
93 0x2a, /* Subcarrier Freq 3 */
94 0x00, /* Subcarrier phase */
95 0x02, /* Timing Register 0 */
96 0x00, /* Extended Captioning 0 */
97 0x00, /* Extended Captioning 1 */
98 0x00, /* Closed Captioning 0 */
99 0x00, /* Closed Captioning 1 */
100 0x00, /* Timing Register 1 */
101 0x28, /* Mode Register 2 */
102 0x00, /* Pedestal Register 0 */
103 0x00, /* Pedestal Register 1 */
104 0x00, /* Pedestal Register 2 */
105 0x00, /* Pedestal Register 3 */
106 0x08, /* Mode Register 3 */
wdenkfe8c2802002-11-03 00:38:21 +0000107
wdenk8564acf2003-07-14 22:13:32 +0000108#else /* ! VIDEO_MODE_RGB_OUT */
wdenkfe8c2802002-11-03 00:38:21 +0000109
wdenk8bde7f72003-06-27 21:31:46 +0000110 0x09, /* Mode Register 0 (was 01) */
wdenkfe8c2802002-11-03 00:38:21 +0000111#ifdef VIDEO_DEBUG_COLORBARS
wdenk8564acf2003-07-14 22:13:32 +0000112 0xd8, /* */
wdenkfe8c2802002-11-03 00:38:21 +0000113#else
wdenk8bde7f72003-06-27 21:31:46 +0000114 0x59, /* Mode Register 1 (was 58) */
wdenk8564acf2003-07-14 22:13:32 +0000115#endif /* VIDEO_DEBUG_COLORBARS */
116 0xcb, /* Subcarrier Freq 0 */
117 0x8a, /* Subcarrier Freq 1 */
118 0x09, /* Subcarrier Freq 2 */
119 0x2a, /* Subcarrier Freq 3 */
120 0x00, /* Subcarrier phase */
wdenk8bde7f72003-06-27 21:31:46 +0000121 0x02, /* Timing Register 0 (was a) */
wdenk8564acf2003-07-14 22:13:32 +0000122 0x00, /* Extended Captioning 0 */
123 0x00, /* Extended Captioning 1 */
124 0x00, /* Closed Captioning 0 */
125 0x00, /* Closed Captioning 1 */
126 0x00, /* Timing Register 1 */
wdenkfe8c2802002-11-03 00:38:21 +0000127#ifdef VIDEO_DEBUG_LOWPOWER
128#ifdef VIDEO_DEBUG_DISABLE_COLORS
wdenk8564acf2003-07-14 22:13:32 +0000129 0x98, /* Mode Register 2 */
wdenkfe8c2802002-11-03 00:38:21 +0000130#else
wdenk8564acf2003-07-14 22:13:32 +0000131 0x88, /* Mode Register 2 */
132#endif /* VIDEO_DEBUG_DISABLE_COLORS */
133#else /* ! VIDEO_DEBUG_LOWPOWER */
wdenkfe8c2802002-11-03 00:38:21 +0000134#ifdef VIDEO_DEBUG_DISABLE_COLORS
wdenk8564acf2003-07-14 22:13:32 +0000135 0x18, /* Mode Register 2 */
wdenkfe8c2802002-11-03 00:38:21 +0000136#else
wdenk8564acf2003-07-14 22:13:32 +0000137 0x08, /* Mode Register 2 */
138#endif /* VIDEO_DEBUG_DISABLE_COLORS */
139#endif /* VIDEO_DEBUG_LOWPOWER */
140 0x00, /* Pedestal Register 0 */
141 0x00, /* Pedestal Register 1 */
142 0x00, /* Pedestal Register 2 */
143 0x00, /* Pedestal Register 3 */
144 0x08 /* Mode Register 3 */
145#endif /* VIDEO_MODE_RGB_OUT */
146#endif /* VIDEO_MODE_PAL */
wdenkfe8c2802002-11-03 00:38:21 +0000147 } ;
148
wdenk8564acf2003-07-14 22:13:32 +0000149#endif /* _VIDEO_AD7177_H_ */