Functions | |
bool | fwSpecs_PBUSCreateRegister (string pRegister, string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, int pSize, int pRefreshRate, bool pDataChange) |
int | fwSpecs_PBUSWrite (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, int pSize, dyn_char pData, bool pWaitFlag=true, dyn_char pMask=makeDynChar()) |
int | fwSpecs_PBUSRead (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, int pSize, dyn_char &pData) |
int | fwSpecs_PBUSWriteRead (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, int pSize, dyn_char pDataWrite, dyn_char &pDataRead, dyn_char pMask=makeDynChar()) |
bool fwSpecs_PBUSCreateRegister | ( | string | pRegister, | |
string | pSPECS, | |||
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
int | pSize, | |||
int | pRefreshRate, | |||
bool | pDataChange | |||
) |
Create a new PBUS register for read/write/monitoring use.
[in] | pRegister | name of the PBUS register to be created. |
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | address. |
[in] | pSize | size (in words) of the PBUS register. |
[in] | pRefreshRate | refresh rate of the monitoring (in seconds). |
[in] | pDataChange | data change enable/disable option. If true, the server will send data when it change, otherwise (false) the server will not send data (even if it change). |
false error found.
(...) if (fwSpecs_PBUSCreateRegister("myPBUSReg", "pclbcecs03", 1, 1, 64, 2, 5, true)) // create a new PBUS register called 'myPBUSReg' (...) else DebugTN("Error found!"); (...)
int fwSpecs_PBUSRead | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
int | pSize, | |||
dyn_char & | pData | |||
) |
Read data from the specified PBUS register.
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | address. |
[in] | pSize | size (in words) of the data to be read. |
[out] | pData | data read. |
> 0 error found (related with SpecsUser; see error codes).
= -1 error found (related with PVSS).
(...) dyn_char myData; if (fwSpecs_PBUSRead("pclbcecs03", 1, 1, 64, 2, myData) == 0) // read 2 words from PBUS DebugTN(myData); else DebugTN("Error found!"); (...)
int fwSpecs_PBUSWrite | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
int | pSize, | |||
dyn_char | pData, | |||
bool | pWaitFlag = true , |
|||
dyn_char | pMask = makeDynChar() | |||
) |
Write data into the specified PBUS register.
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | address. |
[in] | pSize | size (in words) of the data to be written. |
[in] | pData | data to be written. |
[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). |
[in] | pMask | (optional) mask to be applied to the data. |
> 0 error found (related with SpecsUser; see error codes).
= -1 error found (related with PVSS).
(...) if (fwSpecs_PBUSWrite("pclbcecs03", 1, 1, 64, 2, makeDynChar(65, 66, 67, 68), true) == 0) // write 2 words (65 & 66, 67 & 68) into PBUS (...) else DebugTN("Error found!"); (...)
int fwSpecs_PBUSWriteRead | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
int | pSize, | |||
dyn_char | pDataWrite, | |||
dyn_char & | pDataRead, | |||
dyn_char | pMask = makeDynChar() | |||
) |
Write and, then, read data from the specified PBUS 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.
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | address. |
[in] | pSize | size (in words) of the data to be written. |
[in] | pDataWrite | data to be written. |
[out] | pDataRead | data read. |
[in] | pMask | (optional) mask to be applied to the data when writing. |
> 0 error found (related with SpecsUser; see error codes).
= -1 error found (related with PVSS).
(...) dyn_char myData; if (fwSpecs_PBUSWriteRead("pclbcecs03", 1, 1, 0, makeDynChar(65, 66, 67, 68), myData) == 0) // write 2 words (65 & 66, 67 & 68) DebugTN(myData); // and, then, read data from PBUS else DebugTN("Error found!"); (...)