123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- #ifndef _VME_OPCODE_H
- #define _VME_OPCODE_H
- #define VME_VERSION_NUMBER "12.1"
- #define VMEHEXMAX 60000L
- #define SCANMAX 64000L
- #define RESET 0x00
- #define IDLE 0x01
- #define IRPAUSE 0x02
- #define DRPAUSE 0x03
- #define SHIFTIR 0x04
- #define SHIFTDR 0x05
- #define DRCAPTURE 0x06
- #define INTEL_PRGM 0x0001
- #define CASCADE 0x0002
- #define REPEATLOOP 0x0008
- #define SHIFTRIGHT 0x0080
- #define SHIFTLEFT 0x0100
- #define VERIFYUES 0x0200
- #define EXPRESS 0x0001
- #define SIR_DATA 0x0002
- #define SDR_DATA 0x0004
- #define COMPRESS 0x0008
- #define TDI_DATA 0x0010
- #define TDO_DATA 0x0020
- #define MASK_DATA 0x0040
- #define HEAP_IN 0x0080
- #define LHEAP_IN 0x0200
- #define VARIABLE 0x0400
- #define CRC_DATA 0x0800
- #define CMASK_DATA 0x1000
- #define RMASK_DATA 0x2000
- #define READ_DATA 0x4000
- #define DMASK_DATA 0x8000
- #define signalENABLE 0x1C
- #define signalTMS 0x1D
- #define signalTCK 0x1E
- #define signalTDI 0x1F
- #define signalTRST 0x20
- #define VENDOR 0x56
- #define LATTICE 0x01
- #define ALTERA 0x02
- #define XILINX 0x03
- #define ENDDATA 0x00
- #define RUNTEST 0x01
- #define ENDDR 0x02
- #define ENDIR 0x03
- #define ENDSTATE 0x04
- #define TRST 0x05
- #define HIR 0x06
- #define TIR 0x07
- #define HDR 0x08
- #define TDR 0x09
- #define ispEN 0x0A
- #define FREQUENCY 0x0B
- #define STATE 0x10
- #define SIR 0x11
- #define SDR 0x12
- #define TDI 0x13
- #define TDO 0x14
- #define MASK 0x15
- #define XSDR 0x16
- #define XTDI 0x17
- #define XTDO 0x18
- #define MEM 0x19
- #define WAIT 0x1A
- #define TCK 0x1B
- #define SHR 0x23
- #define SHL 0x24
- #define HEAP 0x32
- #define REPEAT 0x33
- #define LEFTPAREN 0x35
- #define VAR 0x55
- #define SEC 0x1C
- #define SMASK 0x1D
- #define MAX_WAIT 0x1E
- #define ON 0x1F
- #define OFF 0x20
- #define SETFLOW 0x30
- #define RESETFLOW 0x31
- #define CRC 0x47
- #define CMASK 0x48
- #define RMASK 0x49
- #define READ 0x50
- #define ENDLOOP 0x59
- #define SECUREHEAP 0x60
- #define VUES 0x61
- #define DMASK 0x62
- #define COMMENT 0x63
- #define HEADER 0x64
- #define FILE_CRC 0x65
- #define LCOUNT 0x66
- #define LDELAY 0x67
- #define LSDR 0x68
- #define LHEAP 0x69
- #define CONTINUE 0x70
- #define LVDS 0x71
- #define ENDVME 0x7F
- #define ENDFILE 0xFF
- #define VME_VERIFICATION_FAILURE -1
- #define VME_FILE_READ_FAILURE -2
- #define VME_VERSION_FAILURE -3
- #define VME_INVALID_FILE -4
- #define VME_ARGUMENT_FAILURE -5
- #define VME_CRC_FAILURE -6
- #define g_ucPinTDI 0x01
- #define g_ucPinTCK 0x02
- #define g_ucPinTMS 0x04
- #define g_ucPinENABLE 0x08
- #define g_ucPinTRST 0x10
- typedef struct {
- unsigned short usPositiveIndex;
- unsigned short usNegativeIndex;
- unsigned char ucUpdate;
- } LVDSPair;
- typedef enum {
- min_lattice_iface_type,
- lattice_jtag_mode,
- max_lattice_iface_type
- } Lattice_iface;
- typedef enum {
- min_lattice_type,
- Lattice_XP2,
- max_lattice_type
- } Lattice_Family;
- typedef struct {
- Lattice_Family family;
- Lattice_iface iface;
- size_t size;
- void *iface_fns;
- void *base;
- int cookie;
- char *desc;
- } Lattice_desc;
- typedef void (*Lattice_jtag_init)(void);
- typedef void (*Lattice_jtag_set_tdi)(int v);
- typedef void (*Lattice_jtag_set_tms)(int v);
- typedef void (*Lattice_jtag_set_tck)(int v);
- typedef int (*Lattice_jtag_get_tdo)(void);
- typedef struct {
- Lattice_jtag_init jtag_init;
- Lattice_jtag_set_tdi jtag_set_tdi;
- Lattice_jtag_set_tms jtag_set_tms;
- Lattice_jtag_set_tck jtag_set_tck;
- Lattice_jtag_get_tdo jtag_get_tdo;
- } lattice_board_specific_func;
- void writePort(unsigned char pins, unsigned char value);
- unsigned char readPort(void);
- void sclock(void);
- void ispVMDelay(unsigned short int a_usMicroSecondDelay);
- void calibration(void);
- int lattice_load(Lattice_desc *desc, const void *buf, size_t bsize);
- int lattice_dump(Lattice_desc *desc, const void *buf, size_t bsize);
- int lattice_info(Lattice_desc *desc);
- void ispVMStart(void);
- void ispVMEnd(void);
- extern void ispVMFreeMem(void);
- signed char ispVMCode(void);
- void ispVMDelay(unsigned short int a_usMicroSecondDelay);
- void ispVMCalculateCRC32(unsigned char a_ucData);
- unsigned char GetByte(void);
- void writePort(unsigned char pins, unsigned char value);
- unsigned char readPort(void);
- void sclock(void);
- #endif
|