fix(rmt): power up memory block

This commit is contained in:
morris
2024-06-20 23:46:21 +08:00
parent 8d34993193
commit 722ce211af
15 changed files with 240 additions and 125 deletions

View File

@@ -88,14 +88,33 @@ static inline void rmt_ll_enable_periph_clock(rmt_dev_t *dev, bool enable)
}
/**
* @brief Power down memory
* @brief Force power on the RMT memory block, regardless of the outside PMU logic
*
* @param dev Peripheral instance address
* @param enable True to power down, False to power up
*/
static inline void rmt_ll_power_down_mem(rmt_dev_t *dev, bool enable)
static inline void rmt_ll_mem_force_power_on(rmt_dev_t *dev)
{
dev->conf_ch[0].conf0.mem_pd = enable; // Only conf0 register of channel0 has `mem_pd`
(void)dev;
}
/**
* @brief Force power off the RMT memory block, regardless of the outside PMU logic
*
* @param dev Peripheral instance address
*/
static inline void rmt_ll_mem_force_power_off(rmt_dev_t *dev)
{
dev->conf_ch[0].conf0.mem_pd = 1;
}
/**
* @brief Power control the RMT memory block by the outside PMU logic
*
* @param dev Peripheral instance address
*/
static inline void rmt_ll_mem_power_by_pmu(rmt_dev_t *dev)
{
dev->conf_ch[0].conf0.mem_pd = 0;
}
/**
@@ -120,7 +139,7 @@ static inline void rmt_ll_enable_mem_access_nonfifo(rmt_dev_t *dev, bool enable)
* @param divider_numerator Numerator part of the divider
*/
static inline void rmt_ll_set_group_clock_src(rmt_dev_t *dev, uint32_t channel, rmt_clock_source_t src,
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
uint32_t divider_integral, uint32_t divider_denominator, uint32_t divider_numerator)
{
(void)divider_integral;
(void)divider_denominator;
@@ -631,7 +650,7 @@ static inline uint32_t rmt_ll_tx_get_idle_level(rmt_dev_t *dev, uint32_t channel
return dev->conf_ch[channel].conf1.idle_out_lv;
}
static inline bool rmt_ll_is_mem_powered_down(rmt_dev_t *dev)
static inline bool rmt_ll_is_mem_force_powered_down(rmt_dev_t *dev)
{
// Only conf0 register of channel0 has `mem_pd`
return dev->conf_ch[0].conf0.mem_pd;