From ff9d967832a459dc4d945284c34e3ff03f1a2296 Mon Sep 17 00:00:00 2001 From: HaiLong Yang Date: Tue, 14 Dec 2021 22:53:45 +0800 Subject: [PATCH] samples: drivers: dac: add gd32f450i_eval board DAC sample support gd32f450i_eval board. Signed-off-by: HaiLong Yang --- samples/drivers/dac/README.rst | 13 +++++++++++++ samples/drivers/dac/boards/gd32f450i_eval.overlay | 13 +++++++++++++ samples/drivers/dac/sample.yaml | 1 + 3 files changed, 27 insertions(+) create mode 100644 samples/drivers/dac/boards/gd32f450i_eval.overlay diff --git a/samples/drivers/dac/README.rst b/samples/drivers/dac/README.rst index e0a54990f09a3b..7f63569fffd8e8 100644 --- a/samples/drivers/dac/README.rst +++ b/samples/drivers/dac/README.rst @@ -176,6 +176,19 @@ built and executed for the :ref:`bl5340_dvk` as follows: DAC output is available on pin 1 of the MCP4725. +Building and Running for GD32450I-EVAL +====================================== +The sample can be built and executed for the +:ref:`gd32f450i_eval` as follows: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/dac + :board: gd32f450i_eval + :goals: build flash + :compact: + +Bridge the JP23 to DAC with the jumper cap, then DAC output will available on JP7. + Sample output ============= diff --git a/samples/drivers/dac/boards/gd32f450i_eval.overlay b/samples/drivers/dac/boards/gd32f450i_eval.overlay new file mode 100644 index 00000000000000..38aa2ea304da2e --- /dev/null +++ b/samples/drivers/dac/boards/gd32f450i_eval.overlay @@ -0,0 +1,13 @@ +/* + * Copyright 2021 BrainCo Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + zephyr,user { + dac = <&dac>; + dac-channel-id = <0>; + dac-resolution = <12>; + }; +}; diff --git a/samples/drivers/dac/sample.yaml b/samples/drivers/dac/sample.yaml index 5375038b4d248d..fd758226402546 100644 --- a/samples/drivers/dac/sample.yaml +++ b/samples/drivers/dac/sample.yaml @@ -7,6 +7,7 @@ tests: arduino_zero frdm_k22f frdm_k64f nucleo_f091rc nucleo_g071rb nucleo_g431rb nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi nucleo_f429zi bl652_dvk bl653_dvk bl654_dvk bl5340_dvk_cpuapp stm32f3_disco stm32l562e_dk nucleo_l552ze_q + gd32f450i_eval depends_on: dac harness: console harness_config: