hal: Adds hal/ll func for SYSTIMER to select clock source: XTAL or RC_FAST_CLK

This commit is contained in:
KonstantinKondrashov
2022-11-17 21:29:16 +08:00
parent 670fda877d
commit 63f852adc8
17 changed files with 167 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "soc/systimer_struct.h"
#include "soc/clk_tree_defs.h"
#include "hal/assert.h"
#define SYSTIMER_LL_COUNTER_CLOCK 0 // Counter used by esptimer, to generate the system level wall clock
@@ -29,6 +30,16 @@ __attribute__((always_inline)) static inline void systimer_ll_enable_clock(systi
dev->conf.clk_en = en;
}
static inline void systimer_ll_set_clock_source(soc_periph_systimer_clk_src_t clk_src)
{
(void)clk_src;
}
static inline soc_periph_systimer_clk_src_t systimer_ll_get_clock_source(void)
{
return SYSTIMER_CLK_SRC_XTAL;
}
/******************* Counter *************************/
__attribute__((always_inline)) static inline void systimer_ll_enable_counter(systimer_dev_t *dev, uint32_t counter_id, bool en)