refactor(gptimer): clean up SOC capabilities for GPTIMER and Timer Group

- Remove GPTIMER and TIMG related definitions from soc_caps_full.h files
- Move timer peripheral definitions to appropriate HAL layer files
- Update references across components to use proper HAL abstractions
- Consolidate timer group and GPTIMER capabilities organization
- Ensure consistent timer configuration across all ESP32 variants

This refactoring improves the separation of concerns between SOC
capabilities and HAL implementations for timer-related functionality.
This commit is contained in:
morris
2025-10-14 11:44:38 +08:00
parent 56c3dc4755
commit e8de5b5a95
80 changed files with 357 additions and 331 deletions
@@ -13,13 +13,13 @@
#include "soc/timer_group_struct.h"
#include "soc/dport_reg.h"
// Get timer group register base address with giving group number
#define LACT_LL_GET_HW(group_id) ((group_id == 0) ? (&TIMERG0) : (&TIMERG1))
#ifdef __cplusplus
extern "C" {
#endif
// Get timer group register base address with giving group number
#define LACT_LL_GET_HW(group_id) ((group_id == 0) ? (&TIMERG0) : (&TIMERG1))
/**
* @brief Set clock prescale for LACT timer
*
@@ -15,19 +15,25 @@
#include "soc/timer_group_struct.h"
#include "soc/dport_reg.h"
#ifdef __cplusplus
extern "C" {
#endif
// Total number of general purpose timers
#define TIMER_LL_GPTIMERS_TOTAL (TIMG_LL_INST_NUM * TIMG_LL_GPTIMERS_PER_INST)
// Get timer group register base address with giving group number
#define TIMER_LL_GET_HW(group_id) ((group_id == 0) ? (&TIMERG0) : (&TIMERG1))
// Bit width of GPTIMER counter
#define TIMER_LL_COUNTER_BIT_WIDTH 64
// Get alarm interrupt mask with the given timer ID
#define TIMER_LL_EVENT_ALARM(timer_id) (1 << (timer_id))
// Support APB as function clock
#define TIMER_LL_FUNC_CLOCK_SUPPORT_APB 1
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Set clock source for timer
*
@@ -14,6 +14,14 @@
#include "soc/timer_group_struct.h"
#include "soc/dport_reg.h"
#define TIMG_LL_GET(_attr) TIMG_LL_ ## _attr
// Number of Timer Group instances
#define TIMG_LL_INST_NUM 2
// Number of general purpose timers in each Timer Group
#define TIMG_LL_GPTIMERS_PER_INST 2
#ifdef __cplusplus
extern "C" {
#endif
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include "soc/timer_periph.h"
#include "hal/timer_periph.h"
const soc_timg_gptimer_signal_desc_t soc_timg_gptimer_signals[2][2] = {
[0] = {