![]() For the pros/cons of a shared interrupt, you can refer to Interrupt Handling. Optional gptimer_config_t::intr_shared sets whether or not mark the timer interrupt source as a shared one. Each count step is equivalent to 1 / resolution_hz seconds. Gptimer_config_t::resolution_hz sets the resolution of the internal counter. Gptimer_config_t::direction sets the counting direction of the timer, supported directions are listed in gptimer_count_direction_t, you can only pick one of them. For the effect on power consumption of different clock source, please refer to Section Power Management. The available clocks are listed in gptimer_clock_source_t, you can only pick one of them. Gptimer_config_t::clk_src selects the source clock for the timer. To install a timer instance, there is a configuration structure that needs to be given in advance: gptimer_config_t: The driver behind will manage all available hardware resources in a pool, so that you do not need to care about which timer and which group it belongs to. 1Ī GPTimer instance is represented by gptimer_handle_t. Kconfig Options - lists the supported Kconfig options that can be used to make a different effect on driver behavior.ĭifferent ESP chips might have different numbers of independent timer groups, and within each group, there could also be several independent timers. Thread Safety - lists which APIs are guaranteed to be thread safe by the driver. IRAM Safe - describes tips on how to make the timer interrupt and IO control functions work better along with a disabled cache. Power Management - describes how different source clock selections can affect power consumption. Start and Stop Timer - shows some typical use cases that start the timer with different alarm behavior. Register Event Callbacks - covers how to hook user specific code to the alarm event callback function.Įnable and Disable Timer - covers how to enable and disable the timer. Set up Alarm Action - covers the parameters that should be set up to enable the alarm event. Set and Get Count Value - covers how to force the timer counting from a start point and how to get the count value at anytime. Resource Allocation - covers which parameters should be set up to get a timer handle and how to recycle the resources when GPTimer finishes working. The following sections of this document cover the typical steps to install and operate a timer: Generate one-shot alarm, respond in target time Generate period alarms, trigger events periodically Typically, a general purpose timer can be used in scenarios like:įree running as a wall clock, fetching a high-resolution timestamp at any time and any places ![]() When a timer alarms, a user registered per-timer callback would be called. The behavior when the internal counter of a timer reaches a specific target value is called a timer alarm. ![]() The hardware timer features high resolution and flexible alarm action. GPTimer (General Purpose Timer) is the driver of ESP32 Timer Group peripheral. General Purpose Timer (GPTimer) Introduction ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |