#include <pit_driver_procFpga.h>
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) | |||
| ||||
void | writeSettingRegister (unsigned int regNumber, UInt32 value) | |||
| ||||
UInt32 | readSettingRegister (unsigned int regNumber) | |||
| ||||
void | setTimerEnable (bool value) | |||
| ||||
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) | |||
| ||||
void | writeSignature (unsigned int signature, UInt32 value) | |||
| ||||
UInt32 | readSignature (unsigned int signature) | |||
| ||||
void | writeRandomPeriod (unsigned int period, UInt32 value) | |||
| ||||
UInt32 | readRandomPeriod (unsigned int period) | |||
| ||||
UInt32 | readCounter (unsigned int counter) | |||
| ||||
void | writeCounter (unsigned int counter, UInt32 value) | |||
| ||||
void | writeMinCounter (unsigned int counter, UInt32 value) | |||
| ||||
UInt32 | readMinCountert (unsigned int counter) | |||
| ||||
void | writeMaxCounter (unsigned int counter, UInt32 value) | |||
| ||||
UInt32 | readMaxCounter (unsigned int counter) | |||
| ||||
UInt32 | readTimeStamp (unsigned int channel, unsigned int timeStamp) | |||
| ||||
UInt32 | readCounterInGroup (unsigned int group, unsigned int counter) | |||
| ||||
void | writeTriggerMode (unsigned int output, pit_trigger_mode mode) | |||
| ||||
void | writeTriggerMode (unsigned int output, const string &mode) | |||
| ||||
pit_trigger_mode | readTriggerMode (unsigned int output) | |||
| ||||
string | readStrTriggerMode (unsigned int output) | |||
| ||||
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_comm * | commFEE | |||
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. |
Definition at line 51 of file pit_driver_procFpga.h.
pit_driver_procFpga::pit_driver_procFpga | ( | pit_comm * | commFEE | ) |
Class constructor requires.
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 | ) |
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
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().
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
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.
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.
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 | ) |
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 | |||
) |
regNumber | number of the register (0-9) |
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 | ) |
regNumber | number of the register (0-9) |
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 | ) |
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
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
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 | ) |
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 | |||
) |
signature | the register number to write (0-9) |
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 | ) |
signature,number | of the signature register to 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 | |||
) |
period,period | to set (0-9) |
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 | ) |
period,: | number of the period register to 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 | ) |
counter,number | of the counter output to read (0-9) |
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 | |||
) |
counter,counter | to set (0-9) |
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 | |||
) |
period,minimun | counter to set (0-9) |
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 | ) |
period,: | number of the counter output register to 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 | |||
) |
period,maximun | counter to set (0-9) |
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 | ) |
period,: | number of the maximun counter output register to 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 | |||
) |
channel,: | number of the channel to read (0-9) |
timestamp,: | number of the time stamp channel to read (0-2) |
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 | |||
) |
group | of the timer to read (0-9) |
period,: | number of counter output register to read (0-11) |
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 | |||
) |
output,: | output to set the mode (0-9) |
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 | |||
) |
output,: | output to set the mode (0-9) |
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 | ) |
output,: | output index (0-9) |
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 | ) |
output,: | output index (0-9) |
Definition at line 274 of file pit_driver_procFpga.cpp.
References readTriggerMode(), Trigger_Normal, Trigger_Random, Trigger_Signature, and Trigger_Toggle.
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().