pit_driver_optinBoard Class Reference

Class to store status and implement functionalities of OPTIN boards. More...

#include <pit_driver_optinBoard.h>

List of all members.

Public Member Functions

 pit_driver_optinBoard (unsigned int boardNumber, pit_comm *commFEE)
 Class constructor requires.
 ~pit_driver_optinBoard (void)
 Class destructor.
unsigned int getBoardNumber () const
 getter of the board number of this object
UInt28 getBaseAddress () const
 getter of the base address to access hardware represented by this optinBoard instance
pit_driver_opticalLinkgetOpticalLink (unsigned int linkNum)
 returns a reference to one of the twelve opticalLink childrens
bool IsBoardPlugged (void) const
 Getter of the status of the communication to this board.
UInt12 refreshLinkStatus (void)
 Public function to test access to the OPTIN board.
unsigned int getOptinFirmwareVersion ()
 Getter of the value stored in optin_fpga_version.
unsigned int readOptinFirmwareVersion ()
 Reads from hardware the OPTIN FPGA version register.
UInt32 refreshOptinStatus (void)
 This method access hardware (when possible) to read the Optin status register the retrieved value.
UInt32 refreshOptinSetting (void)
 Read (and update in case existing services connected to) the setting register.
UInt32 readTimeStamp (int p_timeStampNumber)
 Access pit hardware, read value of timestamp registers.
int readMinFastorCounts (int layer, int chip)
 Read board level minimum FO counts threshold register.
int writeMinFastorCounts (int layer, int chip, unsigned int minCounts)
 Write board level minimum FO counts threshold register.
int readMaxFastorCounts (int layer, int chip)
 Read board level maximum FO counts threshold register.
int writeMaxFastorCounts (int layer, int chip, unsigned int maxCounts)
 Write board level maximum FO counts threshold register.
int refresh ()

Private Member Functions

void checkBoardPlugged (void)
 Try access to board and resfresh boardPlugged.
UInt32 readOptinStatus (void)
 Read Optin status register from hardware.
void refreshStatusServices (void)
 Private function refreshes DIM services connected to the status register (if any).
UInt32 readOptinSetting (void)
 This method access hardware (if possible) to read the setting register.
UInt32 writeOptinSetting (UInt32 p_optinSetting)
 This method access hardware (if possible) to write the setting register.
UInt32 writeOptinCommand (UInt32 p_optinCommand)
 Writes a command to the OPTIN board command register.

Private Attributes

unsigned int boardNumber
 This is the number (physical location) in the pit of the OPTIN board represented by this object.
UInt28 baseAddress
 Base address to access the board corresponding to this instance.
pit_commcommFEE
 This is a pointer to the instance of the class pit_comm that is implementing the communication via DDL.
log4cpp::Category * logDriverOptin
 Pointer to the logger object, initialized in the constructor.
