| Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 |
|---|---|---|---|---|---|---|---|
| GPIO_ SET _PWM _CFG (0x07) | ECHO |
|
MASK | T0L | T0H | T1L | T1H |
The GPIO_SET_PWM_CFG command configures pulse width modulation (PWM) settings for specified IO pins.
IO pins have to be switched to PWM mode using the GPIO_SET_CFG command. GPIO_SET_PWM_CFG command can be used prior to GPIO_SET_CFG. If IO pin is already in PWM mode, the settings are applied immediately.
PWM mode is configured specifying the high time (T1) and low time (T0) in ms. These values can vary from 1 ms to 65.535 seconds (65535 ms).
Command is an 8-byte array of the following format:
For convenience GPIO_SET_PWM_CFG_CMD structure is declared in reports.h file:
typedef struct _GPIO_SET_PWM_CFG_CMD
{
unsigned char id; // = GPIO_SET_PWM_CFG;
unsigned char echo;
unsigned char on: 4;
unsigned char port: 4;
unsigned char mask;
unsigned short t0;
unsigned short t1;
} __PACKED_ATTR GPIO_SET_PWM_CFG_CMD, *PGPIO_SET_PWM_CFG_CMD;
GPIO-24 adapter sends GPIO_SET_PWM_CFG response after command execution.