diff --git a/components/esp32s2/include/esp32s2/brownout.h b/components/esp32s2/include/esp32s2/brownout.h index dafba8dd7..d0c120dd0 100644 --- a/components/esp32s2/include/esp32s2/brownout.h +++ b/components/esp32s2/include/esp32s2/brownout.h @@ -16,6 +16,14 @@ #ifndef __ESP_BROWNOUT_H #define __ESP_BROWNOUT_H +#ifdef __cplusplus +extern "C" { +#endif + void esp_brownout_init(void); +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file diff --git a/components/esp32s2/include/esp32s2/cache_err_int.h b/components/esp32s2/include/esp32s2/cache_err_int.h index 8881291a2..d87a7d9dd 100644 --- a/components/esp32s2/include/esp32s2/cache_err_int.h +++ b/components/esp32s2/include/esp32s2/cache_err_int.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifdef __cplusplus +extern "C" { +#endif /** * @brief initialize cache invalid access interrupt @@ -31,3 +34,7 @@ void esp_cache_err_int_init(void); * - (-1) otherwise */ int esp_cache_err_get_cpuid(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp32s2/include/esp32s2/spiram.h b/components/esp32s2/include/esp32s2/spiram.h index 3ca4e3fa1..d7320c1af 100644 --- a/components/esp32s2/include/esp32s2/spiram.h +++ b/components/esp32s2/include/esp32s2/spiram.h @@ -21,6 +21,10 @@ #include #include "esp_err.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Initialize spiram interface/hardware. Normally called from cpu_start.c. * @@ -87,5 +91,8 @@ void esp_spiram_writeback_cache(void); */ esp_err_t esp_spiram_reserve_dma_pool(size_t size); +#ifdef __cplusplus +} +#endif #endif diff --git a/components/esp32s2/include/esp_clk.h b/components/esp32s2/include/esp_clk.h index 06ada586b..2d379d651 100644 --- a/components/esp32s2/include/esp_clk.h +++ b/components/esp32s2/include/esp_clk.h @@ -14,6 +14,10 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + /** * @file esp_clk.h * @@ -73,3 +77,7 @@ int esp_clk_apb_freq(void); * @return Value or RTC counter, expressed in microseconds */ uint64_t esp_clk_rtc_time(void); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/esp32s2/include/esp_spiram.h b/components/esp32s2/include/esp_spiram.h index 2c3a37eac..414cc310a 100644 --- a/components/esp32s2/include/esp_spiram.h +++ b/components/esp32s2/include/esp_spiram.h @@ -20,6 +20,10 @@ #include #include "esp_err.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Initialize spiram interface/hardware. Normally called from cpu_start.c. * @@ -86,5 +90,8 @@ void esp_spiram_writeback_cache(void); */ esp_err_t esp_spiram_reserve_dma_pool(size_t size); +#ifdef __cplusplus +} +#endif #endif diff --git a/components/esp_wifi/esp32s2/include/phy_init_data.h b/components/esp_wifi/esp32s2/include/phy_init_data.h index 57ea2faa2..da21d6fe2 100644 --- a/components/esp_wifi/esp32s2/include/phy_init_data.h +++ b/components/esp_wifi/esp32s2/include/phy_init_data.h @@ -17,6 +17,10 @@ #include "esp_phy_init.h" #include "sdkconfig.h" +#ifdef __cplusplus +extern "C" { +#endif + // constrain a value between 'low' and 'high', inclusive #define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val) @@ -144,5 +148,9 @@ static const esp_phy_init_data_t phy_init_data= { { static const char phy_init_magic_post[] = PHY_INIT_MAGIC; +#ifdef __cplusplus +} +#endif + #endif /* PHY_INIT_DATA_H */ diff --git a/components/soc/include/hal/touch_sensor_hal.h b/components/soc/include/hal/touch_sensor_hal.h index 3d2f715b8..db64bac87 100644 --- a/components/soc/include/hal/touch_sensor_hal.h +++ b/components/soc/include/hal/touch_sensor_hal.h @@ -25,6 +25,10 @@ #include "hal/touch_sensor_ll.h" #include "hal/touch_sensor_types.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { touch_high_volt_t refh; touch_low_volt_t refl; @@ -218,4 +222,8 @@ void touch_hal_deinit(void); /** * Configure touch sensor for each channel. */ -void touch_hal_config(touch_pad_t touch_num); \ No newline at end of file +void touch_hal_config(touch_pad_t touch_num); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/soc/esp32/include/soc/brownout_caps.h b/components/soc/soc/esp32/include/soc/brownout_caps.h index 5e867a892..079386811 100644 --- a/components/soc/soc/esp32/include/soc/brownout_caps.h +++ b/components/soc/soc/esp32/include/soc/brownout_caps.h @@ -18,6 +18,8 @@ extern "C" { #endif +#include "sdkconfig.h" + #if (CONFIG_ESP32_REV_MIN >= 1) #define SOC_BROWNOUT_RESET_SUPPORTED 1 #endif diff --git a/components/soc/soc/esp32/include/soc/can_caps.h b/components/soc/soc/esp32/include/soc/can_caps.h index 68073a336..2d2df9c43 100644 --- a/components/soc/soc/esp32/include/soc/can_caps.h +++ b/components/soc/soc/esp32/include/soc/can_caps.h @@ -18,6 +18,8 @@ extern "C" { #endif +#include "sdkconfig.h" + #if (CONFIG_ESP32_REV_MIN >= 2) #define CAN_BRP_DIV_SUPPORTED 1 #define CAN_BRP_DIV_THRESH 128 diff --git a/components/soc/soc/esp32/include/soc/cpu.h b/components/soc/soc/esp32/include/soc/cpu.h index 5e1eca273..82e710bfa 100644 --- a/components/soc/soc/esp32/include/soc/cpu.h +++ b/components/soc/soc/esp32/include/soc/cpu.h @@ -21,6 +21,10 @@ #include "xtensa/corebits.h" #include "xtensa/config/core.h" +#ifdef __cplusplus +extern "C" { +#endif + /* C macros for xtensa special register read/write/exchange */ #define RSR(reg, curval) asm volatile ("rsr %0, " #reg : "=r" (curval)); @@ -140,4 +144,8 @@ static inline esp_cpu_ccount_t esp_cpu_get_ccount(void) return result; } +#ifdef __cplusplus +} +#endif + #endif diff --git a/components/soc/soc/esp32s2/include/soc/cpu.h b/components/soc/soc/esp32s2/include/soc/cpu.h index c73b16f24..a09e458b8 100644 --- a/components/soc/soc/esp32s2/include/soc/cpu.h +++ b/components/soc/soc/esp32s2/include/soc/cpu.h @@ -20,6 +20,10 @@ #include #include "xtensa/corebits.h" +#ifdef __cplusplus +extern "C" { +#endif + /* C macros for xtensa special register read/write/exchange */ #define RSR(reg, curval) asm volatile ("rsr %0, " #reg : "=r" (curval)); @@ -131,4 +135,8 @@ static inline esp_cpu_ccount_t esp_cpu_get_ccount(void) return result; } +#ifdef __cplusplus +} +#endif + #endif diff --git a/components/soc/soc/esp32s2/include/soc/periph_defs.h b/components/soc/soc/esp32s2/include/soc/periph_defs.h index a7541ef7b..c72b5a5a4 100644 --- a/components/soc/soc/esp32s2/include/soc/periph_defs.h +++ b/components/soc/soc/esp32s2/include/soc/periph_defs.h @@ -15,6 +15,8 @@ #ifndef _SOC_PERIPH_DEFS_H_ #define _SOC_PERIPH_DEFS_H_ +#include "sdkconfig.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/components/soc/soc/include/soc/adc_periph.h b/components/soc/soc/include/soc/adc_periph.h index b234cf2d7..2ac7e7d35 100644 --- a/components/soc/soc/include/soc/adc_periph.h +++ b/components/soc/soc/include/soc/adc_periph.h @@ -23,6 +23,10 @@ #include "soc/adc_channel.h" #include "soc/adc_caps.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Store IO number corresponding to the ADC channel number. * @@ -30,4 +34,8 @@ * - >=0 : GPIO number index. * - -1 : Not support. */ -extern const int adc_channel_io_map[SOC_ADC_PERIPH_NUM][SOC_ADC_MAX_CHANNEL_NUM]; \ No newline at end of file +extern const int adc_channel_io_map[SOC_ADC_PERIPH_NUM][SOC_ADC_MAX_CHANNEL_NUM]; + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/soc/include/soc/can_periph.h b/components/soc/soc/include/soc/can_periph.h index f00a15d00..d21c08d44 100644 --- a/components/soc/soc/include/soc/can_periph.h +++ b/components/soc/soc/include/soc/can_periph.h @@ -16,7 +16,15 @@ #include "sdkconfig.h" +#ifdef __cplusplus +extern "C" { +#endif + #if CONFIG_IDF_TARGET_ESP32 #include "soc/can_struct.h" #include "soc/can_caps.h" #endif + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/soc/include/soc/emac_periph.h b/components/soc/soc/include/soc/emac_periph.h index 4121018b6..6f7323f46 100644 --- a/components/soc/soc/include/soc/emac_periph.h +++ b/components/soc/soc/include/soc/emac_periph.h @@ -13,5 +13,3 @@ // limitations under the License. #pragma once -#include "soc/emac_reg_v2.h" -#include "soc/emac_ex_reg.h" diff --git a/components/soc/soc/include/soc/i2c_periph.h b/components/soc/soc/include/soc/i2c_periph.h index ea9c2eec6..3f597c5d5 100644 --- a/components/soc/soc/include/soc/i2c_periph.h +++ b/components/soc/soc/include/soc/i2c_periph.h @@ -18,6 +18,10 @@ #include "soc/i2c_caps.h" #include "soc/periph_defs.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { const uint8_t sda_out_sig; const uint8_t sda_in_sig; @@ -28,3 +32,7 @@ typedef struct { } i2c_signal_conn_t; extern const i2c_signal_conn_t i2c_periph_signal[SOC_I2C_NUM]; + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/soc/include/soc/ledc_periph.h b/components/soc/soc/include/soc/ledc_periph.h index e93771e19..4cfb5ac9d 100644 --- a/components/soc/soc/include/soc/ledc_periph.h +++ b/components/soc/soc/include/soc/ledc_periph.h @@ -17,6 +17,10 @@ #include "soc/ledc_struct.h" #include "soc/ledc_caps.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Stores a bunch of per-ledc-peripheral data. */ @@ -29,3 +33,7 @@ extern const ledc_signal_conn_t ledc_periph_signal[2]; #else extern const ledc_signal_conn_t ledc_periph_signal[1]; #endif + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/soc/include/soc/touch_sensor_periph.h b/components/soc/soc/include/soc/touch_sensor_periph.h index edd5195b0..a1ebeafcd 100644 --- a/components/soc/soc/include/soc/touch_sensor_periph.h +++ b/components/soc/soc/include/soc/touch_sensor_periph.h @@ -22,4 +22,12 @@ #include "soc/sens_struct.h" #include "soc/rtc_io_struct.h" -extern const int touch_sensor_channel_io_map[SOC_TOUCH_SENSOR_NUM]; \ No newline at end of file +#ifdef __cplusplus +extern "C" { +#endif + +extern const int touch_sensor_channel_io_map[SOC_TOUCH_SENSOR_NUM]; + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/soc/include/soc/uart_periph.h b/components/soc/soc/include/soc/uart_periph.h index 7dbf8aedd..3ce864543 100644 --- a/components/soc/soc/include/soc/uart_periph.h +++ b/components/soc/soc/include/soc/uart_periph.h @@ -19,6 +19,10 @@ #include "soc/periph_defs.h" #include "soc/gpio_sig_map.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { const uint8_t tx_sig; const uint8_t rx_sig; @@ -29,3 +33,8 @@ typedef struct { } uart_signal_conn_t; extern const uart_signal_conn_t uart_periph_signal[SOC_UART_NUM]; + +#ifdef __cplusplus +} +#endif + diff --git a/components/soc/src/esp32/i2c_rtc_clk.h b/components/soc/src/esp32/i2c_rtc_clk.h index a26b52100..5ca44d308 100644 --- a/components/soc/src/esp32/i2c_rtc_clk.h +++ b/components/soc/src/esp32/i2c_rtc_clk.h @@ -17,6 +17,10 @@ #include "i2c_apll.h" #include "i2c_bbpll.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Analog function control register */ #define ANA_CONFIG_REG 0x6000E044 #define ANA_CONFIG_S (8) @@ -46,3 +50,8 @@ void rom_i2c_writeReg_Mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint #define I2C_READREG_RTC(block, reg_add) \ rom_i2c_readReg(block, block##_HOSTID, reg_add) + + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/adc_ll.h b/components/soc/src/esp32/include/hal/adc_ll.h index d08ec0a84..2d3c6c982 100644 --- a/components/soc/src/esp32/include/hal/adc_ll.h +++ b/components/soc/src/esp32/include/hal/adc_ll.h @@ -4,6 +4,10 @@ #include "hal/adc_types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { ADC_DIG_FORMAT_12BIT, /*!< ADC to I2S data format, [15:12]-channel [11:0]-12 bits ADC data. Note: In single convert mode. */ @@ -620,3 +624,7 @@ static inline bool adc_ll_vref_output(int io) SENS.sar_meas_start2.sar2_en_pad = 1 << channel; return true; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/dac_ll.h b/components/soc/src/esp32/include/hal/dac_ll.h index 1f31c7283..15606357c 100644 --- a/components/soc/src/esp32/include/hal/dac_ll.h +++ b/components/soc/src/esp32/include/hal/dac_ll.h @@ -24,6 +24,10 @@ #include "soc/dac_periph.h" #include "hal/dac_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Power on dac module and start output voltage. * @@ -182,4 +186,9 @@ static inline void dac_ll_dma_enable(void) static inline void dac_ll_dma_disable(void) { SENS.sar_dac_ctrl1.dac_dig_force = 0; -} \ No newline at end of file +} + + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/src/esp32/include/hal/i2c_ll.h b/components/soc/src/esp32/include/hal/i2c_ll.h index 993af1e22..a670a66d8 100644 --- a/components/soc/src/esp32/include/hal/i2c_ll.h +++ b/components/soc/src/esp32/include/hal/i2c_ll.h @@ -18,6 +18,10 @@ #include "soc/i2c_periph.h" #include "hal/i2c_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief I2C hardware cmd register filed. */ @@ -848,4 +852,9 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw) ctrl_reg.scl_force_out = 1; hw->ctr.val = ctrl_reg.val; hw->fifo_conf.fifo_addr_cfg_en = 0; -} \ No newline at end of file +} + +#ifdef __cplusplus +} +#endif + diff --git a/components/soc/src/esp32/include/hal/ledc_ll.h b/components/soc/src/esp32/include/hal/ledc_ll.h index 674b55cff..4bbd90e88 100644 --- a/components/soc/src/esp32/include/hal/ledc_ll.h +++ b/components/soc/src/esp32/include/hal/ledc_ll.h @@ -22,6 +22,10 @@ #define LEDC_LL_GET_HW() &LEDC +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Set LEDC low speed timer clock * @@ -456,3 +460,7 @@ static inline void ledc_ll_bind_channel_timer(ledc_dev_t *hw, ledc_mode_t speed_ static inline void ledc_ll_get_channel_timer(ledc_dev_t *hw, ledc_mode_t speed_mode, ledc_channel_t channel_num, ledc_timer_t *timer_sel){ *timer_sel = hw->channel_group[speed_mode].channel[channel_num].conf0.timer_sel; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/mcpwm_ll.h b/components/soc/src/esp32/include/hal/mcpwm_ll.h index 6bb4bb0c7..b99067518 100644 --- a/components/soc/src/esp32/include/hal/mcpwm_ll.h +++ b/components/soc/src/esp32/include/hal/mcpwm_ll.h @@ -30,6 +30,10 @@ #include "esp_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /// Get the address of peripheral registers #define MCPWM_LL_GET_HW(ID) (((ID)==0)? &MCPWM0: &MCPWM1) @@ -725,3 +729,7 @@ static inline mcpwm_intr_t mcpwm_ll_get_cap_intr_def(int bit) { return BIT(bit+MCPWM_CAP0_INT_RAW_S); } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/rtc_io_ll.h b/components/soc/src/esp32/include/hal/rtc_io_ll.h index ea53a93a2..450185327 100644 --- a/components/soc/src/esp32/include/hal/rtc_io_ll.h +++ b/components/soc/src/esp32/include/hal/rtc_io_ll.h @@ -25,6 +25,10 @@ #include "hal/rtc_io_types.h" #include "hal/gpio_types.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { RTCIO_FUNC_RTC = 0x0, /*!< The pin controled by RTC module. */ RTCIO_FUNC_DIGITAL = 0x1, /*!< The pin controlled by DIGITAL module. */ @@ -346,4 +350,8 @@ static inline void rtcio_ll_enable_sleep_setting(gpio_num_t gpio_num) static inline void rtcio_ll_disable_sleep_setting(gpio_num_t gpio_num) { CLEAR_PERI_REG_MASK(rtc_io_desc[gpio_num].reg, rtc_io_desc[gpio_num].slpsel); -} \ No newline at end of file +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/spi_flash_ll.h b/components/soc/src/esp32/include/hal/spi_flash_ll.h index 36ccb7169..d47396f54 100644 --- a/components/soc/src/esp32/include/hal/spi_flash_ll.h +++ b/components/soc/src/esp32/include/hal/spi_flash_ll.h @@ -30,6 +30,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif //Supported clock register values #define SPI_FLASH_LL_CLKREG_VAL_5MHZ ((spi_flash_ll_clock_reg_t){.val=0x0000F1CF}) ///< Clock set to 5 MHz @@ -375,3 +378,7 @@ static inline void spi_flash_ll_set_dummy(spi_dev_t *dev, uint32_t dummy_n) dev->user.usr_dummy = dummy_n ? 1 : 0; dev->user1.usr_dummy_cyclelen = dummy_n - 1; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/spi_ll.h b/components/soc/src/esp32/include/hal/spi_ll.h index aaa4fa7ab..bfcc9e736 100644 --- a/components/soc/src/esp32/include/hal/spi_ll.h +++ b/components/soc/src/esp32/include/hal/spi_ll.h @@ -29,6 +29,10 @@ #include #include //for abs() +#ifdef __cplusplus +extern "C" { +#endif + /// Registers to reset during initialization. Don't use in app. #define SPI_LL_RST_MASK (SPI_OUT_RST | SPI_IN_RST | SPI_AHBM_RST | SPI_AHBM_FIFO_RST) /// Interrupt not used. Don't use in app. @@ -874,3 +878,7 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/touch_sensor_hal.h b/components/soc/src/esp32/include/hal/touch_sensor_hal.h index 5ff2155dd..f21bbd418 100644 --- a/components/soc/src/esp32/include/hal/touch_sensor_hal.h +++ b/components/soc/src/esp32/include/hal/touch_sensor_hal.h @@ -27,6 +27,10 @@ #include_next "hal/touch_sensor_hal.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Set touch sensor measurement time. * @@ -119,4 +123,8 @@ * * @param pad_num pointer to touch pad which caused wakeup. */ -void touch_hal_get_wakeup_status(touch_pad_t *pad_num); \ No newline at end of file +void touch_hal_get_wakeup_status(touch_pad_t *pad_num); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32/include/hal/touch_sensor_ll.h b/components/soc/src/esp32/include/hal/touch_sensor_ll.h index 6786fef4a..fa86c2399 100644 --- a/components/soc/src/esp32/include/hal/touch_sensor_ll.h +++ b/components/soc/src/esp32/include/hal/touch_sensor_ll.h @@ -27,6 +27,11 @@ #include "soc/touch_sensor_periph.h" #include "hal/touch_sensor_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + //Some register bits of touch sensor 8 and 9 are mismatched, we need to swap the bits. #define TOUCH_LL_BIT_SWAP(data, n, m) (((data >> n) & 0x1) == ((data >> m) & 0x1) ? (data) : ((data) ^ ((0x1 < +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { ADC_DIG_FORMAT_12BIT, /*!< ADC to I2S data format, [15:12]-channel [11:0]-12 bits ADC data. Note: In single convert mode. */ @@ -588,3 +592,8 @@ static inline bool adc_ll_vref_output(int io) { return false; } + + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/dac_ll.h b/components/soc/src/esp32s2/include/hal/dac_ll.h index 1f31c7283..d99471810 100644 --- a/components/soc/src/esp32s2/include/hal/dac_ll.h +++ b/components/soc/src/esp32s2/include/hal/dac_ll.h @@ -24,6 +24,10 @@ #include "soc/dac_periph.h" #include "hal/dac_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Power on dac module and start output voltage. * @@ -182,4 +186,8 @@ static inline void dac_ll_dma_enable(void) static inline void dac_ll_dma_disable(void) { SENS.sar_dac_ctrl1.dac_dig_force = 0; -} \ No newline at end of file +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/gpspi_flash_ll.h b/components/soc/src/esp32s2/include/hal/gpspi_flash_ll.h index af23a0dbb..993370dc4 100644 --- a/components/soc/src/esp32s2/include/hal/gpspi_flash_ll.h +++ b/components/soc/src/esp32s2/include/hal/gpspi_flash_ll.h @@ -30,6 +30,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif #define gpspi_flash_ll_get_hw(host_id) (((host_id)==SPI2_HOST ? &GPSPI2 \ : ((host_id)==SPI3_HOST ? &GPSPI3 \ @@ -352,3 +355,6 @@ static inline void gpspi_flash_ll_set_dummy_out(spi_dev_t *dev, uint32_t out_en, dev->ctrl.d_pol = out_lev; } +#ifdef __cplusplus +} +#endif diff --git a/components/soc/src/esp32s2/include/hal/i2c_ll.h b/components/soc/src/esp32s2/include/hal/i2c_ll.h index e3d080aa8..f06bd8d11 100644 --- a/components/soc/src/esp32s2/include/hal/i2c_ll.h +++ b/components/soc/src/esp32s2/include/hal/i2c_ll.h @@ -18,6 +18,10 @@ #include "soc/i2c_periph.h" #include "hal/i2c_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief I2C hardware cmd register filed. */ @@ -864,3 +868,7 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw) hw->ctr.val = ctrl_reg.val; hw->fifo_conf.fifo_addr_cfg_en = 0; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/ledc_ll.h b/components/soc/src/esp32s2/include/hal/ledc_ll.h index 3cd87a9de..5f3e22a41 100644 --- a/components/soc/src/esp32s2/include/hal/ledc_ll.h +++ b/components/soc/src/esp32s2/include/hal/ledc_ll.h @@ -20,6 +20,10 @@ #include "hal/ledc_types.h" #include "soc/ledc_periph.h" +#ifdef __cplusplus +extern "C" { +#endif + #define LEDC_LL_GET_HW() &LEDC /** @@ -477,3 +481,7 @@ static inline void ledc_ll_bind_channel_timer(ledc_dev_t *hw, ledc_mode_t speed_ static inline void ledc_ll_get_channel_timer(ledc_dev_t *hw, ledc_mode_t speed_mode, ledc_channel_t channel_num, ledc_timer_t *timer_sel){ *timer_sel = hw->channel_group[speed_mode].channel[channel_num].conf0.timer_sel; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/rtc_io_ll.h b/components/soc/src/esp32s2/include/hal/rtc_io_ll.h index 56403ca3d..3a57ad922 100644 --- a/components/soc/src/esp32s2/include/hal/rtc_io_ll.h +++ b/components/soc/src/esp32s2/include/hal/rtc_io_ll.h @@ -25,6 +25,10 @@ #include "hal/rtc_io_types.h" #include "hal/gpio_types.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { RTCIO_FUNC_RTC = 0x0, /*!< The pin controled by RTC module. */ RTCIO_FUNC_DIGITAL = 0x1, /*!< The pin controlled by DIGITAL module. */ @@ -346,4 +350,8 @@ static inline void rtcio_ll_enable_sleep_setting(gpio_num_t gpio_num) static inline void rtcio_ll_disable_sleep_setting(gpio_num_t gpio_num) { CLEAR_PERI_REG_MASK(rtc_io_desc[gpio_num].reg, rtc_io_desc[gpio_num].slpsel); -} \ No newline at end of file +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/spi_flash_ll.h b/components/soc/src/esp32s2/include/hal/spi_flash_ll.h index 79a83dc81..383c8275a 100644 --- a/components/soc/src/esp32s2/include/hal/spi_flash_ll.h +++ b/components/soc/src/esp32s2/include/hal/spi_flash_ll.h @@ -25,6 +25,10 @@ #include "gpspi_flash_ll.h" #include "spimem_flash_ll.h" +#ifdef __cplusplus +extern "C" { +#endif + // For esp32s2, spimem is equivalent to traditional spi peripherals found // in esp32. Let the spi flash clock reg definitions reflect this. #define SPI_FLASH_LL_CLKREG_VAL_5MHZ {.spimem=SPIMEM_FLASH_LL_CLKREG_VAL_5MHZ} @@ -89,3 +93,7 @@ typedef union { #define spi_flash_ll_set_dummy(dev, dummy) spimem_flash_ll_set_dummy((spi_mem_dev_t*)dev, dummy) #define spi_flash_ll_set_dummy_out(dev, en, lev) spimem_flash_ll_set_dummy_out((spi_mem_dev_t*)dev, en, lev) #endif + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/spi_ll.h b/components/soc/src/esp32s2/include/hal/spi_ll.h index b09523a52..f719202a0 100644 --- a/components/soc/src/esp32s2/include/hal/spi_ll.h +++ b/components/soc/src/esp32s2/include/hal/spi_ll.h @@ -29,6 +29,10 @@ #include "soc/spi_periph.h" #include "esp32s2/rom/lldesc.h" +#ifdef __cplusplus +extern "C" { +#endif + /// Registers to reset during initialization. Don't use in app. #define SPI_LL_RST_MASK (SPI_OUT_RST | SPI_IN_RST | SPI_AHBM_RST | SPI_AHBM_FIFO_RST) /// Interrupt not used. Don't use in app. @@ -858,3 +862,7 @@ static inline uint32_t spi_ll_slave_get_rcv_bitlen(spi_dev_t *hw) #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/spimem_flash_ll.h b/components/soc/src/esp32s2/include/hal/spimem_flash_ll.h index c243d2875..dc8b39611 100644 --- a/components/soc/src/esp32s2/include/hal/spimem_flash_ll.h +++ b/components/soc/src/esp32s2/include/hal/spimem_flash_ll.h @@ -31,6 +31,10 @@ #include "hal/spi_types.h" #include "hal/spi_flash_types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define spimem_flash_ll_get_hw(host_id) (((host_id)==SPI1_HOST ? &SPIMEM1 : NULL )) typedef typeof(SPIMEM1.clock) spimem_flash_ll_clock_reg_t; @@ -377,3 +381,7 @@ static inline void spimem_flash_ll_set_dummy_out(spi_mem_dev_t *dev, uint32_t ou dev->ctrl.q_pol = out_lev; dev->ctrl.d_pol = out_lev; } + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/src/esp32s2/include/hal/touch_sensor_hal.h b/components/soc/src/esp32s2/include/hal/touch_sensor_hal.h index 76e77e2d0..40e5a0b41 100644 --- a/components/soc/src/esp32s2/include/hal/touch_sensor_hal.h +++ b/components/soc/src/esp32s2/include/hal/touch_sensor_hal.h @@ -27,6 +27,10 @@ #include_next "hal/touch_sensor_hal.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Reset the whole of touch module. * @@ -572,3 +576,7 @@ void touch_hal_sleep_channel_config(const touch_pad_sleep_channel_t *slp_config) * @param pad_num pointer to touch pad which caused wakeup. */ #define touch_hal_get_wakeup_status(pad_num) touch_ll_get_wakeup_status(pad_num) + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/touch_sensor_ll.h b/components/soc/src/esp32s2/include/hal/touch_sensor_ll.h index 8cc54b68b..0bd1aa70b 100644 --- a/components/soc/src/esp32s2/include/hal/touch_sensor_ll.h +++ b/components/soc/src/esp32s2/include/hal/touch_sensor_ll.h @@ -27,6 +27,11 @@ #include "soc/touch_sensor_periph.h" #include "hal/touch_sensor_types.h" +#ifdef __cplusplus +extern "C" { +#endif + + /** * Set touch sensor touch sensor times of charge and discharge. * @@ -1070,4 +1075,8 @@ static inline void touch_ll_sleep_read_proximity_cnt(uint32_t *approach_cnt) static inline void touch_ll_get_wakeup_status(touch_pad_t *pad_num) { *pad_num = (touch_pad_t)RTCCNTL.touch_slp_thres.touch_slp_pad; -} \ No newline at end of file +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/soc/src/esp32s2/include/hal/uart_ll.h b/components/soc/src/esp32s2/include/hal/uart_ll.h index 7a2a045d3..7068b926f 100644 --- a/components/soc/src/esp32s2/include/hal/uart_ll.h +++ b/components/soc/src/esp32s2/include/hal/uart_ll.h @@ -20,6 +20,10 @@ #include "hal/uart_types.h" #include "soc/uart_periph.h" +#ifdef __cplusplus +extern "C" { +#endif + // The default fifo depth #define UART_LL_FIFO_DEF_LEN (UART_FIFO_LEN) // Get UART hardware instance with giving uart num @@ -767,3 +771,7 @@ static inline void uart_ll_inverse_signal(uart_dev_t *hw, uint32_t inv_mask) conf0_reg.dtr_inv |= (inv_mask & UART_SIGNAL_DTR_INV) ? 1 : 0; hw->conf0.val = conf0_reg.val; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/components/xtensa/esp32s2/include/xtensa/config/core.h b/components/xtensa/esp32s2/include/xtensa/config/core.h index f5bb44faf..8460d1c92 100644 --- a/components/xtensa/esp32s2/include/xtensa/config/core.h +++ b/components/xtensa/esp32s2/include/xtensa/config/core.h @@ -64,6 +64,10 @@ #endif #endif /*_ASMLANGUAGE or __ASSEMBLER__*/ +#ifdef __cplusplus +extern "C" { +#endif + /*---------------------------------------------------------------------- GENERAL @@ -1403,6 +1407,9 @@ extern const unsigned int XCJOIN(Xthal_cp_mask_,XCHAL_CP7_IDENT); # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0) #endif +#ifdef __cplusplus +} +#endif #endif /*XTENSA_CONFIG_CORE_H*/ diff --git a/components/xtensa/esp32s2/include/xtensa/config/defs.h b/components/xtensa/esp32s2/include/xtensa/config/defs.h index 9cf321a1d..bb57294f4 100644 --- a/components/xtensa/esp32s2/include/xtensa/config/defs.h +++ b/components/xtensa/esp32s2/include/xtensa/config/defs.h @@ -30,8 +30,5 @@ #ifdef __XTENSA__ -#include -#include - #endif /* __XTENSA__ */ #endif /* !_XTENSA_BASE_HEADER */ diff --git a/components/xtensa/esp32s2/include/xtensa/config/tie-asm.h b/components/xtensa/esp32s2/include/xtensa/config/tie-asm.h index 681b45602..ac1f374da 100644 --- a/components/xtensa/esp32s2/include/xtensa/config/tie-asm.h +++ b/components/xtensa/esp32s2/include/xtensa/config/tie-asm.h @@ -32,6 +32,10 @@ #ifndef _XTENSA_CORE_TIE_ASM_H #define _XTENSA_CORE_TIE_ASM_H +#ifdef __cplusplus +extern "C" { +#endif + /* Selection parameter values for save-area save/restore macros: */ /* Option vs. TIE: */ #define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */ @@ -126,5 +130,9 @@ #define XCHAL_SA_NUM_ATMPS 1 +#ifdef __cplusplus +} +#endif + #endif /*_XTENSA_CORE_TIE_ASM_H*/ diff --git a/tools/ci/check_public_headers_exceptions.txt b/tools/ci/check_public_headers_exceptions.txt index 8b6c7e46c..0ff628ab3 100644 --- a/tools/ci/check_public_headers_exceptions.txt +++ b/tools/ci/check_public_headers_exceptions.txt @@ -12,8 +12,6 @@ components/freertos/xtensa/include/freertos/* components/log/include/esp_log_internal.h -components/soc/esp32/include/hal/* -components/soc/esp32/include/soc/* components/soc/include/hal/* components/soc/include/soc/*