4.1.3 GET_LINE_CODING Command and its Response
The GET_LINE_CODING command retrieves the current UART configuration.
Send this request through Endpoint 0x0, with the parameters described in the
GET_LINE_CODING - Command table, to retrieve the current
UART configuration. The configuration can be read from Endpoint 0x00 in the format given
in the GET_LINE_CODING - Response table.
| Byte Index | Command | Description | |
|---|---|---|---|
| 0 | 0xA1 | bmRequestType | Host to device, class-specific, Interface 0 |
| 1 | 0x21 | bRequest | Read the UART baud rate, stop bits, parity, and data width |
| 2 | 0x00 | wValue – lower byte | Reserved |
| 3 | 0x00 | wValue – higher byte | |
| 4 | 0x00 | wIndex – lower byte | Interface 0 |
| 5 | 0x00 | wIndex – higher byte | |
| 6 | 0x07 | wLength – lower byte | Payload length in bytes |
| 7 | 0x00 | wLength – higher byte | |
| Byte Index | Response | Description | |
|---|---|---|---|
| 0 | L(Baud) | dwBaud – lowest byte | The baud rate in 32-bit hexadecimal format |
| 1 | H1(Baud) | dwBaud – higher byte | |
| 2 | H2(Baud) | dwBaud – next higher byte | |
| 3 | H3(Baud) | dwBaud – highest byte | |
| 4 |
|
1 Stop bit 1.5 Stop bit 2 Stop bits | Number of stop bits |
| 5 |
|
No parity Odd parity Even parity | Data parity |
| 6 |
|
5-bit data width 6-bit data width 7-bit data width 8-bit data width | Data byte width |
