Commit Graph

2208 Commits

Author SHA1 Message Date
Adam Wojasinski
beb7313fc4 drivers: clock_control_nrf: Align LF clock sources symbols to new nrfx
New nrfx release brings change of Low frequency sources symbols
in nrf_clock hal to uppercase. This commit aligns all occurrences.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-05-05 11:47:53 +02:00
Alberto Escolar Piedras
4b484051be tests/drivers modem: Add tag modem to ease filtering
Add the "modem" tag, which is already used in other
tests/samples using modems drivers, to ease filtering
of the modem drivers tests if somebody so desires.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-05-04 20:50:11 +02:00
Alberto Escolar Piedras
af3b55f04c tests/drivers/nrf_rtc_timer: Fix for nrf52_bsim
Break two busy wait loops with a Z_SPIN_DELAY
(busy_wait() conditionally compiled for the posix arch)
so this test can also be run in the nrf52_bsim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-05-04 20:50:11 +02:00
Laczen JMS
d496a17bb6 flash_simulator: add ability to use memory region
Add the ability for the flash simulator to store its contents in a
memory region.

This allows filesystems on the flash simulator to survive a reboot.
And allows subsystems (e.g. coredump) to store their info on ram while
using the (existing) flash partition backend.

Add a example (for nucleo_f411re) that shows how to configure the flash
simulator for hardware (cfg discussion #54166).

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2023-05-04 20:49:57 +02:00
Gerard Marull-Paretas
84fd4e671f drivers: sensor: ntc_thermistor: add support for generic NTC
Add support for a generic NTC, `ntc-thermistor-generic`. In this case,
the compensation table is provided via devicetree. Note that DT property
is prefixed with `zephyr,`, because while hardware related, it is linked
to a particular software implementation.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-04 20:49:48 +02:00
Gerard Marull-Paretas
44f48f6da7 drivers: sensor: zephyr_thermistor: refactor driver
Refactor driver to align a bit more with its Linux counterpart, ie,
ntc_thermistor. This driver did quite a few _unconventional_ things,
like using "zephyr," compatibles, a dedicated node for pre-computed
compensation table (referenced by the actual pseudo-device node), etc.
The comparison helper function should likely be simplified as well (to
avoid the need for custom wrapper for bsearch), but this can be done
later.

In this refactor, each thermistor gets a compatible, e.g. "epcos,xxxx".
Compatibles are known by the driver, so are compensation tables. This
simplifies devicetree files. There's no need to bother about
compensation tables in **every** board file if Zephyr supports a certain
NTC model.

In general we should respect Linux bindings, which in the end influence
how drivers are implemented. In this case, this principle resulted in
simplified, easier to use code.

For future developers, this is how support for a new NTC can be added:

1. Add to the end of the driver:

```c
 #undef DT_DRV_COMPAT
 #define DT_DRV_COMPAT vnd_model

 static __unused const struct ntc_compensation comp_vnd_model[] = {
     { x, y },
     ...,
 };

 #define DT_INST_FOREACH_STATUS_OKAY_VARGS(NTC_THERMISTOR_DEV_INIT,
                                           DT_DRV_COMPAT, comp_vnd_model)
```
3. In driver's Kconfig make sure it depends on
   DT_HAS_$DT_DRV_COMPAT$_ENABLED

Note: $X$ means _value_ of X.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-04 20:49:48 +02:00
Gerard Marull-Paretas
c60e4ec989 drivers: sensor: zephyr_thermistor: align connection type with Linux
It looks like the Zephyr thermistor driver bindings were half-copied
from Linux ntc-thermistor. Zephyr principle is to maintain compatibility
with Linux, when possible, so there's no reason to deviate here. Convert
the connection type from a custom enum to a boolean, as Linux does.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-04 20:49:48 +02:00
Benedikt Schmidt
e7bb5d2aea tests: drivers: adc: add ADS114S08
Add the ADS114S08 to the ADC tests.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-05-04 10:47:56 +02:00
Andriy Gelman
662f48a45b tests: drivers: adc_api: Add copyright header to xmc45_relax_kit
Add missing copyright header.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Andriy Gelman
e4d753ba4d tests: drivers: spi_loopback: Adds xmc47_relax_kit overlay/conf
Adds overlay and conf to run the test on xmc47_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Andriy Gelman
5fd71e35a1 tests: drivers: uart_async_api: Add xmc47_relax_kit overlay/conf
Adds overlay and conf files to run the test with the xmc47_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Andriy Gelman
f8f09300c1 boards: arm: Add xmc47_relax_kit
Adds Infineon xmc47_relax_kit board.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Henrik Brix Andersen
ef3d01d16f test: drivers: can: move build-only tests to proper location
Move the build-only test for the MCP2515 CAN controller driver to the
tests/drivers/build_all/can/ folder.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-05-01 09:30:42 -05:00
Chris Friedt
bacc8d9293 tests: drivers: dma: chan_blen: correct nodelabel filter
When attempting to add a new platform and run the suite with
`twister`, it seemed to be resulting in being statically
filtered-out. Likely, the correct filter is `test_dma0`,
assuming that `test_dma*` nodes should be enumerated starting
at 0.

Verified the fix by adding `dma` as `supported` to
`boards/arm64/bcm958402m2_a72/bcm958402m2_a72.yaml` and by
adding the `test_dma0` node to
`chan_blen_transfer/boards/bcm958402m2_a72.overlay`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
59b69b917d tests: drivers: dma: sg: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
8c6c96715f tests: drivers: dma: loop: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
7f6d976916 tests: drivers: dma: chan_link: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
5afcac5e14 tests: drivers: dma: chan_blen: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Gerard Marull-Paretas
054bb26cc5 drivers: regulator: add regulator_common_is_init_enabled
Some driver may need this information to implement a proper early
initialization procedure.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-28 20:38:17 +02:00
Aaron Massey
07ee466591 emul: Migrate all emulation use to use DT_HAS_
Remove all enabling of CONFIG_EMUL_.* in favor of automatically enabling
peripheral emulators based on the compatible string presence in the device
tree and the one true CONFIG_EMUL.

Zephyr has long since moved to a model of enabling drivers based on the
presence of their associated IC's compatible string in the final devicetree
overlay. There is no reason that emulators can't align in just the same
way, and probably ought to to remove superfluous enabling of configs.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-04-28 08:37:33 -05:00
Lucas Tamborrino
068d63d804 tests: dac: dac_api: add esp_wrover_kit overlay
Add support for esp_wrover_kit board in dac test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-04-28 14:49:08 +02:00
Lucas Tamborrino
631423bc8e tests: adc: adc_api: add esp_wrover_kit overlay
Add support for esp_wrover_kit board in adc test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-04-28 14:49:08 +02:00
Bill Waters
3e02d48e4e driver: adc: infineon: Adding ADC driver
- This includes the driver, test app, and sample app
- Only the boards\arm\cy8cproto_062_4343w board is supported for now

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2023-04-27 10:16:23 -07:00
Henrik Brix Andersen
f47b537b25 tests: drivers: build_all: rtc: api: add build-only test for PCF8523
Add a build-only test for the NXP PCF8523 RTC driver since no in-tree
boards have this chip.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2023-04-27 09:51:42 +02:00
TOKITA Hiroshi
0a24c4c869 tests: driver: adc: adc_api: add nucleo_f030r8 config
Add adc_api test configuration for nucleo_f303r8

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-04-27 09:51:32 +02:00
Maximilian Deubel
3746074073 drivers: sensor: Add driver for TI INA3221
This patch adds support for the TI INA3221 current monitor.
This is the datasheet used for reference:
https://www.ti.com/lit/gpn/ina3221

Since this device has three channels, there is a custom attribute to
select which channel is to be used when getting a sample.
Measurements are done on all enabled channels.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-04-26 20:08:04 +02:00
Andreas Kilian
a665fc0829 drivers: sensor: Vishay VEML7700 ambient light sensor
Added support for Vishay VEML7700 ambient light sensor
See https://www.vishay.com/doc?84286

Signed-off-by: Andreas Kilian <andreas_kilian@gmx.net>
2023-04-26 12:52:46 +02:00
Tomasz Leman
3d6e9ee7db tests: dma: loop_transfer: add mtl board
Adding meteorlake board overlay.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-25 16:19:45 +02:00
Tomasz Leman
86648fa4c5 tests: drivers: dma: loop_transfer: power state check
This patch modifies the existing loop transfer test to allow testing for
device power state changes when starting and stopping a transfer.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-25 16:19:45 +02:00
Andriy Gelman
b2d7cf05a9 tests: drivers: spi: spi_loopback: Update xmc45_relax_kit to use dma
Update test to use DMA for spi transfers.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-04-25 12:23:26 +02:00
Gerard Marull-Paretas
9faa60aeda drivers: regulator: allow non-thread-safe reference counting
In some cases, it may be desirable to not have thread-safe reference
counting. For example, when CONFIG_MULTITHREADING=n.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-25 12:23:07 +02:00
Roman Dobrodii
59b6c84e1f dts/arm/silabs: IADC support for EFR32BG27
Enable IADC for EFR32BG27 and add support for this board to
tests/drivers/adc_api test.

Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
2023-04-25 12:21:03 +02:00
Gerard Marull-Paretas
1e0028ae3d drivers: spi: add spi_cs_is_gpio(_dt) helpers
Add spi_cs_is_gpio(_dt) helpers to check whether SPI CS is controlled by
GPIO or not. This both improves code readability and isolates SPI
internals.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 21:29:55 +02:00
Gerard Marull-Paretas
3f2c2d4130 drivers: spi: make SPI dt-spec macros compatible with C++
As of today it is not possible to use SPI dt-spec macros in C++,
something known and documented. The main reason is because `cs` property
is initialized using a compound literal, something not supported in C++.
This PR takes another approach, that is to not make `cs` a pointer but a
struct member. This way, we can perform a regular initialization, at the
cost of using extra memory for unused delay/pin/flags if `cs` is not
used.

Fixes #56572

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 21:29:55 +02:00
Filip Kokosinski
a01dc33ef1 tests/drivers/adc/adc_api: add efr32xg24_dk2601b.overlay
This file adds the board overlay file for the `efr32xg24_dk2601b` board
to enable the `drivers.adc` test on this board.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-04-24 09:22:21 -05:00
Mahesh Mahadevan
e060cdd7be tests: spi_loopback: Enable ASYNC mode for NXP platforms
Turn on ASYNC mode for RT595 and RT685 EVK boards

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-04-24 13:34:29 +02:00
Francois Ramu
739ffd8a46 tests: drivers: counter running on stm32 timer-counter instances
Defines the overlay to Use the stm32 counter-timer in addition
to the rtc (if enabled)
to pass the tests/drivers/counter/counter_basic_api/
Enable all the possible timer nodes on each board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-04-24 13:32:29 +02:00
Filip Kokosinski
153f084cd7 tests/drivers/adc/adc_api/boards: add efr32bg22_brd4184a overlay
This commit adds support for the `drivers.adc` test by adding an overlay
for the `efr32bg22_brd4184a` board.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-04-21 16:24:39 +02:00
Matthias Hauser
73ed8ccb5f drivers: sensor: Added driver for the Würth Elektronik WSEN-PDUS sensor
Added driver for the Würth Elektronik WSEN-PDUS sensor

Signed-off-by: Matthias Hauser <Matthias.Hauser@we-online.de>
2023-04-21 07:16:15 -05:00
Brandon Del Bel
6bbadb6012 test: drivers: spi: spi_loopback: fix adafruit_itsybitsy_m4_express
tests/drivers/spi/spi_loopback/drivers.spi.loopback on
adafruit_itsybitsy_m4_express fails to build. Fix it by adding
CONFIG_SPI_ASYNC=n.

Signed-off-by: Brandon Del Bel <delbel@umn.edu>
2023-04-21 09:40:53 +02:00
Brandon Del Bel
587f2ec585 test: drivers: spi: spi_loopback: fix test on atsame54_xpro
tests/drivers/spi/spi_loopback/drivers.spi.loopback on atsame54_xpro
fails to build. Fix it by adding a CS pin and DMA channels to the board
overlay. Passes on hardware with spi_loopback fixture after change.

Signed-off-by: Brandon Del Bel <delbel@umn.edu>
2023-04-21 09:40:53 +02:00
Aaron Massey
75b2f5abed emul: Fuel gauge tests direct access to emul_sbs
The fuel gauge tests should *not* have to enable CONFIG_SENSOR in order to
get access to the sbs gauge emulator.

Allow fuel_gauge sbs_gauge direct access to emul_sbs_gauge.c

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-04-21 09:39:00 +02:00
Anas Nashif
fc249bdda0 tests: rtc: fix test identifier
Tests need to be prefixed with test_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-21 01:43:17 +09:00
Bjarki Arge Andreasen
20bbb538c9 tests/drivers/rtc/rtc_api_helpers: Test for more archs
The test suite was limited to the native_posix board,
now it is built and run for any board supported by CI.

The native_posix yaml files for both 32 and 64 bit
boards have been expanded to support rtc, allowing CI
to build and test the rtc_api test suite against the
native_posix and native_posix_64 boards.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-20 11:43:35 +02:00
Benjamin Björnsson
3386463f95 tests: drivers: adc: adc_emul: Move to use default adc node
Use adc node already present in native_posix dts.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-04-20 10:48:33 +02:00
Benjamin Björnsson
2ee24bf619 tests: drivers: adc: adc_api: Remove redefinition of adc node
Remove redefinition of adc0 node in native_posix overlay
since it's now present in the board dts.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-04-20 10:48:33 +02:00
Benjamin Björnsson
132df467c0 tests: drivers: build_all: sensor: Rename adc node
Rename adc node to not collide with the default adc
node now present in the native posix dts.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-04-20 10:48:33 +02:00
Benjamin Björnsson
5fb5de7e43 tests: remove unnecessary includes of adc dt-bindings
Remove includes of adc dt-bindings header since these are
now already included in the root .dtsi file that adds an
adc node.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-04-20 10:48:33 +02:00
Sreeram Tatapudi
185aa1c2c5 drivers: i2c: Add Infineon CAT1 i2c driver
- Add initial version of Infineon CAT1 i2c driver.
 - Add initial version of binding file for Infineon
   CAT1 I2C driver

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-04-20 10:44:18 +02:00
Anas Nashif
326eb860b8 tests: gpio: be consistent with id across all drivers
change id from peripheral.gpio to drivers.gpio.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-19 08:57:57 -04:00