java.lang.Object
edsim51sh.ports.PortLatches
public class PortLatches
This class is provided as a convenience to the target board programmer.
An instance of this class contains the status of the 8051 port latches
at a given time. This instance is passed to the
TargetBaord.writeToPortPins() method, the method called during each
execution of an 8051 instruction. The target board programmer must
write an implementation for the abstract method
TargetBaord.writeToPortPins(). In doing so, the instance of PortLatches
can be examined to ascertain the status of each latch.
See
TargetBoard.writeToPortPins() for more details.
| Method Summary | |
|---|---|
boolean |
getLatch(int portNumber,
int pinNumber) This method returns the status of a port latch, given the port number and pin number. |
| Method Detail |
|---|
public boolean getLatch(int portNumber,
int pinNumber)
portNumber - A number between 0 and 3,
corresponding to P0, P1, P2 and P3 on the 8051. The value in portNumber
is ANDed with 3 (11 in binary) to force it to a value between 0 and 3.pinNumber - A number between 0 and 7,
corresponding to the pin numbers of a given port. The value in
pinNumber is ANDed with 7 (111 in binary) to force it to a value
between 0 and 7.