![]() |
MelexisIO SCPI Commands
|
This document describes the SCPI-like command interface implemented in commands_adc.c for controlling and reading the ADC (Analog-to-Digital Converter) pins on the STM32 microcontroller.
The commands_adc.c file provides a set of commands for initializing ADC pins, configuring their sample times, and reading their analog voltage values. These commands are accessible via a terminal or remote interface that supports the defined command patterns.
| Command Pattern | Handler | Tag | Description |
|---|---|---|---|
:A0:ADC:INIT | CMD_AdcInit | ADC_A0_PIN | Initialize ADC A0 pin |
:A1:ADC:INIT | CMD_AdcInit | ADC_A1_PIN | Initialize ADC A1 pin |
:A3:ADC:INIT | CMD_AdcInit | ADC_A3_PIN | Initialize ADC A3 pin |
:A0:ADC:SampleTime | CMD_AdcSampTime | ADC_A0_PIN | Set sample time for ADC A0 pin |
:A1:ADC:SampleTime | CMD_AdcSampTime | ADC_A1_PIN | Set sample time for ADC A1 pin |
:A3:ADC:SampleTime | CMD_AdcSampTime | ADC_A3_PIN | Set sample time for ADC A3 pin |
:A0:ADC:SampleTime? | CMD_AdcSampTimeQ | ADC_A0_PIN | Query sample time for ADC A0 pin |
:A1:ADC:SampleTime? | CMD_AdcSampTimeQ | ADC_A1_PIN | Query sample time for ADC A1 pin |
:A3:ADC:SampleTime? | CMD_AdcSampTimeQ | ADC_A3_PIN | Query sample time for ADC A3 pin |
:A0:ADC? | CMD_AdcRead | ADC_A0_PIN | Read voltage from ADC A0 pin |
:A1:ADC? | CMD_AdcRead | ADC_A1_PIN | Read voltage from ADC A1 pin |
:A3:ADC? | CMD_AdcRead | ADC_A3_PIN | Read voltage from ADC A3 pin |
» Note: Commands for A2 are present in the code but commented out or marked as TODO.
:A0:ADC:INIT, :A1:ADC:INIT, :A3:ADC:INIT:A0:ADC:SampleTime «cycles» (cycles: 3, 15, 28, 56, 84, 112, 144, 480):A0:ADC:SampleTime?:A0:ADC?Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response: