Skip to content

Commit d048c44

Browse files
feilongflcarlescufi
authored andcommitted
drivers: gd32-dac: add support for gd32a50x
add macro for gd32a50x Signed-off-by: YuLong Yao <[email protected]>
1 parent caa4721 commit d048c44

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/dac/dac_gd32.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
LOG_MODULE_REGISTER(dac_gd32, CONFIG_DAC_LOG_LEVEL);
2121

2222
/**
23-
* GD32 DAC HAL use different DAC0 interface for 2 or 1 output channels SoCs.
24-
* Unify the DAC0 interface to DAC0_xx.
23+
* For some gd32 series which only have 1 DAC, their HAL name may not same as others.
24+
* Below definitions help to unify the HAL name.
2525
*/
26-
#if DT_INST_PROP(0, num_channels) == 1
26+
#if defined(CONFIG_SOC_SERIES_GD32A50X)
27+
#define DAC_CTL_DEN0 DAC_CTL_DEN
28+
#define DAC0_R8DH OUT_R8DH
29+
#define DAC0_R12DH OUT_R12DH
30+
#elif defined(CONFIG_SOC_SERIES_GD32F3X0)
2731
#define DAC_CTL_DEN0 DAC_CTL_DEN
2832
#define DAC0_R8DH DAC_R8DH
2933
#define DAC0_R12DH DAC_R12DH

0 commit comments

Comments
 (0)