We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caa4721 commit d048c44Copy full SHA for d048c44
drivers/dac/dac_gd32.c
@@ -20,10 +20,14 @@
20
LOG_MODULE_REGISTER(dac_gd32, CONFIG_DAC_LOG_LEVEL);
21
22
/**
23
- * GD32 DAC HAL use different DAC0 interface for 2 or 1 output channels SoCs.
24
- * Unify the DAC0 interface to DAC0_xx.
+ * For some gd32 series which only have 1 DAC, their HAL name may not same as others.
+ * Below definitions help to unify the HAL name.
25
*/
26
-#if DT_INST_PROP(0, num_channels) == 1
+#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)
31
#define DAC_CTL_DEN0 DAC_CTL_DEN
32
#define DAC0_R8DH DAC_R8DH
33
#define DAC0_R12DH DAC_R12DH
0 commit comments