ethjpg2k.h

Go to the documentation of this file.
00001 /*
00002   Copyright 2007 Eurotech S.P.A. (Luca Calligaris)
00003   Copyright 2007 Christian Pellegrin <chripell@gmail.com> EVOL S.R.L.
00004 
00005   This software is released under the GPL v2. Please see the file
00006   COPYING in the top-level directory.
00007 ******************************************************************************/
00008 #ifndef ETHJPG2K_H
00009 #define ETHJPG2K_H
00010 #include "plat.h"
00011 
00012 // IOCTLs
00013 
00015 #define IOCTL_ETHJPG2K_ENCDEC_LOAD_FIRMWARE                     IOCTL_ETHJPG2K(0x51)
00016 
00017 #define IOCTL_ETHJPG2K_ENCDEC_START                             IOCTL_ETHJPG2K(0x52)
00018 
00019 #define IOCTL_ETHJPG2K_ENCDEC_STOP                              IOCTL_ETHJPG2K(0x53)
00020 
00022 #define IOCTL_ETHJPG2K_ENC_QUALITY                              IOCTL_ETHJPG2K(0x58)
00023 
00024 /* gipo stuff */
00025 
00029 #define IOCTL_ETHJPG2K_GPIO_READ                                IOCTL_ETHJPG2K(0x60)
00030 
00035 #define IOCTL_ETHJPG2K_GPIO_WRITE                               IOCTL_ETHJPG2K(0x61)
00036 
00039 #define IOCTL_ETHJPG2K_GPIO_WRITE_READ                          IOCTL_ETHJPG2K(0x62)
00040 
00041 /* linux specific ioctls */
00042 
00045 #define IOCTL_ETHJPG2K_LINUX_INIT                               IOCTL_ETHJPG2K(0x70)
00046 
00047 #define IOCTL_ETHJPG2K_LINUX_GETBSIZE                           IOCTL_ETHJPG2K(0x71)
00048 
00050 #define IOCTL_ETHJPG2K_LINUX_SETBUF                             IOCTL_ETHJPG2K(0x72)
00051 
00052 /* TW2835 */
00053 
00056 #define IOCTL_ETHJPG2K_TW2835_WRITE_REG                        IOCTL_ETHJPG2K(0x80)
00057 
00059 #define IOCTL_ETHJPG2K_TW2835_READ_REG                         IOCTL_ETHJPG2K(0x81)
00060 
00061 #define IOCTL_ETHJPG2K_TW2835_RESET                            IOCTL_ETHJPG2K(0x82)
00062 
00064 #define IOCTL_ETHJPG2K_TW2835_TOUT_SEC                         IOCTL_ETHJPG2K(0x83)
00065 
00069 #define IOCTL_ETHJPG2K_TW2835_BATCH                            IOCTL_ETHJPG2K(0x84)
00070 
00071 /* ADV212 debugging */
00072 
00075 #define IOCTL_ETHJPG2K_ADV212_WRITE_REG                        IOCTL_ETHJPG2K(0x90)
00076 
00078 #define IOCTL_ETHJPG2K_ADV212_READ_REG                         IOCTL_ETHJPG2K(0x91)
00079 
00080 /*Typedef's & struct's*/
00081 
00082 
00086 struct ethjpg2k_linux_hdr {
00089   unsigned long field;
00091   unsigned long index;
00094   union
00095   {
00096     unsigned long info;
00097     struct {
00101       unsigned char version;
00102       unsigned char reserved;
00114       unsigned char videoFormat;
00133       unsigned char codeFormat;
00134     } Info_s;
00135   } Info_u;
00137   unsigned long size;
00138 
00140   unsigned long start;
00143   unsigned int overflow;
00145   unsigned int ticket;
00146 };
00147 
00151 struct ethjpg2k_linux_decode {
00153   unsigned long start;
00155   unsigned long size;
00156 };
00157 
00163 typedef struct _ETHJPG2K_VIDEO_ENCODE_FIRMWARE_PARAMS
00164 {
00165         unsigned char   VFORMAT;                        
00166         unsigned char   PREC;                           
00167         unsigned char   XFORMLEV;                       
00168         unsigned char   UNI;                            
00170         unsigned char   CBSIZE;                         
00171         unsigned char   WKERNEL_QUANT;          
00172         unsigned char   STALLPAR;                       
00173         unsigned char   ATTRTYPE;                       
00175         unsigned char   RCTYPE;                 
00176         unsigned char   RCVAL[3];                               
00178         unsigned char   J2KPROG;                        
00179         unsigned char   PICFG;                          
00180         unsigned char   QFACT;                          
00181         unsigned char   COD_STYLE;                      
00183         unsigned short  STEPSIZES[19];          
00184         unsigned char   LOAD_SS;
00185         unsigned char   LOAD_VW;                        
00187         unsigned short  VW_Y;                           
00188         unsigned short  VW_CB;                          
00189         unsigned short  VW_CR;                          
00190         unsigned char   RESERVED[6];
00191         unsigned long   LayersTargets[16];      
00192 } ETHJPG2K_VIDEO_ENCODE_FIRMWARE_PARAMS, *PETHJPG2K__VIDEO_ENCODE_FIRMWARE_PARAMS;
00193 
00199 typedef struct _ETHJPG2K__VIDEO_DECODE_FIRMWARE_PARAMS
00200 {
00201         unsigned char   VFORMAT;                
00202         unsigned char   PREC;                   
00203         unsigned char   RESERVED_0;
00204         unsigned char   UNI;                    
00205         unsigned char   RESERVED_1[5];
00206         unsigned char   PICFG;                  
00207         unsigned char   DRES;                   
00208         unsigned char   COD_STYLE;              
00209 } ETHJPG2K_VIDEO_DECODE_FIRMWARE_PARAMS, PETHJPG2K_VIDEO_DECODE_FIRMWARE_PARAMS;
00210 
00211 
00217 typedef struct _ETHJPG2K_HIPI_FIRMWARE_PARAMS
00218 {
00219         unsigned short  XTOT;   
00220         unsigned short  YTOT;   
00221         unsigned char   PMODE;  
00222         union {
00223                 ETHJPG2K_VIDEO_ENCODE_FIRMWARE_PARAMS   EncodeParams; 
00224                 ETHJPG2K_VIDEO_DECODE_FIRMWARE_PARAMS   DecodeParams; 
00225         } sub;
00226 } ETHJPG2K_HIPI_FIRMWARE_PARAMS, *PETHJPG2K_HIPI_FIRMWARE_PARAMS;
00227 
00228 
00232 typedef union _ETHJPG2K_FIRMWARE_PARAMS
00233 {
00234         ETHJPG2K_VIDEO_ENCODE_FIRMWARE_PARAMS   EncodeParams;
00235         ETHJPG2K_VIDEO_DECODE_FIRMWARE_PARAMS   DecodeParams;
00236         ETHJPG2K_HIPI_FIRMWARE_PARAMS           HipiParams;
00237 
00238 } ETHJPG2K_FIRMWARE_PARAMS, *PETHJPG2K_FIRMWARE_PARAMS;
00239 
00243 typedef struct _ETHJPG2K_FIRMWARE_DATA
00244 {
00245         unsigned char   Type;   
00246         unsigned long*  pFirmware; 
00247         unsigned long   FirmwareSizeInDwords; 
00248         PETHJPG2K_FIRMWARE_PARAMS       pFirmwareParameters; 
00250 } ETHJPG2K_FIRMWARE_DATA, *PETHJPG2K_FIRMWARE_DATA;
00251 
00255 struct ethjpg2k_linux_imgbuf {
00256   int img_max_size;             
00257   int img_n;                    
00258 };
00259 
00260 
00261 #endif  //ETHJPG2K_H

Generated on Sat Dec 20 08:27:54 2008 for CTR1474 by  doxygen 1.5.1