Functions | |
bool | fwSpecs_REGCreateRegister (string pRegister, string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, int pRefreshRate, bool pDataChange) |
int | fwSpecs_REGWrite (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, dyn_char pData, bool pWaitFlag=true, dyn_char pMask=makeDynChar()) |
int | fwSpecs_REGRead (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, dyn_char &pData) |
int | fwSpecs_REGWriteRead (string pSPECS, int pMasterID, int pSlaveAddress, int pAddress, dyn_char pDataWrite, dyn_char &pDataRead, dyn_char pMask=makeDynChar()) |
bool fwSpecs_REGCreateRegister | ( | string | pRegister, | |
string | pSPECS, | |||
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
int | pRefreshRate, | |||
bool | pDataChange | |||
) |
Create a new REG register for read/write/monitoring use.
[in] | pRegister | name of the REG register to be created. |
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | register address (FWSPECS_REG_TESTMSB, FWSPECS_REG_TESTLSB, FWSPECS_REG_REGOUTMSB, ..., FWSPECS_REG_DEFINTVECT or FWSPECS_REG_CHANBDELAY). |
[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_REGCreateRegister("myREGReg", "pclbcecs03", 1, 1, FWSPECS_REG_CONFREGOUTMSB, 5, true)) // create a new REG register called 'myREGReg' (...) else DebugTN("Error found!"); (...)
int fwSpecs_REGRead | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
dyn_char & | pData | |||
) |
Read data from the specified REG register.
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | register address (FWSPECS_REG_TESTMSB, FWSPECS_REG_TESTLSB, FWSPECS_REG_REGOUTMSB, ..., FWSPECS_REG_DEFINTVECT or FWSPECS_REG_CHANBDELAY). |
[out] | pData | data read. |
> 0 error found (related with SpecsUser; see error codes).
= -1 error found (related with PVSS).
(...) dyn_char myData; if (fwSpecs_REGRead("pclbcecs03", 1, 1, FWSPECS_REG_CONFREGOUTMSB, myData) == 0) // read 2 chars from REG DebugTN(myData); else DebugTN("Error found!"); (...)
int fwSpecs_REGWrite | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
dyn_char | pData, | |||
bool | pWaitFlag = true , |
|||
dyn_char | pMask = makeDynChar() | |||
) |
Write data into the specified REG register.
[in] | pSPECS | name of the SPECS. |
[in] | pMasterID | master ID. |
[in] | pSlaveAddress | slave address. |
[in] | pAddress | register address (FWSPECS_REG_TESTMSB, FWSPECS_REG_TESTLSB, FWSPECS_REG_REGOUTMSB, ..., FWSPECS_REG_DEFINTVECT or FWSPECS_REG_CHANBDELAY). |
[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). |
[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_REGWrite("pclbcecs03", 1, 1, FWSPECS_REG_CONFREGOUTMSB, makeDynChar(65, 66), true) == 0) // write 2 chars (65 & 66) into REG (...) else DebugTN("Error found!"); (...)
int fwSpecs_REGWriteRead | ( | string | pSPECS, | |
int | pMasterID, | |||
int | pSlaveAddress, | |||
int | pAddress, | |||
dyn_char | pDataWrite, | |||
dyn_char & | pDataRead, | |||
dyn_char | pMask = makeDynChar() | |||
) |
Write and, then, read data from the specified REG 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 | register address (FWSPECS_REG_TESTMSB, FWSPECS_REG_TESTLSB, FWSPECS_REG_REGOUTMSB, ..., FWSPECS_REG_DEFINTVECT or FWSPECS_REG_CHANBDELAY). |
[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_REGWriteRead("pclbcecs03", 1, 1, FWSPECS_REG_CONFREGOUTMSB, makeDynChar(65, 66), myData) == 0) // write 2 chars (65 & 66) and, then, read data from REG DebugTN(myData); else DebugTN("Error found!"); (...)