Skip to content
Closed
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
4 changes: 1 addition & 3 deletions arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ endif
endif # I2C

if ADC
config ADC_QMSI_SS
config ADC_DW
def_bool y
config ADC_0_IRQ_PRI
default 0
endif

if BT_H4
Expand Down
6 changes: 6 additions & 0 deletions arch/arc/soc/quark_se_c1000_ss/dts.fixup
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,10 @@
#define CONFIG_GPIO_QMSI_1_IRQ INTEL_QMSI_GPIO_B0800B00_IRQ_0
#define CONFIG_GPIO_QMSI_1_IRQ_PRI INTEL_QMSI_GPIO_B0800B00_IRQ_0_PRIORITY

#define CONFIG_ADC_0_IRQ INTEL_QMSI_ADC_80015000_IRQ_NORMAL
#define CONFIG_ADC_IRQ_ERR INTEL_QMSI_ADC_80015000_IRQ_ERROR
#define CONFIG_ADC_0_IRQ_PRI INTEL_QMSI_ADC_80015000_IRQ_0_PRIORITY
#define CONFIG_ADC_0_NAME INTEL_QMSI_ADC_80015000_LABEL
#define CONFIG_ADC_0_BASE_ADDRESS INTEL_QMSI_ADC_80015000_BASE_ADDRESS

/* End of SoC Level DTS fixup file */
5 changes: 5 additions & 0 deletions arch/arm/soc/nordic_nrf/nrf51/dts.fixup
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* SoC level DTS fixup file */

#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

#define CONFIG_ADC_0_IRQ NORDIC_NRF_ADC_40007000_IRQ_0
#define CONFIG_ADC_0_IRQ_PRI NORDIC_NRF_ADC_40007000_IRQ_0_PRIORITY
#define CONFIG_ADC_0_NAME NORDIC_NRF_ADC_40007000_LABEL

#define CONFIG_UART_0_BASE NORDIC_NRF_UART_40002000_BASE_ADDRESS
#define CONFIG_UART_0_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY
#define CONFIG_UART_0_IRQ_NUM NORDIC_NRF_UART_40002000_IRQ_0
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/soc/nordic_nrf/nrf52/dts.fixup
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* SoC level DTS fixup file */

#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

#define CONFIG_ADC_0_IRQ NORDIC_NRF_SAADC_40007000_IRQ_0
#define CONFIG_ADC_0_IRQ_PRI NORDIC_NRF_SAADC_40007000_IRQ_0_PRIORITY
#define CONFIG_ADC_0_NAME NORDIC_NRF_SAADC_40007000_LABEL

#if defined(NORDIC_NRF_UARTE_40002000_BASE_ADDRESS)
#define CONFIG_UART_0_BASE NORDIC_NRF_UARTE_40002000_BASE_ADDRESS
#define CONFIG_UART_0_IRQ_PRI NORDIC_NRF_UARTE_40002000_IRQ_0_PRIORITY
Expand Down
4 changes: 4 additions & 0 deletions boards/arc/arduino_101_sss/arduino_101_sss.dts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@
&i2c3 {
status = "ok";
};

&adc0 {
status = "ok";
};
4 changes: 4 additions & 0 deletions boards/arm/nrf51_pca10028/nrf51_pca10028.dts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
status ="ok";
};

&adc {
status ="ok";
};

&uart0 {
current-speed = <115200>;
status = "ok";
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf51_pca10028/nrf51_pca10028.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ toolchain:
- gnuarmemb
ram: 32
supported:
- adc
- ble
4 changes: 4 additions & 0 deletions boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
};
};

&adc {
status = "ok";
};

&gpiote {
status ="ok";
};
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
};
};

&adc {
status ="ok";
};

&gpiote {
status ="ok";
};
Expand Down
1 change: 1 addition & 0 deletions boards/arm/nrf52840_pca10056/nrf52840_pca10056.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ toolchain:
- zephyr
- gnuarmemb
supported:
- adc
- usb_device
- ble
- ieee802154
4 changes: 4 additions & 0 deletions boards/arm/nrf52_pca10040/nrf52_pca10040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
};
};

&adc {
status ="ok";
};

&gpiote {
status ="ok";
};
Expand Down
2 changes: 2 additions & 0 deletions boards/arm/nrf52_pca10040/nrf52_pca10040.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ toolchain:
- gnuarmemb
ram: 64
flash: 512
supported:
- adc
4 changes: 4 additions & 0 deletions boards/arm/nrf52_pca20020/nrf52_pca20020.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
};
};

&adc {
status = "ok";
};

&gpiote {
status = "ok";
};
Expand Down
15 changes: 7 additions & 8 deletions drivers/adc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
zephyr_library()

zephyr_library_sources_ifdef(CONFIG_ADC_DW adc_dw.c)
zephyr_library_sources_ifdef(CONFIG_ADC_MCUX_ADC16 adc_mcux_adc16.c)
zephyr_library_sources_ifdef(CONFIG_ADC_QMSI adc_qmsi.c)
zephyr_library_sources_ifdef(CONFIG_ADC_QMSI_SS adc_qmsi_ss.c)
zephyr_library_sources_ifdef(CONFIG_ADC_SAM_AFEC adc_sam_afec.c)
zephyr_library_sources_ifdef(CONFIG_ADC_TI_ADC108S102 adc_ti_adc108s102.c)

