Commit c6700e8e authored by Neil Chen's avatar Neil Chen Committed by Benjamin Cabé
Browse files

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

Support lptmr for NXP frdm_mcxa156 board.
Test using tests/drivers/counter/counter_basic_api.

Signed-off-by: default avatarNeil Chen <cheng.chen_1@nxp.com>
parent faba3cd4
Loading
Loading
Loading
Loading
+19 −0
Changes for boards/nxp/frdm_mcxa156/board.c: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -129,6 +129,25 @@ static int frdm_mcxa156_init(void)
	CLOCK_AttachClk(kFRO12M_to_ADC0);

	CLOCK_EnableClock(kCLOCK_GateADC0);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lptmr0))

/*
 * Clock Select Decides what input source the lptmr will clock from
 *
 * 0 <- Reserved
 * 1 <- 16K FRO
 * 2 <- Reserved
 * 3 <- Combination of clocks configured in MRCC_LPTMR0_CLKSEL[MUX] field
 */
#if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1
	CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN);
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3
	CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u);
	CLOCK_AttachClk(kFRO12M_to_LPTMR0);
#endif /* DT_PROP(DT_NODELABEL(lptmr0), clk_source) */

#endif

	/* Set SystemCoreClock variable. */
+2 −0
Changes for boards/nxp/frdm_mcxa156/doc/index.rst: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+
| DAC       | on-chip    | dac                                 |
+-----------+------------+-------------------------------------+
| LPTMR     | on-chip    | counter                             |
+-----------+------------+-------------------------------------+
| PWM       | on-chip    | pwm                                 |
+-----------+------------+-------------------------------------+

+4 −0
Changes for boards/nxp/frdm_mcxa156/frdm_mcxa156.dts: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -107,3 +107,7 @@
	pinctrl-0 = <&pinmux_lpadc0>;
	pinctrl-names = "default";
};

&lptmr0 {
	status = "okay";
};
+1 −0
Changes for boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ supported:
  - adc
  - flash
  - gpio
  - counter
  - dac
  - pwm
vendor: nxp