CCAENV977 -- Software support for the CAEN V977 I/O register.


#include <CCAENV977.h>
 class CCAENV977 {

  CCAENV977(ULong_t lBase, UShort_t nCrate = 0);

  UShort_t inputSet();
  void inputSet (UShort_t value);
  UShort_t  InputMask();
  void  inputMask(UShort_t mask);
  UShort_t inputRead ();
  UShort_t  singleHitRead ();
  UShort_t  multihitRead ();
  UShort_t   outputSet();
  void         outputSet(UShort_t pattern);
  UShort_t  outputMask ();
  void       outputMask(UShort_t mask);
  UShort_t interruptMask( ();
  void  interruptMask(UShort_t mask);
  void  outputClear();
  UShort_t singleHitReadAndClear ();
  UShort_t  multiHitReadAndClear();
  UShort_t  serialNumber ();
  UShort_t    firmwareLevel ();
  void         controlRegister(UShort_t mask);
  UShort_t  controlRegister();
  void      Reset ();


The CAEN V977 is a 16 channel I/O register. This software provides policy independent support for that module. Other software builds on top of this to e.g. use the module as a trigger or dead-time management module.

Refer to the CAEN hardware manual for the CAEN V977 for more information about this module.

Public member functions

CCAENV977 (ULong_t lBase, UShort_t nCrate);

Constructs a CCAENV977 object. Once constructed, you can use this object to manipulate the actual device described by the constructor.

lBase is the base address of the module as configured in the module's rotary switches. nCrate is the VME crate in which you will insert the module.

UShort_t inputSet (void);

Reads the module input set register. This module describes the current latched state of the inputs. Note that the module allows you to modify the latched set of inputs (e.g. you can clear bits from the register as you process them. See the overload of inputSet described below.

void inputSet (UShort_t value);

Writes value to the input set register.

UShort_t inputMask (void);

Reads and returns the contents of the input mask register. Bits set in the input mask register disable the corresponding bits of the input set register from being set as a result of hardware inputs. It is possible, however for the input set register to be modified arbitrarily by the software. See the overload of inputMask below as well.

void inputMask (UShort_t mask);

Writes mask to the input mask register. This allows you to disable the corresponding bits of the input set register from responding to hardware inputs.

UShort_t inputRead (void);

This reads and returns the module's input read register. The input read register reflects the instantaneous state of the module inputs. Note that since the input read register is not a latched register, in general it's not very useful.

UShort_t singleHitRead (void);

The module is able to distinguish between single and multiple hits in a gate for each input. This register is has bits set for each channel that has received a single hit. The register is not affected by the contents of the input mask register.

UShort_t multihitRead (void);

This register has bits set for each channel of the module that received multiple input pulses during the gate time. The register is not affecte by the input mask register. Multiple hits can also come about as a result of writes to the input set register.

UShort_t outputSet (void);

Reads and returns the value of the output set register. This is the set of bits that is presented to the module's outputs. To write this see the overloaded outputMask function below.

void outputSet (UShort_t pattern);

Writes pattern to the output set register.

UShort_t outputMask (void);

Reads the output mask register. The module outputs are the bitwise OR of the output set register and the input Flip Flop latched value anded with the complement of this mask register. That is bits set in this register prevent the inputs from setting their corresponding outputs. The best description of all of this is probably figure 3.1 in the CAEN hardware manual for the module.

void outputMask (Ushort_t mask);

Writes a value to the output mask register. Each bit set in the mask register disables the corresponding output bit from being controlled by the inputs. See figure 3.1 in the CAEN V977 hardware manual for more information about the function of the output mask register.

UShort_t interruptMask (void);

Reads the interrupt mask register. Each bit of the input register can cause an interrupt to occur. Setting bits in the mask register disables the corresoponding input bit from causing an interrupt. Note that NSCLDAQ does not require

void interruptMask (UShort_t mask);

Writes mask to the interrupt mask register.

void outputClear (void);

Clears the output flipflop channels.

UShort_t singleHitReadAndClear (void);

Returns the value of the single hit read-clear register. This reads and clears the single hit register.

UShort_t multiHitReadAndClear(void);

Reads and returns the value of the multihit read-clear register. This reads and resets the contents of the multihit flip-flop/register.

Ushort_t serialNumber (void);

Returns the serial number of the module.

UShort_t firmwareLevel(void);

Returns the module firmware revision level. The firmware revision is divided into a major and minor version (major.minor is the usual way to write this, e.g. 3.4). The most significant 8 bits of the firmware register are the major revision, the least significatn 8 bits are the minor version.

void controlRegister (void);

Writes the control register. It is an error to attempt to set bits that have no meaning. This is meant to ensure that you use the definitions provided by the class for this (see "Types and public data" below).

UShort_t controlRegister (void);

Reads and returns the value of the control register.

void Reset (void);

Resets the module to its default setup.

Types and public data

The following constant values are defined to represent bits in the control register:

UShort_t CCAENV977::control_Pattern

The Pattern bit in the control register.

UShort_t CCAENV977::control_gateMask

The gateMask bit of the control register.

UShort_t CCAENV977::control_OrMask

The Or mask bit of the control register.


Contract exceptions defined in the header DesignByContract.h can be thrown if the expectations of a function are violated by its caller.