Commit graph

587 commits

Author SHA1 Message Date
Alejandro Hidalgo Muñoz de Rivera 53082e8ce5 samples: Updated README for thermometer sample
Updated README.txt to .rst format.

Signed-off-by: Alejandro Hidalgo Muñoz de Rivera <ahmrivera@gmail.com>
2023-03-21 09:36:17 +01:00
Nick Ward c49a6a0b0c samples: sensor: bq274xx: add test for CONFIG_BQ274XX_PM=n
Adds a test for BQ274XX driver option CONFIG_BQ274XX_PM=n.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-03-16 21:40:18 -04:00
Andrei Emeltchenko 8a229732df samples: sensor_shell: Fix return code for sensor_shell
Fix return code from boolean (probably typo) to int.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-03-08 13:16:19 +01:00
Yuval Peress 8760829064 sample: add trigger support to sensor shell sample
Automatically add trigger callbacks to any sensor that supports the
data ready trigger. Use a window average in order to avoid too many
logs.

Signed-off-by: Yuval Peress <peress@google.com>
2023-03-06 10:44:52 -06:00
Hiroki Tada 01a44000e8 samples: die_temp_polling: Add esp32c3 overlay
- Add overlay for the esp32c3 board to die_temp_polling sample.
- Add aliases for the die_temp_polling sample to esp32c3 dtsi.

Testing Environment:
esp32c3-devkitC-02

Signed-off-by: Hiroki Tada <tada.hiroki@fujitsu.com>
2023-03-06 09:34:18 -06:00
Jamie McCrae af78cbdc99 samples and tests: Add REQUIRED to Zephyr find_package call
Adds REQUIRED to samples and tests for finding the zephyr package
to align all samples and tests with the same call and parameters.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-02 09:58:27 +01:00
Andriy Gelman 1e2111c9e5 samples: die_temp_polling: Add xmc45_relax_kit overlay
Adds overlay for the xmc45_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-02-20 11:14:15 +01:00
Guillaume Gautier 4635af398b dts: arm: st: Remove obsolete properties for all STM32 ADC from dts
In all STM32 dts, remove all reference to the following properties:
- has-temp-channel
- has-vref-channel
- has-vbat-channel

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-25 15:00:21 +00:00
Guillaume Gautier 009fcb9305 dts: arm: st: Add ADC temperature and Vref channels for all STM32
Now that we have a binding to define the channel number for temperature
and Vref measurement, update all dtsi to include the information.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-25 15:00:21 +00:00
Jeppe Odgaard 74b94b4dff boards: add rt1050 qdec pinmux and overlay
Add a qdec pinctrl definition for rt1050.
Add an overlay in the qdec sample to support rt1050.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-01-24 10:21:39 -06:00
Jeppe Odgaard 35d60dbd0e samples: sensor: add qdec emulation support
Add emulation option to the qdec sample.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-01-24 10:21:39 -06:00
TOKITA Hiroshi b70d399a34 samples: sensor: Add CPU temperature monitor sample
Add a polling sample for CPU temperature monitor.
This sample demonstrates how to data fetch and print to the console.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-01-19 15:32:41 -06:00
Jamie McCrae 11c7371f99 samples: Explicitly disable boot USB device support init at boot
Disables having USB enabled for boards that configure USB CDC for
console, shell or logging at bootup in applications that enable USB
to prevent a conflict arising whereby USB is registered from
multiple points and later calls fail.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-10 12:21:10 +01:00
Fabio Baltieri 792469aae9 yamllint: indentation: fix files in samples/
Fix the YAML files indentation for files in samples/.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 14:23:53 +01:00
Fabio Baltieri 620bd5d817 samples, tests: fix key-duplicates in sample.yaml files
Fix few duplicate keys warnings in sample.yaml and testcase.yaml files,
this is going to enable some tests that were otherwise being
unintentionally ignored.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 10:34:18 +01:00
Fabio Baltieri 7db1d17ee3 yamllint: fix all yamllint line-length errors
Fix all line-length errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(line-length)'

Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Fabio Baltieri 5c32300861 yamllint: fix all yamllint truthy errors
Fix all thruthy errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(truthy)'

