pit_driver_procFpga Class Reference

Class to store status and implement functionalities of processing fpga in the brain card. More...

#include <pit_driver_procFpga.h>

List of all members.

Public Member Functions

 pit_driver_procFpga (pit_comm *commFEE)
 Class constructor requires.
 ~pit_driver_procFpga (void)
 Class destructor.
void writeCmdReg (UInt32 value)
 Method to write a value in the command register.
UInt32 readCmdReg ()
 Method to read a value from the command register.
void startCounter ()
 sends the command to start the counter
void stopCounter ()
 sends the command to stop the counter
UInt32 readStatusRegister (unsigned int regNumber)
 
Parameters:
regNumber number of the status register (0-9)

void writeSettingRegister (unsigned int regNumber, UInt32 value)
 
Parameters:
regNumber number of the register (0-9)

UInt32 readSettingRegister (unsigned int regNumber)
 
Parameters:
regNumber number of the register (0-9)

void setTimerEnable (bool value)
 
Parameters:
value boolean value of the enable bit

bool isTimerEnabled ()
 checks if the timer enable bit is active or not
UInt32 readTimerPeriod ()
 reads the timer period register masking the enable bit
void writeTimerPeriod (UInt32 period)
 
Parameters:
period period to set

void writeSignature (unsigned int signature, UInt32 value)
 
Parameters:
signature the register number to write (0-9)

UInt32 readSignature (unsigned int signature)
 
Parameters:
signature,number of the signature register to read

void writeRandomPeriod (unsigned int period, UInt32 value)
 
Parameters:
period,period to set (0-9)

UInt32 readRandomPeriod (unsigned int period)
 
Parameters:
period,: number of the period register to read

UInt32 readCounter (unsigned int counter)
 
Parameters:
counter,number of the counter output to read (0-9)

void writeCounter (unsigned int counter, UInt32 value)
 
Parameters:
counter,counter to set (0-9)

void writeMinCounter (unsigned int counter, UInt32 value)
 
Parameters:
period,minimun counter to set (0-9)

UInt32 readMinCountert (unsigned int counter)
 
Parameters:
period,: number of the counter output register to read

void writeMaxCounter (unsigned int counter, UInt32 value)
 
Parameters:
period,maximun counter to set (0-9)

UInt32 readMaxCounter (unsigned int counter)
 
Parameters:
period,: number of the maximun counter output register to read

UInt32 readTimeStamp (unsigned int channel, unsigned int timeStamp)
 
Parameters:
channel,: number of the channel to read (0-9)

UInt32 readCounterInGroup (unsigned int group, unsigned int counter)
 
Parameters:
group of the timer to read (0-9)

void writeTriggerMode (unsigned int output, pit_trigger_mode mode)
 
Parameters:
output,: output to set the mode (0-9)

void writeTriggerMode (unsigned int output, const string &mode)
 
Parameters:
output,: output to set the mode (0-9)

pit_trigger_mode readTriggerMode (unsigned int output)
 
Parameters:
output,: output index (0-9)

string readStrTriggerMode (unsigned int output)
 
Parameters:
output,: output index (0-9)


Private Member Functions

UInt32 readReg (UInt28 offset)
 Reads one register in the processing fpga address space.
void writeReg (UInt28 offset, UInt32 value)
 Writes one register in the processing fpga address space.

Private Attributes

pit_commcommFEE
 This is a pointer to the instance of the class pit_comm that is implementing the communication via DDL.
log4cpp::Category * logProcFpga
 Pointer to the logger object, initialized in the constructor.


Detailed Description

Class to store status and implement functionalities of processing fpga in the brain card.

Definition at line 51 of file pit_driver_procFpga.h.


Constructor & Destructor Documentation

pit_driver_procFpga::pit_driver_procFpga ( pit_comm commFEE  ) 

Class constructor requires.

Parameters:
commFEE pointer to the hardware communication object

Definition at line 11 of file pit_driver_procFpga.cpp.

References commFEE, and logProcFpga.

pit_driver_procFpga::~pit_driver_procFpga ( void   ) 

Class destructor.

Definition at line 22 of file pit_driver_procFpga.cpp.


Member Function Documentation

UInt32 pit_driver_procFpga::readReg ( UInt28  offset  )  [private]

Reads one register in the processing fpga address space.

its used by all other methods throws out_of_range if you try an access out of the address space range

Parameters:
offset@return value read

Definition at line 27 of file pit_driver_procFpga.cpp.

References commFEE, logProcFpga, pit_comm::PITReadWord(), PROC_FPGA_ADDRESS_SPACE, and PROC_FPGA_BASE_ADRESS.

Referenced by isTimerEnabled(), readCmdReg(), readCounter(), readCounterInGroup(), readMaxCounter(), readMinCountert(), readRandomPeriod(), readSettingRegister(), readSignature(), readStatusRegister(), readTimerPeriod(), readTimeStamp(), readTriggerMode(), writeTimerPeriod(), and writeTriggerMode().

void pit_driver_procFpga::writeReg ( UInt28  offset,
UInt32  value 
) [private]

