The GPIO_GET_HPWM_CFG command retrieves high frequency pulse width modulation (HPWM) settings for specified pin (A.5 or B.5).
| Byte 0 | GPIO_GET_HPWM_CFG | Command ID (0x15). |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | HPWM_ NUMBER | HPWM channel number. |
| Byte 3..7 | Reserved | Reserved (must be 0). |
Command is an 8-byte array of the following format:
This byte contains command ID (command type). It should be set to 0x15.
This byte is used to associate a response received from GPIO-24 adapter with a specific command. Response will contain exactly the same value in its echo byte.
The HPWM channel number.
0 – B.5 pin;
1 – A.5 pin.
These bytes are reserved for future usage and must be set to 0.
For convenience GPIO_GET_HPWM_CFG_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_HPWM_CFG response after command execution. The HPWM configuration settings are specified inside the response.
The GPIO_GET_HPWM_CFG response contains high frequency
pulse width modulation (HPWM) configuration settings for I/O pin,
specified with GPIO_GET_HPWM_CFG
command.
| Byte 0 | GPIO_GET_HPWM_CFG | Response ID (0x15). |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | ST | Status of the command execution. |
| Byte 3 | HPWM_NUMBER | HPWM channel number. |
| Byte 4 | TL | PWM period (least significant byte). |
| Byte 5 | TH | PWM period (most significant byte). |
| Byte 6 | T1L | High time of the pulse (least significant byte). |
| Byte 7 | T1H | High time of the pulse (most significant byte). |
Response is an 8-byte array of the following format:
Response ID (response type). This byte will contain 0x15.
Echo byte copied from the corresponding command. It is used to associate the response with the specific command.
Status of the command execution:
GPIO_ST_SUCCESS (0x00) – The I/O pins were successfully configured.
GPIO_ST_INVALID_PORT (0x03) – Invalid port number has been specified.
The HPWM channel number.
0 – B.5 pin;
1 – A.5 pin.
Byte 4: TL – least significant byte (low byte) of PWM period.
Byte 5: TH – most significant byte (high byte) of PWM period.
The PWM period is the sum of high time and low time of the pulse. It is specified in µs in the range from 1 to 340 µs.
Byte 6: T1L – least significant byte (low byte) of high time of the pulse.
Byte 7: T1H – most significant byte (high byte) of high time of the pulse.
High time is a time period when the output equals to 1. It is specified in µs in the range from 1 to 340 µs.
For convenience GPIO_GET_HPWM_CFG_RSP structure is declared in reports.h file.