boards: nxp: frdm_mcxa156: Support dac for NXP frdm_mcxa156 board

Support dac for NXP frdm_mcxa156 board.

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
This commit is contained in:
Neil Chen 2024-11-29 14:49:59 +08:00 committed by Benjamin Cabé
commit bbec164673
5 changed files with 24 additions and 1 deletions

View file

@ -116,6 +116,14 @@ static int frdm_mcxa156_init(void)
CLOCK_AttachClk(kFRO12M_to_LPUART0); CLOCK_AttachClk(kFRO12M_to_LPUART0);
#endif #endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dac0))
SPC_EnableActiveModeAnalogModules(SPC0, kSPC_controlDac0);
CLOCK_SetClockDiv(kCLOCK_DivDAC0, 1u);
CLOCK_AttachClk(kFRO12M_to_DAC0);
CLOCK_EnableClock(kCLOCK_GateDAC0);
#endif
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = CLOCK_INIT_CORE_CLOCK; SystemCoreClock = CLOCK_INIT_CORE_CLOCK;

View file

@ -54,6 +54,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| FLASH | on-chip | soc flash | | FLASH | on-chip | soc flash |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| DAC | on-chip | dac |
+-----------+------------+-------------------------------------+
Targets available Targets available
================== ==================

View file

@ -16,5 +16,11 @@
input-enable; input-enable;
}; };
}; };
pinmux_dac0: pinmux_dac0 {
group0 {
pinmux = <DAC0_OUT_P2_2>;
drive-strength = "low";
slew-rate = "fast";
};
};
}; };

View file

@ -88,3 +88,9 @@
pinctrl-0 = <&pinmux_lpuart0>; pinctrl-0 = <&pinmux_lpuart0>;
pinctrl-names = "default"; pinctrl-names = "default";
}; };
&dac0 {
status = "okay";
pinctrl-0 = <&pinmux_dac0>;
pinctrl-names = "default";
};

View file

@ -16,4 +16,5 @@ toolchain:
- xtools - xtools
supported: supported:
- gpio - gpio
- dac
vendor: nxp vendor: nxp