boards: frdm_mcxn947: Add support for dac

Add support for dac

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
This commit is contained in:
Zhaoxiang Jin 2024-03-26 08:45:39 +08:00 committed by Fabio Baltieri
commit e3937e99fc
6 changed files with 36 additions and 0 deletions

View file

@ -132,6 +132,22 @@ static int frdm_mcxn947_init(void)
CLOCK_EnableClock(kCLOCK_Gpio5); CLOCK_EnableClock(kCLOCK_Gpio5);
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(dac0), okay)
SPC_EnableActiveModeAnalogModules(SPC0, kSPC_controlDac0);
CLOCK_SetClkDiv(kCLOCK_DivDac0Clk, 1u);
CLOCK_AttachClk(kFRO_HF_to_DAC0);
CLOCK_EnableClock(kCLOCK_Dac0);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(dac1), okay)
SPC_EnableActiveModeAnalogModules(SPC0, kSPC_controlDac1);
CLOCK_SetClkDiv(kCLOCK_DivDac1Clk, 1u);
CLOCK_AttachClk(kFRO_HF_to_DAC1);
CLOCK_EnableClock(kCLOCK_Dac1);
#endif
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = CLOCK_INIT_CORE_CLOCK; SystemCoreClock = CLOCK_INIT_CORE_CLOCK;

View file

@ -69,6 +69,8 @@ The FRDM-MCXN947 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| FLEXSPI | on-chip | flash programming | | FLEXSPI | on-chip | flash programming |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| DAC | on-chip | dac |
+-----------+------------+-------------------------------------+
Targets available Targets available
================== ==================

View file

@ -49,4 +49,12 @@
bias-pull-up; bias-pull-up;
}; };
}; };
pinmux_dac0: pinmux_dac0 {
group0 {
pinmux = <DAC0_OUT_PIO4_2>;
drive-strength = "low";
slew-rate = "fast";
};
};
}; };

View file

@ -131,3 +131,8 @@
}; };
}; };
}; };
&dac0 {
pinctrl-0 = <&pinmux_dac0>;
pinctrl-names = "default";
};

View file

@ -92,3 +92,7 @@
&w25q64jvssiq { &w25q64jvssiq {
status = "okay"; status = "okay";
}; };
&dac0 {
status = "okay";
};

View file

@ -18,4 +18,5 @@ supported:
- dma - dma
- gpio - gpio
- spi - spi
- dac
vendor: nxp vendor: nxp