Skip to content

Commit c875ce7

Browse files
khoa-nguyen-18kartben
authored andcommitted
samples: dac: Add DAC support for Renesas RA4 boards
Add support DAC for ek_ra4m1, ek_ra4w1, fpb_ra4e1, voice_ra4e1, ek_ra4l1 Signed-off-by: Khoa Nguyen <[email protected]>
1 parent c802729 commit c875ce7

File tree

10 files changed

+88
-1
lines changed

10 files changed

+88
-1
lines changed

samples/drivers/dac/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Private config options for dac sample
22

33
# Copyright (c) 2025 NXP
4+
# Copyright (c) 2025 Renesas Electronics Corporation
45
# SPDX-License-Identifier: Apache-2.0
56

67
mainmenu "DAC sample application"
@@ -14,3 +15,8 @@ config DAC_SAMPLE_RUN
1415
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),dac)
1516
help
1617
platform supports dac sample
18+
19+
config DAC_BUFFER_NOT_SUPPORT
20+
bool "DAC on board/SoC does not support output buffer mode"
21+
help
22+
If this config is turned on, the sample will run with no output buffer enabled
Lines changed: 4 additions & 0 deletions
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
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac0>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <12>;
12+
};
13+
};
Lines changed: 4 additions & 0 deletions
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
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac0>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <12>;
12+
};
13+
};
Lines changed: 4 additions & 0 deletions
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
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac0>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <12>;
12+
};
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac0>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <12>;
12+
};
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac0>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <12>;
12+
};
13+
};

samples/drivers/dac/src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ static const struct device *const dac_dev = DEVICE_DT_GET(DAC_NODE);
2828
static const struct dac_channel_cfg dac_ch_cfg = {
2929
.channel_id = DAC_CHANNEL_ID,
3030
.resolution = DAC_RESOLUTION,
31-
.buffered = true
31+
#if defined(CONFIG_DAC_BUFFER_NOT_SUPPORT)
32+
.buffered = false,
33+
#else
34+
.buffered = true,
35+
#endif /* CONFIG_DAC_BUFFER_NOT_SUPPORT */
3236
};
3337

3438
int main(void)

0 commit comments

Comments
 (0)