IOP – General-Purpose I/O Polarity
Gets/sets the polarity [value] of all general-purpose I/O ports.
Access: Read/Write
Category: I/O
Applies to: 2CR, 2ED, 2EX, 4CR, 4ED, 4EX, 8CR
ASCII IOP
IOP=[value]
Syntax
Read
IOP
Write
IOP=[value]
|
[value] is a 2-bit value to set polarity of the configurable I/O. Bit 0 is set to 0 for negative input logic (active low), 1 for positive input logic (active high) Bit 1 is set to 0 for negative output logic (active low), 1 for positive output logic (active high) |
Reply
Command is accepted and executed
Read
Returns the value set (0-3, 00b-11b).
|
Bit |
Description |
Setting |
|
|
0 |
Logic of input setting |
0 - Negative logic Active Low |
1 - Positive logic Active High |
|
1 |
Logic of output setting |
0 - Negative logic Active Low |
1 - Positive logic Active High |
IOP command
Write
OK
Command cannot be processed
An error message is returned. See Error Codes
Example
Read
IOP * Returns value for general purpose I/O polarity setting
Write
IOP=1 * Set input polarity to 1 positive logic, active high.
IOP=3 * Set input and output polarity to 1 positive logic, active high.
Notes
To write the value to the device’s flash memory, use the STORE command.
See also
AI, DI, DIP, DO, DOBOOT, DOP, IO, IOBOOT, IOCFG