7.1.1 IO_SetConfiguration Command and its Response
The IO_SetConfiguration command (0x60) configures the
specified I/O pin with the selected settings:
The
bPinSetting value includes the following bit fields:- Bit 7,
Idle-State– valid only for an output pin- 0 → Idle state is Low
- 1 → Idle state is High
- Bit 6:5,
AlertEdge– valid only for an alert pin- 00 → Alert/Interrupt disabled
- 01 → Alert/Interrupt on falling edge
- 10 → Alert/Interrupt on rising edge
- 11 → Alert/Interrupt on both the edges
ClkDiv– valid only for the CLKO pin- 00 → 6 MHz clock
- 01 → 4 MHz clock
- 10 → 2 MHz
- 11 → 1 MHz
- Bit 4,
Open-Drain– valid only for an output pin- 0 → The pin is not a open-drain pin
- 1 → The pin is a open-drain pin
- Bit 3,
PUSel– valid only for an input pin- 0 → The pin is not pulled up internally
- 1 → The pin is pulled up internally
- Bit 2,
IODir- 0 → The pin is a output pin
- 1 → The pin is a input pin
- Bit 1:0,
IODesignation– varies with the I/O pin selected- 00 → GPIO function
- 01 → CTS/RTS/RXA/TXA/USBCFG/USBSPND function
- 10 → CS3/CS2/CS1/I2CTO/CS0/SPIA function
- 11 → Alert0/I2CA/Alert1/CLKO/Alert2/Alert3 function
This command is sent through Endpoint 0x04 (OUT). The response is read through Endpoint 0x84 (IN).
| Byte Index | Command | Description | |
|---|---|---|---|
| 0 | 0x60 | Command code | Configures the specified I/O pin |
| 1 |
|
IONum: IO0 IO1 IO2 IO3 IO4 IO5 | I/O number |
| 2 | bPinSetn | IOn setting register value | I/O setting register value for the selected pin |
| Byte Index | Response | Description | |
|---|---|---|---|
| 0 | 0x60 | Returns the command code | Returns whether the status of the command was accepted |
| 1 | 0x20 | Accepted - successful | The command is accepted and acted upon |
0x60 | Rejected – invalid configuration | The command rejected because the configuration is invalid | |
0x64 | Rejected – locked | The command rejected because the device configurations are locked | |