This only accepts true/false for boolean properties. Seems like python
takes all sort of formats:

https://github.com/yaml/pyyaml/blob/master/lib/yaml/constructor.py#L224-L235

But the current specs only mention "true" or "false"

https://yaml.org/spec/1.2.2/#10212-boolean

Which is the standard yamllint config.

Excluding codeconv and workflow files, as some are using yes/no instead
in the respective documentation.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Francois Ramu d75292feea samples: sensor: vbat of the stm32u5x channel 14 on ADC4
Enable the channel14 of the ADC4 of the stm32U5x
to measure the vbat voltage with internal on channel 14
of the ADC4 on the nucleo board or disco kit.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-12-27 15:33:06 +01:00
Steffen Jahnke a4d67d3c85 sensor: amg88xx: fix sensor sample
Since logging with printk() was updated in commit  c5a40e3,
the amg88xx sample dropped around 60 of the messages after
sampling. Increasing log buffer size will fix this issue.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2022-12-19 18:18:48 +01:00
Marek Matej ac0cbe3c4e samples: esp32: temp: CPU die temperature sample
Add die temperature measure sample for ESP32 targets
esp32s2_saola, esp32c3_devkitm.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-15 18:21:39 +01:00
Dinesh Kumar K 4eb1a34cac samples: sensor: Added sample for grow_r502a fingerprint sensor
Added sample application for grow_r502a fingerprint sensor

Signed-off-by: Dinesh Kumar K <dinesh@linumiz.com>
2022-12-14 18:44:29 +01:00
Anas Nashif ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Mirai Shinjo d595148c98 samples: sensor: doc: fix a code block formatting issue
This commit fixes a code block formatting issue in the stm32_vbat_sensor
sample documentation.

Signed-off-by: Mirai Shinjo <miraishinjo@icloud.com>
2022-11-22 12:54:44 +09:00
Anas Nashif 67e8d03280 tests/samples: fix some missing tags
Many driver samples or tests only had 'drivers' as the tag, without a
tag indicating what driver that is exactly, so add some missing tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-14 07:08:04 -05:00
Maureen Helm 0ddc2a9b65 drivers: sensor: Remove brackets from sensor info shell command output
Brackets were originally used in the sensor info shell command output to
make it obvious when a field is a null string, however they incorrectly
suggest that a field is an array. Remove the brackets and conditionally
print "(null)" instead.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-11-02 15:40:24 +09:00
Maureen Helm 387a108b5f samples: sensor: Fix sensor shell application build command
Fixes the sensor shell sample application build command to use the
correct source directory.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-11-02 15:40:24 +09:00
Maureen Helm 32aa66d57e samples: sensor: Enable sensor info shell command
Enables the new sensor info shell command in the sensor shell sample
application and documents its usage.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-31 11:21:37 +01:00
Maureen Helm eef0e1a180 samples: sensor: Update sensor shell documentation
Updates the sensor shell sample documentation to reflect the currently
supported sensor shell commands. The list and list_channels commands
were removed in commit 95b4d37230 but the
documentation wasn't updated at the time.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-31 11:21:37 +01:00
Stephanos Ioannidis 9dd570f8a2 tests: Remove explicit newlib nano override
This commit removes explicit `CONFIG_NEWLIB_LIBC_NANO=n` overrides
because the newlib nano variant is no longer enabled by default when
it is available.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-19 16:02:51 +02:00
James Johnson 0eaff5a11d drivers: sensor: add ams AS621x Temperature Sensor driver support
Added support for the AMS AS621x series of temperature sensors as a
variant of the TI TMP108 temperature sensor.

Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
Signed-off-by: James Johnson <james.johnson672@t-mobile.com>
2022-10-07 10:01:47 +02:00
Valerio Setti 2bcc6f9194 samples: sensor: adding a sample application for the STM32 qdec driver
Sample application for the STM32 quadrature encoder driver

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-10-03 10:10:31 +02:00
Stephanos Ioannidis e04e9f3958 samples: sensor: th02: Fix outdated link to TH02 datasheet
This commit replaces the outdated link to the TH02 sensor datasheet
with the link to the Si7005 datasheet (the original part name of TH02
is Si7005).

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis 3d80f937fb samples: sensor: ds18b20: Fix incorrect link
This commit fixes the incorrect link to the DS18B20 sensor product
page.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis 25062a51c0 samples: sensor: bme280: Fix incorrect link
This commit fixes the incorrect link to the BME250 sensor product page.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Daniel Leung 47bf9ee51c samples: sensors: add a new one for lsm6dso as I2C on I3C bus
This adds some skeleton files to enable using LSM6DSO on I3C bus
while still acting like a I2C device. The new files here are
simply to provide a way to have overlay for each board that
would not conflict with the pure I2C one. Also this is set to
build only because it require external hardware that is not
necessary on the board being tested.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Daniel Leung 34e353c0a8 samples: sensors: adds a new one for lps22hh on I3C bus
This adds some skeleton files to enable using LPS22HH on I3C bus.
This still uses the C source file for I2C. The new files here
are simply to provide a way to have overlay for each board that
would not conflict with the I2C one. Also this is set to build
only because it may require external hardware that is not
necessary on the board being tested.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Erwan Gouriou 14ae669a8d samples: sensors: lsm6dso: Fix regex filter following unit fix
https://github.com/zephyrproject-rtos/zephyr/pull/49068 fixed units
displayed by  the sample from dps to rad/s but did not update the
sample twister regex filter.
Fix the filter as well to allow testing in CI.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-02 11:24:08 +00:00
Erwan Gouriou 5106b9cc2a samples: hts221: Fix testing support by twister
-In order to allow non regression of trigger mode in CI, add
a dedicated configuration for this mode
-Fix regex
-Use a filter on compat rather than using a fixture

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-01 13:15:14 -05:00
Yannick Thesen 8700bfd789 drivers: sensor: Added sample for the Würth Elektronik WSEN-HIDS sensor.
Added sample for the WSEN-HIDS humidity and temperature sensor.

