File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,25 @@ static int frdm_mcxa156_init(void)
129129 CLOCK_AttachClk (kFRO12M_to_ADC0 );
130130
131131 CLOCK_EnableClock (kCLOCK_GateADC0 );
132+ #endif
133+
134+ #if DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (lptmr0 ))
135+
136+ /*
137+ * Clock Select Decides what input source the lptmr will clock from
138+ *
139+ * 0 <- Reserved
140+ * 1 <- 16K FRO
141+ * 2 <- Reserved
142+ * 3 <- Combination of clocks configured in MRCC_LPTMR0_CLKSEL[MUX] field
143+ */
144+ #if DT_PROP (DT_NODELABEL (lptmr0 ), clk_source ) == 0x1
145+ CLOCK_SetupFRO16KClocking (kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN );
146+ #elif DT_PROP (DT_NODELABEL (lptmr0 ), clk_source ) == 0x3
147+ CLOCK_SetClockDiv (kCLOCK_DivLPTMR0 , 1u );
148+ CLOCK_AttachClk (kFRO12M_to_LPTMR0 );
149+ #endif /* DT_PROP(DT_NODELABEL(lptmr0), clk_source) */
150+
132151#endif
133152
134153 /* Set SystemCoreClock variable. */
Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
5858+-----------+------------+-------------------------------------+
5959| DAC | on-chip | dac |
6060+-----------+------------+-------------------------------------+
61+ | LPTMR | on-chip | counter |
62+ +-----------+------------+-------------------------------------+
6163| PWM | on-chip | pwm |
6264+-----------+------------+-------------------------------------+
6365
Original file line number Diff line number Diff line change 107107 pinctrl-0 = <&pinmux_lpadc0>;
108108 pinctrl-names = "default";
109109};
110+
111+ &lptmr0 {
112+ status = "okay";
113+ };
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ supported:
1818 - adc
1919 - flash
2020 - gpio
21+ - counter
2122 - dac
2223 - pwm
2324vendor : nxp
You can’t perform that action at this time.
0 commit comments