About AgsiSetSFRValue(DWORD dwValue)

hello,
I am engaged in developing a new SPeriDLL.dll(dialog) and I can't understand the following function and its specification:

BOOL About AgsiSetSFRValue(DWORD dwValue);

"This function is used to let the SFR read value C used to watch function with read access set for the SFR
Input Parameter
dwValue SFRReadValue;
return value:True if successful(otherwise FALSE)
EXAMPLE:
static void (void
{...
AgsiSetSFRValue(P1&PORT1);
...
}
"
I can't correctly understand the above explanation.can anybody give me more words?

thanks and best regards
huihl@163.com

Parents

  • I don't see a function by exactly that name in the copy I have of app note 154. Perhaps you have an older version?

    There is one that seems to be what you're talking about, though: AgsiSetSFRReadValue(). It has a similar example, using port 0 instead of port 1.

    The purpose of this function seems to be to override the value that would be read from an SFR. Many SFRs aren't simply passive memory registers. The bits will change depending on the state of the system. So, you need a function that supplies the value that would be read from an SFR, no matter what bits are actually in that register.

    The example given is for an I/O port. To read inputs of an I/O port, you must write 1s to the port, and then read back a value. The SFR itself will contain all ones, but the read needs to return the value that's actually on the port pins. This function allows you to do exactly that. As shown in the example in the app note, you install a hook on attempts to read the I/O port, and that hook calls this function to set the actual value that should be read, based on the state of your simulated system.


Reply

  • I don't see a function by exactly that name in the copy I have of app note 154. Perhaps you have an older version?

    There is one that seems to be what you're talking about, though: AgsiSetSFRReadValue(). It has a similar example, using port 0 instead of port 1.

    The purpose of this function seems to be to override the value that would be read from an SFR. Many SFRs aren't simply passive memory registers. The bits will change depending on the state of the system. So, you need a function that supplies the value that would be read from an SFR, no matter what bits are actually in that register.

    The example given is for an I/O port. To read inputs of an I/O port, you must write 1s to the port, and then read back a value. The SFR itself will contain all ones, but the read needs to return the value that's actually on the port pins. This function allows you to do exactly that. As shown in the example in the app note, you install a hook on attempts to read the I/O port, and that hook calls this function to set the actual value that should be read, based on the state of your simulated system.


Children
More questions in this forum