forked from espressif/esp-idf
feat(ulp): LP Timer interrupt support
This commit adds support for the LP Timer interrupt to be used by the LP Core. Merges https://github.com/espressif/esp-idf/pull/15717
This commit is contained in:
@ -73,6 +73,11 @@ FORCE_INLINE_ATTR void lp_timer_ll_clear_lp_intsts_mask(lp_timer_dev_t *dev, uin
|
||||
dev->lp_int_clr.val = mask;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, bool enable)
|
||||
{
|
||||
dev->lp_int_ena.main_timer_lp_int_ena = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -73,6 +73,11 @@ FORCE_INLINE_ATTR void lp_timer_ll_clear_lp_intsts_mask(lp_timer_dev_t *dev, uin
|
||||
dev->lp_int_clr.val = mask;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, bool enable)
|
||||
{
|
||||
dev->lp_int_en.alarm = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -73,6 +73,11 @@ FORCE_INLINE_ATTR void lp_timer_ll_clear_lp_intsts_mask(lp_timer_dev_t *dev, uin
|
||||
dev->lp_int_clr.val = mask;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, bool enable)
|
||||
{
|
||||
dev->lp_int_ena.main_timer_lp_int_ena = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -57,6 +57,11 @@ FORCE_INLINE_ATTR void lp_timer_ll_clear_overflow_intr_status(lp_timer_dev_t *de
|
||||
dev->int_clr.overflow = 1;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, bool enable)
|
||||
{
|
||||
dev->lp_int_en.alarm = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -73,6 +73,11 @@ FORCE_INLINE_ATTR void lp_timer_ll_clear_lp_intsts_mask(lp_timer_dev_t *dev, uin
|
||||
dev->lp_int_clr.val = mask;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, bool enable)
|
||||
{
|
||||
dev->lp_int_ena.main_timer_lp_int_ena = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -104,6 +104,20 @@ void ulp_lp_core_sw_intr_enable(bool enable);
|
||||
*/
|
||||
void ulp_lp_core_sw_intr_clear(void);
|
||||
|
||||
#if SOC_LP_TIMER_SUPPORTED
|
||||
/**
|
||||
* @brief Enable the LP Timer interrupt
|
||||
*
|
||||
*/
|
||||
void ulp_lp_core_lp_timer_intr_enable(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Clear the interrupt status for the LP Timer interrupt
|
||||
*
|
||||
*/
|
||||
void ulp_lp_core_lp_timer_intr_clear(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Puts the CPU into a wait state until an interrupt is triggered
|
||||
*
|
||||
|
@ -191,6 +191,18 @@ void ulp_lp_core_sw_intr_clear(void)
|
||||
pmu_ll_lp_clear_sw_intr_status(&PMU);
|
||||
}
|
||||
|
||||
#if SOC_LP_TIMER_SUPPORTED
|
||||
void ulp_lp_core_lp_timer_intr_enable(bool enable)
|
||||
{
|
||||
lp_timer_ll_lp_alarm_intr_enable(&LP_TIMER, enable);
|
||||
}
|
||||
|
||||
void ulp_lp_core_lp_timer_intr_clear(void)
|
||||
{
|
||||
lp_timer_ll_clear_lp_alarm_intr_status(&LP_TIMER);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ulp_lp_core_wait_for_intr(void)
|
||||
{
|
||||
asm volatile("wfi");
|
||||
|
Reference in New Issue
Block a user