![]() |
MelexisIO SCPI Commands
|
This document describes the SCPI command interface implemented in commands_gpio.c for GPIO (General Purpose Input/Output) control on the Melexis IO STM32 platform.
The commands_gpio.c file provides SCPI-like commands for initializing, deinitializing, reading, and writing to GPIO pins. The commands support both board and connector pins, and allow configuration as input or output.
| Command Pattern | Description |
|---|---|
:A0:GPIO:INIT:IN | Init A0 as GPIO Input |
:A0:GPIO:INIT:OUT | Init A0 as GPIO Output |
| ... | ... |
:CON:SCL:GPIO:INIT:IN | Init Connector SCL as GPIO Input |
:CON:SCL:GPIO:INIT:OUT | Init Connector SCL as GPIO Output |
| Command Pattern | Description |
|---|---|
:A0:GPIO:DEINIT | DeInit A0 as GPIO |
| ... | ... |
:CON:SCL:GPIO:DEINIT | DeInit Connector SCL as GPIO |
| Command Pattern | Description |
|---|---|
:A0:GPIO «1/0» | Set A0 GPIO Output |
| ... | ... |
:CON:SCL:GPIO «1/0» | Set Connector SCL GPIO Output |
| Command Pattern | Description |
|---|---|
:A0:GPIO? | Read A0 GPIO Input |
| ... | ... |
:CON:SCL:GPIO? | Read Connector SCL GPIO Input |
» Note: Replace A0, A1, A2, A3, SDA, SCL, TX, RX, MO, MI, SCK, CON:SCL, CON:SDA, CON:SCLK, CON:MO, CON:MI, CON:CS0, CON:CS1 with the desired pin name.
All commands are handled by the CMD_GPIO function, which interprets the tag to determine the pin, direction, and action.
:A0:GPIO:INIT:OUT:A0:GPIO 1:A0:GPIO?:A0:GPIO:DEINIT:CON:SCL:GPIO:INIT:INCommand sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
CON:.