

config: Pointer to timer initialization parameters.Įsp_err_t timer_get_config ( timer_group_t group_num, timer_idx_t timer_num, timer_config_t * config ) ¶.If non-NULL, a handle for the interrupt will be returned here.Įsp_err_t timer_init ( timer_group_t group_num, timer_idx_t timer_num, const timer_config_t * config ) ¶ One or multiple (ORred) ESP_INTR_FLAG_* values.

intr_alloc_flags: Flags used to allocate the interrupt.Use direct register access to configure timers from inside the ISR in this case. Note If the intr_alloc_flags value ESP_INTR_FLAG_IRAM is set, the handler function must be declared with IRAM_ATTR attribute and can only call functions in IRAM or ROM. The handler will be attached to the same CPU core that this function is running on. Register Timer interrupt handler, the handler is an ISR. alarm_en: To enable or disable timer alarm function.Įsp_err_t timer_isr_register ( timer_group_t group_num, timer_idx_t timer_num, void (* fn) (void * ), void * arg, int intr_alloc_flags, timer_isr_handle_t * handle, ) ¶.alarm_value: Pointer of A 64-bit value to accept the alarm value.Įsp_err_t timer_set_alarm ( timer_group_t group_num, timer_idx_t timer_num, timer_alarm_t alarm_en ) ¶Įnable or disable generation of timer alarm events.alarm_value: A 64-bit value to set the alarm value.Įsp_err_t timer_get_alarm_value ( timer_group_t group_num, timer_idx_t timer_num, uint64_t * alarm_value ) ¶.The divider’s range is from from 2 to 65536.Įsp_err_t timer_set_alarm_value ( timer_group_t group_num, timer_idx_t timer_num, uint64_t alarm_value ) ¶ Timer groups clock are divider from APB clock. counter_dir: Counting direction of timer, count-up or count-downĮsp_err_t timer_set_auto_reload ( timer_group_t group_num, timer_idx_t timer_num, timer_autoreload_t reload ) ¶Įnable or disable counter reload function when alarm event occurs.Įsp_err_t timer_set_divider ( timer_group_t group_num, timer_idx_t timer_num, uint32_t divider ) ¶.group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1Įsp_err_t timer_pause ( timer_group_t group_num, timer_idx_t timer_num ) ¶Įsp_err_t timer_set_counter_mode ( timer_group_t group_num, timer_idx_t timer_num, timer_count_dir_t counter_dir ) ¶.load_val: Counter value to write to the hardware timer.Įsp_err_t timer_start ( timer_group_t group_num, timer_idx_t timer_num ) ¶.time: Pointer, type of double*, to accept timer counter value, in seconds.Įsp_err_t timer_set_counter_value ( timer_group_t group_num, timer_idx_t timer_num, uint64_t load_val ) ¶.Read the counter value of hardware timer, in unit of a given scale. timer_val: Pointer to accept timer counter value.Įsp_err_t timer_get_counter_time_sec ( timer_group_t group_num, timer_idx_t timer_num, double * time ) ¶.timer_num: Timer index, 0 for hw_timer & 1 for hw_timer.group_num: Timer group, 0 for TIMERG0 or 1 for TIMERG1.Read the counter value of hardware timer. Functions ¶ esp_err_t timer_get_counter_value ( timer_group_t group_num, timer_idx_t timer_num, uint64_t * timer_val ) ¶
