Subversion Repositories shark

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | 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
 ------------
80 pj 23
 CVS :        $Id: pxc.h,v 1.2 2003-03-13 13:38:28 pj Exp $
2 pj 24
 
25
 File:        $File$
80 pj 26
 Revision:    $Revision: 1.2 $
27
 Last update: $Date: 2003-03-13 13:38:28 $
2 pj 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
 
80 pj 78
#include "ll/sys/cdefs.h"
79
 
80
__BEGIN_DECLS
81
 
2 pj 82
// Definizione degli indirizzi di comando della scheda , relativamente
83
// a quelli direttamente impiegati
84
 
85
#define PXC_DSTATUS 0x000
86
#define PXC_IOFORM 0x004
87
#define PXC_E_CROP 0x00c
88
#define PXC_O_CROP 0x08c
89
#define PXC_E_VDELAY_LO 0x010
90
#define PXC_O_VDELAY_LO 0x090
91
#define PXC_E_VACTIVE_LO 0x014
92
#define PXC_O_VACTIVE_LO 0x094
93
#define PXC_E_HDELAY_LO 0x018
94
#define PXC_O_HDELAY_LO 0x098
95
#define PXC_E_HACTIVE_LO 0x01c
96
#define PXC_O_HACTIVE_LO 0x09c
97
#define PXC_E_HSCALE_HI 0x020
98
#define PXC_O_HSCALE_HI 0x0a0
99
#define PXC_E_HSCALE_LO 0x024
100
#define PXC_O_HSCALE_LO 0x0a4
101
#define PXC_E_VSCALE_HI 0x04c
102
#define PXC_O_VSCALE_HI 0x0cc
103
#define PXC_E_VSCALE_LO 0x050
104
#define PXC_O_VSCALE_LO 0x0d0
105
#define PXC_ADELAY 0x060
106
#define PXC_BDELAY 0x064
107
#define PXC_COLOR_FMT 0x0d4
108
#define PXC_CAP_CTL 0x0dc
109
#define PXC_INT_STAT 0x100
110
#define PXC_INT_MASK 0x104
111
#define PXC_RISC_STRT_ADD 0x114
112
#define PXC_GPIO_DMA_CTL 0x10c
113
 
114
 
115
// Definizione delle macro per realizzare le istruzioni RISC
116
// Codici operativi
117
#define PXC_WRITE (((DWORD)0x01) << 28)
118
#define PXC_WRITE123 (((DWORD)0x09) << 28)
119
#define PXC_WRITE1S23 (((DWORD)0x0b) << 28)
120
#define PXC_WRITEC (((DWORD)0x05) << 28)
121
#define PXC_SKIP (((DWORD)0x02) << 28)
122
#define PXC_SKIP123 (((DWORD)0x0a) << 28)
123
#define PXC_JUMP (((DWORD)0x07) << 28)
124
#define PXC_SYNC (((DWORD)0x08) << 28)
125
 
126
// Usati per settare l' interruzione e per indicare come la stessa
127
// istruzione di deve sincronizzare con l' inizio di riga e la fine di
128
// riga
129
#define PXC_SET_IRQ (((DWORD) 0x01) << 24)
130
#define PXC_SET_SOL (((DWORD) 0x01) << 27)
131
#define PXC_SET_EOL (((DWORD) 0x01) << 26)
132
#define PXC_FM1 ((DWORD) 0x06)
133
#define PXC_FM3 ((DWORD) 0x0e)
134
#define PXC_VRO ((DWORD) 0x0c)
135
#define PXC_VRE ((DWORD) 0x04)
136
 
137
 
138
 
139
 
140
#define PXC_MAXX 384
141
#define PXC_MAXY 288
142
 
143
#define PXC_MAX_LISTENERS 20 // Al massimo 20 task possono essere
144
                             // risvegliati dal frame grabber
145
 
146
 
147
 
148
#define PXC_FRAME_TIME 20000 // Un frame ogni 20 msec
149
 
150
// Prototipi delle funzioni interessate e strutture dati
151
typedef struct {
152
 PID proc;
153
 int DRel; /* Frame rate di attivazione dei task;
154
              esso e' scorrelato dal periodo del task;
155
              1 significa che il task e' sempre attivato. */
156
} PXC_Node;
157
 
158
 
159
 
160
typedef struct {
161
 PXC_Node Elementi[PXC_MAX_LISTENERS];
162
 int Top;
163
} PXC_Listeners;
164
 
165
 
166
// Prototipi
167
 
168
TIME PXC_Initiate(int number);
169
     /*
170
      Inizializza il frame grabber e ritorna il periodo di attivazione del
171
      Server(che in sostanza non esiste, Š solo una fast di attivazione)
172
     */
173
 
174
void PXC_Start(void) ;
175
     /* Attivazione del processo di cattura */
176
 
177
void PXC_Close(void);
178
     /* Chiusura dell' applicazione con rimozione del frame grabber dal
179
     bus PCI
180
     */
181
 
182
int PXC_Push_Listener(PID l, int rate);
183
                    // Aggiunge un processo che si deve risvegliare
184
                    // con la telecamera; rate indica ogni quanto deve
185
                    // essere attivato tale task.
186
                    // 1 = successo , 0 = insuccesso
187
 
188
int PXC_Pop_Listener(void);
189
                    // Rimuove il processo affiorante
190
                    // 1 successo , 0 = pila vuota
191
 
192
 
193
CAB PXC_GetCab(void);
194
 
195
 
80 pj 196
__END_DECLS
2 pj 197
#endif