Skip to content

Commit c802729

Browse files
khoa-nguyen-18kartben
authored andcommitted
tests: drivers: dac: Add support test app DAC for RA4
Add support test app dac_api, dac_loopback for Renesas ek_ra4l1, ek_ra4w1, ek_ra4m1 Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
1 parent 538e797 commit c802729

File tree

10 files changed

+65
-5
lines changed

10 files changed

+65
-5
lines changed

tests/drivers/dac/dac_api/Kconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
mainmenu "DAC API test"
5+
6+
source "Kconfig.zephyr"
7+
8+
config DAC_BUFFER_NOT_SUPPORT
9+
bool "DAC on board/SoC does not support output buffer mode"
10+
help
11+
If this config is turned on, the test will run with no output buffer enabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y

tests/drivers/dac/dac_api/src/test_dac.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,13 @@
110110
#endif
111111

112112
static const struct dac_channel_cfg dac_ch_cfg = {
113-
.channel_id = DAC_CHANNEL_ID,
114-
.resolution = DAC_RESOLUTION,
115-
.buffered = true
113+
.channel_id = DAC_CHANNEL_ID,
114+
.resolution = DAC_RESOLUTION,
115+
#if defined(CONFIG_DAC_BUFFER_NOT_SUPPORT)
116+
.buffered = false,
117+
#else
118+
.buffered = true,
119+
#endif /* CONFIG_DAC_BUFFER_NOT_SUPPORT */
116120
};
117121

118122
const struct device *get_dac_device(void)
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
mainmenu "DAC Loopback test"
5+
6+
source "Kconfig.zephyr"
7+
8+
config DAC_BUFFER_NOT_SUPPORT
9+
bool "DAC on board/SoC does not support output buffer mode"
10+
help
11+
If this config is turned on, the test will run with no output buffer enabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_DAC_BUFFER_NOT_SUPPORT=y

tests/drivers/dac/dac_loopback/src/test_dac.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,13 @@
176176
#define ADC_GAIN ADC_GAIN_1
177177
#define ADC_REFERENCE ADC_REF_INTERNAL
178178
#define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT
179-
#define ADC_CHANNEL_ID 0
179+
#if defined(CONFIG_BOARD_EK_RA4L1)
180+
#define ADC_CHANNEL_ID 1
181+
#elif defined(CONFIG_BOARD_EK_RA4W1)
182+
#define ADC_CHANNEL_ID 4
183+
#else
184+
#define ADC_CHANNEL_ID 0
185+
#endif
180186

181187
#else
182188
#error "Unsupported board."
@@ -185,7 +191,11 @@
185191
static const struct dac_channel_cfg dac_ch_cfg = {
186192
.channel_id = DAC_CHANNEL_ID,
187193
.resolution = DAC_RESOLUTION,
188-
.buffered = true
194+
#if defined(CONFIG_DAC_BUFFER_NOT_SUPPORT)
195+
.buffered = false,
196+
#else
197+
.buffered = true,
198+
#endif /* CONFIG_DAC_BUFFER_NOT_SUPPORT */
189199
};
190200

191201
static const struct adc_channel_cfg adc_ch_cfg = {

0 commit comments

Comments
 (0)