StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ddl_lib.hh
1 #ifndef _DDL_LIB_H_
2 #define _DDL_LIB_H_
3 
4 #include <RORC/rorc_lib.h> // for the descriptors
5 
6 #include "rb.hh"
7 
8 class ddlDriver : public rb {
9 public:
10  ddlDriver(int board, int channel, int fifo_cou, u_int buff_bytes) ;
11  ~ddlDriver() { ; } ;
12 
13  int open(char *vbuff = 0, u_int pbuff = 0) ; // open device
14  int open_23(char *vbuff = 0, u_int pbuff = 0) ; // open device
15  int init() ; // new for FY23 & TPX
16  void close() ; // close device
17 
18  int start(u_int what=4) ; // start run
19  int stop() ; // stop run
20 
21 
22  int cmd(u_char cmd, u_int param=0, u_int dest=4) ; // send a command and wait ?
23  int read(u_int param=0) ; // this just issues the STBRD command!
24 
25  int write(char *inbuff, int bytes, int no_delay=0, int param=0) ; // write something to the device
26 
27  int link_check() ;
28 
29  int busy() ;
30 
31  int mark(char *addr, u_int how) ;
32  int get(char **addr, u_int *status) ; // returns word count; 0 for no data; negative for error
33  int get_priority(char **addr, u_int *status, int *ix=0) ; // returns word count; 0 for no data; negative for error
34  int free(char *addr) ; // return the particular buffer to the free pile
35  int free_ix(int ix) ;
36 
37  int get_free_fifos() ;
38 
39  void emu_place_event(int ix, char *data, int bytes) ;
40  void emu_go() ;
41 
42  u_int status ; // bitmask: xxx1=requested; xx1x=opened; x1xx=error
43 // u_int alloced ; // how many bytes we used of physmem...
44  int start_ix ;
45 
46  unsigned int fifo_order[128] ;
47  unsigned int fifo_order_cou ;
48 
49 private:
50  // from the initializer
51 // char *buff ;
52  u_int phys_buff ;
53 // int fifo_cou ;
54 // u_int buff_bytes ;
55 
56 // int board ; // board: 0,1,2
57 // int ch ; // channel: 0=lower fiber,1=upper fiber
58 
59  rorcDescriptor_t dev ;
60  int board_23 ;
61  int ch_23 ;
62 
63  // storage
64 // volatile rorcReadyFifo_t *sfifo ;
65  volatile u_int sfifo_p ;
66 
67 // char *sbuff ;
68  u_int sbuff_p ;
69 
70 // volatile rorcReadyFifo_t *rfifo ;
71  volatile u_int rfifo_p ;
72 
73 // char *rbuff ;
74  u_int rbuff_p ;
75 
76 
77  int set_base(char *vbuff, u_int pbuff) ;
78 } ;
79 
80 
81 #endif
Definition: rb.hh:21