rmt: disable carrier feature by default
This commit is contained in:
parent
0e4d82bc55
commit
07088c6446
4 changed files with 6 additions and 5 deletions
|
@ -156,7 +156,7 @@ esp_err_t rmt_set_tx_carrier(rmt_channel_t channel, bool carrier_en, uint16_t hi
|
||||||
RMT_ENTER_CRITICAL();
|
RMT_ENTER_CRITICAL();
|
||||||
rmt_ll_set_carrier_high_low_ticks(p_rmt_obj[channel]->hal.regs, channel, high_level, low_level);
|
rmt_ll_set_carrier_high_low_ticks(p_rmt_obj[channel]->hal.regs, channel, high_level, low_level);
|
||||||
rmt_ll_set_carrier_to_level(p_rmt_obj[channel]->hal.regs, channel, carrier_level);
|
rmt_ll_set_carrier_to_level(p_rmt_obj[channel]->hal.regs, channel, carrier_level);
|
||||||
rmt_ll_enable_tx_carrier(p_rmt_obj[channel]->hal.regs, channel, carrier_en);
|
rmt_ll_enable_carrier(p_rmt_obj[channel]->hal.regs, channel, carrier_en);
|
||||||
RMT_EXIT_CRITICAL();
|
RMT_EXIT_CRITICAL();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
@ -447,6 +447,7 @@ static esp_err_t rmt_internal_config(rmt_dev_t *dev, const rmt_config_t *rmt_par
|
||||||
}
|
}
|
||||||
rmt_ll_set_mem_blocks(dev, channel, mem_cnt);
|
rmt_ll_set_mem_blocks(dev, channel, mem_cnt);
|
||||||
rmt_ll_set_mem_owner(dev, channel, RMT_MEM_OWNER_HW);
|
rmt_ll_set_mem_owner(dev, channel, RMT_MEM_OWNER_HW);
|
||||||
|
rmt_ll_enable_carrier(dev, channel, false); // disable carrier feature by default
|
||||||
RMT_EXIT_CRITICAL();
|
RMT_EXIT_CRITICAL();
|
||||||
|
|
||||||
s_rmt_src_clock_hz[channel] = rmt_source_clk_hz;
|
s_rmt_src_clock_hz[channel] = rmt_source_clk_hz;
|
||||||
|
@ -463,7 +464,7 @@ static esp_err_t rmt_internal_config(rmt_dev_t *dev, const rmt_config_t *rmt_par
|
||||||
rmt_ll_enable_tx_idle(dev, channel, rmt_param->tx_config.idle_output_en);
|
rmt_ll_enable_tx_idle(dev, channel, rmt_param->tx_config.idle_output_en);
|
||||||
rmt_ll_set_tx_idle_level(dev, channel, idle_level);
|
rmt_ll_set_tx_idle_level(dev, channel, idle_level);
|
||||||
/*Set carrier*/
|
/*Set carrier*/
|
||||||
rmt_ll_enable_tx_carrier(dev, channel, carrier_en);
|
rmt_ll_enable_carrier(dev, channel, carrier_en);
|
||||||
if (carrier_en) {
|
if (carrier_en) {
|
||||||
uint32_t duty_div, duty_h, duty_l;
|
uint32_t duty_div, duty_h, duty_l;
|
||||||
duty_div = rmt_source_clk_hz / carrier_freq_hz;
|
duty_div = rmt_source_clk_hz / carrier_freq_hz;
|
||||||
|
|
|
@ -260,7 +260,7 @@ static inline void rmt_ll_get_carrier_high_low_ticks(rmt_dev_t *dev, uint32_t ch
|
||||||
*low_ticks = dev->carrier_duty_ch[channel].low;
|
*low_ticks = dev->carrier_duty_ch[channel].low;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void rmt_ll_enable_tx_carrier(rmt_dev_t *dev, uint32_t channel, bool enable)
|
static inline void rmt_ll_enable_carrier(rmt_dev_t *dev, uint32_t channel, bool enable)
|
||||||
{
|
{
|
||||||
dev->conf_ch[channel].conf0.carrier_en = enable;
|
dev->conf_ch[channel].conf0.carrier_en = enable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ static inline void rmt_ll_get_carrier_high_low_ticks(rmt_dev_t *dev, uint32_t ch
|
||||||
*low_ticks = dev->carrier_duty_ch[channel].low;
|
*low_ticks = dev->carrier_duty_ch[channel].low;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void rmt_ll_enable_tx_carrier(rmt_dev_t *dev, uint32_t channel, bool enable)
|
static inline void rmt_ll_enable_carrier(rmt_dev_t *dev, uint32_t channel, bool enable)
|
||||||
{
|
{
|
||||||
dev->conf_ch[channel].conf0.carrier_en = enable;
|
dev->conf_ch[channel].conf0.carrier_en = enable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ void ref_clock_init()
|
||||||
rmt_ll_start_tx(s_rmt.regs, REF_CLOCK_RMT_CHANNEL);
|
rmt_ll_start_tx(s_rmt.regs, REF_CLOCK_RMT_CHANNEL);
|
||||||
rmt_ll_set_mem_owner(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 0);
|
rmt_ll_set_mem_owner(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 0);
|
||||||
rmt_ll_reset_tx_pointer(s_rmt.regs, REF_CLOCK_RMT_CHANNEL);
|
rmt_ll_reset_tx_pointer(s_rmt.regs, REF_CLOCK_RMT_CHANNEL);
|
||||||
rmt_ll_enable_tx_carrier(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, false);
|
rmt_ll_enable_carrier(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, false);
|
||||||
rmt_ll_set_counter_clock_div(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 1);
|
rmt_ll_set_counter_clock_div(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 1);
|
||||||
rmt_ll_set_mem_blocks(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 1);
|
rmt_ll_set_mem_blocks(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 1);
|
||||||
rmt_ll_set_counter_clock_src(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 0);
|
rmt_ll_set_counter_clock_src(s_rmt.regs, REF_CLOCK_RMT_CHANNEL, 0);
|
||||||
|
|
Loading…
Reference in a new issue