#include <CSIS3600.h>
Inheritance diagram for CSIS3600:
Public Member Functions | |
CSIS3600 (unsigned long base, int crate=0) throw (STD(string)) | |
~CSIS3600 () | |
void | Reset () |
Reset the module. | |
void | LightLed () const |
Light the led. | |
void | ClearLed () const |
Clear the led. | |
bool | isLedLit () const |
true if led is lit. | |
void | SetLatchMode () const |
Use latch (strobed) mode. | |
void | SetCoincidenceMode () const |
Use coincidence mode instead. | |
bool | isLatchMode () const |
Check current operating mode. | |
void | EnableExternalClear () const |
External clear input works. | |
void | DisableExternalClear () const |
External clear disable. | |
bool | ExternalClearEnabled () const |
State of clear enable. | |
void | EnableExternalNext () const |
void | DisableExternalNext () const |
bool | ExternalNextEnabled () const |
void | SetFastClearWindow (int ns) |
Set fast clear window. | |
int | GetFastClearWindow () const |
Inquire fast clear window. | |
void | Enable () const |
Enable receipt of data. | |
void | Disable () const |
Disable receipt of data. | |
void | Clock () const |
Software clock data. | |
void | StartLatch () const |
Begin a software latch. | |
void | EndLatch () const |
End the software latch period. | |
bool | DataReady () const |
True if FIFO not empty. | |
void | ClearData () const |
Clear the FIFO. | |
unsigned long | Read () const throw (STD(string)) |
Read a datum from FIFO. | |
unsigned int | Read (void *pBuffer, int nLongs) const |
Read block of events. | |
Private Member Functions | |
CSIS3600 (const CSIS3600 &rhs) | |
Copy constructor. | |
CSIS3600 & | operator= (const CSIS3600 &rhs) |
Assignment. | |
int | operator== (const CSIS3600 &rhs) const |
int | operator!= (const CSIS3600 &rhs) const |
Private Attributes | |
int | m_nFastClearWindow |
Shadows fast clear window value. |
Definition at line 301 of file CSIS3600.h.
CSIS3600::CSIS3600 | ( | unsigned long | base, | |
int | crate = 0 | |||
) | throw (STD(string)) |
Construct a module. The module consists of a VME space definition that is held by m_Module. Note that use of m_Module ensures portability between SBS Bit3 and Wiener bus bridge modules.
base | (unsigned long [in]): VME Base address of the module. | |
crate | (int [in default = 0]) Selects the VME crate holding the module. |
Definition at line 464 of file CSIS3600.cpp.
CSIS3600::~CSIS3600 | ( | ) |
Destructor.
Definition at line 485 of file CSIS3600.cpp.
CSIS3600::CSIS3600 | ( | const CSIS3600 & | rhs | ) | [private] |
Copy constructor.
int CSIS3600::operator== | ( | const CSIS3600 & | rhs | ) | const [private] |
int CSIS3600::operator!= | ( | const CSIS3600 & | rhs | ) | const [private] |
void CSIS3600::Reset | ( | ) |
Reset the module.
Reset the module back to power up setttings.
Definition at line 589 of file CSIS3600.cpp.
References CModule32::Key(), m_nFastClearWindow, and RESET.
Referenced by sis3600tests::FClearWindow(), sis3600tests::Read(), and sis3600tests::Read1().
void CSIS3600::LightLed | ( | ) | const |
Light the led.
Light the led. Note that if the output mode is 2 (not yet implemented), this will also assert the user output).
Definition at line 494 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LED().
void CSIS3600::ClearLed | ( | ) | const |
Clear the led.
Turn off the led. Note that if the output mode is 2 (not yet implemented), this will also turn off the user output).
Definition at line 511 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LED().
bool CSIS3600::isLedLit | ( | ) | const |
true if led is lit.
Check to see if the led (user output in the as yet unimplemented output mode 2) is lit.
Definition at line 532 of file CSIS3600.cpp.
References CSR, GetBit, Long, and CModule32::peek().
Referenced by sis3600tests::LED().
void CSIS3600::SetLatchMode | ( | ) | const |
Use latch (strobed) mode.
Tell the module to run in latch mode. Note that latch (or strobed mode as the docs call it) is mutually incompatible with coincidence mode (see SetCoincidenceMode)
Definition at line 546 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LatchMode().
void CSIS3600::SetCoincidenceMode | ( | ) | const |
Use coincidence mode instead.
Tell the module to run in coincidence mode. Note that coincidence mode is not compatible with strobed (Latched) mode.
Definition at line 561 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LatchMode(), sis3600tests::LatchTest(), sis3600tests::Read(), and sis3600tests::Read1().
bool CSIS3600::isLatchMode | ( | ) | const |
Check current operating mode.
Returns true if the module is in latch mode. This will be the case if the coincidence mode bit of the status register is not set.
Definition at line 577 of file CSIS3600.cpp.
References CSR, GetBit, Long, and CModule32::peek().
Referenced by sis3600tests::LatchMode().
void CSIS3600::EnableExternalClear | ( | ) | const |
External clear input works.
Enable the external clear. Once enabled, the external clear can be used as a fast clear mechanism to prevent an event from making it into the FIFO. Note this is not the same as a module clear that must be done from the VME...however there is an external RESET input that does that (I don't think it requires an enable??
Definition at line 639 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::ExternalClear().
void CSIS3600::DisableExternalClear | ( | ) | const |
External clear disable.
Disable the external clear.
Definition at line 651 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::ExternalClear().
bool CSIS3600::ExternalClearEnabled | ( | ) | const |
State of clear enable.
True if the external clear is enabled.
Definition at line 662 of file CSIS3600.cpp.
References CSR, GetBit, Long, and CModule32::peek().
Referenced by sis3600tests::ExternalClear().
void CSIS3600::EnableExternalNext | ( | ) | const |
Enable the external next event input. This is required to accept an external latch or coinc. gate.
Definition at line 599 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
void CSIS3600::DisableExternalNext | ( | ) | const |
Disable the external next event input. (Not recommended).
Definition at line 611 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
bool CSIS3600::ExternalNextEnabled | ( | ) | const |
Return true if the external next event input is enabled.
Definition at line 624 of file CSIS3600.cpp.
References CSR, GetBit, Long, and CModule32::peek().
void CSIS3600::SetFastClearWindow | ( | int | ns | ) |
Set fast clear window.
Set the fast clear window. The fast clear window register determines the time period following the initial falling edge of the strobe that a fast clear can be accepted. If accepted, the fast clear will abort the transmission of the latched data into the event fifo.
ns | (int [in]): Width of the fast clear interval in nanoseconds. Note that the actual window must be in the range [220,25720] ns and that the granularity of the register is 100ns steps... with an offset of 20 (e.g. 220, 320, 420...). The value provided, once range checked, will be converted to the closest legal value. |
string | If the value fails range check a string exception is thrown. |
Definition at line 685 of file CSIS3600.cpp.
References FCLEARWIN, m_nFastClearWindow, CModule32::poke(), and CModule32::ThrowString().
Referenced by sis3600tests::FClearWindow().
int CSIS3600::GetFastClearWindow | ( | ) | const |
Inquire fast clear window.
Get the value of the fast clear window. The fast clear window register is an 8 bit register the relationship:
ns = (r + 1) *100 + 120
Definition at line 713 of file CSIS3600.cpp.
References m_nFastClearWindow.
Referenced by sis3600tests::FClearWindow().
void CSIS3600::Enable | ( | ) | const |
Enable receipt of data.
Enable the module to receive data (strobes).
Definition at line 766 of file CSIS3600.cpp.
References ENABLENEXTCLOCK, and CModule32::Key().
Referenced by sis3600tests::LatchTest(), sis3600tests::Read(), and sis3600tests::Read1().
void CSIS3600::Disable | ( | ) | const |
Disable receipt of data.
Disable the module to receive strobes clocks.
Definition at line 774 of file CSIS3600.cpp.
References DISABLENEXTCLOCK, and CModule32::Key().
void CSIS3600::Clock | ( | ) | const |
Software clock data.
Clock the module.
Definition at line 782 of file CSIS3600.cpp.
References CModule32::Key(), and NEXTCLOCK.
Referenced by sis3600tests::LatchEvent().
void CSIS3600::StartLatch | ( | ) | const |
Begin a software latch.
Start a latch cycle. The coincidence register includes the ability for the software to gate signals. This is done by invoking this function to start the coincidence interval in which the latch is taken and then invoking EndLatch to end the latch cycle signal. At the end of the latch signal, data are transferred to the module fifo.
Definition at line 727 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LatchEvent().
void CSIS3600::EndLatch | ( | ) | const |
End the software latch period.
Stop a latch cycle. For more information about software latch cycles, see StartLatch above.
Definition at line 740 of file CSIS3600.cpp.
References CSR, Long, CModule32::poke(), SetBit, and Zero.
Referenced by sis3600tests::LatchEvent().
bool CSIS3600::DataReady | ( | ) | const |
True if FIFO not empty.
Returns true if the FIFO is not empty. FIFO not empty is determined by not seeing bit FIFOEmpty in the status register.
Definition at line 754 of file CSIS3600.cpp.
References CSR, GetBit, Long, and CModule32::peek().
Referenced by sis3600tests::FIFOClear(), sis3600tests::LatchTest(), Read(), and sis3600tests::Read1().
void CSIS3600::ClearData | ( | ) | const |
Clear the FIFO.
Clear the FIFO.
Definition at line 790 of file CSIS3600.cpp.
References CLEARFIFO, and CModule32::Key().
Referenced by sis3600tests::FIFOClear().
unsigned long CSIS3600::Read | ( | ) | const throw (STD(string)) |
Read a datum from FIFO.
Read an 'event' from the FIFO. Note that an event consists of a single longword of data. If no data are available this fact is thrown as an exception. To prevent this from happening, the caller needs to check for events via DataReady().
string | Exception describing what happened if the read was attempted without data ready. |
Definition at line 808 of file CSIS3600.cpp.
References DataReady(), FIFO, CModule32::peek(), and CModule32::ThrowString().
Referenced by sis3600tests::Read(), Read(), and sis3600tests::Read1().
unsigned int CSIS3600::Read | ( | void * | pBuffer, | |
int | nLongs | |||
) | const |
Read block of events.
Read a block of events from the FIFO. Events are read into the user buffer until either:
pBuffer | (void* [out]): Pointer to a buffer into which the data will be read. | |
nLongs | (int [in]): Number of longwords in pBuffer. The storage pointed to by pBuffer must be at lest nLongs longwords of valid data space. |
Definition at line 846 of file CSIS3600.cpp.
References DataReady(), and Read().
int CSIS3600::m_nFastClearWindow [private] |
Shadows fast clear window value.
Definition at line 304 of file CSIS3600.h.
Referenced by GetFastClearWindow(), Reset(), and SetFastClearWindow().