#include <CBD8210.h>
Inheritance diagram for CBD8210:
Public Member Functions | |
CBD8210 (unsigned int b) | |
Default constructor. | |
CBD8210 (const CBD8210 &rhs) | |
Copy constructor. | |
~CBD8210 () | |
Destructor. | |
CBD8210 & | operator= (const CBD8210 &rhs) |
Assignment. | |
int | operator== (const CBD8210 &rhs) const |
Comparison for equality. | |
int | operator!= (const CBD8210 &rhs) const |
volatile unsigned short * | getCsr () const |
volatile unsigned short * | getITF () |
volatile unsigned short * | getCAR () |
volatile unsigned short * | getBTB () |
volatile unsigned short * | getBZ () |
volatile unsigned long * | getGL () |
bool | Xtest () const |
bool | Qtest () const |
bool | TimedOut () const |
bool | BranchDemand () const |
void | MNoX (bool fSet=true) |
void | MTo (bool fSet=true) |
void | MLAM (bool fSet=true) |
void | MIT2 (bool fSet=true) |
void | MIT4 (bool fSet=true) |
bool | IT2 () const |
bool | IT4 () const |
unsigned short | ReadCsr () const |
void | WriteCsr (unsigned short nMask) |
void | WriteIFR (unsigned short nMask) |
unsigned short | ReadBTB () const |
unsigned long | ReadGl () const |
void | InitBranch () const |
Static Public Attributes | |
static const int | IT2BIT = 2 |
static const int | IT4BIT = 1 |
Private Attributes | |
volatile unsigned short * | m_pCsr |
Pointer to the Control Status Register. | |
volatile unsigned short * | m_pITF |
Pointer to the Interrupt flag register. | |
volatile unsigned short * | m_pCAR |
Pointer to the Crate Address Register. | |
volatile unsigned short * | m_pBTB |
Pointer to the branch timing register. | |
volatile unsigned short * | m_pBZ |
Pointer to the Branch Zero register. | |
volatile unsigned long * | m_pGL |
Graded LAM register. |
Definition at line 298 of file CBD8210.h.
CBD8210::CBD8210 | ( | unsigned int | b | ) |
Default constructor.
Default constructor. This is called when declarations of the form e.g.:
Definition at line 307 of file CBD8210.cpp.
References m_pBTB, m_pBZ, m_pCAR, m_pCsr, m_pGL, m_pITF, and CCamacModule::MakePointer().
CBD8210::CBD8210 | ( | const CBD8210 & | rhs | ) |
Copy constructor.
Copy construction. This is invoked when e.g. an object is passed by value to a function. The copy constructor makes a clone of the rhs object.
Definition at line 333 of file CBD8210.cpp.
Assignment.
Assignment operation. This member function supports assignment of an object of this class to an object of the same class.
Definition at line 349 of file CBD8210.cpp.
References m_pBTB, m_pBZ, m_pCAR, m_pCsr, m_pGL, m_pITF, and CCamacModule::operator=().
int CBD8210::operator== | ( | const CBD8210 & | rhs | ) | const |
Comparison for equality.
Equality test:
Definition at line 368 of file CBD8210.cpp.
References m_pBTB, m_pBZ, m_pCAR, m_pCsr, m_pGL, and m_pITF.
Referenced by operator!=().
int CBD8210::operator!= | ( | const CBD8210 & | rhs | ) | const [inline] |
volatile unsigned short* CBD8210::getCsr | ( | ) | const [inline] |
volatile unsigned short* CBD8210::getITF | ( | ) | [inline] |
volatile unsigned short* CBD8210::getCAR | ( | ) | [inline] |
volatile unsigned short* CBD8210::getBTB | ( | ) | [inline] |
volatile unsigned short* CBD8210::getBZ | ( | ) | [inline] |
volatile unsigned long* CBD8210::getGL | ( | ) | [inline] |
bool CBD8210::Xtest | ( | ) | const |
Returns true if the last operation on this branch returned an X response. The X response indicates that the module has 'responded' to the function code.
Definition at line 389 of file CBD8210.cpp.
bool CBD8210::Qtest | ( | ) | const |
Returns true if the last operation on this branch returned a valid Q. The meaning of the Q bit depends on the module and the function being performned. Q's are often used to send the result of a test function back (e.g. test for lam), indicate the end of a block transfer and other module specific functions.
Definition at line 407 of file CBD8210.cpp.
Referenced by CCrateController::isDemandEnabled(), CCrateController::isDemanding(), and CCrateController::isInhibited().
bool CBD8210::TimedOut | ( | ) | const |
Returns true if the last operation on the branch timed out (The TO bit is set in the CSR). This usually indicates that a crate which was offline was addressed.
Definition at line 421 of file CBD8210.cpp.
bool CBD8210::BranchDemand | ( | ) | const |
Returns true if a global demand is pending on the branch.
Definition at line 433 of file CBD8210.cpp.
void CBD8210::MNoX | ( | bool | fset = true |
) |
Sets the state of the MNox bit in the status register. When this bit is clear, operations which don't provoke an X response result in a VME bus error. In general, this bit should be set disabling this bus error.
fSet | - true if the bit should be set. |
Definition at line 449 of file CBD8210.cpp.
void CBD8210::MTo | ( | bool | fset = true |
) |
Controls the state of the MTO bit in the control status register. When this bit is clear, Branch timeouts (accesses to nonexistent cratss) result in bus errors on the VME bus. This bit should normally be set as there's no way to catch these bus errors as an inline trap.
fset | - true to set the bit. |
Definition at line 474 of file CBD8210.cpp.
void CBD8210::MLAM | ( | bool | fset = true |
) |
Controls the state of the MLAM bit in the CSR. When this bit is clear, a LAM produces an VME interrupt at IPL3. This bit should normally be set as there is no time efficient way to catch these interrupts at process level.
fset | - When true the MLAM bit will be set. |
Definition at line 500 of file CBD8210.cpp.
void CBD8210::MIT2 | ( | bool | fset = true |
) |
When clear, a NIM true on the IT2 will create a VME interrupt at IPL2. This bit should normally be set as there is no time efficient way to catch VME interrupts at process level.
fset | - If true MIT2 is set. |
Definition at line 524 of file CBD8210.cpp.
void CBD8210::MIT4 | ( | bool | fset = true |
) |
When clear, a NIM true on IT4 will produce a VME bus interrupt at IPL4. Since there's no good time efficient way to catch these interrupts at process level, this bit should be set.
fset | - If true, the MIT4 bit will be set. |
Definition at line 548 of file CBD8210.cpp.
bool CBD8210::IT2 | ( | ) | const |
Returns true if the IT2 bit is set in the CSR. This bit is set to indicate that the IT2 input has received a falling edge. To reset the edge, you must write the IFR with the IT2 bit.
Definition at line 571 of file CBD8210.cpp.
bool CBD8210::IT4 | ( | ) | const |
True if the IT4 bit is set in the CSR. This bit indicates that a falling NIM edge was presented to the IT4 input of the module. To clear this latched bit the IFR must be written with the IT4 bit.
Definition at line 587 of file CBD8210.cpp.
unsigned short CBD8210::ReadCsr | ( | ) | const |
Returns the current value of the CSR.
Definition at line 598 of file CBD8210.cpp.
References m_pCsr.
Referenced by CCAMACTrigger::operator()().
void CBD8210::WriteCsr | ( | unsigned short | nMask | ) |
Writes the CSR with the mask of bits supplied:
nMask | - The mask of bits to write. |
Definition at line 611 of file CBD8210.cpp.
References m_pCsr.
void CBD8210::WriteIFR | ( | unsigned short | nMask | ) |
Writes the IFR (interrupt flag register) with the specified mask. The bits in this register reset the IT2 and IT4 bits in the CSR.
nMask | - Mask to write in the IFR. |
Definition at line 626 of file CBD8210.cpp.
References m_pITF.
Referenced by CCAMACTrigger::operator()().
unsigned short CBD8210::ReadBTB | ( | ) | const |
Returns the value of the BTB register. In practice, the bits in this register specify which crates are powered up and online. The map of these bits is:
7 6 5 4 3 2 1 0 +-----------------------------------------------------------------+ | ... Cr7 | Cr6 | Cr5 | Cr4 | Cr3 | Cr2 | Cr1 | 0| +------------------------------------------------------------------+
Definition at line 645 of file CBD8210.cpp.
References m_pBTB.
unsigned long CBD8210::ReadGl | ( | ) | const |
Returns the current value of the branch graded demand. This may have nothing to do with crate LAMs. To get a crate LAM, you should read the individual crate GL registers.
Definition at line 660 of file CBD8210.cpp.
References m_pGL.
void CBD8210::InitBranch | ( | ) | const |
const int CBD8210::IT2BIT = 2 [static] |
const int CBD8210::IT4BIT = 1 [static] |
volatile unsigned short* CBD8210::m_pCsr [private] |
Pointer to the Control Status Register.
Definition at line 306 of file CBD8210.h.
Referenced by BranchDemand(), CBD8210(), getCsr(), IT2(), IT4(), MIT2(), MIT4(), MLAM(), MNoX(), MTo(), operator=(), operator==(), Qtest(), ReadCsr(), TimedOut(), WriteCsr(), and Xtest().
volatile unsigned short* CBD8210::m_pITF [private] |
Pointer to the Interrupt flag register.
Definition at line 307 of file CBD8210.h.
Referenced by CBD8210(), getITF(), operator=(), operator==(), and WriteIFR().
volatile unsigned short* CBD8210::m_pCAR [private] |
Pointer to the Crate Address Register.
Definition at line 308 of file CBD8210.h.
Referenced by CBD8210(), getCAR(), operator=(), and operator==().
volatile unsigned short* CBD8210::m_pBTB [private] |
Pointer to the branch timing register.
Definition at line 309 of file CBD8210.h.
Referenced by CBD8210(), getBTB(), operator=(), operator==(), and ReadBTB().
volatile unsigned short* CBD8210::m_pBZ [private] |
Pointer to the Branch Zero register.
Definition at line 310 of file CBD8210.h.
Referenced by CBD8210(), getBZ(), InitBranch(), operator=(), and operator==().
volatile unsigned long* CBD8210::m_pGL [private] |
Graded LAM register.
Definition at line 311 of file CBD8210.h.
Referenced by CBD8210(), getGL(), operator=(), operator==(), and ReadGl().