@@ -85,7 +85,7 @@ static inline void rmt_ll_reset_register(int group_id)
8585 * @param divider_numerator Numerator part of the divider
8686 */
8787static 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