lib_srxl.h

00001 #ifndef LIB_SRXL_H_
00002 #define LIB_SRXL_H_
00003 
00004 #include "edtinc.h"
00005 
00022 /* ***************** SRXL related registers *****************/
00023 /* SRXL Spartan3 registers.
00024    They're on the srxl mezzanine board xilinx,
00025    but accessed through the gs/ss user interface xilinx w/ 
00026    the srxl bitfile loaded.
00027  */
00028 #define SRXL_DDS_CTRL (INTFC_BYTE | 0x50)
00029 #define SRXL_DDS_DATA (INTFC_BYTE | 0x51)
00030 #define SRXL_SERIAL_CTRL (INTFC_BYTE | 0x54)
00031 #define SRXL_DACA_LOW (INTFC_BYTE | 0x58)
00032 #define SRXL_DACB_LOW (INTFC_BYTE | 0x5a)
00033 #define SRXL_PLL_LOW (INTFC_BYTE | 0x5c)
00034 #define SRXL_CLK_CTRL (INTFC_BYTE | 0x5f)
00035 #define SRXL_AD_READ_DATA (INTFC_BYTE | 0x60) 
00036 #define SRXL_AD_CAPTURE_CTRL (INTFC_BYTE | 0x63)
00037 #define SRXL_GC_ADDR (INTFC_BYTE | 0x64)
00038 #define SRXL_GC_DATA (INTFC_BYTE | 0x65)
00039 
00040 
00041 /* Interface xilinx registers used during programming of SRXL 
00042  * mezz-board xilinx. These registers are very similar to the 
00043  * OCM's registers, so see edt_ocm.h for more documentation. 
00044  */
00045 #define SRXL_X_DATA (INTFC_BYTE | 0x40)
00046 #define SRXL_X_CTRL (INTFC_BYTE | 0x41)
00047 #define SRXL_X_STAT (INTFC_BYTE | 0x42)
00048 
00049 /* SRXL_X_CTRL bits: control (programming) register bits */
00050 #define SRXL_X_CTRL_INIT 0x01     /* tristates init pin, starts init and enables readback */
00051 #define SRXL_X_CTRL_PROG 0x02     /* starts/resets xilinx program */
00052 #define SRXL_X_CTRL_PROG_EN 0x20  /* enables xilinx programming */
00053 #define SRXL_X_CTRL_FIFO_EN 0x40  /* enables fifo */
00054 
00055 /* SRXL_X_STAT bits: status register bits.
00056  * The top 4 bits of the status register are the number of bytes in the fifo,
00057  *  SRXL_X_STAT_FIFO_CNT(edt_p) will give that number.  
00058  */
00059 #define SRXL_X_STAT_INIT 0x01
00060 #define SRXL_X_STAT_DONE 0x02
00061 #define SRXL_X_STAT_FCNT_MSK            0xf0 /* mask to give just the fifo count */
00062 #define SRXL_X_STAT_FCNT_SHFT           4    /* amount to right shift to get fifo count */
00063 #define SRXL_X_STAT_FIFO_CNT(dev) ((edt_reg_read((dev), SRXL_X_STAT)>>SRXL_X_STAT_FCNT_SHFT) & SRXL_X_STAT_FCNT_MSK) 
00064 
00065 /* SERIAL_CTRL register bits */
00066 #define SRXL_SERIAL_CTRL_XFER_BUSY 0x80
00067 
00068 #define SRXL_X_CONST 0x43
00069 #define SRXL_CONSTANT 0x0c    /* fixed pattern in SRXL_X_CONST register */
00070 
00071 /* Note the SRXL user intfc. xilinx also provides: */
00072  /* VHDL NAME     ADDR   edtreg.h 
00073     -----------------------------
00074     CMD_REG       0x00   PCD_CMD
00075     DATA_PATH_REG 0x01  
00076     FUNCT_REG     0x02   
00077         BD_ID_REG     0x7f   MEZZANINE_BD_ID
00078     CONFIG_REG    0x0F
00079     CH_EN_REG     0x10   SSD16_CHENL
00080     LSB_FIRST_REG 0X16   SSD16_LSB
00081  */
00082 /* **************** end SRXL registers ***********************/
00083 
00084 
00085 EDTAPI void srxl_serial_write(EdtDev *edt_p, uint_t desc, uint_t val);
00086 EDTAPI void srxl_gc_write(EdtDev *edt_p, int chip, uint_t address, uint_t value);
00087 EDTAPI void srxl_gc_set_page(EdtDev *edt_p, int chip, int page);
00088 EDTAPI int srxl_set_sample_clk(EdtDev* edt_p, float samp_freq);
00089 EDTAPI int srxl_set_if_losc(EdtDev *edt_p, unsigned freq);
00090 EDTAPI int srxl_set_lb_losc(EdtDev *edt_p, unsigned freq);
00091  /* end group srxl */
00093 
00094 #endif 

Generated on Mon May 12 16:38:54 2008 by  doxygen 1.5.1