| 33 | } |
| 34 | |
| 35 | void begin() |
| 36 | { |
| 37 | periph_module_enable(timer_group_periph_signals.groups[group].module); |
| 38 | enable_counter(false); |
| 39 | enable_alarm(true); |
| 40 | set_alarm_value(0); |
| 41 | #if ESP_IDF_VERSION_MAJOR < 5 |
| 42 | timer_ll_set_counter_increase(dev, index, false); |
| 43 | #else |
| 44 | timer_ll_set_count_direction(dev, index, GPTIMER_COUNT_DOWN); |
| 45 | timer_ll_set_clock_source(dev, index, GPTIMER_CLK_SRC_DEFAULT); |
| 46 | #endif |
| 47 | } |
| 48 | |
| 49 | void IRAM_ATTR attach_interrupt(hw_timer_source_type_t, hw_timer_callback_t callback, void* arg) |
| 50 | { |