GBE Functions


Functions

int fwCcpc_GBEWrite (string pCCPC, int pAddress, int pSize, dyn_char pData, dyn_char pMask=makeDynChar(), bool pWaitFlag=true)
int fwCcpc_GBERead (string pCCPC, int pAddress, int pSize, dyn_char &pData)
int fwCcpc_GBEWriteRead (string pCCPC, int pAddress, int pSize, dyn_char pDataWrite, dyn_char pMask, dyn_char &pDataRead)

Detailed Description

List of functions to operate with GBE (Gigabit Ethernet). The interface to the GBE card (MAC chip) is implemented as if it were a 32 bit bus. The fact that the GBE bus is just a 16 bit bus is hidden within the server.

Function Documentation

int fwCcpc_GBERead ( string  pCCPC,
int  pAddress,
int  pSize,
dyn_char &  pData 
)

Read data from the specified GBE register.

Parameters:
[in] pCCPC name of the CCPC.
[in] pAddress address.
[in] pSize size (in words) of the data to be read.
[out] pData data read.
Returns:
= 0 no error found.

> 0 error found (related with CCPC Server).

= -1 error found (related with PVSS).

Example:

  (...)
  dyn_char myData;

  if (fwCcpc_GBERead("pclbcecs03", 0x600, 1, myData) == 0)   // read 1 word from GBE
     DebugTN(fwCcpc_convertByteToHex(myData);
  else
     DebugTN("Error found!");
  (...)



int fwCcpc_GBEWrite ( string  pCCPC,
int  pAddress,
int  pSize,
dyn_char  pData,
dyn_char  pMask = makeDynChar(),
bool  pWaitFlag = true 
)

Write data into the specified GBE register.

Parameters:
[in] pCCPC name of the CCPC.
[in] pAddress address.
[in] pSize size (in words) of the data to be written.
[in] pData data to be written. Note: If the data is greater than the specified size, then the data will be truncated to that size. If the data is shorter than the specified size, than it will be filled up with leading zeroes.
[in] pMask mask that is going to be used for the writing. Note: if the mask is empty, then no masking operation will be performed.
[in] pWaitFlag if true, the function will wait for the return value, otherwise (false) the function will not wait for the return value (in this case, the return value will be always equal to 0 or -1). Note: this parameter is optional (if not specified, the default will be true).
Returns:
= 0 no error found.

> 0 error found (related with CCPC Server).

= -1 error found (related with PVSS).

Example:

  (...)
  if (fwCcpc_GBEWrite("pclbcecs03", 0x600, 2, fwCcpc_convertHexToByte("feedbabe"+"deaddead"), makeDynChar(), true) == 0)   // write 2 words to GBE 
     (...)
  else
     DebugTN("Error found!");
  (...)



int fwCcpc_GBEWriteRead ( string  pCCPC,
int  pAddress,
int  pSize,
dyn_char  pDataWrite,
dyn_char  pMask,
dyn_char &  pDataRead 
)

Write and, then, read data from the specified GBE register. This function should be used whenever possible, since it will optimize speed. Note: if the write operation fails, then the read operation will not be performed.

Parameters:
[in] pCCPC name of the CCPC.
[in] pAddress address.
[in] pSize size (in words) of the data to be written.
[in] pDataWrite data to be written. Note: If the data is greater than the specified size, then the data will be truncated to that size. If the data is shorter than the specified size, than it will be filled up with leading zeroes.
[in] pMask mask that is going to be used for the writing. Note: if the mask is empty, then no masking operation will be performed.
[out] pDataRead data read.
Returns:
= 0 no error found.

> 0 error found (related with CCPC Server).

= -1 error found (related with PVSS).

Example:

  (...)
  dyn_char myData;

  if (fwCcpc_GBEWriteRead("pclbcecs03", 0x600, 2, fwCcpc_convertHexToByte("feedbabe"+"deaddead"), makeDynChar(), myData) == 0)   // write 2 words and then
     DebugTN(fwCcpc_convertByteToHex(myData);                                                                                    // read back from same address
  else
     DebugTN("Error found!");
  (...)




Generated on Fri Mar 28 13:15:39 2008 for FwCcpc by  doxygen 1.4.7