Signed-off-by: Yannick Thesen <Yannick.Thesen@we-online.de>
2022-08-31 21:47:58 +00:00
TLIG Dhaou 366a32bccf Samples: sensor: stm32_temp_sensor: Edit the yaml file of the sample
-Edit the yaml file of the sample in order to execute tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-08-24 11:35:45 +02:00
Gerard Marull-Paretas a202341958 devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).

Automated using:

```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Gerard Marull-Paretas e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Maureen Helm 4dfc43e296 samples: sensor: Fix displayed gyro units in lsm6dso sample
The sensor driver API specifies gyroscope units in radians/second, not
degrees/second. Fix the lsm6dso sample application printk string to
display the correct units.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-17 17:06:23 +02:00
Maureen Helm 17437f9dc5 samples: sensor: Remove adxl372 accelerometer sample
The accel_polling sample application supports the adxl372 driver, so we
can remove this redundant driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-09 12:27:07 +02:00
Maureen Helm 5306db05af samples: sensor: Remove adxl362 accelerometer sample
The accel_polling sample application supports the adxl362 driver, so we
can remove this redundant driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-09 12:27:07 +02:00
TOKITA Hiroshi 4c326ea5da samples: sensor: accel_polling: Correct integration platform name
bl5340_dvk is a non-exists target.
I fix it to bl5340_dvk_cpuapp to fix the CI error.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-08-05 00:00:09 +09:00
TOKITA Hiroshi 9179350c40 samples: sensor: Add 3-Axis accelerometer polling sample
Add a polling sample for 3-Axis accelerometers.
This sample demonstrates how to data fetch and print to the console.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-08-04 09:06:57 -05:00
Kumar Gala 5d36157c7c sensors: Remove unnecessary Kconfig setting of sensors
Sensor Kconfig sybmols should be enabled if CONFIG_SENSOR=y
and the devicetree node for the sensor is enabled.  We can
remove explicitly enabling specific sensor drivers in .conf
files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 15:18:56 +02:00
Kumar Gala ef964ca4e1 samples: th02: simplify sample and use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE to remove usage of
device_get_binding.  Additionally simplfy the sample to
just access a single TH02 device.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 09:39:51 +02:00