pit_driver_opticalLinkopticalLink [NUMBER_OPTICAL_LINKS]
 The pointers of this array allow access to the 12 objects representing the links (i.e.
bool boardPlugged
 This data member is to inform methods and children on the presence and functioning of the OPTIN board.
int fpgaVersion
 Data member: fpga version number.


Detailed Description

Class to store status and implement functionalities of OPTIN boards.

Definition at line 42 of file pit_driver_optinBoard.h.


Constructor & Destructor Documentation

pit_driver_optinBoard::pit_driver_optinBoard ( unsigned int  boardNumber,
pit_comm commFEE 
)

Class constructor requires.

Parameters:
boardNumber is the OPTIN board number
commFEE pointer to the hardware communication object

Definition at line 9 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, checkBoardPlugged(), commFEE, logDriverOptin, NUMBER_OPTICAL_LINKS, opticalLink, OPTIN_BOARDS_BASE_ADDRESS, and OPTIN_BOARDS_OFFSET.

pit_driver_optinBoard::~pit_driver_optinBoard ( void   ) 

Class destructor.

Definition at line 33 of file pit_driver_optinBoard.cpp.

References NUMBER_OPTICAL_LINKS, and opticalLink.


Member Function Documentation

void pit_driver_optinBoard::checkBoardPlugged ( void   )  [private]

Try access to board and resfresh boardPlugged.

Definition at line 58 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, boardPlugged, commFEE, fpgaVersion, logDriverOptin, OPTIN_BOARDS_FWVERSION_OFFSET, pit_comm::PITCheckCommStatus(), and pit_comm::PITReadWord().

Referenced by pit_driver_optinBoard().

UInt32 pit_driver_optinBoard::readOptinStatus ( void   )  [private]

Read Optin status register from hardware.

This method access hardware (if possible) to read the Optin status register. It returns the retrieved value. It can be used by the other public member functions to perform the hardware access to read the Optin status register It throws: exception (forwarding the one thrown by the comm layer) in case for some reason the communication to hardware fails.

Definition at line 109 of file pit_driver_optinBoard.cpp.

References baseAddress, commFEE, OPTIN_BOARDS_STATUS_OFFSET, and pit_comm::PITReadWord().

Referenced by refreshOptinStatus().

void pit_driver_optinBoard::refreshStatusServices ( void   )  [private]

Private function refreshes DIM services connected to the status register (if any).

Definition at line 116 of file pit_driver_optinBoard.cpp.

Referenced by refresh().

UInt32 pit_driver_optinBoard::readOptinSetting ( void   )  [private]

This method access hardware (if possible) to read the setting register.

Used by other public member functions to perform hardware access to read the optin setting register.

Returns:
the retrieved value of the setting register.

Definition at line 120 of file pit_driver_optinBoard.cpp.

References baseAddress, commFEE, OPTIN_BOARDS_SETTING_OFFSET, and pit_comm::PITReadWord().

Referenced by refreshOptinSetting().

UInt32 pit_driver_optinBoard::writeOptinSetting ( UInt32  p_optinSetting  )  [private]

This method access hardware (if possible) to write the setting register.

Used by other public member functions to perform hardware access to write the optin setting register.

Returns:
the set value of the setting register.

Definition at line 127 of file pit_driver_optinBoard.cpp.

References baseAddress, commFEE, OPTIN_BOARDS_SETTING_OFFSET, and pit_comm::PITWriteWord().

UInt32 pit_driver_optinBoard::writeOptinCommand ( UInt32  p_optinCommand  )  [private]

Writes a command to the OPTIN board command register.

Definition at line 132 of file pit_driver_optinBoard.cpp.

References baseAddress, commFEE, OPTIN_BOARDS_COMMAND_OFFSET, and pit_comm::PITWriteWord().

unsigned int pit_driver_optinBoard::getBoardNumber (  )  const [inline]

getter of the board number of this object

Definition at line 140 of file pit_driver_optinBoard.h.

References boardNumber.

Referenced by pit_driver_opticalLink::getBoardNumber(), and pit_driver_opticalLink::refreshDetectorCoordinates().

UInt28 pit_driver_optinBoard::getBaseAddress (  )  const [inline]

getter of the base address to access hardware represented by this optinBoard instance

Definition at line 143 of file pit_driver_optinBoard.h.

References baseAddress.

Referenced by pit_driver_opticalLink::getBoardBaseAdress(), pit_driver_opticalLink::readErrorCounter(), pit_driver_opticalLink::readLinkSetting(), and pit_driver_opticalLink::readLinkStatus().

pit_driver_opticalLink & pit_driver_optinBoard::getOpticalLink ( unsigned int  linkNum  ) 

returns a reference to one of the twelve opticalLink childrens

Returns a reference to one of the twelve opticalLink childrens Throws an exception in case the parameter is out of proper boundary

Parameters:
linkNum number of the link in the OPTIN board represented by this object

Definition at line 99 of file pit_driver_optinBoard.cpp.

References boardNumber, logDriverOptin, NUMBER_OPTICAL_LINKS, and opticalLink.

Referenced by pit_driver::getFoChannelFromStream(), and pit_driver::getLinkFromStream().

bool pit_driver_optinBoard::IsBoardPlugged ( void   )  const [inline]

Getter of the status of the communication to this board.

Definition at line 150 of file pit_driver_optinBoard.h.

References boardPlugged.

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

UInt12 pit_driver_optinBoard::refreshLinkStatus ( void   ) 

Public function to test access to the OPTIN board.

Definition at line 138 of file pit_driver_optinBoard.cpp.

unsigned int pit_driver_optinBoard::getOptinFirmwareVersion (  )  [inline]

Getter of the value stored in optin_fpga_version.

Definition at line 142 of file pit_driver_optinBoard.cpp.

References fpgaVersion.

unsigned int pit_driver_optinBoard::readOptinFirmwareVersion (  ) 

Reads from hardware the OPTIN FPGA version register.

Definition at line 146 of file pit_driver_optinBoard.cpp.

References baseAddress, commFEE, OPTIN_BOARDS_FWVERSION_OFFSET, and pit_comm::PITReadWord().

UInt32 pit_driver_optinBoard::refreshOptinStatus ( void   ) 

This method access hardware (when possible) to read the Optin status register the retrieved value.

Calls method readOptinStatus refreshes related DIMServices if existing It throws: exception (forwarding the one thrown by the comm layer) on failure of communication to hardware.

Definition at line 153 of file pit_driver_optinBoard.cpp.

References readOptinStatus().

Referenced by refresh().

UInt32 pit_driver_optinBoard::refreshOptinSetting ( void   ) 

Read (and update in case existing services connected to) the setting register.

Definition at line 158 of file pit_driver_optinBoard.cpp.

References readOptinSetting().

Referenced by refresh().

UInt32 pit_driver_optinBoard::readTimeStamp ( int  p_timeStampNumber  ) 

Access pit hardware, read value of timestamp registers.

This method access hardware (if possible) to read one out of three auxiliar timestamp registers in the OPTIN board. It should correspond to a dedicated DIMCommand.

Parameters:
p_timeStampNumber [0,2] selects the timestamp register.
Returns:
Value retrived on communication success.

Definition at line 163 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, commFEE, logDriverOptin, OPTIN_BOARDS_TIMESTAMP_OFFSET, and pit_comm::PITReadWord().

Referenced by pit_driver::executeCommand().

int pit_driver_optinBoard::readMinFastorCounts ( int  layer,
int  chip 
)

Read board level minimum FO counts threshold register.

Reads from HW the value used as minimum threshold required for the FO rate monitoring. Registers are implemented for layer and chip.

Parameters:
layer [0;1] = [inner,outer] layer
chip [0;9]
Returns:
value obtained from lower comm layer

Definition at line 176 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, commFEE, logDriverOptin, OPTIN_BOARDS_MINFOCOUNTS_OFFSET, and pit_comm::PITReadWord().

Referenced by pit_driver::executeCommand().

int pit_driver_optinBoard::writeMinFastorCounts ( int  layer,
int  chip,
unsigned int  minCounts 
)

Write board level minimum FO counts threshold register.

Writes to HW the value used as minimum threshold required for the FO rate monitoring. Registers are implemented for layer and chip.

Parameters:
layer [0;1] = [inner,outer] layer
chip [0;9]
minCounts threshold value to store in the register
Returns:
value obtained from lower comm layer

Definition at line 189 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, commFEE, logDriverOptin, OPTIN_BOARDS_MINFOCOUNTS_OFFSET, and pit_comm::PITWriteWord().

Referenced by pit_driver::executeCommand().

int pit_driver_optinBoard::readMaxFastorCounts ( int  layer,
int  chip 
)

Read board level maximum FO counts threshold register.

Reads from HW the value used as maximum threshold required for the FO rate monitoring. Registers are implemented for layer and chip.

Parameters:
layer [0;1] = [inner,outer] layer
chip [0;9]
Returns:
value obtained from lower comm layer

Definition at line 200 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, commFEE, logDriverOptin, OPTIN_BOARDS_MINFOCOUNTS_OFFSET, and pit_comm::PITReadWord().

Referenced by pit_driver::executeCommand().

int pit_driver_optinBoard::writeMaxFastorCounts ( int  layer,
int  chip,
unsigned int  maxCounts 
)

Write board level maximum FO counts threshold register.

Writes to HW the value used as maximum threshold required for the FO rate monitoring. Registers are implemented for layer and chip.

Parameters:
layer [0;1] = [inner,outer] layer
chip [0;9]
maxCounts threshold value to store in the register
Returns:
value obtained from lower comm layer

Definition at line 213 of file pit_driver_optinBoard.cpp.

References baseAddress, boardNumber, commFEE, logDriverOptin, OPTIN_BOARDS_MINFOCOUNTS_OFFSET, and pit_comm::PITWriteWord().

Referenced by pit_driver::executeCommand().

int pit_driver_optinBoard::refresh (  ) 

Definition at line 85 of file pit_driver_optinBoard.cpp.

References refreshOptinSetting(), refreshOptinStatus(), and refreshStatusServices().

Referenced by pit_driver::executeCommand().


Member Data Documentation

unsigned int pit_driver_optinBoard::boardNumber [private]

This is the number (physical location) in the pit of the OPTIN board represented by this object.

range: [0;9].

Definition at line 48 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), getBoardNumber(), getOpticalLink(), pit_driver_optinBoard(), readMaxFastorCounts(), readMinFastorCounts(), readTimeStamp(), writeMaxFastorCounts(), and writeMinFastorCounts().

UInt28 pit_driver_optinBoard::baseAddress [private]

Base address to access the board corresponding to this instance.

Needs to be properly initialized by the constructor This is used by all child objects for hardware access

Definition at line 55 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), getBaseAddress(), pit_driver_optinBoard(), readMaxFastorCounts(), readMinFastorCounts(), readOptinFirmwareVersion(), readOptinSetting(), readOptinStatus(), readTimeStamp(), writeMaxFastorCounts(), writeMinFastorCounts(), writeOptinCommand(), and writeOptinSetting().

pit_comm* pit_driver_optinBoard::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) and is then used by objects instantiated as childrens of this one (foChannel)

Definition at line 63 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), pit_driver_optinBoard(), readMaxFastorCounts(), readMinFastorCounts(), readOptinFirmwareVersion(), readOptinSetting(), readOptinStatus(), readTimeStamp(), writeMaxFastorCounts(), writeMinFastorCounts(), writeOptinCommand(), and writeOptinSetting().

log4cpp::Category* pit_driver_optinBoard::logDriverOptin [private]

Pointer to the logger object, initialized in the constructor.

Definition at line 67 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), getOpticalLink(), pit_driver_optinBoard(), readMaxFastorCounts(), readMinFastorCounts(), readTimeStamp(), writeMaxFastorCounts(), and writeMinFastorCounts().

pit_driver_opticalLink* pit_driver_optinBoard::opticalLink[NUMBER_OPTICAL_LINKS] [private]

The pointers of this array allow access to the 12 objects representing the links (i.e.

MCMs) received on the board represented by this object

Definition at line 73 of file pit_driver_optinBoard.h.

Referenced by getOpticalLink(), pit_driver_optinBoard(), and ~pit_driver_optinBoard().

bool pit_driver_optinBoard::boardPlugged [private]

This data member is to inform methods and children on the presence and functioning of the OPTIN board.

Definition at line 78 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), and IsBoardPlugged().

int pit_driver_optinBoard::fpgaVersion [private]

Data member: fpga version number.

Definition at line 81 of file pit_driver_optinBoard.h.

Referenced by checkBoardPlugged(), and getOptinFirmwareVersion().


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