![]() |
MelexisIO SCPI Commands
|
This document describes the SCPI command interface implemented in commands_pwm.c for PWM (Pulse Width Modulation) and frequency measurement/control on the Melexis IO STM32 platform.
The commands_pwm.c file provides SCPI-like commands for initializing, deinitializing, reading, and setting PWM and frequency on various pins. It also supports DMA and IRQ-based PWM input, as well as clock configuration for advanced timing features.
| Command Pattern | Description |
|---|---|
:A0:PWM:DMA:INIT | Init A0 for PWM DMA Input |
:A0:PWM:DMA? | Get A0 PWM DMA Data |
:A0:PWM:IRQ:INIT | Init A0 for PWM IRQ Input |
:A0:PWM:IRQ? | Get A0 PWM IRQ Data |
:A0:CLK:INIT | Clock at A0 Init |
:A0:CLK:FREQ | Set clock frequency at A0 |
:A0:DEINIT | Deinit A0 pin |
| Command Pattern | Description |
|---|---|
:A0:PWM:INIT | Init A0 as PWM input |
:A0:PWM? | Read A0 PWM |
:A0:FREQ:INIT | Init A0 as Frequency measure |
:A0:FREQ? | Read A0 Frequency in Hz |
:A0:OUT:INIT | Init A0 as PWM output |
:A0:OUT:SET | Set A0 PWM output in Hz |
:A0:OUT:SET:FREQ | Set A0 Frequency output |
:A0:PWM:DEINIT | DeInit A0 PWM Out/In |
| ... | ... (same for A1, A2, A3, SDA, SCL) |
A0 with A1, A2, A3, SDA, or SCL for similar commands on those pins.:CON:SCLK:INIT) and other SPI/UART-related pins, which can be enabled or extended as needed.CMD_Pwm_Init: Handles initialization and deinitialization for PWM/frequency modes.CMD_Pwm_Read: Reads frequency or PWM values.CMD_Pwm_Set: Sets PWM duty or frequency.CMD_PwmDmaInit, CMD_PwmDmaData: DMA-based PWM input.CMD_PwmIrqInit, CMD_PwmIrqData: IRQ-based PWM input.CMD_Clk, CMD_ClkFreq: Clock configuration.CMD_DeInit: Deinitialization of all PWM/clock/DMA resources.:A0:PWM:INIT:A0:FREQ?:A1:OUT:SET 50 (sets duty cycle):SCL:OUT:SET:FREQ 1000 (sets frequency):A0:PWM:DMA:INIT:A0:PWM:DMA? 10 (reads 10 samples)Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response: