Skip to content

Commit 91902b6

Browse files
authored
Merge branch 'Jason2866:release/v5.2' into release/v5.2
2 parents b8925c7 + df99e6f commit 91902b6

File tree

13 files changed

+228
-79
lines changed

13 files changed

+228
-79
lines changed

components/driver/deprecated/driver/rmt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -152,10 +152,10 @@ esp_err_t rmt_set_tx_carrier(rmt_channel_t channel, bool carrier_en, uint16_t hi
152152
esp_err_t rmt_set_mem_pd(rmt_channel_t channel, bool pd_en);
153153

154154
/**
155-
* @brief Get RMT memory low power mode.
155+
* @brief Check if the RMT memory is force powered down
156156
*
157-
* @param channel RMT channel
158-
* @param pd_en Pointer to accept RMT memory low power mode.
157+
* @param channel RMT channel (actually this function is configured for all channels)
158+
* @param pd_en Pointer to accept the result
159159
*
160160
* @return
161161
* - ESP_ERR_INVALID_ARG Parameter error

components/driver/deprecated/rmt_legacy.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static void rmt_module_enable(void)
141141
rmt_ll_enable_bus_clock(0, true);
142142
rmt_ll_reset_register(0);
143143
}
144+
rmt_ll_mem_power_by_pmu(rmt_contex.hal.regs);
144145
rmt_contex.rmt_module_enabled = true;
145146
}
146147
RMT_EXIT_CRITICAL();
@@ -151,6 +152,7 @@ static void rmt_module_disable(void)
151152
{
152153
RMT_ENTER_CRITICAL();
153154
if (rmt_contex.rmt_module_enabled == true) {
155+
rmt_ll_mem_force_power_off(rmt_contex.hal.regs);
154156
RMT_RCC_ATOMIC() {
155157
rmt_ll_enable_bus_clock(0, false);
156158
}
@@ -250,7 +252,11 @@ esp_err_t rmt_set_mem_pd(rmt_channel_t channel, bool pd_en)
250252
{
251253
ESP_RETURN_ON_FALSE(channel < RMT_CHANNEL_MAX, ESP_ERR_INVALID_ARG, TAG, RMT_CHANNEL_ERROR_STR);
252254
RMT_ENTER_CRITICAL();
253-
rmt_ll_power_down_mem(rmt_contex.hal.regs, pd_en);
255+
if (pd_en) {
256+
rmt_ll_mem_force_power_off(rmt_contex.hal.regs);
257+
} else {
258+
rmt_ll_mem_power_by_pmu(rmt_contex.hal.regs);
259+
}
254260
RMT_EXIT_CRITICAL();
255261
return ESP_OK;
256262
}
@@ -259,7 +265,7 @@ esp_err_t rmt_get_mem_pd(rmt_channel_t channel, bool *pd_en)
259265
{
260266
ESP_RETURN_ON_FALSE(channel < RMT_CHANNEL_MAX, ESP_ERR_INVALID_ARG, TAG, RMT_CHANNEL_ERROR_STR);
261267
RMT_ENTER_CRITICAL();
262-
*pd_en = rmt_ll_is_mem_powered_down(rmt_contex.hal.regs);
268+
*pd_en = rmt_ll_is_mem_force_powered_down(rmt_contex.hal.regs);
263269
RMT_EXIT_CRITICAL();
264270
return ESP_OK;
265271
}

components/esp_wifi/include/esp_wifi.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,36 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
250250
#define WIFI_ENABLE_GMAC 0
251251
#endif
252252

253+
#if CONFIG_ESP_WIFI_11R_SUPPORT
254+
#define WIFI_ENABLE_11R (1<<6)
255+
#else
256+
#define WIFI_ENABLE_11R 0
257+
#endif
258+
259+
#if CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
260+
#define WIFI_ENABLE_ENTERPRISE (1<<7)
261+
#else
262+
#define WIFI_ENABLE_ENTERPRISE 0
263+
#endif
264+
253265
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
254266
#define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1)
255267
#define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2)
256268
#define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3)
257269
#define CONFIG_FEATURE_GCMP_BIT (1<<4)
258270
#define CONFIG_FEATURE_GMAC_BIT (1<<5)
271+
#define CONFIG_FEATURE_11R_BIT (1<<6)
272+
#define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7)
259273

260274
/* Set additional WiFi features and capabilities */
261275
#define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \
262276
WIFI_ENABLE_SPIRAM | \
263277
WIFI_FTM_INITIATOR | \
264278
WIFI_FTM_RESPONDER | \
265279
WIFI_ENABLE_GCMP | \
266-
WIFI_ENABLE_GMAC)
280+
WIFI_ENABLE_GMAC | \
281+
WIFI_ENABLE_11R | \
282+
WIFI_ENABLE_ENTERPRISE)
267283

