esp-idf/components/soc/esp32h2
Ivan Grokhotkov 5b54ae76d4 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.
2022-07-11 12:24:37 +08:00
..
include esp_timer, hal: add support for non-integer systimer frequency 2022-07-11 12:24:37 +08:00
ld soc: Adds efuse hal 2022-02-24 22:20:09 +08:00
adc_periph.c adc: create common adc hal layer 2022-05-07 19:20:44 +08:00
CMakeLists.txt temperature_sensor: Add temperature sensor support for ESP32-C2 2022-06-23 15:36:43 +08:00
dedic_gpio_periph.c fast_gpio: driver support on esp32c3 2021-09-06 19:39:09 +08:00
gdma_periph.c gdma: support IRAM interrupt 2021-11-08 16:14:51 +08:00
gpio_periph.c esp32h2: support GPIO peripheral, IO_MUX, GPIO matrix. 2022-03-04 11:25:05 +08:00
i2c_bias.h esp32h2: add rtc clock support 2021-08-26 11:25:39 +08:00
i2c_periph.c esp32h2: copy driver/hal/soc components from esp32c3 2021-07-01 19:53:11 +08:00
i2c_pmu.h esp32h2: add rtc clock support 2021-08-26 11:25:39 +08:00
i2c_ulp.h esp32h2: add rtc clock support 2021-08-26 11:25:39 +08:00
i2s_periph.c i2s: update copyright 2022-02-21 21:28:48 +08:00
interrupts.c esp32h2: update reg and struct for beta2 2021-11-24 12:34:17 +08:00
ledc_periph.c esp32h2: copy driver/hal/soc components from esp32c3 2021-07-01 19:53:11 +08:00
rmt_periph.c rmt: document and improve LL driver 2022-03-09 10:58:12 +08:00
sigmadelta_periph.c esp32h2: copy driver/hal/soc components from esp32c3 2021-07-01 19:53:11 +08:00
spi_periph.c esp32h2: copy driver/hal/soc components from esp32c3 2021-07-01 19:53:11 +08:00
temperature_sensor_periph.c temperature_sensor: Add temperature sensor support for ESP32-C2 2022-06-23 15:36:43 +08:00
timer_periph.c gptimer: clean up hal and ll for driver-ng 2021-10-20 18:40:08 +08:00
uart_periph.c uart: uart_set_pin function will now use IOMUX whenever possible 2021-08-04 12:48:30 +08:00