Direction methods - These methods concern the direction of the bean (encapsulation of
the direction of the allocated physical device).
The direction is expressed as a boolean value:
FALSE =
input,
TRUE =
output.
Value methods - These methods work with the whole width of the bean (with the 8 bits together).
Bit methods - These methods work with a single bit of the bean. The bit is specified
as a number from 0 to 7.
The bit value is expressed as a boolean value:
FALSE corresponds to logical "0" or "Low",
TRUE corresponds to logical "1" or "High".
GetDir
- Returns selected direction.
ANSIC prototype: bool GetDir(void)
- Return value:bool - Possible values:
FALSE - Input
TRUE - Output
SetDir
- Sets the port direction (available only if the Direction = input/output).
ANSIC prototype: void SetDir(bool Dir)
- Dir:bool - Direction to set. Possible values:
FALSE - Input
TRUE - Output
SetInput
- Sets the port direction to input (available only if the Direction = input/output).
ANSIC prototype: void SetInput(void)
SetOutput
- Sets the port direction to output (available only if the Direction = input/output).
ANSIC prototype: void SetOutput(void)
GetVal
- Returns the value of the Input/Output bean. If the direction is input then it reads the input value of the pins and returns it. If the direction is output then it returns the last written value (see Safe mode property for limitations).
ANSIC prototype: byte GetVal(void)
- Return value:byte - Input value
PutVal
- Specified value is passed to the Input/Output bean. If the direction is input saves the value to a memory or a register, this value will be written to the pins after switching to the output mode - using SetDir(TRUE) (see Safe mode property for limitations). If the direction is output it writes the value to the port. (Method is available only if the Direction = output or input/output).
ANSIC prototype: void PutVal(byte Val)
- Val:byte - Output value
GetBit
- Returns the value of the specified bit/pin of the Input/Output bean. If the direction is input then it reads the input value of the pin and returns it. If the direction is output then it returns the last written value (see Safe mode property for limitations).
ANSIC prototype: bool GetBit(byte Bit)
- Bit:byte - Bit/pin number to read (0 to 7)
- Return value:bool - Bit value. Possible values:
FALSE - logical "0" (Low level)
TRUE - logical "1" (High level)
PutBit
- Specified value is passed to the specified bit/pin of the Input/Output bean. If the direction is input it saves the value to a memory or a register, this value will be written to the pin after switching to the output mode - using SetDir(TRUE) (see Safe mode property for limitations). If the direction is output it writes the value to the pin. (Method is available only if the Direction = output or input/output).
ANSIC prototype: void PutBit(byte Bit,bool Val)
- Bit:byte - Bit/pin number (0 to 7)
- Val:bool - A new bit value. Possible values:
FALSE - logical "0" (Low level)
TRUE - logical "1" (High level)
SetBit
- Sets (to one) the specified bit of the Input/Output bean. It is the same as PutBit(Bit, TRUE). (Method is available only if the Direction = output or input/output).
ANSIC prototype: void SetBit(byte Bit)
- Bit:byte - Bit/pin number to set (0 to 7)
ClrBit
- Clears (set to zero) the specified bit of the Input/Output bean. It is the same as PutBit(Bit, FALSE). (Method is available only if the Direction = output or input/output).
ANSIC prototype: void ClrBit(byte Bit)
- Bit:byte - Bit/pin number to clear (0 to 7)
NegBit
- Negates (inverts) the specified bit of the Input/Output bean. It is the same as PutBit(Bit,!GetBit(Bit)). (Method is available only if the Direction = output or input/output).
ANSIC prototype: void NegBit(byte Bit)
- Bit:byte - Bit/pin number to invert (0 to 7)
Methods for HCS12 and 56800 derivatives.
-
GetRawVal
- Returns the value of the port. The method uses raw data input register, i.e., a register that always reads back the status of the port regardless of the port direction. The method is available only if raw data input is supported by the port.
ANSIC prototype: byte GetRawVal(void)
- Return value:byte - Input value
-
GetRawBit
- Returns the value of the specified bit/pin. The method uses raw data input register, i.e., a register that always reads back the status of the port regardless of the port direction. The method is available only if raw data input is supported by the port.
ANSIC prototype: bool GetRawBit(byte Bit)
- Bit:byte - Bit/pin number to read.
- Return value:bool - Input value. Possible values:
FALSE - logical "0" (Low level)
TRUE - logical "1" (High level)