Skip to content

Commit 7ed7b3c

Browse files
NeilChen93kartben
authored andcommitted
boards: nxp: frdm_mcxa153: Support lptmr for NXP frdm_mcxa153 board
Support lptmr for NXP frdm_mcxa153 board. Test using tests/drivers/counter/counter_basic_api. Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
1 parent e66e545 commit 7ed7b3c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

boards/nxp/frdm_mcxa153/board.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,25 @@ void board_early_init_hook(void)
133133
CLOCK_AttachClk(kFRO12M_to_LPSPI1);
134134
#endif
135135

136+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lptmr0))
137+
138+
/*
139+
* Clock Select Decides what input source the lptmr will clock from
140+
*
141+
* 0 <- Reserved
142+
* 1 <- 16K FRO
143+
* 2 <- Reserved
144+
* 3 <- Combination of clocks configured in MRCC_LPTMR0_CLKSEL[MUX] field
145+
*/
146+
#if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1
147+
CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN);
148+
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3
149+
CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u);
150+
CLOCK_AttachClk(kFRO12M_to_LPTMR0);
151+
#endif /* DT_PROP(DT_NODELABEL(lptmr0), clk_source) */
152+
153+
#endif
154+
136155
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0))
137156
CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u);
138157
CLOCK_AttachClk(kFRO12M_to_LPUART0);

boards/nxp/frdm_mcxa153/frdm_mcxa153.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@
148148
pinctrl-names = "default";
149149
};
150150

151+
&lptmr0 {
152+
status = "okay";
153+
};
154+
151155
&lpuart0 {
152156
status = "okay";
153157
current-speed = <115200>;

0 commit comments

Comments
 (0)