Datasheet

MCP2221
DS20005292A-page 48 2014 Microchip Technology Inc.
3.1.12 GET GPIO VALUES
This command is used to retrieve the GPIO direction
and pin value for those GP pins assigned for GPIO
operation (GPIO inputs or outputs).
3.1.12.1 Responses
TABLE 3-34: COMMAND STRUCTURE
Byte
Index
Value Effect
0 0x51 Get GPIO Values – command code
1-63 Don’t
care
TABLE 3-35: RESPONSE 1 STRUCTURE
Byte
Index
Function
Description
Value Effect
0 0x51 Get GPIO Values – command code
1 0x00 Command completed successfully
2 GP0 pin value 0xEE If GP0 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP0 is already set for GPIO operation, the value represents the GP0 logic
pin value.
3GP0 direction
value
0xEF If GP0 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP0 is already set for GPIO operation, the value represents the GP0 pin
designation (0x00 for output and 0x01 for input).
4 GP1 pin value 0xEE If GP1 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP1 is already set for GPIO operation, the value represents the GP1 logic
pin value.
5GP1 direction
value
0xEF If GP1 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP1 is already set for GPIO operation, the value represents the GP1 pin
designation (0x00 for output and 0x01 for input).
6 GP2 pin value 0xEE If GP2 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP2 is already set for GPIO operation, the value represents the GP2 logic
pin value.
7GP2 direction
value
0xEF If GP2 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP2 is already set for GPIO operation, the value represents the GP2 pin
designation (0x00 for output and 0x01 for input).
8 GP3 pin value 0xEE If GP3 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP3 is already set for GPIO operation, the value represents the GP3 logic
pin value.
9GP3 direction
value
0xEF If GP3 is not set for GPIO operation
Other values
(0x00 or 0x01)
If GP3 is already set for GPIO operation, the value represents the GP3 pin
designation (0x00 for output and 0x01 for input).
10-63 Don’t care