USB-IO Interface Adapter GPIO-24. Programmers Reference Manual.


3.1.10. GPIO_MAKE_PULSE

Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
GPIO _MAKE _PULSE (0x0A) ECHO GPIO VAL TL TH 0 0

The GPIO_MAKE_PULSE command instructs GPIO-24 adapter to make a single pulse on selected I/O pin. Pulse length has to be specified in bytes 4 and 5 and can vary from 1 ms to 65.535 seconds (65535 ms). After the pulse is finished the pin remains configured for output.

Command is an 8-byte array of the following format:

Byte 0: GPIO_MAKE_PULSE (0x0A)
This byte contains command identifier (command type). It should be set to 0x0A.
Byte 1: ECHO
This byte can be used to associate a response received from GPIO-24 adapter with specific command. Response will contain exactly the same value in its echo byte.
Byte 2: GPIO
GPIO pin number:
  • 0..7 corresponds to GPIO PORT A pins 0..7
  • 8..15 corresponds to GPIO PORT B pins 0..7
  • 16..23 corresponds to GPIO PORT C pins 0..7
Byte 3: VAL
Logical level of the pulse:
  • 0 - Negative pulse.
  • 1 - Positive pulse.
Byte 4: TL
Least significant byte (low byte) of pulse length in ms.
Byte 5: TH
Most significant byte (high byte) of pulse length in ms.
Byte 6..7: Reserved
These bytes are reserved for future use and have to be set to 0.

For convenience GPIO_MAKE_PULSE_CMD structure is declared in reports.h file:

typedef struct _GPIO_MAKE_PULSE_CMD
{
   unsigned char id; //  = GPIO_MAKE_PULSE;
   unsigned char echo;
   unsigned char gpio;
   unsigned char val;
   unsigned short t;
   unsigned char reserved[2]; // must be 0
} __PACKED_ATTR GPIO_MAKE_PULSE_CMD, *PGPIO_MAKE_PULSE_CMD;

GPIO-24 adapter sends GPIO_MAKE_PULSE response after command execution.