CNimout

Name

CNimout -- Low level support for the BiRa VME nim output module

Synopsis


#include <Nimout.h>
            
 class CNimout : public CVmeModule {

  CNimout(UInt_t base);

  void ClearAll();
  void WriteRegister(Register reg, UShort_t pattern);
  Bool_t SetStrobeLength(DFloat_t time_in_ns);
  void StrobeAll();
  void OrRegister(Register reg, UShort_t or_pattern);
  void AndRegister(Register reg, UShort_t and_pattern);
  Bool_t SetBit(Register reg, UInt_t bit_num);
  Bool_t ClearBit(Register reg, UInt_t bit_num);
  void TransferData();
  void SetTBit();
  void ClearCBit();
  void ClearTBit();
  UShort_t ReadRegister(Register reg);
  Bool_t ModuleReady();
  Bool_t TBitSet();
}

Description

This class provides low level support for the BiRA VME NIM output module. The module has 16 outputs that can be individually either latched or pulsed. The pulse width is programmable over a wide range of values, however it is common to all pulsed channels.

Public member functions

CNimout(UInt_t base);

Constructs a new CNimout object that will be used to communicate with the actual physical module whose switches have been set to the base address base in VME crate number 0.

void ClearAll();

Clears all module registers (sets them to zero).

void WriteRegister(Register reg, UShort_t pattern);

Writes the value pattern to the module register designated by the reg parameter. The possible values of the reg parameter are described in "Public types and data" below.

Bool_t SetStrobeLength(DFloat_t time_in_ns);

Sets the length of the pulse for pulsed outputs. While the time time_in_ns is given in ns, please note that the granularity of the tming is 62.5ns. This function will choose the 'closest' strobe time and, if necessary also set or clear the bit in the CONTROL register responsible for setting longer timings.

void StrobeAll();

Sets all the bits in the STROBE register to 1. This enables all outputs to be pulsed.

void OrRegister(Register reg, UShort_t or_pattern);

Ors the bits in the or_pattern mask with the contents of the register selected by reg. This is a bitwise or.

void AndRegister(Register reg, UShort_t and_pattern);

Ands the bits in and_pattern with the contents of the register selected by reg. Note that this is a bitwise and.

Bool_t SetBit(Register reg, UInt_t bit_num);

Sets a specific bit (bit bit_num numbered from 0 at the least significant bit to 15 at the most significant bit), in the register designated by reg.

Bool_t ClearBit(Register reg, UInt_t bit_num);

Clears the bit specified by bit_num in the register designated by reg.

void TransferData();

Asks the control register to transfer the data from the data register to the hardware. Bits in the Strobe register that are set select the bits that will be strobed on for a time set by the timing register while all others will be level outputs.

void SetTBit();

Sets the T bit in the control register. Setting the T bit changes the units of the NIM Strobe timing to 4096usec.

void ClearCBit();

Clears the transfer bit in the control/status register. Data are transfered by pulsing the C bit in the control status register.

void ClearTBit();

Clears the T bit in the control register. Clearing the T bit changes the units of the NIM strobe timing to 62.5ns.

UShort_t ReadRegister(Register reg);

Reads a register and returns its 16 bit value. The register read is selected by the reg parameter. Legal values for this parameter documented in the "Types and public data" section below.

Bool_t ModuleReady();

Returns kfTRUE if the module is ready for another operation. This is true if the bottom bit of the status register is set.

Bool_t TBitSet();

Returns kfTRUE if the module's T bit is set in the control/status register. If this bit is set, NIM strobe timing is set in units of 4096usec if not, the strobe timing is in units of 62.5ns.

Types and public data

The CNimout::Register enumerated type is defined to select register names. It is used by the ReadRegister and WriteRegister functions to select the target register. legal values of this type are:

CNimout::DATA

Selects the NIM data register (offset 0 in the module).

CNimout::STROBE

Selects the NIM Strobe mask register (offset 2 in the module).

CNimout::TIMING

Selects the strobe timing register of the module (offset 4 in the module).

CNimout::CONTROL

Selects the control status register (offset 6 in the module).

Issues and defects