Skip to content

Commit 3c050cf

Browse files
piotrkoziarkartben
authored andcommitted
modules: hal_nordic: nrf_802154: emit hfclk_ready with timer on nRF54LM20A
Right now, the power_clock_irq is not available on nRF54LM20A. Since the onoff mechanism relies on the irq, the timer is used to emit the hfclk_ready callback. Signed-off-by: Piotr Koziar <piotr.koziar@nordicsemi.no>
1 parent fd3cc9b commit 3c050cf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

modules/hal_nordic/nrf_802154/sl_opensource/platform/nrf_802154_clock_zephyr.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ static void hfclk_on_callback(struct onoff_manager *mgr,
4444
}
4545

4646
#if defined(CONFIG_CLOCK_CONTROL_NRF)
47+
48+
#if defined(NRF54LM20A_ENGA_XXAA)
49+
/* HF clock time to ramp-up. */
50+
#define MAX_HFXO_RAMP_UP_TIME_US 550
51+
52+
static void hfclk_started_timer_handler(struct k_timer *dummy)
53+
{
54+
hfclk_on_callback(NULL, NULL, 0, 0);
55+
}
56+
57+
K_TIMER_DEFINE(hfclk_started_timer, hfclk_started_timer_handler, NULL);
58+
#endif
59+
4760
void nrf_802154_clock_hfclk_start(void)
4861
{
4962
struct onoff_manager *mgr =
@@ -64,6 +77,15 @@ void nrf_802154_clock_hfclk_start(void)
6477
int ret = onoff_request(mgr, &hfclk_cli);
6578
__ASSERT_NO_MSG(ret >= 0);
6679
(void)ret;
80+
81+
#if defined(NRF54LM20A_ENGA_XXAA)
82+
/*
83+
* Right now, the power_clock_irq is not available on nRF54LM20A.
84+
* Since the onoff mechanism relies on the irq, the timer is used
85+
* to emit the hfclk_ready callback.
86+
*/
87+
k_timer_start(&hfclk_started_timer, K_USEC(MAX_HFXO_RAMP_UP_TIME_US), K_NO_WAIT);
88+
#endif
6789
}
6890

6991
void nrf_802154_clock_hfclk_stop(void)

0 commit comments

Comments
 (0)