Datasheet
2014 Microchip Technology Inc. DS20005292A-page 45
MCP2221
3.1.11 SET GPIO OUTPUT VALUES
This command is used to change the GPIO output
value for those GP pins assigned for GPIO operation
(GPIO outputs).
TABLE 3-32: COMMAND STRUCTURE
Byte
Index
Function
Description
Value Effect
0 0x50 Set GPIO Output Values – command code.
1Don’t
care
2 Alter GP0 output
(enable/disable)
0x00 Do not modify GP0 output (if GP0 is set as GPIO output).
Any other
value
The next byte (index 3) will be the value used to set GP0 output (only if
GP0 is set for GPIO output).
3 GP0 output value 0x00 GP0 (if set up for GPIO output operation) will take a logical value of ‘0’.
Any other
value
GP0 (if set up for GPIO output operation) will take a logical value of ‘1’.
4 Alter GP0 pin direction
(enable/disable)
0x00 Leave the GP0 GPIO designation as is (input or output).
Any other
value
The next byte (index 5) will be the value used to set GP0’s pin direction
(only if GP0 is set for GPIO operation).
5 GP0 pin direction
(input or output)
0x00 Set GP0 GPIO as output.
Any other
value
GP0 (if set up for GPIO operation) will be set as a digital input.
6 Alter GP1 output
(enable/disable)
0x00 Do not modify GP1 output (if GP1 is set as GPIO output).
Any other
value
The next byte (index 7) will be the value used to set GP1 output (only if
GP1 is set for GPIO output).
7 GP1 output value 0x00 GP1 (if set up for GPIO output operation) will take a logical value of ‘0’.
Any other
value
GP1 (if set up for GPIO output operation) will take a logical value of ‘1’.
8 Alter GP1 pin direction
(enable/disable)
0x00 Leave the GP1 GPIO designation as is (input or output).
Any other
value
The next byte (index 9) will be the value used to set GP1’s pin direction
(only if GP1 is set for GPIO operation).
9 GP1 pin direction
(input or output)
0x00 Set GP1 GPIO as output.
Any other
value
GP1 (if set up for GPIO operation) will be set as a digital input.
10 Alter GP2 output
(enable/disable)
0x00 Do not modify GP2 output (if GP2 is set as GPIO output).
Any other
value
The next byte (index 11) will be the value used to set GP2 output (only if
GP2 is set for GPIO output).
11 GP2 output value 0x00 The GP2 (if GP2 is set-up for GPIO output operation) will take a logical
value of ‘0’.
Any other
value
GP2 (if GP2 is set-up for GPIO output operation) will take a logical value
of ‘1’.
12 Alter GP2 pin direction
(enable/disable)
0x00 Leave the GP2 GPIO designation as is (input or output).
Any other
value
The next byte (index 13) will be the value used to set GP2’s pin direction
(only if GP2 is set for GPIO operation).
13 GP2 pin direction
(input or output)
0x00 Set GP2 GPIO as output.
Any other
value
GP2 (if set up for GPIO operation) will be set as a digital input.
14 Alter GP3 output
(enable/disable)
0x00 Do not modify GP3 output (if GP3 is set as GPIO output).
Any other
value
The next byte (index 11) will be the value used to set GP3 output (only if
GP3 is set for GPIO output).