diff --git a/cpu/esp32/esp-idf-api/adc.c b/cpu/esp32/esp-idf-api/adc.c deleted file mode 100644 index 46a11f535b..0000000000 --- a/cpu/esp32/esp-idf-api/adc.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF ADC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#include - -#include "driver/adc.h" - -void esp_idf_adc_power_acquire(void) -{ - adc_power_acquire(); -} - -void esp_idf_adc_power_release(void) -{ - adc_power_release(); -} - -esp_err_t esp_idf_adc1_config_width(adc_bits_width_t width_bit) -{ - return adc1_config_width(width_bit); -} - -esp_err_t esp_idf_adc1_config_channel_atten(adc_channel_t channel, - adc_atten_t atten) -{ - return adc1_config_channel_atten(channel, atten); -} - -int esp_idf_adc1_get_raw(adc1_channel_t channel) -{ - return adc1_get_raw(channel); -} - -esp_err_t esp_idf_adc2_config_channel_atten(adc_channel_t channel, - adc_atten_t atten) -{ - return adc2_config_channel_atten(channel, atten); -} - -esp_err_t esp_idf_adc2_get_raw(adc2_channel_t channel, - adc_bits_width_t width_bit, int *raw_out) -{ - return adc2_get_raw(channel, width_bit, raw_out); -} - -esp_err_t esp_idf_adc_vref_to_gpio(adc_unit_t adc_unit, gpio_num_t gpio) -{ - return adc_vref_to_gpio(adc_unit, gpio); -} diff --git a/cpu/esp32/esp-idf-api/dac.c b/cpu/esp32/esp-idf-api/dac.c deleted file mode 100644 index c1ba8a77ab..0000000000 --- a/cpu/esp32/esp-idf-api/dac.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF DAC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#ifdef MODULE_PERIPH_DAC - -#include - -#include "driver/dac_common.h" - -esp_err_t esp_idf_dac_output_voltage(dac_channel_t channel, uint8_t dac_value) -{ - return dac_output_voltage(channel, dac_value); -} - -esp_err_t esp_idf_dac_output_enable(dac_channel_t channel) -{ - return dac_output_enable(channel); -} - -esp_err_t esp_idf_dac_output_disable(dac_channel_t channel) -{ - return dac_output_disable(channel); -} - -#endif diff --git a/cpu/esp32/esp-idf-api/ledc.c b/cpu/esp32/esp-idf-api/ledc.c deleted file mode 100644 index 74a3dcb140..0000000000 --- a/cpu/esp32/esp-idf-api/ledc.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF LEDC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#include - -#include "driver/ledc.h" - -int esp_ledc_channel_config(const ledc_channel_config_t* ledc_conf) -{ - return ledc_channel_config(ledc_conf); -} - -int esp_ledc_timer_config(const ledc_timer_config_t* timer_conf) -{ - return ledc_timer_config(timer_conf); -} - -int esp_ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel) -{ - return ledc_update_duty(speed_mode, channel); -} - -int esp_ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, - ledc_channel_t channel, - uint32_t duty, uint32_t hpoint) -{ - return ledc_set_duty_with_hpoint(speed_mode, channel, duty, hpoint); -} diff --git a/cpu/esp32/esp-idf-api/periph_ctrl.c b/cpu/esp32/esp-idf-api/periph_ctrl.c deleted file mode 100644 index d9e69b2e92..0000000000 --- a/cpu/esp32/esp-idf-api/periph_ctrl.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for ESP-IDF peripherals control API - * - * @author Gunar Schorcht - * @} - */ - -#include "driver/periph_ctrl.h" - -void esp_idf_periph_module_enable(periph_module_t periph) -{ - periph_module_enable(periph); -} - -void esp_idf_periph_module_disable(periph_module_t periph) -{ - periph_module_disable(periph); -} diff --git a/cpu/esp32/esp-idf/esp_idf.mk b/cpu/esp32/esp-idf/esp_idf.mk index 4d2a2b7e31..92cd2315c2 100644 --- a/cpu/esp32/esp-idf/esp_idf.mk +++ b/cpu/esp32/esp-idf/esp_idf.mk @@ -1,6 +1,6 @@ # common definitions for all ESP-IDF modules -# additional include pathes required by als ESP-IDF module +# additional include pathes required by ESP-IDF module INCLUDES += -I$(ESP32_SDK_DIR)/components/bootloader_support/include INCLUDES += -I$(ESP32_SDK_DIR)/components/bootloader_support/include_bootloader INCLUDES += -I$(ESP32_SDK_DIR)/components/driver/$(CPU_FAM)/include diff --git a/cpu/esp32/esp-idf/esp_idf_cflags.mk b/cpu/esp32/esp-idf/esp_idf_cflags.mk index 3e7ac6b896..a78bccfe0b 100644 --- a/cpu/esp32/esp-idf/esp_idf_cflags.mk +++ b/cpu/esp32/esp-idf/esp_idf_cflags.mk @@ -1,5 +1,8 @@ # common definitions for all ESP-IDF modules +# indicate that ESP-IDF code is compiled +CFLAGS += -DESP_IDF_CODE + # shortcuts used by ESP-IDF CFLAGS += -Dasm=__asm CFLAGS += -Dtypeof=__typeof__ diff --git a/cpu/esp32/esp-idf/include/driver/gpio.h b/cpu/esp32/esp-idf/include/driver/gpio.h new file mode 100644 index 0000000000..154519993c --- /dev/null +++ b/cpu/esp32/esp-idf/include/driver/gpio.h @@ -0,0 +1,24 @@ +#ifndef DRIVER_GPIO_H +#define DRIVER_GPIO_H + +#ifdef ESP_IDF_CODE + +#include_next "driver/gpio.h" + +#else + +#include "hal/gpio_types.h" + +#define GPIO_PIN_COUNT (SOC_GPIO_PIN_COUNT) + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* DRIVER_GPIO_H */ diff --git a/cpu/esp32/include/adc_arch.h b/cpu/esp32/include/adc_arch.h index 379e448d52..783885685b 100644 --- a/cpu/esp32/include/adc_arch.h +++ b/cpu/esp32/include/adc_arch.h @@ -34,10 +34,9 @@ extern "C" { #include "periph/adc.h" #include "periph/gpio.h" +#include "driver/adc.h" #include "hal/adc_types.h" -#include "esp_idf_api/adc.h" - /** * @brief Attenuations that can be set for ADC lines * @@ -112,9 +111,9 @@ int adc_line_vref_to_gpio(adc_t line, gpio_t gpio); * @return 0 on success * @return -1 on invalid ADC line */ -static inline int adc_vref_to_gpio25 (void) +static inline int adc_vref_to_gpio25(void) { - return esp_idf_adc_vref_to_gpio(ADC_UNIT_2, GPIO25); + return adc_vref_to_gpio(ADC_UNIT_2, GPIO25); } #endif diff --git a/cpu/esp32/include/esp_idf_api/adc.h b/cpu/esp32/include/esp_idf_api/adc.h deleted file mode 100644 index 5ddaac5f04..0000000000 --- a/cpu/esp32/include/esp_idf_api/adc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF ADC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#ifndef ESP_IDF_API_ADC_H -#define ESP_IDF_API_ADC_H - -#include "esp_err.h" -#include "hal/adc_types.h" -#include "hal/gpio_types.h" - -#ifndef DOXYGEN /* Hide implementation details from doxygen */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name ESP-IDF interface mapper functions - * @{ - */ -/** @} */ -void esp_idf_adc_power_acquire(void); -void esp_idf_adc_power_release(void); - -esp_err_t esp_idf_adc1_config_width(adc_bits_width_t width_bit); -esp_err_t esp_idf_adc1_config_channel_atten(adc_channel_t channel, - adc_atten_t atten); -int esp_idf_adc1_get_raw(adc_channel_t channel); - -esp_err_t esp_idf_adc2_config_channel_atten(adc_channel_t channel, - adc_atten_t atten); -esp_err_t esp_idf_adc2_get_raw(adc_channel_t channel, - adc_bits_width_t width_bit, int *raw_out); -esp_err_t esp_idf_adc_vref_to_gpio(adc_unit_t adc_unit, gpio_num_t gpio); - -#ifdef __cplusplus -} -#endif - -#endif /* DOXYGEN */ -#endif /* ESP_IDF_API_ADC_H */ diff --git a/cpu/esp32/include/esp_idf_api/dac.h b/cpu/esp32/include/esp_idf_api/dac.h deleted file mode 100644 index 8ee0b7de9c..0000000000 --- a/cpu/esp32/include/esp_idf_api/dac.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF DAC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#ifndef ESP_IDF_API_DAC_H -#define ESP_IDF_API_DAC_H - -#include "esp_err.h" -#include "hal/dac_types.h" - -#ifndef DOXYGEN /* Hide implementation details from doxygen */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name ESP-IDF interface wrapper functions - * @{ - */ -esp_err_t esp_idf_dac_output_voltage(dac_channel_t channel, uint8_t dac_value); -esp_err_t esp_idf_dac_output_enable(dac_channel_t channel); -esp_err_t esp_idf_dac_output_disable(dac_channel_t channel); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* DOXYGEN */ -#endif /* ESP_IDF_API_DAC_H */ diff --git a/cpu/esp32/include/esp_idf_api/ledc.h b/cpu/esp32/include/esp_idf_api/ledc.h deleted file mode 100644 index 442360ff55..0000000000 --- a/cpu/esp32/include/esp_idf_api/ledc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for the ESP-IDF LEDC HAL API - * - * @author Gunar Schorcht - * @} - */ - -#ifndef ESP_IDF_API_LEDC_H -#define ESP_IDF_API_LEDC_H - -#include "hal/ledc_types.h" - -#ifndef DOXYGEN /* Hide implementation details from doxygen */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name ESP-IDF interface wrapper functions - * @{ - */ -int esp_ledc_channel_config(const ledc_channel_config_t* ledc_conf); -int esp_ledc_timer_config(const ledc_timer_config_t* timer_conf); -int esp_ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel); -int esp_ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, - ledc_channel_t channel, - uint32_t duty, uint32_t hpoint); -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* DOXYGEN */ -#endif /* ESP_IDF_API_LEDC_H */ diff --git a/cpu/esp32/include/esp_idf_api/periph_ctrl.h b/cpu/esp32/include/esp_idf_api/periph_ctrl.h deleted file mode 100644 index 017ab009cf..0000000000 --- a/cpu/esp32/include/esp_idf_api/periph_ctrl.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 Gunar Schorcht - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup cpu_esp32_esp_idf_api - * @{ - * - * @file - * @brief Interface for ESP-IDF peripherals control API - * - * @author Gunar Schorcht - * @} - */ - -#ifndef ESP_IDF_API_PERIPH_CTRL_H -#define ESP_IDF_API_PERIPH_CTRL_H - -#ifndef DOXYGEN /* Hide implementation details from doxygen */ - -#include "soc/periph_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_idf_periph_module_enable(periph_module_t periph); -void esp_idf_periph_module_disable(periph_module_t periph); - -#ifdef __cplusplus -} -#endif - -#endif /* DOXYGEN */ -#endif /* ESP_IDF_API_PERIPH_CTRL_H */ diff --git a/cpu/esp32/periph/adc.c b/cpu/esp32/periph/adc.c index c4372488f3..e79f40275a 100644 --- a/cpu/esp32/periph/adc.c +++ b/cpu/esp32/periph/adc.c @@ -36,7 +36,7 @@ #include "esp_common.h" #include "gpio_arch.h" -#include "esp_idf_api/adc.h" +#include "driver/adc.h" #define ENABLE_DEBUG 0 #include "debug.h" @@ -134,15 +134,13 @@ int adc_init(adc_t line) /* initialize the ADC1 unit if needed */ _adc1_ctrl_init(); /* set the attenuation and configure its associated GPIO pin mux */ - esp_idf_adc1_config_channel_atten(_adc_hw[rtcio].adc_channel, - ADC_ATTEN_DB_11); + adc1_config_channel_atten(_adc_hw[rtcio].adc_channel, ADC_ATTEN_DB_11); } else if (_adc_hw[rtcio].adc_ctrl == ADC_UNIT_2) { /* initialize the ADC2 unit if needed */ _adc2_ctrl_init(); /* set the attenuation and configure its associated GPIO pin mux */ - esp_idf_adc2_config_channel_atten(_adc_hw[rtcio].adc_channel, - ADC_ATTEN_DB_11); + adc2_config_channel_atten(_adc_hw[rtcio].adc_channel, ADC_ATTEN_DB_11); } else { return -1; @@ -166,15 +164,15 @@ int32_t adc_sample(adc_t line, adc_res_t res) int raw; if (_adc_hw[rtcio].adc_ctrl == ADC_UNIT_1) { - esp_idf_adc1_config_width(_adc_esp_res_map[res].res); - raw = esp_idf_adc1_get_raw(_adc_hw[rtcio].adc_channel); + adc1_config_width(_adc_esp_res_map[res].res); + raw = adc1_get_raw(_adc_hw[rtcio].adc_channel); if (raw < 0) { return -1; } } else if (_adc_hw[rtcio].adc_ctrl == ADC_UNIT_2) { - if (esp_idf_adc2_get_raw(_adc_hw[rtcio].adc_channel, - _adc_esp_res_map[res].res, &raw) < 0) { + if (adc2_get_raw(_adc_hw[rtcio].adc_channel, + _adc_esp_res_map[res].res, &raw) < 0) { return -1; } } @@ -191,12 +189,10 @@ int adc_set_attenuation(adc_t line, adc_atten_t atten) assert(rtcio != RTCIO_NA); if (_adc_hw[rtcio].adc_ctrl == ADC_UNIT_1) { - return esp_idf_adc1_config_channel_atten(_adc_hw[rtcio].adc_channel, - atten); + return adc1_config_channel_atten(_adc_hw[rtcio].adc_channel, atten); } else if (_adc_hw[rtcio].adc_ctrl == ADC_UNIT_2) { - return esp_idf_adc2_config_channel_atten(_adc_hw[rtcio].adc_channel, - atten); + return adc2_config_channel_atten(_adc_hw[rtcio].adc_channel, atten); } return -1; @@ -221,10 +217,10 @@ int adc_line_vref_to_gpio(adc_t line, gpio_t gpio) esp_err_t res = ESP_OK; if (_adc_hw[rtcio_vref].adc_ctrl == ADC_UNIT_1) { - res = esp_idf_adc_vref_to_gpio(ADC_UNIT_1, gpio); + res = adc_vref_to_gpio(ADC_UNIT_1, gpio); } else if (_adc_hw[rtcio_vref].adc_ctrl == ADC_UNIT_2) { - res = esp_idf_adc_vref_to_gpio(ADC_UNIT_2, gpio); + res = adc_vref_to_gpio(ADC_UNIT_2, gpio); } if (res != ESP_OK) { LOG_TAG_ERROR("adc", "Could not route Vref of ADC line %d to GPIO%d\n", diff --git a/cpu/esp32/periph/dac.c b/cpu/esp32/periph/dac.c index 4ee55d92ac..04cf0d4110 100644 --- a/cpu/esp32/periph/dac.c +++ b/cpu/esp32/periph/dac.c @@ -23,8 +23,8 @@ #include "periph/dac.h" #include "esp_common.h" +#include "driver/dac_common.h" #include "soc/dac_periph.h" -#include "esp_idf_api/dac.h" #define ENABLE_DEBUG 0 #include "debug.h" @@ -61,22 +61,21 @@ void dac_set(dac_t line, uint16_t value) { assert(line < DAC_NUMOF); assert(_dac_channels[line] != DAC_CHANNEL_MAX); - esp_idf_dac_output_voltage(_dac_channels[line], - value >> (16 - SOC_DAC_RESOLUTION)); + dac_output_voltage(_dac_channels[line], value >> (16 - SOC_DAC_RESOLUTION)); } void dac_poweroff(dac_t line) { assert(line < DAC_NUMOF); assert(_dac_channels[line] != DAC_CHANNEL_MAX); - esp_idf_dac_output_disable(_dac_channels[line]); + dac_output_disable(_dac_channels[line]); } void dac_poweron(dac_t line) { assert(line < DAC_NUMOF); assert(_dac_channels[line] != DAC_CHANNEL_MAX); - esp_idf_dac_output_enable(_dac_channels[line]); + dac_output_enable(_dac_channels[line]); } static bool _dac_conf_check(void) diff --git a/cpu/esp32/periph/pwm.c b/cpu/esp32/periph/pwm.c index be64f10722..0f50ef092f 100644 --- a/cpu/esp32/periph/pwm.c +++ b/cpu/esp32/periph/pwm.c @@ -28,14 +28,13 @@ #include "periph/pwm.h" #include "periph/gpio.h" +#include "driver/periph_ctrl.h" #include "esp_common.h" #include "esp_rom_gpio.h" #include "hal/ledc_hal.h" #include "soc/ledc_struct.h" #include "soc/rtc.h" -#include "esp_idf_api/periph_ctrl.h" - #define ENABLE_DEBUG 0 #include "debug.h" @@ -253,7 +252,7 @@ void pwm_poweron(pwm_t pwm) DEBUG("%s pwm=%u\n", __func__, pwm); /* enable and init the module and select the right clock source */ - esp_idf_periph_module_enable(_CFG.module); + periph_module_enable(_CFG.module); ledc_hal_init(&_DEV.hw, _CFG.group); ledc_hal_set_slow_clk_sel(&_DEV.hw, LEDC_SLOW_CLK_APB); ledc_hal_set_clock_source(&_DEV.hw, _CFG.timer, LEDC_APB_CLK); @@ -317,7 +316,7 @@ void pwm_poweroff(pwm_t pwm) /* if all devices of the same hardware module are disable, it is powered off */ if (i == PWM_NUMOF) { - esp_idf_periph_module_disable(_CFG.module); + periph_module_disable(_CFG.module); } } diff --git a/cpu/esp32/periph/spi.c b/cpu/esp32/periph/spi.c index be72c6b36d..b218782486 100644 --- a/cpu/esp32/periph/spi.c +++ b/cpu/esp32/periph/spi.c @@ -38,13 +38,13 @@ #include "periph/spi.h" #include "syscalls.h" +#include "driver/periph_ctrl.h" #include "esp_attr.h" #include "esp_rom_gpio.h" #include "hal/spi_hal.h" #include "hal/spi_types.h" #include "soc/rtc.h" -#include "esp_idf_api/periph_ctrl.h" #include "esp_idf_api/gpio.h" #undef MHZ @@ -117,7 +117,7 @@ void IRAM_ATTR spi_init(spi_t bus) } /* enable (power on) the according SPI module */ - esp_idf_periph_module_enable(_spi[bus].periph->module); + periph_module_enable(_spi[bus].periph->module); /* initialize SPI peripheral */ spi_ll_master_init(_spi[bus].periph->hw); diff --git a/cpu/esp32/periph/timer.c b/cpu/esp32/periph/timer.c index 7a58973a07..0d1e4e248a 100644 --- a/cpu/esp32/periph/timer.c +++ b/cpu/esp32/periph/timer.c @@ -26,6 +26,7 @@ */ #include "periph/timer.h" +#include "driver/periph_ctrl.h" #include "esp/common_macros.h" #include "hal/interrupt_controller_types.h" #include "hal/interrupt_controller_ll.h" @@ -40,8 +41,6 @@ #include "xtensa/xtensa_api.h" #endif -#include "esp_idf_api/periph_ctrl.h" - #include "esp_common.h" #include "irq_arch.h" #include "syscalls.h" @@ -244,7 +243,7 @@ int timer_init(tim_t dev, uint32_t freq, timer_cb_t cb, void *arg) intr_cntrl_ll_enable_interrupts(BIT(CPU_INUM_TIMER)); /* enable TMG module */ - esp_idf_periph_module_enable(_timers_desc[dev].module); + periph_module_enable(_timers_desc[dev].module); /* hardware timer configuration */ timer_hal_init(&_timers[dev].hw, _timers_desc[dev].group, _timers_desc[dev].index); diff --git a/cpu/esp_common/periph/uart.c b/cpu/esp_common/periph/uart.c index d7459fe86a..1d320cc372 100644 --- a/cpu/esp_common/periph/uart.c +++ b/cpu/esp_common/periph/uart.c @@ -59,6 +59,7 @@ #else /* defined(MCU_ESP8266) */ +#include "driver/periph_ctrl.h" #include "esp_rom_gpio.h" #include "esp_rom_uart.h" #include "hal/interrupt_controller_types.h" @@ -73,8 +74,6 @@ #include "soc/uart_reg.h" #include "soc/uart_struct.h" -#include "esp_idf_api/periph_ctrl.h" - #undef UART_CLK_FREQ #define UART_CLK_FREQ rtc_clk_apb_freq_get() /* APB_CLK is used */ @@ -232,7 +231,7 @@ void uart_poweron(uart_t uart) assert(uart < UART_NUMOF); #ifndef MCU_ESP8266 - esp_idf_periph_module_enable(_uarts[uart].mod); + periph_module_enable(_uarts[uart].mod); #endif _uart_config(uart); } @@ -242,7 +241,7 @@ void uart_poweroff(uart_t uart) assert(uart < UART_NUMOF); #ifndef MCU_ESP8266 - esp_idf_periph_module_disable(_uarts[uart].mod); + periph_module_disable(_uarts[uart].mod); #endif } diff --git a/drivers/servo/timer.c b/drivers/servo/timer.c index c47f31396e..b003006d4b 100644 --- a/drivers/servo/timer.c +++ b/drivers/servo/timer.c @@ -61,7 +61,7 @@ static unsigned ticks_from_us(uint64_t duration, uint64_t freq) * timer chan n+1 ------------+ * * Channel 0 is set to the period of one PWM control cycle and due to flag - * `TIM_FLAG_RESET_ON_MATCH` will end the period and stat the new period. As + * `TIM_FLAG_RESET_ON_MATCH` will end the period and start the new period. As * a result, n+1 channels are needed to control n servos. */ static void timer_cb(void *arg, int chan)