Commit 69065fa3 authored by Jeppe Odgaard's avatar Jeppe Odgaard Committed by Johan Hedberg
Browse files

samples: sensors: add veaa_x_3 sample

Add sample for VEAA-X-3 sensor.

Signed-off-by: default avatarJeppe Odgaard <jeppe.odgaard@prevas.dk>
parent 0b94ab77
Loading
Loading
Loading
Loading
+8 −0
Changes for samples/sensor/veaa_x_3/CMakeLists.txt: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(app)

target_sources(app PRIVATE src/main.c)
+23 −0
Changes for samples/sensor/veaa_x_3/Kconfig: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
#
#  Copyright (c) 2024 Vitrolife A/S
#
# SPDX-License-Identifier: Apache-2.0
#

mainmenu "VEAA sample application"

config SAMPLE_USE_SHELL
	bool "Use sensor shell and disable loop"
	default n
	select SHELL
	select SENSOR_SHELL

config SAMPLE_LOOP_INTERVAL
	int "Sample loop delay in milliseconds"
	default 200

config SAMPLE_LOOP_INCREMENT
	int "Sample kPa increment per loop"
	default 1

source "Kconfig.zephyr"
+38 −0
Changes for samples/sensor/veaa_x_3/README.rst: 38 added lines, 0 removed lines.
Original line number Diff line number Diff line
.. veaa_x_3:

VEAA-X-3 sample
##########################

Overview
********

A sensor sample that demonstrates how to use a VEAA-X-3 device.

Building and Running
********************

This sample sets the valve setpoint then reads the actual pressure.
This is done continuously. When the maximum supported pressure is reached the setpoint is reset to
the valve's minimum supported pressure value.

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/veaa_x_3
   :board: <board to use>
   :goals: build flash
   :compact:

Sample Output
=============

.. code-block:: console

    Testing test_veaa_x_3
    Valve range: 1 to 200 kPa
    Setpoint:    1 kPa, actual:   1 kPa
    Setpoint:    2 kPa, actual:   2 kPa
    Setpoint:    3 kPa, actual:   3 kPa
    ...
    Setpoint:  199 kPa, actual: 199 kPa
    Setpoint:  200 kPa, actual: 200 kPa
    Setpoint:    1 kPa, actual:   1 kPa
    <repeats endlessly>
+35 −0
Changes for samples/sensor/veaa_x_3/boards/nucleo_h563zi.overlay: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright (c) 2024, Vitrolife A/S
 */

/* spi1 sck conflicts with dac1 channel 3 */
/delete-node/ &spi1;

/ {
	test_veaa_x_3: test_veaa_x_3 {
		status = "okay";
		compatible = "festo,veaa-x-3";
		io-channels = <&adc1 3>;
		dac = <&dac1>;
		dac-channel-id = <2>;
		dac-resolution = <12>;
		pressure-range-type = "D2";
	};

};

&adc1 {
	#address-cells = <1>;
	#size-cells = <0>;

	channel@3 {
		reg = <3>;
		zephyr,gain = "ADC_GAIN_1";
		zephyr,reference = "ADC_REF_INTERNAL";
		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
		zephyr,resolution = <12>;
	};

};
+4 −0
Changes for samples/sensor/veaa_x_3/prj.conf: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
CONFIG_ADC=y
CONFIG_DAC=y
CONFIG_SENSOR=y
CONFIG_LOG=y
Loading