Skip to content

Commit bbec164

Browse files
NeilChen93kartben
authored andcommitted
boards: nxp: frdm_mcxa156: Support dac for NXP frdm_mcxa156 board
Support dac for NXP frdm_mcxa156 board. Signed-off-by: Neil Chen <[email protected]>
1 parent 2d37c3d commit bbec164

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

boards/nxp/frdm_mcxa156/board.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ static int frdm_mcxa156_init(void)
116116
CLOCK_AttachClk(kFRO12M_to_LPUART0);
117117
#endif
118118

119+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dac0))
120+
SPC_EnableActiveModeAnalogModules(SPC0, kSPC_controlDac0);
121+
CLOCK_SetClockDiv(kCLOCK_DivDAC0, 1u);
122+
CLOCK_AttachClk(kFRO12M_to_DAC0);
123+
124+
CLOCK_EnableClock(kCLOCK_GateDAC0);
125+
#endif
126+
119127
/* Set SystemCoreClock variable. */
120128
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
121129

boards/nxp/frdm_mcxa156/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
5454
+-----------+------------+-------------------------------------+
5555
| FLASH | on-chip | soc flash |
5656
+-----------+------------+-------------------------------------+
57+
| DAC | on-chip | dac |
58+
+-----------+------------+-------------------------------------+
5759

5860
Targets available
5961
==================

boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@
1616
input-enable;
1717
};
1818
};
19-
19+
pinmux_dac0: pinmux_dac0 {
20+
group0 {
21+
pinmux = <DAC0_OUT_P2_2>;
22+
drive-strength = "low";
23+
slew-rate = "fast";
24+
};
25+
};
2026
};

boards/nxp/frdm_mcxa156/frdm_mcxa156.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@
8888
pinctrl-0 = <&pinmux_lpuart0>;
8989
pinctrl-names = "default";
9090
};
91+
92+
&dac0 {
93+
status = "okay";
94+
pinctrl-0 = <&pinmux_dac0>;
95+
pinctrl-names = "default";
96+
};

boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ toolchain:
1616
- xtools
1717
supported:
1818
- gpio
19+
- dac
1920
vendor: nxp

0 commit comments

Comments
 (0)