![]() |
MelexisIO SCPI Commands
|
This document describes the SCPI command interface implemented in commands_i2c.c for I2C and FMPI2C control on the Melexis IO STM32 platform.
The commands_i2c.c file provides SCPI-like commands for initializing, deinitializing, configuring, and performing data transfers over the I2C and FMPI2C interfaces. The commands support both the main FMPI2C peripheral and a secondary I2C2 peripheral, with options for memory and direct read/write operations, timing configuration, and advanced I2C features.
| Command Pattern | Description |
|---|---|
:I2C:INFO | Print FMPI2C info (clock, timing, filters, etc.) |
:I2C:INIT | Initialize FMPI2C (pins SCL/SDA) |
:I2C:DEINIT | Deinitialize FMPI2C |
:I2C:TimingRegister «val» | Set timing register (uint32) |
:I2C:TimingRegister? | Get timing register |
:I2C:FREQuency «freq» | Set I2C frequency (e.g. 100k, 400k, 1MA) |
:I2C:FastModePlus «bool» | Set fast mode plus (ON/OFF, 1/0, TRUE/FALSE) |
:I2C:FastModePlus? | Get fast mode plus status |
:I2C:AnalogFilter «bool» | Set analog filter (ON/OFF, 1/0, TRUE/FALSE) |
:I2C:AnalogFilter? | Get analog filter status |
:I2C:DigitalFilter «0-15» | Set digital filter coefficient |
:I2C:DigitalFilter? | Get digital filter coefficient |
:I2C:MemReaD «dev,mem,sz,cnt» | Read memory (dev addr, mem addr, mem addr size, count) |
:I2C:MemWRite «dev,mem,sz,data» | Write memory (dev addr, mem addr, mem addr size, data bytes) |
:I2C:ReaD «dev,cnt» | Read from device (dev addr, count) |
:I2C:WRite «dev,data» | Write to device (dev addr, data bytes) |
:I2C:EXCHange «dev,cnt,data» | Write and/or read to/from device (dev addr, count, data bytes, ...) |
| Command Pattern | Description |
|---|---|
:I2C2:INFO | Print I2C2 info |
:I2C2:INIT | Initialize I2C2 (pins A2/A3) |
:I2C2:DEINIT | Deinitialize I2C2 |
:I2C2:ClockSpeed «val» | Set I2C2 clock speed (Hz) |
:I2C2:AddressingMode «0/1» | Set addressing mode (0=7BIT, 1=10BIT) |
:I2C2:DualAddressMode «bool» | Set dual address mode (ON/OFF, 1/0, TRUE/FALSE) |
:I2C2:GeneralCallMode «bool» | Set general call mode (ON/OFF, 1/0, TRUE/FALSE) |
:I2C2:NoStretchMode «bool» | Set no stretch mode (ON/OFF, 1/0, TRUE/FALSE) |
:I2C2:PullUpDown «0/1/2» | Set GPIO pull (0=No Pull, 1=Pull-Up, 2=Pull-Down) |
:I2C2:MemReaD «dev,mem,sz,cnt» | Read memory (dev addr, mem addr, mem addr size, count) |
:I2C2:MemWRite «dev,mem,sz,data» | Write memory (dev addr, mem addr, mem addr size, data bytes) |
:I2C2:ReaD «dev,cnt» | Read from device (dev addr, count) |
:I2C2:WRite «dev,data» | Write to device (dev addr, data bytes) |
:I2C2:EXCHange «dev,cnt,data» | Write and/or read to/from device (dev addr, count, data bytes, ...) |
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response:
Command sent:
Response: