EXTIO Unit
Support the following products:
class EXTIOUnit
Constructors
Methods
- EXTIOUnit.set_port_mode(mode) None
Set the mode of the entire port.
- Parameters:
mode (Literal[0x00,0x01]) – The mode to set, either PCA9554.IN (input, 0x00) or PCA9554.OUT (output, 0x01).
UIFLOW2:
- EXTIOUnit.set_pin_mode(id, mode) None
Set the mode of a specific pin.
- Parameters:
id (int) – The pin number (0-7).
mode (Literal[0x00,0x01]) – The mode to set, either PCA9554.IN (input, 0x00) or PCA9554.OUT (output, 0x01).
UIFLOW2:
- EXTIOUnit.digit_write_port(value) None
Set a value to the entire port.
- Parameters:
value (int) – An 8-bit value to set to the port.
UIFLOW2:
- EXTIOUnit.digit_read_port() int
Read the value from the entire port.
- Returns:
An 8-bit value representing the state of the port.
UIFLOW2:
- EXTIOUnit.digit_read(id) int
Read the value from a specific pin.
- Parameters:
id (int) – The pin number (0-7).
- Returns:
The value of the pin, either 0 (low) or 1 (high).
UIFLOW2:
class Pin
Constructors
- class Pin(port, id, mode, value)
Initialize the Pin object with specified parameters.
- Parameters:
port – The port object controlling the pin.
id – The pin identifier (e.g., GPIO number).
mode (int) – The mode of the pin, either Pin.IN (default) or Pin.OUT.
value – Optional initial value for the pin, 0 or 1.
UIFLOW2:
Methods
- Pin.init(mode, value)
Reinitialize the pin with a new mode or value.
- Parameters:
mode (int) – New mode for the pin, Pin.IN (default) or Pin.OUT.
value – New value for the pin, 0 or 1.
- Pin.value(args)
Get or set the digital value of the pin.
If no arguments are passed, the method returns the current value of the pin. If one argument is passed, it sets the pin to the specified value.
- Parameters:
args – Optional argument to set the pin value.
- Pin.on()
Set the pin to a high state (1).
- Pin.off()
Set the pin to a low state (0).