Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion industry/scpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,71 @@ config SCPI_PARSER
tristate "SCPI instrument side parser"
default n

if SCPI_PARSER

menu "SCPI parser unit support"

config SCPI_PARSER_UNITS_IMPERIAL
bool "Imperial units"
default n

config SCPI_PARSER_UNITS_ANGLE
bool "Angle units"
default n

config SCPI_PARSER_UNITS_PARTICLES
bool "Particle units"
default n

config SCPI_PARSER_UNITS_DISTANCE
bool "Distance units"
default n

config SCPI_PARSER_UNITS_MAGNETIC
bool "Magnetic units"
default n

config SCPI_PARSER_UNITS_LIGHT
bool "Light units"
default n

config SCPI_PARSER_UNITS_ENERGY_FORCE_MASS
bool "Energy, force, and mass units"
default n

config SCPI_PARSER_UNITS_TIME
bool "Time units"
default n

config SCPI_PARSER_UNITS_TEMPERATURE
bool "Temperature units"
default n

config SCPI_PARSER_UNITS_RATIO
bool "Ratio units"
default n

config SCPI_PARSER_UNITS_POWER
bool "Power units"
default y

config SCPI_PARSER_UNITS_FREQUENCY
bool "Frequency units"
default y

config SCPI_PARSER_UNITS_ELECTRIC
bool "Electric units"
default y

config SCPI_PARSER_UNITS_ELECTRIC_CHARGE_CONDUCTANCE
bool "Electric charge and conductance units"
default n

endmenu

config SCPI_PARSER_DEMO
bool "Enable the SCPI parser library demo"
default n
depends on SCPI_PARSER

if SCPI_PARSER_DEMO

Expand All @@ -23,3 +84,5 @@ config SCPI_PARSER_DEMO_STACKSIZE
default DEFAULT_TASK_STACKSIZE

endif

endif
18 changes: 18 additions & 0 deletions industry/scpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ CFLAGS += -DHAVE_SNPRINTF
CFLAGS += -DHAVE_STRNDUP
CFLAGS += -DHAVE_STRNCASECMP

SCPI_UNIT = $(if $(filter y,$(CONFIG_SCPI_PARSER_UNITS_$(1))),1,0)
SCPI_UECC = $(call SCPI_UNIT,ELECTRIC_CHARGE_CONDUCTANCE)

CFLAGS += -DUSE_UNITS_IMPERIAL=$(call SCPI_UNIT,IMPERIAL)
CFLAGS += -DUSE_UNITS_ANGLE=$(call SCPI_UNIT,ANGLE)
CFLAGS += -DUSE_UNITS_PARTICLES=$(call SCPI_UNIT,PARTICLES)
CFLAGS += -DUSE_UNITS_DISTANCE=$(call SCPI_UNIT,DISTANCE)
CFLAGS += -DUSE_UNITS_MAGNETIC=$(call SCPI_UNIT,MAGNETIC)
CFLAGS += -DUSE_UNITS_LIGHT=$(call SCPI_UNIT,LIGHT)
CFLAGS += -DUSE_UNITS_ENERGY_FORCE_MASS=$(call SCPI_UNIT,ENERGY_FORCE_MASS)
CFLAGS += -DUSE_UNITS_TIME=$(call SCPI_UNIT,TIME)
CFLAGS += -DUSE_UNITS_TEMPERATURE=$(call SCPI_UNIT,TEMPERATURE)
CFLAGS += -DUSE_UNITS_RATIO=$(call SCPI_UNIT,RATIO)
CFLAGS += -DUSE_UNITS_POWER=$(call SCPI_UNIT,POWER)
CFLAGS += -DUSE_UNITS_FREQUENCY=$(call SCPI_UNIT,FREQUENCY)
CFLAGS += -DUSE_UNITS_ELECTRIC=$(call SCPI_UNIT,ELECTRIC)
CFLAGS += -DUSE_UNITS_ELECTRIC_CHARGE_CONDUCTANCE=$(SCPI_UECC)

ifneq ($(CONFIG_SCPI_PARSER_DEMO),)
MAINSRC = $(SCPI_UNPACK)/examples/test-interactive/main.c
CSRCS += scpi-def.c
Expand Down
Loading