//bbmodules.h
#include "segidlist.h"
#define BBRL
#define MAXBUFF 4000
#define DBUFF
#define DMASIZE 4000
#define EFN 82
#define VME
#define VMEINT
#define INTLEVEL 1
#define INTVEC 0
#define UNIV
#define A32 0x09
#define A16 0x29
#define RPV130REGSIZE 0x10
#define RPV130ADDR 0x8ff0
#define RPV130MAPN 1
#define OPBUSYCL 0x03
#define OPVSSTART 0x20
#define OPVSSTOP 0x40
#define OPVSRESET 0x80
#define QDCREGSIZE 0x2000
#define QDCADDR 0x20000000
#define QDCMAPN 3
// startup.c
void map(void){
univ_init_window(QDCADDR, QDCREGSIZE, A32, QDCMAPN);
univ_init_window(RPV130ADDR, RPV130REGSIZE, A16, RPV130MAPN);
}
void startup(void){
// printk("babildrv: start\n");
vme_define_intlevel(INTLEVEL);
v7XX_map_clear(QDCMAPN);
v7XX_map_event(1, QDCMAPN);
v7XX_map_intlevel(INTLEVEL, QDCMAPN);
rpv130_map_output(OPBUSYCL, RPV130MAPN);
rpv130_map_output(OPVSRESET, RPV130MAPN);
rpv130_map_output(OPVSSTART, RPV130MAPN);
}
// evt.c
void evt(void){
// printk("babildrv: evt\n");
init_event();
init_segment(MKSEGID(0,0,0,V792));
v7XX_map_segdata(QDCMAPN);
end_segment();
}
// clear.c
void clear(void){
// printk("babildrv: clear\n");
v7XX_map_clear(QDCMAPN);
rpv130_map_output(OPBUSYCL, RPV130MAPN);
}
// stop.c
void unmap(void){
univ_end_window(QDCMAPN);
univ_end_window(RPV130MAPN);
}
void stop(void){
// printk("babildrv: stop\n");
rpv130_map_output(OPVSSTOP, RPV130MAPN);
v7XX_map_intlevel(0, QDCMAPN);
v7XX_map_clear(QDCMAPN);
}
//rpv130.c
int rpv130_map_output(short l, int n){
univ_map_write16(0x8, &l, n);
return 1;
}
|