samples: drivers: adc: add gd32 boards support
This add gd32 boards support for the adc sample. Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
This commit is contained in:
parent
f54df1640f
commit
de052b2993
5 changed files with 109 additions and 1 deletions
27
samples/drivers/adc/boards/gd32f350r_eval.overlay
Normal file
27
samples/drivers/adc/boards/gd32f350r_eval.overlay
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 BrainCo Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/dt-bindings/adc/adc.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
zephyr,user {
|
||||||
|
/* adjust channel number according to pinmux in board.dts */
|
||||||
|
io-channels = <&adc0 11>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&adc0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
channel@b {
|
||||||
|
reg = <11>;
|
||||||
|
zephyr,gain = "ADC_GAIN_1";
|
||||||
|
zephyr,reference = "ADC_REF_INTERNAL";
|
||||||
|
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||||
|
zephyr,resolution = <12>;
|
||||||
|
};
|
||||||
|
};
|
27
samples/drivers/adc/boards/gd32f403z_eval.overlay
Normal file
27
samples/drivers/adc/boards/gd32f403z_eval.overlay
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 BrainCo Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/dt-bindings/adc/adc.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
zephyr,user {
|
||||||
|
/* adjust channel number according to pinmux in board.dts */
|
||||||
|
io-channels = <&adc0 13>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&adc0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
channel@d {
|
||||||
|
reg = <13>;
|
||||||
|
zephyr,gain = "ADC_GAIN_1";
|
||||||
|
zephyr,reference = "ADC_REF_INTERNAL";
|
||||||
|
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||||
|
zephyr,resolution = <12>;
|
||||||
|
};
|
||||||
|
};
|
27
samples/drivers/adc/boards/gd32f450i_eval.overlay
Normal file
27
samples/drivers/adc/boards/gd32f450i_eval.overlay
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 BrainCo Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/dt-bindings/adc/adc.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
zephyr,user {
|
||||||
|
/* adjust channel number according to pinmux in board.dts */
|
||||||
|
io-channels = <&adc0 13>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&adc0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
channel@d {
|
||||||
|
reg = <13>;
|
||||||
|
zephyr,gain = "ADC_GAIN_1";
|
||||||
|
zephyr,reference = "ADC_REF_INTERNAL";
|
||||||
|
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||||
|
zephyr,resolution = <12>;
|
||||||
|
};
|
||||||
|
};
|
27
samples/drivers/adc/boards/gd32vf103v_eval.overlay
Normal file
27
samples/drivers/adc/boards/gd32vf103v_eval.overlay
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 BrainCo Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/dt-bindings/adc/adc.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
zephyr,user {
|
||||||
|
/* adjust channel number according to pinmux in board.dts */
|
||||||
|
io-channels = <&adc0 13>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&adc0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
channel@d {
|
||||||
|
reg = <13>;
|
||||||
|
zephyr,gain = "ADC_GAIN_1";
|
||||||
|
zephyr,reference = "ADC_REF_INTERNAL";
|
||||||
|
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
|
||||||
|
zephyr,resolution = <12>;
|
||||||
|
};
|
||||||
|
};
|
|
@ -6,7 +6,7 @@ tests:
|
||||||
depends_on: adc
|
depends_on: adc
|
||||||
platform_allow: nucleo_l073rz disco_l475_iot1 cc3220sf_launchxl
|
platform_allow: nucleo_l073rz disco_l475_iot1 cc3220sf_launchxl
|
||||||
cc3235sf_launchxl stm32l496g_disco nrf51dk_nrf51422 nrf52840dk_nrf52840
|
cc3235sf_launchxl stm32l496g_disco nrf51dk_nrf51422 nrf52840dk_nrf52840
|
||||||
mec172xevb_assy6906
|
mec172xevb_assy6906 gd32f350r_eval gd32f450i_eval gd32vf103v_eval gd32f403z_eval
|
||||||
integration_platforms:
|
integration_platforms:
|
||||||
- nucleo_l073rz
|
- nucleo_l073rz
|
||||||
- nrf52840dk_nrf52840
|
- nrf52840dk_nrf52840
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue