boards: nxp: frdm_mcxn947: updated board support for CTimer

Updated the frdm_mcxn947 with support for the
CTimer counter.

Signed-off-by: William Tang <william.tang@nxp.com>
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
This commit is contained in:
Emilio Benavente 2024-04-08 04:33:19 +00:00 committed by Fabio Baltieri
parent 13735ff789
commit 4c47df19df
4 changed files with 32 additions and 0 deletions

View file

@ -166,6 +166,31 @@ static int frdm_mcxn947_init(void)
CLOCK_SetClkDiv(kCLOCK_DivWdt0Clk, 1u); CLOCK_SetClkDiv(kCLOCK_DivWdt0Clk, 1u);
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer0), okay)
CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER0);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer1), okay)
CLOCK_SetClkDiv(kCLOCK_DivCtimer1Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER1);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer2), okay)
CLOCK_SetClkDiv(kCLOCK_DivCtimer2Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER2);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer3), okay)
CLOCK_SetClkDiv(kCLOCK_DivCtimer3Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER3);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ctimer4), okay)
CLOCK_SetClkDiv(kCLOCK_DivCtimer4Clk, 1U);
CLOCK_AttachClk(kPLL0_to_CTIMER4);
#endif
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = CLOCK_INIT_CORE_CLOCK; SystemCoreClock = CLOCK_INIT_CORE_CLOCK;

View file

@ -80,6 +80,8 @@ The FRDM-MCXN947 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| PWM | on-chip | pwm | | PWM | on-chip | pwm |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| CTIMER | on-chip | counter |
+-----------+------------+-------------------------------------+
Targets available Targets available
================== ==================

View file

@ -137,3 +137,7 @@
&flexpwm1_pwm0 { &flexpwm1_pwm0 {
status = "okay"; status = "okay";
}; };
&ctimer0 {
status = "okay";
};

View file

@ -22,4 +22,5 @@ supported:
- i2c - i2c
- watchdog - watchdog
- pwm - pwm
- counter
vendor: nxp vendor: nxp