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: Neil Chen <cheng.chen_1@nxp.com>
This commit is contained in:
Neil Chen 2024-12-06 17:40:30 +08:00 committed by Benjamin Cabé
parent faba3cd42a
commit c6700e8ec5
4 changed files with 26 additions and 0 deletions

View file

@ -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. */

View file

@ -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 |
+-----------+------------+-------------------------------------+

View file

@ -107,3 +107,7 @@
pinctrl-0 = <&pinmux_lpadc0>;
pinctrl-names = "default";
};
&lptmr0 {
status = "okay";
};

View file

@ -18,6 +18,7 @@ supported:
- adc
- flash
- gpio
- counter
- dac
- pwm
vendor: nxp