SCPI parser and status register model implementation (device side) written in C
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Ondřej Hruška 19bdb56748 Fixed bug in error handling causing good commands to be discarded after an error 9 years ago
source Fixed bug in error handling causing good commands to be discarded after an error 9 years ago
.gitignore Added some more builtins, cleaning 9 years ago
LICENSE Initial commit 9 years ago
Makefile fixed stupid bug causing a warning 9 years ago
README.md readme 9 years ago
errorgen.php error table and error string building function added 9 years ago
main.c fixed stupid bug causing a warning 9 years ago
scpi fixed some small style errors and warnings 9 years ago
scpi.pro Fixed bug in error handling causing good commands to be discarded after an error 9 years ago
scpi.pro.user Fixed bug in error handling causing good commands to be discarded after an error 9 years ago
style.astylerc initial 9 years ago

README.md

SCPI parser

This library provides a simple ("KISS") SCPI implementation for embedded devices (instruments).

The implementation is not 100% complete, but it's sufficient for basic SCPI communication.

What's supported

  • The hierarchical header model (commands with colon)
  • Long and short header variants (eg. SYSTem?)
  • Easy configuration with one const array of structs and callback functions (see main.c)
  • Semicolon for chaining commands on the same level
  • String, Int, Float, Bool arguments
  • Block data argument with callback each N received bytes (configurable)
  • Status Register model
  • Error queue including error messages from the SCPI spec
  • All mandatory SCPI commands (headers) are implemented as built-ins

Built-in commands can be overriden in user command array.

See main.c for example of how to use the library.

What is missing

  • Setting error type flags in the ESR when error is added to queue
  • There may be some bugs in the status registers (not tested much)
  • Character data argument ("string without quotes", enum-like)
  • Number units and metric suffixes (k,M,G,m,u,n)
  • DEF, MIN, MAX, INF, NINF argument values for numbers

Support for units and "constants" (DEF etc) in numeric fields will need some larger changes to the numeric parser and SCPI_argval_t.

Feel free to propose a pull request implementing any missing features.