Start Back Next End
  
ZBasic System Library
230
ZBasic Microcontrollers
PortMask
Type
Function returning Byte
Invocation
PortMask(pin)
Parameter
Method
Type
Description
pin
ByVal
integral
A pin number
Discussion
This function returns a bit mask for the port with which the specified pin is associated. The resulting bit
mask will have at most one bit set if the pin is valid and will be zero for an invalid pin.  The bit mask can
be used for directly manipulating the I/O registers associated with a pin.
Note that the value of this function is a compile-time constant if the compiler can determine the value of
the pin parameter at compile-time.
For further information about how to use this function, see the discussion of Register.Port() in the
ZBasic Reference Manual.
Example
Dim mask as Byte
mask = PortMask(C.2)
' the result will be &H04
Compatibility
This function is not available in BasicX compatibility mode.
Previous page Top Next page