From 86a1d579ffd5ee24aacba153cc309338b69d4807 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sun, 18 Mar 2018 16:37:54 +0100 Subject: [PATCH 1/3] docs: add warning to gpio_get_level() On most microcontrollers I have worked with one can retrieve the current state of output GPIO pins. On ESP32 this is not the case if the pad is not explictly configured to route this information into the port by configuring it as input or i/o. Thus add a warning to the API documentation of gpio_get_level(). Merges https://github.com/espressif/esp-idf/pull/1740 --- components/driver/include/driver/gpio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/driver/include/driver/gpio.h b/components/driver/include/driver/gpio.h index 7cace8836..8246c415e 100644 --- a/components/driver/include/driver/gpio.h +++ b/components/driver/include/driver/gpio.h @@ -302,6 +302,8 @@ esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level); /** * @brief GPIO get input level * + * @warning If the pad is not configured for input (or input and output) the returned value is always 0. + * * @param gpio_num GPIO number. If you want to get the logic level of e.g. pin GPIO16, gpio_num should be GPIO_NUM_16 (16); * * @return From 38daa1e716588562797dcfc63545d0381b4136a3 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sun, 18 Mar 2018 18:28:38 +0100 Subject: [PATCH 2/3] docs: fix description of timer_get_alarm_value() Replace c&p text with an actual description. Merges https://github.com/espressif/esp-idf/pull/1740 --- components/driver/include/driver/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/include/driver/timer.h b/components/driver/include/driver/timer.h index 6b43eb470..48e2b9890 100644 --- a/components/driver/include/driver/timer.h +++ b/components/driver/include/driver/timer.h @@ -238,7 +238,7 @@ esp_err_t timer_set_alarm_value(timer_group_t group_num, timer_idx_t timer_num, esp_err_t timer_get_alarm_value(timer_group_t group_num, timer_idx_t timer_num, uint64_t* alarm_value); /** - * @brief Get timer alarm value. + * @brief Enable or disable generation of timer alarm events. * * @param group_num Timer group, 0 for TIMERG0 or 1 for TIMERG1 * @param timer_num Timer index, 0 for hw_timer[0] & 1 for hw_timer[1] From 757c1d673953da15fa12a22fb3c6a2d3c82636fe Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sun, 18 Mar 2018 18:30:11 +0100 Subject: [PATCH 3/3] docs: explicitly note that timer alarms are not recurring Merges https://github.com/espressif/esp-idf/pull/1740 --- docs/en/api-reference/peripherals/timer.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/api-reference/peripherals/timer.rst b/docs/en/api-reference/peripherals/timer.rst index 2d7a057cb..03f093da7 100644 --- a/docs/en/api-reference/peripherals/timer.rst +++ b/docs/en/api-reference/peripherals/timer.rst @@ -67,7 +67,8 @@ After the alarm is enabled and the timer reaches the alarm value, depending on c .. note:: - The alarm will be triggered immediately, if an alarm value is set and the timer has already passed this value. + * The alarm will be triggered immediately, if an alarm value is set and the timer has already passed this value. + * Once triggered the alarm will be disabled automatically and needs to be re-armed to trigger again. To check what alarm value has been set up, call :cpp:func:`timer_get_alarm_value`.