AlcapDAQ  1
Macros | Functions | Variables
rpv130_module.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include <sys/time.h>
#include "midas.h"
#include "crate.h"
#include "diag.h"
#include "rpv130.h"

Go to the source code of this file.

Macros

#define RPV130_BASE   0x8000
 

Functions

INT rpv130_init ()
 
INT rpv130_start_block ()
 
INT rpv130_poll_live ()
 
INT rpv130_poll_dead ()
 

Variables

bool block_sig
 
struct timespec timer_start
 
MVME_INTERFACEmyvme
 
struct readout_module rpv130_module
 

Macro Definition Documentation

#define RPV130_BASE   0x8000

Definition at line 15 of file rpv130_module.cpp.

Referenced by rpv130_poll_live(), and rpv130_start_block().

Function Documentation

INT rpv130_init ( )

Definition at line 43 of file rpv130_module.cpp.

References mvme_open(), printf(), and SUCCESS.

44 {
45  printf("VME crate init...\n");
46  mvme_open(&myvme,0);
47  return SUCCESS;
48 }
INT rpv130_poll_dead ( )

Definition at line 92 of file rpv130_module.cpp.

93 {
94  return 0;
95 }
INT rpv130_poll_live ( )

Definition at line 73 of file rpv130_module.cpp.

References FE_END_BLOCK, printf(), RPV130_BASE, rpv130_IsBusy3(), and SUCCESS.

74 {
75  struct timespec timer_now;
76  clock_gettime(CLOCK_REALTIME, &timer_now);
77  unsigned int time_elapse =(timer_now.tv_sec - timer_start.tv_sec)*1000000000 +
78  (timer_now.tv_nsec - timer_start.tv_nsec);
79  printf("time elapse: %ld\n", time_elapse);
80 
82  return FE_END_BLOCK;
83 
84  //if (time_elapse > 2*1000*1000)
85  //{
86  //printf("end of block\n");
87  //return FE_END_BLOCK;
88  //}
89  return SUCCESS;
90 }
INT rpv130_start_block ( )

Definition at line 54 of file rpv130_module.cpp.

References RPV130_BASE, rpv130_ClearBusy3(), rpv130_Pulse(), and SUCCESS.

55 {
58  clock_gettime(CLOCK_REALTIME,&timer_start);
59  return SUCCESS;
60 }

Variable Documentation

bool block_sig

Definition at line 20 of file rpv130_module.cpp.

Definition at line 22 of file rpv130_module.cpp.

struct readout_module rpv130_module
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}

Definition at line 24 of file rpv130_module.cpp.

struct timespec timer_start

Definition at line 21 of file rpv130_module.cpp.