boards: add adc support for gd32 boards

This add adc support for gd32f350r_eval, gd32f450i_eval and
gd32vf103v_eval boards.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
This commit is contained in:
HaiLong Yang 2022-03-16 13:51:09 +08:00 committed by Carles Cufí
parent cd8e8f3826
commit f54df1640f
12 changed files with 61 additions and 1 deletions

View file

@ -62,6 +62,9 @@ The board configuration supports the following hardware features:
* - PINMUX
- :kconfig:option:`CONFIG_PINCTRL`
- :dtcompatible:`gd,gd32-pinctrl-af`
* - ADC
- :kconfig:option:`CONFIG_ADC`
- :dtcompatible:`gd,gd32-adc`
Serial Port
===========

View file

@ -11,4 +11,10 @@
pinmux = <USART0_TX_PA9>, <USART0_RX_PA10>;
};
};
adc0_default: adc0_default {
group1 {
pinmux = <ADC_IN11_PC1>;
};
};
};

View file

@ -26,3 +26,11 @@
pinctrl-0 = <&usart0_default>;
pinctrl-names = "default";
};
&adc0 {
status = "okay";
/* Set ADC0 clock source to RCU_ADCCK_APB2_DIV4. */
rcu-clock-source = <4>;
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
};

View file

@ -72,7 +72,8 @@ The board configuration supports the following hardware features:
+-----------+------------+-----------------------+
| UART | on-chip | serial port-polling |
+-----------+------------+-----------------------+
| ADC | on-chip | ADC |
+-----------+------------+-----------------------+
Serial Port
===========

View file

@ -12,6 +12,12 @@
};
};
adc0_default: adc0_default {
group1 {
pinmux = <ADC012_IN13_PC3>;
};
};
pwm0_default: pwm0_default {
group1 {
pinmux = <TIMER0_CH0_PA8_OUT_NORMP>;

View file

@ -88,6 +88,12 @@
status = "okay";
};
&adc0 {
status = "okay";
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
};
&usart0 {
status = "okay";
current-speed = <115200>;

View file

@ -86,6 +86,9 @@ The board configuration supports the following hardware features:
* - EEPROM
- :kconfig:option:`CONFIG_EEPROM`
- :dtcompatible:`atmel,at24`
* - ADC
- :kconfig:option:`CONFIG_ADC`
- :dtcompatible:`gd,gd32-adc`
Serial Port
===========

View file

@ -12,6 +12,12 @@
};
};
adc0_default: adc0_default {
group1 {
pinmux = <ADC012_IN13_PC3>;
};
};
dac_default: dac_default {
group1 {
pinmux = <DAC_OUT0_PA4>;

View file

@ -104,6 +104,12 @@
pinctrl-names = "default";
};
&adc0 {
status = "okay";
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
};
&dac {
status = "okay";
pinctrl-0 = <&dac_default>;

View file

@ -67,6 +67,9 @@ The board configuration supports the following hardware features:
* - USART
- :kconfig:option:`CONFIG_SERIAL`
- :dtcompatible:`gd,gd32-usart`
* - ADC
- :kconfig:option:`CONFIG_ADC`
- :dtcompatible:`gd,gd32-adc`
Serial Port
===========

View file

@ -30,4 +30,10 @@
<SPI0_MISO_PA6_OUT_NORMP>;
};
};
adc0_default: adc0_default {
group1 {
pinmux = <ADC01_IN13_PC3>;
};
};
};

View file

@ -137,3 +137,9 @@
jedec-id = [c8 40 15];
};
};
&adc0 {
status = "okay";
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
};