Subversion Repositories shark

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/**
22
 ------------
23
 CVS :        $Id: pxc.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1.1.1 $
27
 Last update: $Date: 2002-03-29 14:12:51 $
28
 ------------
29
 
30
**/
31
 
32
/*
33
 * Copyright (C) 2000 Danilo Dealberti and Claudio Melita
34
 *
35
 * This program is free software; you can redistribute it and/or modify
36
 * it under the terms of the GNU General Public License as published by
37
 * the Free Software Foundation; either version 2 of the License, or
38
 * (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
48
 *
49
 */
50
 
51
/*
52
 Nome File : PXC.H
53
 Autore : Danilo Dealberti
54
          Claudio Melita
55
 Data : 16-11-1999
56
 Descrizione : Header file per il controllo del frame grabber PXC200 della
57
               ImageNation
58
 
59
*/
60
/*
61
 Note :
62
 Il seguente modulo permette Š in grado di supportare ogni frame grabber
63
 dotato del controllore single-chip Bt848/Bt848A/Bt849 della BrookTree (ora
64
 Conexant)
65
 Per variare la risoluzione di acquisizione o il formato dei dati in ingresso
66
 vanno variati i parametri contenuti nel seguente modulo , il quale Š
67
 specifico per immagini di 384x288 pixel codificate a 8 livelli di grigio
68
 Le modifiche possono essere effettuate consultando il manuale di descrizione del
69
 chip Bt848 disponibile al sito www.Conexant.com
70
*/
71
 
72
#ifndef F_G_PXC
73
#define F_G_PXC
74
 
75
#include <kernel/types.h>
76
#include <modules/cabs.h>
77
 
78
// Definizione degli indirizzi di comando della scheda , relativamente
79
// a quelli direttamente impiegati
80
 
81
#define PXC_DSTATUS 0x000
82
#define PXC_IOFORM 0x004
83
#define PXC_E_CROP 0x00c
84
#define PXC_O_CROP 0x08c
85
#define PXC_E_VDELAY_LO 0x010
86
#define PXC_O_VDELAY_LO 0x090
87
#define PXC_E_VACTIVE_LO 0x014
88
#define PXC_O_VACTIVE_LO 0x094
89
#define PXC_E_HDELAY_LO 0x018
90
#define PXC_O_HDELAY_LO 0x098
91
#define PXC_E_HACTIVE_LO 0x01c
92
#define PXC_O_HACTIVE_LO 0x09c
93
#define PXC_E_HSCALE_HI 0x020
94
#define PXC_O_HSCALE_HI 0x0a0
95
#define PXC_E_HSCALE_LO 0x024
96
#define PXC_O_HSCALE_LO 0x0a4
97
#define PXC_E_VSCALE_HI 0x04c
98
#define PXC_O_VSCALE_HI 0x0cc
99
#define PXC_E_VSCALE_LO 0x050
100
#define PXC_O_VSCALE_LO 0x0d0
101
#define PXC_ADELAY 0x060
102
#define PXC_BDELAY 0x064
103
#define PXC_COLOR_FMT 0x0d4
104
#define PXC_CAP_CTL 0x0dc
105
#define PXC_INT_STAT 0x100
106
#define PXC_INT_MASK 0x104
107
#define PXC_RISC_STRT_ADD 0x114
108
#define PXC_GPIO_DMA_CTL 0x10c
109
 
110
 
111
// Definizione delle macro per realizzare le istruzioni RISC
112
// Codici operativi
113
#define PXC_WRITE (((DWORD)0x01) << 28)
114
#define PXC_WRITE123 (((DWORD)0x09) << 28)
115
#define PXC_WRITE1S23 (((DWORD)0x0b) << 28)
116
#define PXC_WRITEC (((DWORD)0x05) << 28)
117
#define PXC_SKIP (((DWORD)0x02) << 28)
118
#define PXC_SKIP123 (((DWORD)0x0a) << 28)
119
#define PXC_JUMP (((DWORD)0x07) << 28)
120
#define PXC_SYNC (((DWORD)0x08) << 28)
121
 
122
// Usati per settare l' interruzione e per indicare come la stessa
123
// istruzione di deve sincronizzare con l' inizio di riga e la fine di
124
// riga
125
#define PXC_SET_IRQ (((DWORD) 0x01) << 24)
126
#define PXC_SET_SOL (((DWORD) 0x01) << 27)
127
#define PXC_SET_EOL (((DWORD) 0x01) << 26)
128
#define PXC_FM1 ((DWORD) 0x06)
129
#define PXC_FM3 ((DWORD) 0x0e)
130
#define PXC_VRO ((DWORD) 0x0c)
131
#define PXC_VRE ((DWORD) 0x04)
132
 
133
 
134
 
135
 
136
#define PXC_MAXX 384
137
#define PXC_MAXY 288
138
 
139
#define PXC_MAX_LISTENERS 20 // Al massimo 20 task possono essere
140
                             // risvegliati dal frame grabber
141
 
142
 
143
 
144
#define PXC_FRAME_TIME 20000 // Un frame ogni 20 msec
145
 
146
// Prototipi delle funzioni interessate e strutture dati
147
typedef struct {
148
 PID proc;
149
 int DRel; /* Frame rate di attivazione dei task;
150
              esso e' scorrelato dal periodo del task;
151
              1 significa che il task e' sempre attivato. */
152
} PXC_Node;
153
 
154
 
155
 
156
typedef struct {
157
 PXC_Node Elementi[PXC_MAX_LISTENERS];
158
 int Top;
159
} PXC_Listeners;
160
 
161
 
162
// Prototipi
163
 
164
TIME PXC_Initiate(int number);
165
     /*
166
      Inizializza il frame grabber e ritorna il periodo di attivazione del
167
      Server(che in sostanza non esiste, Š solo una fast di attivazione)
168
     */
169
 
170
void PXC_Start(void) ;
171
     /* Attivazione del processo di cattura */
172
 
173
void PXC_Close(void);
174
     /* Chiusura dell' applicazione con rimozione del frame grabber dal
175
     bus PCI
176
     */
177
 
178
int PXC_Push_Listener(PID l, int rate);
179
                    // Aggiunge un processo che si deve risvegliare
180
                    // con la telecamera; rate indica ogni quanto deve
181
                    // essere attivato tale task.
182
                    // 1 = successo , 0 = insuccesso
183
 
184
int PXC_Pop_Listener(void);
185
                    // Rimuove il processo affiorante
186
                    // 1 successo , 0 = pila vuota
187
 
188
 
189
CAB PXC_GetCab(void);
190
 
191
 
192
 
193
#endif