systimer: support etm event

This commit is contained in:
morris
2022-11-23 15:32:34 +08:00
parent 00b6ec28b2
commit 560ea9b754
16 changed files with 362 additions and 3 deletions
+4 -2
View File
@@ -192,8 +192,10 @@ wdt_hal_is_enabled = 0x400003bc;
***************************************/
/* Functions */
systimer_hal_init = 0x400003c0;
systimer_hal_deinit = 0x400003c4;
/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */
/* systimer_hal_init = 0x400003c0; */
/* systimer_hal_deinit = 0x400003c4; */
systimer_hal_set_tick_rate_ops = 0x400003c8;
systimer_hal_get_counter_value = 0x400003cc;
systimer_hal_get_time = 0x400003d0;
@@ -64,4 +64,20 @@ void systimer_hal_counter_value_advance(systimer_hal_context_t *hal, uint32_t co
}
#endif // CONFIG_IDF_TARGET_ESP32C2
#if CONFIG_IDF_TARGET_ESP32C6
void systimer_hal_init(systimer_hal_context_t *hal)
{
hal->dev = &SYSTIMER;
systimer_ll_enable_clock(hal->dev, true);
systimer_ll_enable_etm(&SYSTIMER, true);
}
void systimer_hal_deinit(systimer_hal_context_t *hal)
{
systimer_ll_enable_etm(&SYSTIMER, false);
systimer_ll_enable_clock(hal->dev, false);
hal->dev = NULL;
}
#endif // CONFIG_IDF_TARGET_ESP32C6
#endif // CONFIG_HAL_SYSTIMER_USE_ROM_IMPL