diff --git a/drivers/dac/CMakeLists.txt b/drivers/dac/CMakeLists.txt index 0e5fdf34981..0d6051cf980 100644 --- a/drivers/dac/CMakeLists.txt +++ b/drivers/dac/CMakeLists.txt @@ -9,4 +9,5 @@ zephyr_library_sources_ifdef(CONFIG_DAC_SAM0 dac_sam0.c) zephyr_library_sources_ifdef(CONFIG_DAC_DACX0508 dac_dacx0508.c) zephyr_library_sources_ifdef(CONFIG_DAC_DACX3608 dac_dacx3608.c) zephyr_library_sources_ifdef(CONFIG_DAC_SHELL dac_shell.c) +zephyr_library_sources_ifdef(CONFIG_DAC_MCP4725 dac_mcp4725.c) zephyr_library_sources_ifdef(CONFIG_USERSPACE dac_handlers.c) diff --git a/drivers/dac/Kconfig b/drivers/dac/Kconfig index 254e2456b88..e50e640f9cc 100644 --- a/drivers/dac/Kconfig +++ b/drivers/dac/Kconfig @@ -34,4 +34,6 @@ source "drivers/dac/Kconfig.dacx0508" source "drivers/dac/Kconfig.dacx3608" +source "drivers/dac/Kconfig.mcp4725" + endif # DAC diff --git a/drivers/dac/Kconfig.mcp4725 b/drivers/dac/Kconfig.mcp4725 new file mode 100644 index 00000000000..d4f9a5d55b9 --- /dev/null +++ b/drivers/dac/Kconfig.mcp4725 @@ -0,0 +1,21 @@ +# DAC configuration options + +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 + +config DAC_MCP4725 + bool "Microchip MCP4725 DAC driver" + depends on I2C + help + Enable the driver for the Microchip MCP4725. + +if DAC_MCP4725 + +config DAC_MCP4725_INIT_PRIORITY + int "Init priority" + default 80 + help + MCP4725 DAC device driver initialization priority. + +endif # DAC_MCP4725 diff --git a/drivers/dac/dac_mcp4725.c b/drivers/dac/dac_mcp4725.c new file mode 100644 index 00000000000..15a88ae096e --- /dev/null +++ b/drivers/dac/dac_mcp4725.c @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ +#define DT_DRV_COMPAT microchip_mcp4725 + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(dac_mcp4725, CONFIG_DAC_LOG_LEVEL); + +/* Information in this file comes from MCP4725 datasheet revision D + * found at https://ww1.microchip.com/downloads/en/DeviceDoc/22039d.pdf + */ + +/* Defines for field values in MCP4725 DAC register */ +#define MCP4725_DAC_MAX_VAL 0xFFF + +#define MCP4725_FAST_MODE_POWER_DOWN_POS 4U +#define MCP4725_FAST_MODE_DAC_UPPER_VAL_POS 8U +#define MCP4725_FAST_MODE_DAC_UPPER_VAL_MASK 0xF +#define MCP4725_FAST_MODE_DAC_LOWER_VAL_MASK 0xFF + +#define MCP4725_READ_RDY_POS 7U +#define MCP4725_READ_RDY_MASK (0x1 << MCP4725_READ_RDY_POS) + +/* After writing eeprom, the MCP4725 can be in a busy state for 25 - 50ms + * See section 1.0 of MCP4725 datasheet, 'Electrical Characteristics' + */ +#define MCP4725_BUSY_TIMEOUT_MS 60U + +struct mcp4725_config { + const struct device *i2c_dev; + uint16_t i2c_addr; +}; + +/* Read mcp4725 and check RDY status bit */ +static int mcp4725_wait_until_ready(const struct device *dev, uint16_t i2c_addr) +{ + uint8_t rx_data[5]; + bool mcp4725_ready = false; + int ret; + int32_t timeout = k_uptime_get_32() + MCP4725_BUSY_TIMEOUT_MS; + + /* Wait until RDY bit is set or return error if timer exceeds MCP4725_BUSY_TIMEOUT_MS */ + while (!mcp4725_ready) { + ret = i2c_read(dev, rx_data, sizeof(rx_data), i2c_addr); + + if (ret == 0) { + mcp4725_ready = rx_data[0] & MCP4725_READ_RDY_MASK; + } else { + /* I2C error */ + return ret; + } + + if (k_uptime_get_32() > timeout) { + return -ETIMEDOUT; + } + } + + return 0; +} + +/* MCP4725 is a single channel 12 bit DAC */ +static int mcp4725_channel_setup(const struct device *dev, + const struct dac_channel_cfg *channel_cfg) +{ + if (channel_cfg->channel_id != 0) { + return -EINVAL; + } + + if (channel_cfg->resolution != 12) { + return -ENOTSUP; + } + + return 0; +} + +static int mcp4725_write_value(const struct device *dev, uint8_t channel, + uint32_t value) +{ + const struct mcp4725_config *config = (struct mcp4725_config *)dev->config; + uint8_t tx_data[2]; + int ret; + + if (channel != 0) { + return -EINVAL; + } + + /* Check value isn't over 12 bits */ + if (value > MCP4725_DAC_MAX_VAL) { + return -ENOTSUP; + } + + /* WRITE_MODE_FAST message format (2 bytes): + * + * || 15 14 | 13 12 | 11 10 9 8 || 7 6 5 4 3 2 1 0 || + * || Fast mode (0) | Power-down bits (0) | DAC value[11:8] || DAC value[7:0] || + */ + tx_data[0] = ((value >> MCP4725_FAST_MODE_DAC_UPPER_VAL_POS) & + MCP4725_FAST_MODE_DAC_UPPER_VAL_MASK); + tx_data[1] = (value & MCP4725_FAST_MODE_DAC_LOWER_VAL_MASK); + ret = i2c_write(config->i2c_dev, tx_data, sizeof(tx_data), + config->i2c_addr); + + return ret; +} + +static int dac_mcp4725_init(const struct device *dev) +{ + const struct mcp4725_config *config = dev->config; + + if (!device_is_ready(config->i2c_dev)) { + LOG_ERR("I2C device not found"); + return -EINVAL; + } + + /* Check we can read a 'RDY' bit from this device */ + if (mcp4725_wait_until_ready(config->i2c_dev, config->i2c_addr)) { + return -EBUSY; + } + + return 0; +} + +static const struct dac_driver_api mcp4725_driver_api = { + .channel_setup = mcp4725_channel_setup, + .write_value = mcp4725_write_value, +}; + + +#define INST_DT_MCP4725(index) \ + static const struct mcp4725_config mcp4725_config_##index = { \ + .i2c_dev = DEVICE_DT_GET(DT_INST_BUS(index)), \ + .i2c_addr = DT_INST_REG_ADDR(index) \ + }; \ + \ + DEVICE_DT_INST_DEFINE(index, dac_mcp4725_init, \ + device_pm_control_nop, \ + NULL, \ + &mcp4725_config_##index, POST_KERNEL, \ + CONFIG_DAC_MCP4725_INIT_PRIORITY, \ + &mcp4725_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(INST_DT_MCP4725); diff --git a/dts/bindings/dac/microchip,mcp4725.yaml b/dts/bindings/dac/microchip,mcp4725.yaml new file mode 100644 index 00000000000..4a33ee37a10 --- /dev/null +++ b/dts/bindings/dac/microchip,mcp4725.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2021 Laird Connectivity +# SPDX-License-Identifier: Apache-2.0 + +description: Microchip MCP4725 12-bit DAC + +compatible: "microchip,mcp4725" + +include: [dac-controller.yaml, i2c-device.yaml] + +properties: + "#io-channel-cells": + const: 1 + +io-channel-cells: + - output diff --git a/samples/drivers/dac/README.rst b/samples/drivers/dac/README.rst index 064363782a1..7567fd3bc65 100644 --- a/samples/drivers/dac/README.rst +++ b/samples/drivers/dac/README.rst @@ -88,6 +88,48 @@ follows: DAC output is available on connector J4 pin 11. +Building and Running for BL652 +====================================== +The BL652 DVK PCB contains a footprint for a MCP4725 to use as an external +DAC. Note this is not populated by default. The sample can be built and +executed for the :ref:`bl652_dvk` as follows: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/dac + :board: bl652_dvk + :goals: build flash + :compact: + +DAC output is available on pin 1 of the MCP4725. + +Building and Running for BL653 +====================================== +The BL653 DVK PCB contains a footprint for a MCP4725 to use as an external +DAC. Note this is not populated by default. The sample can be built and +executed for the :ref:`bl653_dvk` as follows: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/dac + :board: bl653_dvk + :goals: build flash + :compact: + +DAC output is available on pin 1 of the MCP4725. + +Building and Running for BL654 +====================================== +The BL654 DVK PCB contains a footprint for a MCP4725 to use as an external +DAC. Note this is not populated by default. The sample can be built and +executed for the :ref:`bl654_dvk` as follows: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/dac + :board: bl654_dvk + :goals: build flash + :compact: + +DAC output is available on pin 1 of the MCP4725. + Sample output ============= diff --git a/samples/drivers/dac/boards/bl652_dvk.conf b/samples/drivers/dac/boards/bl652_dvk.conf new file mode 100644 index 00000000000..abc42c157a7 --- /dev/null +++ b/samples/drivers/dac/boards/bl652_dvk.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_DAC_MCP4725=y diff --git a/samples/drivers/dac/boards/bl652_dvk.overlay b/samples/drivers/dac/boards/bl652_dvk.overlay new file mode 100644 index 00000000000..4e69a89be68 --- /dev/null +++ b/samples/drivers/dac/boards/bl652_dvk.overlay @@ -0,0 +1,14 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/samples/drivers/dac/boards/bl653_dvk.conf b/samples/drivers/dac/boards/bl653_dvk.conf new file mode 100644 index 00000000000..abc42c157a7 --- /dev/null +++ b/samples/drivers/dac/boards/bl653_dvk.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_DAC_MCP4725=y diff --git a/samples/drivers/dac/boards/bl653_dvk.overlay b/samples/drivers/dac/boards/bl653_dvk.overlay new file mode 100644 index 00000000000..4e69a89be68 --- /dev/null +++ b/samples/drivers/dac/boards/bl653_dvk.overlay @@ -0,0 +1,14 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/samples/drivers/dac/boards/bl654_dvk.conf b/samples/drivers/dac/boards/bl654_dvk.conf new file mode 100644 index 00000000000..abc42c157a7 --- /dev/null +++ b/samples/drivers/dac/boards/bl654_dvk.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_DAC_MCP4725=y diff --git a/samples/drivers/dac/boards/bl654_dvk.overlay b/samples/drivers/dac/boards/bl654_dvk.overlay new file mode 100644 index 00000000000..4e69a89be68 --- /dev/null +++ b/samples/drivers/dac/boards/bl654_dvk.overlay @@ -0,0 +1,14 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/samples/drivers/dac/sample.yaml b/samples/drivers/dac/sample.yaml index 5eedc3159f9..d8e0318b663 100644 --- a/samples/drivers/dac/sample.yaml +++ b/samples/drivers/dac/sample.yaml @@ -5,7 +5,8 @@ tests: tags: DAC platform_allow: | arduino_zero frdm_k22f frdm_k64f nucleo_f091rc nucleo_g071rb nucleo_g431rb - nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi nucleo_f429zi + nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi nucleo_f429zi bl652_dvk + bl653_dvk bl654_dvk depends_on: dac harness: console harness_config: diff --git a/tests/drivers/dac/dac_api/boards/bl652_dvk.conf b/tests/drivers/dac/dac_api/boards/bl652_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl652_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_api/boards/bl652_dvk.overlay b/tests/drivers/dac/dac_api/boards/bl652_dvk.overlay new file mode 100644 index 00000000000..eec33e81505 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl652_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_api/boards/bl653_dvk.conf b/tests/drivers/dac/dac_api/boards/bl653_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl653_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_api/boards/bl653_dvk.overlay b/tests/drivers/dac/dac_api/boards/bl653_dvk.overlay new file mode 100644 index 00000000000..eec33e81505 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl653_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_api/boards/bl654_dvk.conf b/tests/drivers/dac/dac_api/boards/bl654_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl654_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_api/boards/bl654_dvk.overlay b/tests/drivers/dac/dac_api/boards/bl654_dvk.overlay new file mode 100644 index 00000000000..eec33e81505 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/bl654_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_api/src/test_dac.c b/tests/drivers/dac/dac_api/src/test_dac.c index 3b1d6ea237c..98236292ce5 100644 --- a/tests/drivers/dac/dac_api/src/test_dac.c +++ b/tests/drivers/dac/dac_api/src/test_dac.c @@ -37,6 +37,16 @@ #define DAC_RESOLUTION 12 #define DAC_CHANNEL_ID 0 +#elif defined(CONFIG_BOARD_BL652_DVK) || \ + defined(CONFIG_BOARD_BL653_DVK) || \ + defined(CONFIG_BOARD_BL654_DVK) + /* Note external DAC MCP4725 is not populated on BL652_DVK, BL653_DVK and + * BL654_DVK at factory + */ +#define DAC_DEVICE_NAME DT_LABEL(DT_NODELABEL(dac0)) +#define DAC_RESOLUTION 12 +#define DAC_CHANNEL_ID 0 + #else #error "Unsupported board." #endif diff --git a/tests/drivers/dac/dac_api/testcase.yaml b/tests/drivers/dac/dac_api/testcase.yaml index 04d8e9851da..51c69a0018f 100644 --- a/tests/drivers/dac/dac_api/testcase.yaml +++ b/tests/drivers/dac/dac_api/testcase.yaml @@ -2,5 +2,7 @@ common: tags: dac drivers userspace tests: drivers.dac: - platform_allow: frdm_k22f frdm_k64f nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi nucleo_f429zi + platform_allow: + frdm_k22f frdm_k64f nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi + nucleo_f429zi bl652_dvk bl653_dvk bl654_dvk depends_on: dac diff --git a/tests/drivers/dac/dac_loopback/boards/bl652_dvk.conf b/tests/drivers/dac/dac_loopback/boards/bl652_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl652_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_loopback/boards/bl652_dvk.overlay b/tests/drivers/dac/dac_loopback/boards/bl652_dvk.overlay new file mode 100644 index 00000000000..eec33e81505 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl652_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_loopback/boards/bl653_dvk.conf b/tests/drivers/dac/dac_loopback/boards/bl653_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl653_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_loopback/boards/bl653_dvk.overlay b/tests/drivers/dac/dac_loopback/boards/bl653_dvk.overlay new file mode 100644 index 00000000000..eec33e81505 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl653_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + dac0: mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_loopback/boards/bl654_dvk.conf b/tests/drivers/dac/dac_loopback/boards/bl654_dvk.conf new file mode 100644 index 00000000000..f8f6db471e5 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl654_dvk.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2021 Laird Connectivity +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_I2C=y +CONFIG_DAC_MCP4725=y diff --git a/tests/drivers/dac/dac_loopback/boards/bl654_dvk.overlay b/tests/drivers/dac/dac_loopback/boards/bl654_dvk.overlay new file mode 100644 index 00000000000..1dbe9e872f8 --- /dev/null +++ b/tests/drivers/dac/dac_loopback/boards/bl654_dvk.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c0 { + mcp4725@60 { + /* MCP4725 not populated at factory */ + compatible = "microchip,mcp4725"; + reg = <0x60>; + label = "MCP4725"; + #io-channel-cells = <1>; + }; +}; diff --git a/tests/drivers/dac/dac_loopback/src/test_dac.c b/tests/drivers/dac/dac_loopback/src/test_dac.c index 304faf87ea5..4cfc666c265 100644 --- a/tests/drivers/dac/dac_loopback/src/test_dac.c +++ b/tests/drivers/dac/dac_loopback/src/test_dac.c @@ -111,6 +111,28 @@ #define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT #define ADC_CHANNEL_ID 23 +#elif defined(CONFIG_BOARD_BL652_DVK) || \ + defined(CONFIG_BOARD_BL653_DVK) || \ + defined(CONFIG_BOARD_BL654_DVK) +#include + /* DAC output from MCP4725 pin 1 + * ADC_1 input read from pin SIO_3 + * Note external DAC MCP4725 is not populated on BL652_DVK, BL653_DVK and + * BL654_DVK at factory + */ + +#define DAC_DEVICE_NAME DT_LABEL(DT_NODELABEL(dac0)) +#define DAC_RESOLUTION 12 +#define DAC_CHANNEL_ID 0 + +#define ADC_DEVICE_NAME DT_LABEL(DT_NODELABEL(adc)) +#define ADC_RESOLUTION 12 +#define ADC_GAIN ADC_GAIN_1_4 +#define ADC_REFERENCE ADC_REF_VDD_1_4 +#define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT +#define ADC_CHANNEL_ID 1 +#define ADC_1ST_CHANNEL_INPUT NRF_SAADC_INPUT_AIN1 + #else #error "Unsupported board." #endif @@ -125,6 +147,12 @@ static const struct adc_channel_cfg adc_ch_cfg = { .reference = ADC_REFERENCE, .acquisition_time = ADC_ACQUISITION_TIME, .channel_id = ADC_CHANNEL_ID, + +#if defined(CONFIG_BOARD_BL652_DVK) || \ + defined(CONFIG_BOARD_BL653_DVK) || \ + defined(CONFIG_BOARD_BL654_DVK) + .input_positive = ADC_1ST_CHANNEL_INPUT, +#endif }; static const struct device *init_dac(void) diff --git a/tests/drivers/dac/dac_loopback/testcase.yaml b/tests/drivers/dac/dac_loopback/testcase.yaml index 40c3989839f..f4080e12590 100644 --- a/tests/drivers/dac/dac_loopback/testcase.yaml +++ b/tests/drivers/dac/dac_loopback/testcase.yaml @@ -8,3 +8,4 @@ tests: fixture: dac_adc_loopback platform_allow: | frdm_k22f frdm_k64f nucleo_f207zg nucleo_l073rz nucleo_l152re twr_ke18f + bl652_dvk bl653_dvk bl654_dvk