Writes one register in the processing fpga address space.

its used by all other methods throws out_of_range if you try an access out of the address space range

Parameters:
offset@param value to write

Definition at line 42 of file pit_driver_procFpga.cpp.

References commFEE, logProcFpga, pit_comm::PITWriteWord(), PROC_FPGA_ADDRESS_SPACE, and PROC_FPGA_BASE_ADRESS.

Referenced by setTimerEnable(), writeCmdReg(), writeCounter(), writeMaxCounter(), writeMinCounter(), writeRandomPeriod(), writeSettingRegister(), writeSignature(), writeTimerPeriod(), and writeTriggerMode().

void pit_driver_procFpga::writeCmdReg ( UInt32  value  )  [inline]

Method to write a value in the command register.

Parameters:
value value to write

Definition at line 86 of file pit_driver_procFpga.h.

References PROC_FPGA_CMD_REG_OFFSET, and writeReg().

Referenced by pit_driver::executeCommand(), startCounter(), and stopCounter().

UInt32 pit_driver_procFpga::readCmdReg (  )  [inline]

Method to read a value from the command register.

Returns:
value read

Definition at line 90 of file pit_driver_procFpga.h.

References PROC_FPGA_CMD_REG_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::startCounter (  )  [inline]

sends the command to start the counter

Definition at line 94 of file pit_driver_procFpga.h.

References PROC_FPGA_CMD_START_COUNTER, and writeCmdReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::stopCounter (  )  [inline]

sends the command to stop the counter

Definition at line 97 of file pit_driver_procFpga.h.

References PROC_FPGA_CMD_STOP_COUNTER, and writeCmdReg().

Referenced by pit_driver::executeCommand().

UInt32 pit_driver_procFpga::readStatusRegister ( unsigned int  regNumber  ) 

Parameters:
regNumber number of the status register (0-9)

Definition at line 112 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_STATUS_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeSettingRegister ( unsigned int  regNumber,
UInt32  value 
)

Parameters:
regNumber number of the register (0-9)

Parameters:
value,value to write in the register

Definition at line 130 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_SETTING_OFFSET, and writeReg().

Referenced by pit_driver::executeCommand().

UInt32 pit_driver_procFpga::readSettingRegister ( unsigned int  regNumber  ) 

Parameters:
regNumber number of the register (0-9)

Returns:
value, value read

Definition at line 121 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_SETTING_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::setTimerEnable ( bool  value  ) 

Parameters:
value boolean value of the enable bit

Definition at line 54 of file pit_driver_procFpga.cpp.

References PROC_FPGA_TIMER_ENABLE_OFFSET, and writeReg().

Referenced by pit_driver::executeCommand().

bool pit_driver_procFpga::isTimerEnabled (  ) 

checks if the timer enable bit is active or not

Returns:
returns the boolean stating if the timer is enabled or not

Definition at line 62 of file pit_driver_procFpga.cpp.

References PROC_FPGA_TIMER_ENABLE_OFFSET, and readReg().

UInt32 pit_driver_procFpga::readTimerPeriod (  )  [inline]

reads the timer period register masking the enable bit

Returns:
returns the value masked with 0x3fffffff

Definition at line 123 of file pit_driver_procFpga.h.

References PROC_FPGA_TIMER_ENABLE_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeTimerPeriod ( UInt32  period  ) 

Parameters:
period period to set

Definition at line 70 of file pit_driver_procFpga.cpp.

References PROC_FPGA_TIMER_ENABLE_OFFSET, readReg(), and writeReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeSignature ( unsigned int  signature,
UInt32  value 
)

Parameters:
signature the register number to write (0-9)

Parameters:
value the value to write

Definition at line 139 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_SIGNATURE_OFFSET, and writeReg().

Referenced by pit_driver::executeCommand().

UInt32 pit_driver_procFpga::readSignature ( unsigned int  signature  ) 

Parameters:
signature,number of the signature register to read

Returns:
value read

Definition at line 148 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_SIGNATURE_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeRandomPeriod ( unsigned int  period,
UInt32  value 
)

Parameters:
period,period to set (0-9)

Parameters:
value,value to write

Definition at line 159 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_RANDOM_PERIOD_OFFSET, and writeReg().

UInt32 pit_driver_procFpga::readRandomPeriod ( unsigned int  period  ) 

Parameters:
period,: number of the period register to read

Returns:
value read

Definition at line 169 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_RANDOM_PERIOD_OFFSET, and readReg().

UInt32 pit_driver_procFpga::readCounter ( unsigned int  counter  ) 

Parameters:
counter,number of the counter output to read (0-9)

Returns:
returnd the counter value

Definition at line 179 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_COUNTER_OUTPUT_OFFSET, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeCounter ( unsigned int  counter,
UInt32  value 
)

Parameters:
counter,counter to set (0-9)

Parameters:
value,value to write

Definition at line 189 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_COUNTER_OUTPUT_OFFSET, and writeReg().

void pit_driver_procFpga::writeMinCounter ( unsigned int  counter,
UInt32  value 
)

