📄 adv601.h
字号:
/*------------------------------------------------------------------------
$Workfile: ADV601.H $
$Date: 1/07/97 6:34p $
$Revision: 16 $
* Purpose:
* Header for ADV601 Wavelet Compression Chip.
* Notes: Bit and Register Definitions take from ADV601 data sheet
* of Jan 1996.
*
$History: ADV601.H $
*
* ***************** Version 16 *****************
* User: Stevel Date: 1/07/97 Time: 6:34p
* Updated in $/601cman
* Add new function prototype read_fifo_thre_file().
*
* ***************** Version 15 *****************
* User: Dstarr Date: 10/08/96 Time: 9:53a
* Updated in $/601cman
* Support DSP bin width calc bit in the ADV601 mode control register.
*
* ***************** Version 14 *****************
* User: Dstarr Date: 8/07/96 Time: 1:26p
* Updated in $/601cman
* Support Phillips mode
*
* ***************** Version 13 *****************
* User: Dstarr Date: 8/05/96 Time: 10:08a
* Updated in $/601test
* Add ADV601 hardware revision level register definition and the mem_err
* bit definitions.
*
* ***************** Version 12 *****************
* User: Stevel Date: 6/23/96 Time: 9:26p
* Updated in $/601cman
* Add changes to support run time Bin Width Calculation.
*
* ***************** Version 11 *****************
* User: Stevel Date: 6/06/96 Time: 1:47p
* Updated in $/601cman
* Change wavelet_init() function prototype.
*
* ***************** Version 10 *****************
* User: Dstarr Date: 5/29/96 Time: 9:51a
* Updated in $/601test
* Fixup TEST_RAM_ to set the fifo threshold to "soon as possible" mode
* (ASAP mode).
*
* ***************** Version 9 *****************
* User: Dstarr Date: 5/29/96 Time: 8:33a
* Updated in $/601cman
* Add new function dma_init()
*
* ***************** Version 8 *****************
* User: Stevel Date: 4/15/96 Time: 7:49p
* Updated in $/601cman
* Add new constant for ADV601 master and unicolor mode.
*
* ***************** Version 7 *****************
* User: Stevel Date: 4/09/96 Time: 7:36p
* Updated in $/601cman
* Add new constant for VxD.
*
* ***************** Version 6 *****************
* User: Dstarr Date: 4/05/96 Time: 11:52a
* Updated in $/601test
* Add adv601 test register, define symbol for ADV601 fifo size and the
* fifo test bit.
*
* ***************** Version 5 *****************
* User: Stevel Date: 3/18/96 Time: 9:13p
* Updated in $/601cman
* Add new constants for VxD
*
* ***************** Version 4 *****************
* User: Dstarr Date: 3/13/96 Time: 5:08p
* Updated in $/601cman
* Checked out in lab. 601test plays beauty thru DLL. Defines all
* dll objects as dllimport.
*
* ***************** Version 3 *****************
* User: Stevel Date: 3/11/96 Time: 7:34p
* Updated in $/601cman
* Rename bw_calulator_input() to bw_calculator_input().
*
* ***************** Version 1 *****************
* User: Stevel Date: 3/06/96 Time: 7:53p
* Created in $/601cman
* Initial release
This code and information is provided "as is" without warranty of any
kind, either expressed or implied, including but not limited to the
implied warranties of merchantability and/or fitness for a particular
purpose.
1996 Analog Devices, Inc.
-------------------------------------------------------------------------*/
#include "globsym.h"
#define LINKTODLL __declspec(dllimport)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ADV601 Write SubAddress
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ADV601_WR_MdCtl 0x0000
#define ADV601_WR_FIFOCtl 0x0001
#define ADV601_WR_Hstart 0x0002
#define ADV601_WR_Hend 0x0003
#define ADV601_WR_Vstart 0x0004
#define ADV601_WR_Vend 0x0005
#define ADV601_WR_CmpRatio 0x0006
#define ADV601_WR_RBW0 0x0100
#define ADV601_WR_BW 0x0101
#define ADV601_WR_TestReg 0x0180 /* Write 1 for back end test mode */
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ADV601 Read SubAddress
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ADV601_RD_RevReg 0x0040 /* Undocumented register */
#define ADV601_RD_SumOfSq0 0x0080
#define ADV601_RD_SumOfY 0x00AA
#define ADV601_RD_SumOfCb 0x00AB
#define ADV601_RD_SumOfCr 0x00AC
#define ADV601_RD_MinOfY 0x00AD
#define ADV601_RD_MaxOfY 0x00AE
#define ADV601_RD_MinOfCb 0x00AF
#define ADV601_RD_MaxOfCb 0x00B0
#define ADV601_RD_MinOfCr 0x00B1
#define ADV601_RD_MaxOfCr 0x00B2
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Interrupt Mask Bits. From Jan 96 ADV601 data sheet Pg 18
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ADV601_IE_CCIRER 0x0100
#define ADV601_IE_STATSR 0x0200
#define ADV601_IE_LCODE 0x0400
#define ADV601_IE_FIFOSRQ 0x0800
#define ADV601_IE_FIFOERR 0x1000
#define ADV601_IE_FIFOSTP 0x2000
#define ADV601_IE_MEMERR 0x4000 /* Undocumented Bit */
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Interrupt Status Bits. From Jan 96 ADV601 data sheet Pg 18
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ADV601_CCIRER 0x0001
#define ADV601_STATSR 0x0002
#define ADV601_LCODE 0x0004
#define ADV601_FIFOSRQ 0x0008
#define ADV601_FIFOERR 0x0010
#define ADV601_FIFOSTP 0x0020
#define ADV601_MEMERR 0x40 /* Undocumented Bit */
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// FIFO condition to generate Interrupt for encode/decode
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ADV601_NFS_32FILLED 0x0001 // for encode only
#define ADV601_NFS_HALF 0x0008 // for encode only
#define ADV601_NFS_32LEFT 0x000F // for encode only
#define ADV601_NES_32FILLED 0x0010 // for decode only
#define ADV601_NES_HALF 0x0080 // for decode only
#define ADV601_NES_32LEFT 0x00F0 // for decode only
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Structures
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
typedef struct tagADV601_REG
{
word mode_ctl; // Video format (CCIR656, Philips ...)
word fifo_ctl; // FIFO Control
word hstart; // Pixel start of the active video (10 bits)
word hend; // Pixel end of the active video (10 bits)
word vstart; // Lines start of the active video (10 bits)
word vend; // Lines End of the active video (10 bits)
word compratio; // Compression ratio for DSP
// Byte 2-3: Interrupt mask
} ADV601_REG;
#define ALL601REGS (sizeof(ADV601_REG)/2)
#define FIFOSIZ_601 512 /* No. of long words in ADV601 FIFO */
#define FIFO_THRESHOLD 0xF1 // ADV601 FIFO threshold
/* Main Ctl & Stat Reg bits */
/* Video Interface Format (VIF) codes for bits 0-3 */
#define CCIR_656 0 /* Sync embedded in video data */
#define MLTPX 2 /* Multiplex Phillips mode video */
#define PLAIN_PHILLIPS 3 /* Drive Luma & Chroma in parallel */
#define GRAY_SCALE 8 /* 12 bit Black & White Video */
/* Other Control bits in the MCSR */
#define VCLK2 0x10 /* Div VCLK by 2 for Plain Phillips & grayscale*/
#define MASTER_601 0x0020 /* ADV601 drives H&V sync */
#define PAL_601 0x40 /* Clear this bit for NTSC */
#define ENCODE_601 0x80 /* Clear this bit for DECODE */
#define UNI_COLOR_601 0x0200
#define DSP_601 0x400 /* DSP on serial port does BWC */
#define RESET_601 0x800
#define SWR_601 0x0800
#define PHSYNC 0x1000 /* Set if hsync is active low */
#define HIRQ_ACT_HI_601 0x2000
/* fifo ctl register bits */
#define FIFO_RAM_TEST 0x1F1 /* Put FIFO into test mode */
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Function prototypes
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LINKTODLL int wavelet_init(int video_format,
int direction,
byte fifo_threshold,
EV601 * ptr2ptrs,
word * bwc_array);
LINKTODLL int read_wavelet_chip(void * hisptr, int subaddr,int nreg );
LINKTODLL int rite_wavelet_chip(void * hisptr, int subaddr,int nreg );
LINKTODLL int bw_calculator_input(BWCinput * pBWCin, dword * VxD_StatsBuf);
LINKTODLL int bw_calculator_output(BWCoutput * pBWCout
, dword * VxD_BWCoeffBuf);
LINKTODLL int dma_init(dword * bufptr, int bufsiz,int direction
, EV601 * ptr2ptrs );
LINKTODLL int read_fifo_thre_file(char *fname, byte * thre);
LINKTODLL ADV601_REG init_601;/* let diags see initial values */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -