Commit graph

835 commits

Author SHA1 Message Date
Andrzej Głąbek
ec8632dcd1 drivers: adc_ad4130: Fix out-of-bounds accesses to channel_setup_cfg
Correct the size of the channel_setup_cfg array, as it should contain
entries for all available channels (AD4130_MAX_CHANNELS), not for the
available configuration slots (AD4130_MAX_SETUPS).
Move also checking of the channel index to the very beginning of
adc_ad4130_channel_setup(), to avoid potential writes to .live_cfg
beyond the channel_setup_cfg array.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-05-28 10:05:02 +02:00
Tu Nguyen Van
6f4f702ed2 drivers: adc: update new macro name in RTD 2.0.1
FEATURE_ADC_MAX_CHN_COUNT changed to ADC_SAR_IP_MAX_CHN_COUNT
in RTD 2.0.1

Signed-off-by: Tu Nguyen Van <tu.nguyenvan@nxp.com>
2025-05-28 05:54:38 +02:00
Julien Panis
dd5ed02146 drivers: adc: Add support for cc23x0 ADC
Add support for 16-channel ADC to cc23x0 SoC. The driver supports the
following conversion modes:
- Single channel | Single conversion,
- Sequence of channels (up to 4) | Single conversion.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2025-05-23 19:49:48 +02:00
jhan bo chao
98478189f2 drivers: adc: rts5912: clear pending irq when setup
clear pending irq when setup.

Signed-off-by: jhan bo chao <jhan_bo_chao@realtek.com>
2025-05-22 04:51:36 +02:00
Hao Luo
ba52a93ac9 drivers: adc: Add support for Apollo510 ADC
This commit adds support for Apollo510 SoC in ambiq adc driver

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-05-14 09:11:17 +02:00
Michał Stasiak
8b998060f2 drivers: adc: adc_nrf_saadc: Add analog pins for nRF54L20
Added set of analog pins for nRF54L20 SAADC.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-05-13 17:45:18 +02:00
Krzysztof Chruściński
2f7d799c99 drivers: adc: nrfx_saadc: Add validation of channel configuration
On nrf54h20 there are additional analog pins (AIN8+). When differential
mode is used they must not be mixed with AIN0-AIN7. Add build time
validation which detects if configuration is invalid.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-05-09 15:40:53 +02:00
John Bason Mitchell
28c2521926 drivers: adc: disabling timer after DMA eror
The ADC timer should be disabled however the read is finished.

Signed-off-by: John Bason Mitchell <johnbasonmitchell@gmail.com>
2025-04-30 10:55:17 +01:00
Yunshao Chiang
13087ee1b0 drivers: adc: add it515xx_evb board adc driver
Add it515xx analog to digital converter driver which supports 8 channels
ch0 ~ ch7 and 12-bit resolution.

Signed-off-by: Yunshao Chiang <Yunshao.Chiang@ite.com.tw>
2025-04-23 15:02:36 +02:00
Dylan Hsieh
f3bc550117 driver: adc: add adc driver for rts5912
Add adc driver for Realtek rts5912.

Signed-off-by: Dylan Hsieh <dylan.hsieh@realtek.com>
2025-04-22 14:02:37 +02:00
Hao Luo
6f4b92d64d soc: ambiq: Optimize the inclusion relationship of header files
Optimized the inclusion relationship of header files

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-04-17 09:06:18 +02:00
Okan Sahin
be1218081a drivers: adc: Introduce AD4130 adc driver
This commit introduces ad4130 adc driver.

Signed-off-by: Okan Sahin <Okan.Sahin@analog.com>
2025-04-09 17:32:29 +02:00
Sreeram Tatapudi
970460e809 drivers: adc: Update configuration values for CAT1B ADC
- Update resolution and inter reference mV
	- make unused code conditional

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-04-09 09:03:19 +02:00
Andrew Featherstone
a2aa0a3e2b docs: raspberrrypi: Correct names of products
Replace occurrences of "RaspberryPi" with "Raspberry Pi" in
documentation, comment blocks etc. Correct the name of "PicoW" to
"Pico W", matching Raspberry Pi's documentation at
https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html .

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-04-03 15:27:50 -07:00
Etienne Carriere
bec3a6fc98 drivers: adc: stm32: support DMA when CONFIG_MEM_ATTR=n
Allow STM32 ADC driver to operate with DMA support even when
CONFIG_MEM_ATTR is disabled which happen when CONFIG_ARM_MPU is
intentionally disabled despite the CPU supports MPU.

By the way, remove some #ifdef directive on header files inclusion
that add noise in the header file inclusion section without any
benefit. Also remove inclusion of zephyr/arch/cache.h that is not
needed at all.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-04-02 12:54:50 +02:00
Dimitrije Lilic
c0e5e5236f drivers: adc: ad405x: Add diff support and res used form adc spec
Added support for differentail or single ended setup.
Reading resolution form dt - adc spec.

Signed-off-by: Dimitrije Lilic <dimitrije.lilic@orioninc.com>
2025-04-01 22:14:31 +02:00
Elliott Cutmore
1788c701cb drivers: adc: adc_ads1x4s0x remove duplicated initialiser
Removed duplicated "vbias_level" initialiser in driver

Signed-off-by: Elliott Cutmore <elliott.cutmore@gmail.com>
2025-03-27 14:01:32 +01:00
Hao Luo
4744d138c2 drivers: ambiq: Change the way to power on ambiq drivers
This commit changes to use ambiq hal power control APIs
to replace the previous register settings to power on
ambiq drivers.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-03-24 09:54:17 +01:00
Krzysztof Chruściński
f2e1ac0da5 drivers: adc: nrfx_saadc: Add support for AIN8-AIN13 on nrf54h20
Extend support in dt bindings and in the driver to allow use of
AIN8 to AIN13 analog inputs.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-19 10:57:33 +01:00
Aksel Skauge Mellbye
d2c49544c8 drivers: adc: iadc_gecko: Use pm_device_driver_init
Enable PM device support by making use of the pm_device_driver_init
helper.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-03-19 01:23:24 +01:00
Emil Gydesen
60a980185d Revert "drivers: adc: adopt new count_bits util function"
This reverts commit 17c42550f3.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-18 16:39:47 +01:00
Benjamin Cabé
17c42550f3 drivers: adc: adopt new count_bits util function
Adopt new count_bits helper from util.h and avoid
having conflicting definition

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-03-18 08:24:16 +01:00
Phuc Pham
fe53749cdf drivers: adc: Initial support for RZ/G3S
Add ADC driver support for Renesas RZ/G3S

Signed-off-by: Phuc Pham <phuc.pham.xr@bp.renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2025-03-13 07:21:40 +01:00
Dimitrije Lilic
4a9d1473d3 drivers: adc: ad405x: Add AD405X driver
Initial AD405X driver supporting sampling, averaging
and burst averaging operation modes. Configurable
without interrupts or with device ready and
data ready interrupt.

Signed-off-by: Dimitrije Lilic <dimitrije.lilic@orioninc.com>
2025-03-12 19:02:25 +01:00
Khoa Nguyen
8671fdd86d drivers: adc: Remove channel_count property for Renesas driver
Currently, in Renesas adc driver, channel_count is used
as the maximum index of the channels can be supported.
However, the value input in dts of "channel_count"
represents the total number of supported channels.

After consideration, we have decided to remove this
reduntant property.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-03-10 08:58:52 +01:00
Elliott Cutmore
e44a9523d4 drivers: adc: Fix ads1x4s0x driver initialised asynchronously
Definition of stack variable did not match the initialiser
reference in the driver

Signed-off-by: Elliott Cutmore <elliott.cutmore@gmail.com>
2025-03-08 08:56:33 +01:00
Khoa Nguyen
c768144002 drivers: Correct value of event macro for all Renesas SoC
Since the RA2L1 uses the macro "ICU_EVENT" instead of
"ELC_EVENT" (which is currently used) to input into
the IELSR register, the ek_ra2l1 board cannot assign
any interrupts for any driver.

This commit aim to correct the Event macro to input correct
value for IELSR register on all the Renesas SoC by using
"BSP_PRV_IELS_ENUM" macro.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-02-28 18:29:17 +01:00
Jeppe Odgaard
3a8dddcdad drivers: adc: stm32: use __maybe_unused
Replace conditional `ARG_UNUSED` with `__maybe_unused`. This is recommended
by coding style:
https://kernel.org/doc/html/latest/process/coding-style.html#conditional-compilation

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-02-28 14:53:17 +01:00
Marcio Ribeiro
71277577be driver: adc: esp32: fix read function
Compensates raw value reading before adc_read returns it

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2025-02-25 07:57:00 +01:00
Sebastian Głąb
99c398845d drivers: adc: Fix Vref selection for nRF54L20pdk
Select Reference voltage of 900mV for ADC on nRF54L20pdk.

Add ADC to the list of supported peripherals.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-02-17 10:22:03 +01:00
Bjarki Arge Andreasen
96c3cd6cd3 drivers: adc: nrf_saadc: add pm device support
Extend nrf saadc device driver with pm device runtime support.

To preserve previous behavior:

* if pm device is disabled, saadc is resumed on sampling start
  and suspended when sampling done.
* if pm device is enabled only, saadc does nothing on
  sampling start/stop. its resumed on init.
* if pm device runtime is enabled, saadc is got on
  sampling start, and put on sampling stop.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-14 17:12:03 +01:00
Guillaume Gautier
a0761d6353 drivers: adc: stm32: configure data size for stm32n6
On STM32N6, the register holding the data is 32 bits and DMA must operate
in word transfer to work properly. So we change the type of the buffer in
which we store the ADC data from uint16_t to uint32_t for N6.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-02-14 10:48:35 +01:00
Guillaume Gautier
a28381f459 drivers: adc: stm32: enable analog supply in dedicated function
Move code to enable the analog supply in a dedicated function.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-02-14 10:48:35 +01:00
Guillaume Gautier
9ee33e990e drivers: adc: stm32: add support for stm32n6 adc
Add support for STM32N6 ADC in the STM32 ADC driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-02-14 10:48:35 +01:00
Rafał Kuźnia
f78742ff75 tests: drivers: adc: add nRF54L20 configuration
Added the test configuration for nRF54L20 for the following tests:
- adc_api
- adc_error_cases

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2025-02-13 16:41:57 +01:00
Aksel Skauge Mellbye
2322cc92c5 drivers: adc: iadc_gecko: Use clock control
Use clock control driver instead of hard-coding HAL function calls
to configure clocks.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-02-03 19:51:46 +01:00
Aksel Skauge Mellbye
117d7d1582 drivers: adc: iadc_gecko: Use pinctrl for bus allocation
Make use of ABUS support in the pinctrl driver to allocate
analog buses, rather than hard-coding bus 0 in the ADC driver.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-02-03 19:51:46 +01:00
McAtee Maxwell
24eb735b24 adc: modifications to support adc on cyw920829m2evk_02 platform
- Modifications to adc driver
	- Modifications to clock_control driver
	- Add adc to board's yaml
	- Add adc to relevant dts file

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2025-02-03 19:50:11 +01:00
Sylvio Alves
491bbcfcbd drivers: adc: esp32: delete line curve scheme
Make sure to delete line scheme instead of curve scheme
for socs that uses line scheme.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-02-03 17:00:04 +01:00
Terry Geng
49308e45d2 drivers: adc: ads1x4s0x: Add ADS124S0X support into existing drivers
Refactor code for ADS114S08 (12 ch, 16 bit) to accommodate ADS114S06
(6 ch, 16 bit), ADS124S06 (6 ch, 24 bit), and ADS124S08 (12 ch, 24 bit).

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
cbcb2d8f12 drivers: adc: ads1x4s0x: Rename files, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
43079c8086 drivers: adc: ads114s0x: Rename variables, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Sylvio Alves
e472fb603e drivers: adc: esp32: delete previous calibration curve
In case channel_setup is called with a new attenuation
config, make sure previous calibration scheme is deleted properly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-01-30 22:59:21 +01:00
Yasin Ustuner
d411b4f67b drivers: adc: Introduce AD7124 adc driver
This commit introduces ad7124 adc driver.

Signed-off-by: Yasin Ustuner <Yasin.Ustuner@analog.com>
2025-01-30 20:33:10 +01:00
Karol Lasończyk
057de458e2 drivers: adc: Add support for gain 2/7 in nRF devices
Extend current adc gains with new entry 2/7.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2025-01-29 15:13:19 +01:00
Raffael Rostagno
8af0d881f4 drivers: adc: esp32: Clang run
Clang run for code formatting and calibrationc control for
repeated calls at channel_setup().

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-01-27 17:08:30 +01:00
Raffael Rostagno
1ed70820ca drivers: adc: esp32: GPIO config
Share GPIO config for both DMA and non-DMA mode.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-01-27 17:08:30 +01:00
Raffael Rostagno
5ee8600a59 drivers: adc: esp32: Clock init
Peripheral clock init.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-01-27 17:08:30 +01:00
Raffael Rostagno
f195b3528c drivers: adc: esp32: Driver update
Driver update to support newer HAL versions.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-01-27 17:08:30 +01:00
Pieter De Gendt
f1c4760304 drivers: Update APIs to use DEVICE_API macro
Some drivers APIs were not wrapped using the DEVICE_API macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-24 01:15:19 +01:00