Parameters:
period,minimun counter to set (0-9)

Parameters:
value,value to write

Definition at line 200 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_MIN_COUNTER_OFFSET, and writeReg().

UInt32 pit_driver_procFpga::readMinCountert ( unsigned int  counter  ) 

Parameters:
period,: number of the counter output register to read

Returns:
value read

Definition at line 210 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_MIN_COUNTER_OFFSET, and readReg().

void pit_driver_procFpga::writeMaxCounter ( unsigned int  counter,
UInt32  value 
)

Parameters:
period,maximun counter to set (0-9)

Parameters:
value,value to write

Definition at line 103 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_MAX_COUNTER_OFFSET, and writeReg().

UInt32 pit_driver_procFpga::readMaxCounter ( unsigned int  counter  ) 

Parameters:
period,: number of the maximun counter output register to read

Returns:
value read

Definition at line 219 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_MAX_COUNTER_OFFSET, and readReg().

UInt32 pit_driver_procFpga::readTimeStamp ( unsigned int  channel,
unsigned int  timeStamp 
)

Parameters:
channel,: number of the channel to read (0-9)

Parameters:
timestamp,: number of the time stamp channel to read (0-2)
Returns:
value read

Definition at line 82 of file pit_driver_procFpga.cpp.

References PROC_FPGA_TIME_STAMP_OFFSET, PROC_FPGA_TIME_STAMP_REG_NUMBER, and readReg().

Referenced by pit_driver::executeCommand().

UInt32 pit_driver_procFpga::readCounterInGroup ( unsigned int  group,
unsigned int  counter 
)

Parameters:
group of the timer to read (0-9)

Parameters:
period,: number of counter output register to read (0-11)
Returns:
value read

Definition at line 90 of file pit_driver_procFpga.cpp.

References logProcFpga, NUMBER_OPTIN, PROC_FPGA_COUNTER_GROUP_OFFSET, PROC_FPGA_COUNTER_GROUP_REGISTERS, PROC_FPGA_N_GEN_COUNTERS, and readReg().

Referenced by pit_driver::executeCommand().

void pit_driver_procFpga::writeTriggerMode ( unsigned int  output,
pit_trigger_mode  mode 
)

Parameters:
output,: output to set the mode (0-9)

Parameters:
mode,: mode to set this output (0-3)

Definition at line 242 of file pit_driver_procFpga.cpp.

References insertIntoUInt32(), logProcFpga, NUMBER_FO_CHANNELS, PROC_FPGA_OUTPUT_MODE_OFFSET, readReg(), and writeReg().

Referenced by pit_driver::executeCommand(), and writeTriggerMode().

void pit_driver_procFpga::writeTriggerMode ( unsigned int  output,
const string &  mode 
)

Parameters:
output,: output to set the mode (0-9)

Parameters:
mode,: mode to set this output (normal, toggle, signature, random)

Definition at line 258 of file pit_driver_procFpga.cpp.

References logProcFpga, Trigger_Normal, Trigger_Random, Trigger_Signature, Trigger_Toggle, and writeTriggerMode().

pit_trigger_mode pit_driver_procFpga::readTriggerMode ( unsigned int  output  ) 

Parameters:
output,: output index (0-9)

Returns:
mode of this channel (0-3)

Definition at line 228 of file pit_driver_procFpga.cpp.

References extractFromUInt32(), logProcFpga, NUMBER_FO_CHANNELS, PROC_FPGA_OUTPUT_MODE_OFFSET, and readReg().

Referenced by pit_driver::executeCommand(), and readStrTriggerMode().

std::string pit_driver_procFpga::readStrTriggerMode ( unsigned int  output  ) 

Parameters:
output,: output index (0-9)

Returns:
string with the mode of this channel (normal, toggle, signature, random)

Definition at line 274 of file pit_driver_procFpga.cpp.

References readTriggerMode(), Trigger_Normal, Trigger_Random, Trigger_Signature, and Trigger_Toggle.


Member Data Documentation

pit_comm* pit_driver_procFpga::commFEE [private]

This is a pointer to the instance of the class pit_comm that is implementing the communication via DDL.

This must be initialized (in the constructor)

Definition at line 58 of file pit_driver_procFpga.h.

Referenced by pit_driver_procFpga(), readReg(), and writeReg().

log4cpp::Category* pit_driver_procFpga::logProcFpga [private]

Pointer to the logger object, initialized in the constructor.

Definition at line 62 of file pit_driver_procFpga.h.

Referenced by pit_driver_procFpga(), readCounter(), readCounterInGroup(), readMaxCounter(), readMinCountert(), readRandomPeriod(), readReg(), readSettingRegister(), readSignature(), readStatusRegister(), readTriggerMode(), writeCounter(), writeMaxCounter(), writeMinCounter(), writeRandomPeriod(), writeReg(), writeSettingRegister(), writeSignature(), and writeTriggerMode().


The documentation for this class was generated from the following files:
Generated on Sat Mar 29 22:55:56 2008 for pixelTrigger by  doxygen 1.5.0