zephyr_library_sources_ifdef(CONFIG_USERSPACE adc_handlers.c)
zephyr_library_sources_ifdef(CONFIG_ADC_DW adc_dw.c)
zephyr_library_sources_ifdef(CONFIG_ADC_MCUX_ADC16 adc_mcux_adc16.c)
zephyr_library_sources_ifdef(CONFIG_ADC_QMSI adc_qmsi.c)
zephyr_library_sources_ifdef(CONFIG_ADC_SAM_AFEC adc_sam_afec.c)
zephyr_library_sources_ifdef(CONFIG_ADC_TI_ADC108S102 adc_ti_adc108s102.c)
zephyr_library_sources_ifdef(CONFIG_ADC_NRFX_ADC adc_nrfx_adc.c)
zephyr_library_sources_ifdef(CONFIG_ADC_NRFX_SAADC adc_nrfx_saadc.c)
19 changes: 18 additions & 1 deletion drivers/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,26 @@
#
menuconfig ADC
bool "ADC drivers"
# All platforms that implement the ADC driver are now required to
# provide relevant DTS entries.
select HAS_DTS_ADC
help
Enable ADC (Analog to Digital Converter) driver configuration
Enable ADC (Analog to Digital Converter) driver configuration.

if ADC

# By selecting or not this option particular ADC drivers indicate if it is
# required to explicitly specify analog inputs when configuring channels or
# just the channel identifier is sufficient.
config ADC_CONFIGURABLE_INPUTS
bool

config ADC_ASYNC
bool "Enable asynchronous call support"
select POLL
help
This option enables the asynchronous API calls.

config SYS_LOG_ADC_LEVEL
int "ADC drivers log level"
depends on SYS_LOG
Expand Down Expand Up @@ -73,6 +88,8 @@ source "drivers/adc/Kconfig.dw"

source "drivers/adc/Kconfig.mcux"

source "drivers/adc/Kconfig.nrfx"

source "drivers/adc/Kconfig.qmsi"

source "drivers/adc/Kconfig.sam_afec"
Expand Down
1 change: 0 additions & 1 deletion drivers/adc/Kconfig.mcux
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
config ADC_MCUX_ADC16
bool "MCUX ADC16 driver"
depends on HAS_MCUX_ADC16
select HAS_DTS_ADC
help
Enable the MCUX ADC16 driver.
32 changes: 32 additions & 0 deletions drivers/adc/Kconfig.nrfx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kconfig - ADC configuration options

#
# Copyright (c) 2018, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#

config ADC_NRFX_ADC
bool "nRF ADC nrfx driver"
depends on HAS_HW_NRF_ADC
select NRFX_ADC
select ADC_CONFIGURABLE_INPUTS
help
Enable support for nrfx ADC driver for nRF51 MCU series.

config ADC_NRFX_ADC_CHANNEL_COUNT
int "Number of ADC channels"
depends on ADC_NRFX_ADC
range 1 8
default 1
help
Number of ADC channels to be supported by the driver. Each channel
needs a dedicated structure in RAM that stores the ADC settings
to be used when sampling this channel.

config ADC_NRFX_SAADC
bool "nRF SAADC nrfx driver"
depends on HAS_HW_NRF_SAADC
select ADC_CONFIGURABLE_INPUTS
help
Enable support for nrfx SAADC driver for nRF52 MCU series.
29 changes: 2 additions & 27 deletions drivers/adc/Kconfig.qmsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ menuconfig ADC_QMSI
help
Enable the driver implementation of the QMSI ADC IP.

menuconfig ADC_QMSI_SS
bool "QMSI ADC Driver for the Sensor Subsystem"
depends on QMSI
select ADC_0
help
Enable the driver implementation of the QMSI ADC IP.

if ADC_QMSI || ADC_QMSI_SS
if ADC_QMSI

choice
prompt "Capturing Mode"
Expand Down Expand Up @@ -59,7 +52,6 @@ config ADC_QMSI_SERIAL_DELAY
the serial output is delayed after the conversion
has started.

if ADC_QMSI
config ADC_QMSI_SAMPLE_WIDTH
int "Sample Width"
default 3
Expand All @@ -73,22 +65,5 @@ config ADC_QMSI_SAMPLE_WIDTH
- 2 = 10 bits resolution

- 3 = 12 bits resolution
endif

if ADC_QMSI_SS
config ADC_QMSI_SAMPLE_WIDTH
int "Sample Width"
default 11
help
Defines ADC device data sample width (resolution):

- 5 = 6 bits resolution

- 7 = 8 bits resolution

- 9 = 10 bits resolution

- 11 = 12 bits resolution
endif

endif # ADC_QMSI || ADC_QMSI_SS
endif # ADC_QMSI
1 change: 0 additions & 1 deletion drivers/adc/Kconfig.sam_afec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
menuconfig ADC_SAM_AFEC
bool "SAM ADC Driver"
depends on SOC_FAMILY_SAM
select HAS_DTS_ADC
help
Enable Atmel SAM MCU Family Analog-to-Digital Converter (ADC) driver
based on AFEC module.
Loading