268284
#define WIFI_INIT_CONFIG_DEFAULT() { \
269285
.osi_funcs = &g_wifi_osi_funcs, \

components/hal/esp32/include/hal/rmt_ll.h

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,33 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
8888
}
8989

9090
/**
91-
* @brief Power down memory
91+
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
9292
*
9393
* @param dev Peripheral instance address
94-
* @param enable True to power down, False to power up
9594
*/
96-
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
95+
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
9796
{
98-
dev->conf_ch[0].conf0.mem_pd = enable; // Only conf0 register of channel0 has `mem_pd`
97+
(void)dev;
98+
}
99+
100+
/**
101+
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
102+
*
103+
* @param dev Peripheral instance address
104+
*/
105+
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
106+
{
107+
dev->conf_ch[0].conf0.mem_pd = 1;
108+
}
109+
110+
/**
111+
* @brief Power control the RMT memory block by the outside PMU logic
112+
*
113+
* @param dev Peripheral instance address
114+
*/
115+
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
116+
{
117+
dev->conf_ch[0].conf0.mem_pd = 0;
99118
}
100119

101120
/**
@@ -120,7 +139,7 @@ static inline void rmt_ll_enable_mem_access_nonfifo(rmt_dev_t *dev, bool enable)
120139
* @param divider_numerator Numerator part of the divider
121140
*/
122141
static inline void rmt_ll_set_group_clock_src(rmt_dev_t *dev, uint32_t channel, rmt_clock_source_t src,
123-
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
142+
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
124143
{
125144
(void)divider_integral;
126145
(void)divider_denominator;
@@ -631,7 +650,7 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
631650
return dev->conf_ch[channel].conf1.idle_out_lv;
632651
}
633652

634-
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
653+
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
635654
{
636655
// Only conf0 register of channel0 has `mem_pd`
637656
return dev->conf_ch[0].conf0.mem_pd;

components/hal/esp32c3/include/hal/rmt_ll.h

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,36 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
8787
}
8888

8989
/**
90-
* @brief Power down memory
90+
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
9191
*
9292
* @param dev Peripheral instance address
93-
* @param enable True to power down, False to power up
9493
*/
95-
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
94+
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
9695
{
97-
dev->sys_conf.mem_force_pu = !enable;
98-
dev->sys_conf.mem_force_pd = enable;
96+
dev->sys_conf.mem_force_pu = 1;
97+
dev->sys_conf.mem_force_pd = 0;
98+
}
99+
100+
/**
101+
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
102+
*
103+
* @param dev Peripheral instance address
104+
*/
105+
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
106+
{
107+
dev->sys_conf.mem_force_pd = 1;
108+
dev->sys_conf.mem_force_pu = 0;
109+
}
110+
111+
/**
112+
* @brief Power control the RMT memory block by the outside PMU logic
113+
*
114+
* @param dev Peripheral instance address
115+
*/
116+
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
117+
{
118+
dev->sys_conf.mem_force_pd = 0;
119+
dev->sys_conf.mem_force_pu = 0;
99120
}
100121

101122
/**
@@ -812,12 +833,9 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
812833
return dev->tx_conf[channel].idle_out_lv;
813834
}
814835

815-
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
836+
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
816837
{
817-
// the RTC domain can also power down RMT memory
818-
// so it's probably not enough to detect whether it's powered down or not
819-
// mem_force_pd has higher priority than mem_force_pu
820-
return (dev->sys_conf.mem_force_pd) || !(dev->sys_conf.mem_force_pu);
838+
return dev->sys_conf.mem_force_pd;
821839
}
822840

823841
__attribute__((always_inline))

components/hal/esp32c6/include/hal/rmt_ll.h

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,36 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
7979
}
8080

8181
/**
82-
* @brief Power down memory
82+
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
8383
*
8484
* @param dev Peripheral instance address
85-
* @param enable True to power down, False to power up
8685
*/
87-
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
86+
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
8887
{
89-
dev->sys_conf.mem_force_pu = !enable;
90-
dev->sys_conf.mem_force_pd = enable;
88+
dev->sys_conf.mem_force_pu = 1;
89+
dev->sys_conf.mem_force_pd = 0;
90+
}
91+
92+
/**
93+
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
94+
*
95+
* @param dev Peripheral instance address
96+
*/
97+
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
98+
{
99+
dev->sys_conf.mem_force_pd = 1;
100+
dev->sys_conf.mem_force_pu = 0;
101+
}
102+
103+
/**
104+
* @brief Power control the RMT memory block by the outside PMU logic
105+
*
106+
* @param dev Peripheral instance address
107+
*/
108+
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
109+
{
110+
dev->sys_conf.mem_force_pd = 0;
111+
dev->sys_conf.mem_force_pu = 0;
91112
}
92113

93114
/**
@@ -818,12 +839,9 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
818839
return dev->chnconf0[channel].idle_out_lv_chn;
819840
}
820841

821-
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
842+
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
822843
{
823-
// the RTC domain can also power down RMT memory
824-
// so it's probably not enough to detect whether it's powered down or not
825-
// mem_force_pd has higher priority than mem_force_pu
826-
return (dev->sys_conf.mem_force_pd) || !(dev->sys_conf.mem_force_pu);
844+
return dev->sys_conf.mem_force_pd;
827845
}
828846

829847
__attribute__((always_inline))

components/hal/esp32h2/include/hal/rmt_ll.h

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,36 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
7979
}
8080

8181
/**
82-
* @brief Power down memory
82+
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
8383
*
8484
* @param dev Peripheral instance address
85-
* @param enable True to power down, False to power up
8685
*/
87-
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
86+
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
8887
{
89-
dev->sys_conf.mem_force_pu = !enable;
90-
dev->sys_conf.mem_force_pd = enable;
88+
dev->sys_conf.mem_force_pu = 1;
89+
dev->sys_conf.mem_force_pd = 0;
90+
}
91+
92+
/**
93+
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
94+
*
95+
* @param dev Peripheral instance address
96+
*/
97+
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
98+
{
99+
dev->sys_conf.mem_force_pd = 1;
100+
dev->sys_conf.mem_force_pu = 0;
101+
}
102+
103+
/**
104+
* @brief Power control the RMT memory block by the outside PMU logic
105+
*
106+
* @param dev Peripheral instance address
107+
*/
108+
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
109+
{
110+
dev->sys_conf.mem_force_pd = 0;
111+
dev->sys_conf.mem_force_pu = 0;
91112
}
92113

93114
/**
@@ -812,12 +833,9 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
812833
return dev->chnconf0[channel].idle_out_lv_chn;
813834
}
814835

815-
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
836+
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
816837
{
817-
// the RTC domain can also power down RMT memory
818-
// so it's probably not enough to detect whether it's powered down or not
819-
// mem_force_pd has higher priority than mem_force_pu
820-
return (dev->sys_conf.mem_force_pd) || !(dev->sys_conf.mem_force_pu);
838+
return dev->sys_conf.mem_force_pd;
821839
}
822840

823841
__attribute__((always_inline))

components/hal/esp32p4/include/hal/rmt_ll.h

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static inline void rmt_ll_reset_register(int group_id)
8585
* @param divider_numerator Numerator part of the divider
8686
*/
8787
static inline void rmt_ll_set_group_clock_src(rmt_dev_t *dev, uint32_t channel, rmt_clock_source_t src,
88-
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
88+
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
8989
{
9090
(void)dev;
9191
// Formula: rmt_sclk = module_clock_src / (1 + div_num + div_a / div_b)
@@ -143,15 +143,36 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
143143
}
144144

145145
/**
146-
* @brief Power down memory
146+
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
147147
*
148148
* @param dev Peripheral instance address
149-
* @param enable True to power down, False to power up
150149
*/
151-
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
150+
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
152151
{
153-
dev->sys_conf.mem_force_pu = !enable;
154-
dev->sys_conf.mem_force_pd = enable;
152+
dev->sys_conf.mem_force_pu = 1;
153+
dev->sys_conf.mem_force_pd = 0;
154+
}
155+
156+
/**
157+
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
158+
*
159+
* @param dev Peripheral instance address
160+
*/
161+
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
162+
{
163+
dev->sys_conf.mem_force_pd = 1;
164+
dev->sys_conf.mem_force_pu = 0;
165+
}
166+
167+
/**
168+
* @brief Power control the RMT memory block by the outside PMU logic
169+
*
170+
* @param dev Peripheral instance address
171+
*/
172+
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
173+
{
174+
dev->sys_conf.mem_force_pd = 0;
175+
dev->sys_conf.mem_force_pu = 0;
155176
}
156177

157178
/**
@@ -860,12 +881,9 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
860881
return dev->chnconf0[channel].idle_out_lv_chn;
861882
}
862883

863-
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
884+
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
864885
{
865-
// the RTC domain can also power down RMT memory
866-
// so it's probably not enough to detect whether it's powered down or not
867-
// mem_force_pd has higher priority than mem_force_pu
868-
return (dev->sys_conf.mem_force_pd) || !(dev->sys_conf.mem_force_pu);
886+
return dev->sys_conf.mem_force_pd;
869887
}
870888

871889
__attribute__((always_inline))

0 commit comments

Comments
 (0)