kopia lustrzana https://github.com/espressif/esp-idf
esp_timer, hal: add support for non-integer systimer frequency
When ESP32-C2 is paired with a 26 MHz XTAL, the systimer tick frequency becomes equal to 26 / 2.5 = 10.4 MHz. Previously we always assumed that systimer tick frequency is integer (and 1 MHz * power of two, above that!). This commit introduces a new LL macro, SYSTIMER_LL_TICKS_PER_US_DIV. It should be set in such a way that: 1. SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV equals the actual systimer tick frequency, 2. and SYSTIMER_LL_TICKS_PER_US is integer. For ESP32-C2 this means that SYSTIMER_LL_TICKS_PER_US = 52 and SYSTIMER_LL_TICKS_PER_US_DIV = 5. This introduced two possible issues: 1. Overflow when multiplying systimer counter by 5 - Should not be an issue, since systimer counter is 52-bit, so counter * 5 is no more than 55-bit. 2. The code needs to perform: - divide by 5: when converting from microseconds to ticks - divide by 52: when converting from ticks to microseconds The latter potentially introduces a performance issue for the esp_timer_get_time function.pull/9408/head
rodzic
f0f9890096
commit
5b54ae76d4
|
@ -64,7 +64,7 @@ uint64_t IRAM_ATTR esp_timer_impl_get_counter_reg(void)
|
|||
|
||||
int64_t IRAM_ATTR esp_timer_impl_get_time(void)
|
||||
{
|
||||
return systimer_hal_get_counter_value(&systimer_hal, SYSTIMER_LL_COUNTER_CLOCK) / SYSTIMER_LL_TICKS_PER_US;
|
||||
return systimer_hal_get_counter_value(&systimer_hal, SYSTIMER_LL_COUNTER_CLOCK) * SYSTIMER_LL_TICKS_PER_US_DIV / SYSTIMER_LL_TICKS_PER_US;
|
||||
}
|
||||
|
||||
int64_t esp_timer_get_time(void) __attribute__((alias("esp_timer_impl_get_time")));
|
||||
|
@ -96,7 +96,7 @@ static void IRAM_ATTR timer_alarm_isr(void *arg)
|
|||
|
||||
void IRAM_ATTR esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us)
|
||||
{
|
||||
#if !SOC_SYSTIMER_FIXED_TICKS_US
|
||||
#if !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
systimer_hal_on_apb_freq_update(&systimer_hal, apb_ticks_per_us);
|
||||
#endif
|
||||
}
|
||||
|
@ -104,7 +104,9 @@ void IRAM_ATTR esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us)
|
|||
void esp_timer_impl_set(uint64_t new_us)
|
||||
{
|
||||
portENTER_CRITICAL_SAFE(&s_time_update_lock);
|
||||
systimer_counter_value_t new_count = { .val = new_us * SYSTIMER_LL_TICKS_PER_US };
|
||||
systimer_counter_value_t new_count = {
|
||||
.val = new_us * SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV
|
||||
};
|
||||
systimer_ll_set_counter_value(systimer_hal.dev, SYSTIMER_LL_COUNTER_CLOCK, new_count.val);
|
||||
systimer_ll_apply_counter_value(systimer_hal.dev, SYSTIMER_LL_COUNTER_CLOCK);
|
||||
portEXIT_CRITICAL_SAFE(&s_time_update_lock);
|
||||
|
@ -121,7 +123,7 @@ esp_err_t esp_timer_impl_early_init(void)
|
|||
{
|
||||
systimer_hal_init(&systimer_hal);
|
||||
|
||||
#if !SOC_SYSTIMER_FIXED_TICKS_US
|
||||
#if !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
assert(esp_clk_xtal_freq() == (40 * 1000000) &&
|
||||
"update the step for xtal to support other XTAL:APB frequency ratios");
|
||||
systimer_hal_set_steps_per_tick(&systimer_hal, 0, 2); // for xtal
|
||||
|
|
|
@ -9,13 +9,20 @@
|
|||
#include <stdbool.h>
|
||||
#include "soc/systimer_struct.h"
|
||||
#include "hal/assert.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#define SYSTIMER_LL_COUNTER_CLOCK (0) // Counter used for "wallclock" time
|
||||
#define SYSTIMER_LL_COUNTER_OS_TICK (1) // Counter used for OS tick
|
||||
#define SYSTIMER_LL_ALARM_OS_TICK_CORE0 (0) // Alarm used for OS tick of CPU core 0
|
||||
#define SYSTIMER_LL_ALARM_CLOCK (2) // Alarm used for "wallclock" time
|
||||
|
||||
#ifdef CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#define SYSTIMER_LL_TICKS_PER_US (52) // (26 / 2.5) = 10.4 = 52/5 systimer ticks per us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (5)
|
||||
#else
|
||||
#define SYSTIMER_LL_TICKS_PER_US (16) // 16 systimer ticks == 1us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (1)
|
||||
#endif // ESP32C2_XTAL_FREQ_*
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -24,6 +16,7 @@
|
|||
#define SYSTIMER_LL_ALARM_CLOCK (2) // Alarm used for "wallclock" time
|
||||
|
||||
#define SYSTIMER_LL_TICKS_PER_US (16) // 16 systimer ticks == 1us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define SYSTIMER_LL_ALARM_CLOCK (2) // Alarm used for "wallclock" time
|
||||
|
||||
#define SYSTIMER_LL_TICKS_PER_US (16) // 16 systimer ticks == 1us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
// Copyright 2020-2021 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -22,6 +14,7 @@
|
|||
#define SYSTIMER_LL_ALARM_CLOCK (2) // Alarm used for "wallclock" time
|
||||
|
||||
#define SYSTIMER_LL_TICKS_PER_US (80) // 80 systimer ticks == 1us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -25,6 +17,7 @@
|
|||
#define SYSTIMER_LL_ALARM_CLOCK (2) // Alarm used for "wallclock" time
|
||||
|
||||
#define SYSTIMER_LL_TICKS_PER_US (16) // 16 systimer ticks == 1us
|
||||
#define SYSTIMER_LL_TICKS_PER_US_DIV (1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -93,7 +85,7 @@ void systimer_hal_connect_alarm_counter(systimer_hal_context_t *hal, uint32_t al
|
|||
*/
|
||||
void systimer_hal_counter_can_stall_by_cpu(systimer_hal_context_t *hal, uint32_t counter_id, uint32_t cpu_id, bool can);
|
||||
|
||||
#if !SOC_SYSTIMER_FIXED_TICKS_US
|
||||
#if !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
/**
|
||||
* @brief set increase steps for systimer counter on different clock source
|
||||
*/
|
||||
|
|
|
@ -47,19 +47,25 @@ uint64_t systimer_hal_get_counter_value(systimer_hal_context_t *hal, uint32_t co
|
|||
|
||||
uint64_t systimer_hal_get_time(systimer_hal_context_t *hal, uint32_t counter_id)
|
||||
{
|
||||
return systimer_hal_get_counter_value(hal, counter_id) / SYSTIMER_LL_TICKS_PER_US;
|
||||
return systimer_hal_get_counter_value(hal, counter_id) * SYSTIMER_LL_TICKS_PER_US_DIV / SYSTIMER_LL_TICKS_PER_US;
|
||||
}
|
||||
|
||||
#if SOC_SYSTIMER_ALARM_MISS_COMPENSATE
|
||||
void systimer_hal_set_alarm_target(systimer_hal_context_t *hal, uint32_t alarm_id, uint64_t target)
|
||||
{
|
||||
systimer_counter_value_t alarm = { .val = target * SYSTIMER_LL_TICKS_PER_US};
|
||||
systimer_counter_value_t alarm = {
|
||||
.val = target * SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV
|
||||
};
|
||||
systimer_ll_enable_alarm(hal->dev, alarm_id, false);
|
||||
systimer_ll_set_alarm_target(hal->dev, alarm_id, alarm.val);
|
||||
systimer_ll_apply_alarm_value(hal->dev, alarm_id);
|
||||
systimer_ll_enable_alarm(hal->dev, alarm_id, true);
|
||||
}
|
||||
#else
|
||||
|
||||
#else // SOC_SYSTIMER_ALARM_MISS_COMPENSATE
|
||||
|
||||
_Static_assert(SYSTIMER_LL_TICKS_PER_US_DIV == 1, "SYSTIMER_LL_TICKS_PER_US_DIV > 1 && !SOC_SYSTIMER_ALARM_MISS_COMPENSATE hasn't been supported");
|
||||
|
||||
void systimer_hal_set_alarm_target(systimer_hal_context_t *hal, uint32_t alarm_id, uint64_t timestamp)
|
||||
{
|
||||
int64_t offset = SYSTIMER_LL_TICKS_PER_US * 2;
|
||||
|
@ -81,12 +87,12 @@ void systimer_hal_set_alarm_target(systimer_hal_context_t *hal, uint32_t alarm_i
|
|||
}
|
||||
} while (1);
|
||||
}
|
||||
#endif
|
||||
#endif // SOC_SYSTIMER_ALARM_MISS_COMPENSATE
|
||||
|
||||
void systimer_hal_set_alarm_period(systimer_hal_context_t *hal, uint32_t alarm_id, uint32_t period)
|
||||
{
|
||||
systimer_ll_enable_alarm(hal->dev, alarm_id, false);
|
||||
systimer_ll_set_alarm_period(hal->dev, alarm_id, period * SYSTIMER_LL_TICKS_PER_US);
|
||||
systimer_ll_set_alarm_period(hal->dev, alarm_id, period * SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV);
|
||||
systimer_ll_apply_alarm_value(hal->dev, alarm_id);
|
||||
systimer_ll_enable_alarm(hal->dev, alarm_id, true);
|
||||
}
|
||||
|
@ -103,7 +109,10 @@ void systimer_hal_enable_alarm_int(systimer_hal_context_t *hal, uint32_t alarm_i
|
|||
|
||||
void systimer_hal_counter_value_advance(systimer_hal_context_t *hal, uint32_t counter_id, int64_t time_us)
|
||||
{
|
||||
systimer_counter_value_t new_count = { .val = systimer_hal_get_counter_value(hal, counter_id) + time_us * SYSTIMER_LL_TICKS_PER_US };
|
||||
systimer_counter_value_t new_count = {
|
||||
.val = systimer_hal_get_counter_value(hal, counter_id)
|
||||
+ time_us * SYSTIMER_LL_TICKS_PER_US / SYSTIMER_LL_TICKS_PER_US_DIV
|
||||
};
|
||||
systimer_ll_set_counter_value(hal->dev, counter_id, new_count.val);
|
||||
systimer_ll_apply_counter_value(hal->dev, counter_id);
|
||||
}
|
||||
|
@ -137,7 +146,10 @@ void systimer_hal_counter_can_stall_by_cpu(systimer_hal_context_t *hal, uint32_t
|
|||
systimer_ll_counter_can_stall_by_cpu(hal->dev, counter_id, cpu_id, can);
|
||||
}
|
||||
|
||||
#if !SOC_SYSTIMER_FIXED_TICKS_US
|
||||
#if !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
|
||||
_Static_assert(SYSTIMER_LL_TICKS_PER_US_DIV == 1, "SYSTIMER_LL_TICKS_PER_US_DIV > 1 && !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US hasn't been supported");
|
||||
|
||||
void systimer_hal_set_steps_per_tick(systimer_hal_context_t *hal, int clock_source, uint32_t steps)
|
||||
{
|
||||
/* Configure the counter:
|
||||
|
@ -171,4 +183,4 @@ void systimer_hal_on_apb_freq_update(systimer_hal_context_t *hal, uint32_t apb_t
|
|||
systimer_ll_set_step_for_xtal(hal->dev, SYSTIMER_LL_TICKS_PER_US / apb_ticks_per_us);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // !SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
|
|
|
@ -411,9 +411,9 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
|
|||
int
|
||||
default 20
|
||||
|
||||
config SOC_SYSTIMER_FIXED_TICKS_US
|
||||
int
|
||||
default 16
|
||||
config SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_SYSTIMER_INT_LEVEL
|
||||
bool
|
||||
|
|
|
@ -203,14 +203,14 @@
|
|||
#define SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED 1
|
||||
|
||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_FIXED_TICKS_US (16) // Number of ticks per microsecond is fixed
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US (1) // Number of ticks per microsecond is fixed (16 ticks/us if 40MHz XTAL; 10.4 ticks/us if 26MHz XTAL)
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
|
||||
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
|
||||
#define SOC_TIMER_GROUPS (1U)
|
||||
|
|
|
@ -603,9 +603,9 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
|
|||
int
|
||||
default 20
|
||||
|
||||
config SOC_SYSTIMER_FIXED_TICKS_US
|
||||
int
|
||||
default 16
|
||||
config SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_SYSTIMER_INT_LEVEL
|
||||
bool
|
||||
|
|
|
@ -283,14 +283,14 @@
|
|||
#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1
|
||||
|
||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_FIXED_TICKS_US (16) // Number of ticks per microsecond is fixed
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US (1) // Number of ticks per microsecond is fixed (16 ticks/us)
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
|
||||
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
|
||||
#define SOC_TIMER_GROUPS (2)
|
||||
|
|
|
@ -579,9 +579,9 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
|
|||
int
|
||||
default 20
|
||||
|
||||
config SOC_SYSTIMER_FIXED_TICKS_US
|
||||
int
|
||||
default 16
|
||||
config SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_SYSTIMER_INT_LEVEL
|
||||
bool
|
||||
|
|
|
@ -288,14 +288,14 @@
|
|||
#define SOC_MEMSPI_SRC_FREQ_12M_SUPPORTED 1
|
||||
|
||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_FIXED_TICKS_US (16) // Number of ticks per microsecond is fixed
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US (1) // Number of ticks per microsecond is fixed (16 ticks/us)
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level interrupt
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
|
||||
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
|
||||
#define SOC_TIMER_GROUPS (2)
|
||||
|
|
|
@ -679,9 +679,9 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
|
|||
int
|
||||
default 20
|
||||
|
||||
config SOC_SYSTIMER_FIXED_TICKS_US
|
||||
int
|
||||
default 16
|
||||
config SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_SYSTIMER_INT_LEVEL
|
||||
bool
|
||||
|
|
|
@ -277,14 +277,14 @@
|
|||
#define SOC_SPIRAM_SUPPORTED 1
|
||||
|
||||
/*-------------------------- SYS TIMER CAPS ----------------------------------*/
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_FIXED_TICKS_US (16) // Number of ticks per microsecond is fixed
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
#define SOC_SYSTIMER_SUPPORTED 1
|
||||
#define SOC_SYSTIMER_COUNTER_NUM (2) // Number of counter units
|
||||
#define SOC_SYSTIMER_ALARM_NUM (3) // Number of alarm units
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_LO (32) // Bit width of systimer low part
|
||||
#define SOC_SYSTIMER_BIT_WIDTH_HI (20) // Bit width of systimer high part
|
||||
#define SOC_SYSTIMER_HAS_FIXED_TICKS_PER_US (1) // Number of ticks per microsecond is fixed (16 ticks/us)
|
||||
#define SOC_SYSTIMER_INT_LEVEL (1) // Systimer peripheral uses level
|
||||
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE (1) // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
|
||||
|
||||
/*-------------------------- TIMER GROUP CAPS --------------------------------*/
|
||||
#define SOC_TIMER_GROUPS (2)
|
||||
|
|
|
@ -758,7 +758,6 @@ components/hal/esp32c3/include/hal/rtc_cntl_ll.h
|
|||
components/hal/esp32c3/include/hal/sha_ll.h
|
||||
components/hal/esp32c3/include/hal/sigmadelta_ll.h
|
||||
components/hal/esp32c3/include/hal/spi_flash_encrypted_ll.h
|
||||
components/hal/esp32c3/include/hal/systimer_ll.h
|
||||
components/hal/esp32c3/include/hal/uhci_ll.h
|
||||
components/hal/esp32c3/include/hal/usb_serial_jtag_ll.h
|
||||
components/hal/esp32c3/rtc_cntl_hal.c
|
||||
|
@ -785,7 +784,6 @@ components/hal/esp32s2/include/hal/rtc_io_ll.h
|
|||
components/hal/esp32s2/include/hal/sha_ll.h
|
||||
components/hal/esp32s2/include/hal/sigmadelta_ll.h
|
||||
components/hal/esp32s2/include/hal/spi_flash_encrypted_ll.h
|
||||
components/hal/esp32s2/include/hal/systimer_ll.h
|
||||
components/hal/esp32s2/include/hal/trace_ll.h
|
||||
components/hal/esp32s2/include/hal/usb_ll.h
|
||||
components/hal/esp32s2/touch_sensor_hal.c
|
||||
|
@ -795,7 +793,6 @@ components/hal/esp32s3/include/hal/rwdt_ll.h
|
|||
components/hal/esp32s3/include/hal/sha_ll.h
|
||||
components/hal/esp32s3/include/hal/sigmadelta_ll.h
|
||||
components/hal/esp32s3/include/hal/spi_flash_encrypted_ll.h
|
||||
components/hal/esp32s3/include/hal/systimer_ll.h
|
||||
components/hal/esp32s3/include/hal/uhci_ll.h
|
||||
components/hal/esp32s3/include/hal/usb_ll.h
|
||||
components/hal/esp32s3/include/hal/usb_serial_jtag_ll.h
|
||||
|
@ -815,7 +812,6 @@ components/hal/include/hal/sigmadelta_hal.h
|
|||
components/hal/include/hal/spi_flash_encrypt_hal.h
|
||||
components/hal/include/hal/spi_slave_hal.h
|
||||
components/hal/include/hal/spi_slave_hd_hal.h
|
||||
components/hal/include/hal/systimer_hal.h
|
||||
components/hal/include/hal/twai_types.h
|
||||
components/hal/include/hal/uhci_types.h
|
||||
components/hal/include/hal/usb_hal.h
|
||||
|
|
Ładowanie…
Reference in New Issue