#include <pit_comm.h>
Public Member Functions | |
pit_comm (void) | |
~pit_comm (void) | |
int | PITGetControl0 () |
int | PITGetBusStatus () |
its a special register like wr_len, rd_len with the following status bits : 1 parity error 2 block length mismatch 3 target stoped transaction 4 no target answered before timeout 5 no data input from ddl before timeout 6 fifo overflow error 7 fifo underflow | |
int | PITGetControl1 () |
int | PITGetVersion () |
int | PITSetControl0 (UInt8 value) |
int | PITSetControl1 (UInt8 value) |
bool | PITGetDDLLinkStatus () |
Getter of DDLLinkStatus. | |
bool | PITCheckCommStatus () |
Tries to reset, access the hardware and to decode, by the returned value, the status of the DDL link updating DDLLinkStatus and controlFPGAAnswers Method to reset and check DDL link status. | |
int | PITReadBlock (UInt28 address, UInt19 datalength, UInt32 *data) |
int | PITWriteBlock (UInt28 address, UInt19 datalength, UInt32 *data) |
int | PITReadWord (UInt28 address, UInt32 *data) |
int | PITWriteWord (UInt28 address, const UInt32 &data) |
int | PITrorcReset (void) |
Resets the rorc channel Makes a call from the rorcReset function from the lower level rorc_lib.h. | |
Private Member Functions | |
void | PITDecodeRORCError (int rorcError, const char *extraInfo) |
DDL library error decoding method, logs error message throws pit_com_exceptions. | |
void | PITDecodeComError (int comError, const char *extraInfo) |
to decode the pit generated errors like the wrong length also logs errors throws pit_com_exceptions | |
int | PITSetWrA (UInt28) |
Private member function, implementation details inside. | |
int | PITSetRdA (UInt28) |
Private member function, implementation details inside. | |
int | PITSetLen (UInt19) |
Private member function, implementation details inside. | |
int | PITGetRdA () |
Private member function, implementation details inside. | |
int | PITGetWrA () |
Private member function, implementation details inside. | |
int | PITGetLen () |
Private member function, implementation details inside. | |
int | PITGetRdLen () |
Private member function, implementation details inside. | |
int | PITGetWrLen () |
Private member function, implementation details inside. | |
Private Attributes | |
log4cpp::Category * | logCom |
pointer to the logger instance | |
chan_key * | rorc |
Communication library handler. | |
int | rorcStatus |
Data member to store fec2rorc library error value. | |
bool | DDLLinkStatus |
No hardware access attempt should be done if this if FAILURE. | |
int | controlFPGAAnswers |
No hardware access attempt should be done if this if FAILURE. | |
DimService * | serviceCommunicationStatus |
Dim service to publish the status of the communication to the PIT hardware, name "PIT/COMMUNICATION_STATUS", type = integer. |
This class uses the fec2rorc_lib. Modified by Gianluca on 15/01/2008 to implement exception mechanism.
Definition at line 26 of file pit_comm.h.
pit_comm::pit_comm | ( | void | ) |
Definition at line 12 of file pit_comm.cpp.
References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, PITCheckCommStatus(), rorc, RORC_CHANNEL, RORC_REVISION, RORC_SERIAL, rorcStatus, and serviceCommunicationStatus.
pit_comm::~pit_comm | ( | void | ) |
void pit_comm::PITDecodeRORCError | ( | int | rorcError, | |
const char * | extraInfo | |||
) | [private] |
DDL library error decoding method, logs error message throws pit_com_exceptions.
Definition at line 137 of file pit_comm.cpp.
References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, and SUCCESS.
Referenced by PITCheckCommStatus(), PITGetBusStatus(), PITGetControl0(), PITGetControl1(), PITGetLen(), PITGetRdA(), PITGetRdLen(), PITGetVersion(), PITGetWrA(), PITGetWrLen(), PITReadBlock(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), and PITWriteBlock().
void pit_comm::PITDecodeComError | ( | int | comError, | |
const char * | extraInfo | |||
) | [private] |
to decode the pit generated errors like the wrong length also logs errors throws pit_com_exceptions
Definition at line 190 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, ERROR_GENERIC_BUS_STATUS, ERROR_PARITY_CHECK, ERROR_PROTOCOL_DATALENGTH, and logCom.
Referenced by PITReadBlock(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), and PITWriteBlock().
int pit_comm::PITSetWrA | ( | UInt28 | ) | [private] |
Private member function, implementation details inside.
Definition at line 488 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, PIT_GET_WRA_MSB, PITDecodeComError(), PITDecodeRORCError(), and rorc.
Referenced by PITWriteBlock().
int pit_comm::PITSetRdA | ( | UInt28 | ) | [private] |
Private member function, implementation details inside.
Definition at line 438 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, PIT_GET_RDA_MSB, PITDecodeComError(), PITDecodeRORCError(), and rorc.
Referenced by PITReadBlock().
int pit_comm::PITSetLen | ( | UInt19 | ) | [private] |
Private member function, implementation details inside.
Definition at line 536 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, PIT_GET_LEN, PITDecodeComError(), PITDecodeRORCError(), and rorc.
Referenced by PITReadBlock().
int pit_comm::PITGetRdA | ( | ) | [private] |
Private member function, implementation details inside.
Definition at line 225 of file pit_comm.cpp.
References PIT_GET_RDA_LSB, PIT_GET_RDA_MSB, PITDecodeRORCError(), and rorc.
int pit_comm::PITGetWrA | ( | ) | [private] |
Private member function, implementation details inside.
Definition at line 261 of file pit_comm.cpp.
References PIT_GET_WRA_LSB, PIT_GET_WRA_MSB, PITDecodeRORCError(), and rorc.
int pit_comm::PITGetLen | ( | ) | [private] |
Private member function, implementation details inside.
Definition at line 295 of file pit_comm.cpp.
References PIT_GET_LEN, PITDecodeRORCError(), and rorc.
int pit_comm::PITGetRdLen | ( | ) | [private] |
Private member function, implementation details inside.
Definition at line 315 of file pit_comm.cpp.
References PIT_GET_RD_LEN, PITDecodeRORCError(), and rorc.
Referenced by PITReadBlock().
int pit_comm::PITGetWrLen | ( | ) | [private] |
Private member function, implementation details inside.
Definition at line 335 of file pit_comm.cpp.
References PIT_GET_WR_LEN, PITDecodeRORCError(), and rorc.
Referenced by PITWriteBlock().
int pit_comm::PITGetControl0 | ( | ) |
Definition at line 355 of file pit_comm.cpp.
References PIT_GET_CONTROL0, PITDecodeRORCError(), and rorc.
int pit_comm::PITGetBusStatus | ( | ) |
its a special register like wr_len, rd_len with the following status bits : 1 parity error 2 block length mismatch 3 target stoped transaction 4 no target answered before timeout 5 no data input from ddl before timeout 6 fifo overflow error 7 fifo underflow
Definition at line 415 of file pit_comm.cpp.
References PIT_GET_BUS_STATUS, PITDecodeRORCError(), and rorc.
Referenced by PITReadBlock().
int pit_comm::PITGetControl1 | ( | ) |
Definition at line 375 of file pit_comm.cpp.
References PIT_GET_CONTROL1, PITDecodeRORCError(), and rorc.
int pit_comm::PITGetVersion | ( | ) |
Definition at line 395 of file pit_comm.cpp.
References PIT_GET_VERSION, PITDecodeRORCError(), and rorc.
Referenced by pit_driver::readFpgaFirmwareVersion().
int pit_comm::PITSetControl0 | ( | UInt8 | value | ) |
Definition at line 586 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, PIT_GET_CONTROL0, PITDecodeComError(), PITDecodeRORCError(), and rorc.
int pit_comm::PITSetControl1 | ( | UInt8 | value | ) |
Definition at line 630 of file pit_comm.cpp.
References ERROR_BAD_REGISTER_WRITE, PIT_GET_CONTROL1, PITDecodeComError(), PITDecodeRORCError(), and rorc.
bool pit_comm::PITGetDDLLinkStatus | ( | ) | [inline] |
bool pit_comm::PITCheckCommStatus | ( | ) |
Tries to reset, access the hardware and to decode, by the returned value, the status of the DDL link updating DDLLinkStatus and controlFPGAAnswers Method to reset and check DDL link status.
Definition at line 55 of file pit_comm.cpp.
References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, PIT_GET_VERSION, PITDecodeRORCError(), PITrorcReset(), rorc, rorcStatus, serviceCommunicationStatus, and SUCCESS.
Referenced by pit_driver_optinBoard::checkBoardPlugged(), pit_driver::executeCommand(), pit_comm(), and pit_driver::refresh().
Reads a block of data from pit address space.
address | Base address to read from | |
datalength | Length of requested data | |
data | pointer to a piece of memory long enough to store the read block |
Definition at line 682 of file pit_comm.cpp.
References ERROR_BAD_LENGTH_COMPARISON, ERROR_GENERIC_BUS_STATUS, ERROR_PARITY_CHECK, extractFromUInt32(), PITDecodeComError(), PITDecodeRORCError(), PITGetBusStatus(), PITGetRdLen(), PITSetLen(), PITSetRdA(), and rorc.
Referenced by pit_driver::executeCommand(), pit_driver::pitMemoryAccessTest(), PITReadWord(), testReadMemBlock(), and testReadWord().
Writes a block of data to the pit hardware.
address | Base address where to start writing to (general addressing space) | |
datalength | Length of data to write | |
data | Pointer to a piece of memory with data |
Definition at line 749 of file pit_comm.cpp.
References ERROR_BAD_LENGTH_COMPARISON, PITDecodeComError(), PITDecodeRORCError(), PITGetWrLen(), PITSetWrA(), and rorc.
Referenced by pit_driver::executeCommand(), pit_driver::pitMemoryAccessTest(), PITWriteWord(), testReadMemBlock(), and testReadWord().
Reads a word from pit address space.
address | Base address to read from | |
data | pointer to the memory space where to write the read value |
Definition at line 789 of file pit_comm.cpp.
References logCom, and PITReadBlock().
Referenced by pit_driver_optinBoard::checkBoardPlugged(), pit_driver_foChannel::isRateValid(), pit_driver_foChannel::readCounter(), pit_driver_opticalLink::readErrorCounter(), pit_driver_opticalLink::readLinkSetting(), pit_driver_opticalLink::readLinkStatus(), pit_driver_optinBoard::readMaxFastorCounts(), pit_driver_optinBoard::readMinFastorCounts(), pit_driver_optinBoard::readOptinFirmwareVersion(), pit_driver_optinBoard::readOptinSetting(), pit_driver_optinBoard::readOptinStatus(), pit_driver_procFpga::readReg(), and pit_driver_optinBoard::readTimeStamp().
Writes a block of data to the pit hardware.
address | Base address where to start writing to (general addressing space) | |
datalength | Length of data to write | |
data | Pointer to a piece of memory with data |
Definition at line 781 of file pit_comm.cpp.
References logCom, and PITWriteBlock().
Referenced by simulate_values(), pit_driver_optinBoard::writeMaxFastorCounts(), pit_driver_optinBoard::writeMinFastorCounts(), pit_driver_optinBoard::writeOptinCommand(), pit_driver_optinBoard::writeOptinSetting(), and pit_driver_procFpga::writeReg().
int pit_comm::PITrorcReset | ( | void | ) |
Resets the rorc channel Makes a call from the rorcReset function from the lower level rorc_lib.h.
the low level function rorcReset is called twice with the options RORC_RESET_SIU and RORC_RESET_RORC for the moment also added a ddlResetSiu call, as see in the siu_reset.c code
Definition at line 101 of file pit_comm.cpp.
References logCom, rorc, and rorcStatus.
Referenced by pit_driver::executeCommand(), PITCheckCommStatus(), and ~pit_comm().
log4cpp::Category* pit_comm::logCom [private] |
pointer to the logger instance
Definition at line 33 of file pit_comm.h.
Referenced by pit_comm(), PITCheckCommStatus(), PITDecodeComError(), PITDecodeRORCError(), PITReadWord(), PITrorcReset(), and PITWriteWord().
chan_key* pit_comm::rorc [private] |
Communication library handler.
Definition at line 35 of file pit_comm.h.
Referenced by pit_comm(), PITCheckCommStatus(), PITGetBusStatus(), PITGetControl0(), PITGetControl1(), PITGetLen(), PITGetRdA(), PITGetRdLen(), PITGetVersion(), PITGetWrA(), PITGetWrLen(), PITReadBlock(), PITrorcReset(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), PITWriteBlock(), and ~pit_comm().
int pit_comm::rorcStatus [private] |
Data member to store fec2rorc library error value.
Definition at line 36 of file pit_comm.h.
Referenced by pit_comm(), PITCheckCommStatus(), and PITrorcReset().
bool pit_comm::DDLLinkStatus [private] |
No hardware access attempt should be done if this if FAILURE.
Definition at line 41 of file pit_comm.h.
Referenced by pit_comm(), PITCheckCommStatus(), PITDecodeRORCError(), and PITGetDDLLinkStatus().
int pit_comm::controlFPGAAnswers [private] |
No hardware access attempt should be done if this if FAILURE.
Definition at line 46 of file pit_comm.h.
Referenced by pit_comm(), PITCheckCommStatus(), and PITDecodeRORCError().
DimService* pit_comm::serviceCommunicationStatus [private] |
Dim service to publish the status of the communication to the PIT hardware, name "PIT/COMMUNICATION_STATUS", type = integer.
Definition at line 49 of file pit_comm.h.
Referenced by pit_comm(), and PITCheckCommStatus().