.portenabled Property

Function:

Sets/returns the state of the output buffers for the currently selected I/O port (selection is made through the io.portnum property).

Type:

Byte

Value Range:

Default = 0 (all eight I/O lines of the port are configured as inputs)

See Also:

Controlling Output Buffers, io.portstate


Details

Each I/O port groups eight I/O lines. Each bit of this property's byte value corresponds to one "member" I/O line.  Setting the bit to 0 keeps the output buffer turned off, while setting the bit to 1 enables the output buffer.


A warning note icon.After enabling a port, do not manipulate its constituent I/O lines individually (e.g., set one line as an input via io.enabled). Doing so may adversely affect the operation of the port.


Exception Safety

There are a few situations in which an exception may be thrown when getting or setting this property. For more information, see Handling Exceptions.


Getting the Property

Exception

Root Cause(s)

std::invalid_argument

The selected I/O port number is invalid.


Setting the Property

Exception

Root Cause(s)

std::invalid_argument

The selected I/O port number is invalid.

std::logic_error

The direction of the selected I/O port cannot be changed because one of its lines is currently in use.


.portenabled Property

Details

Exception Safety

Getting the Property

Setting the Property