fix(ledc): left-off gamma ram registers should be cleared

Hardware reads in (range_number+1) fade parameter registers, which could
cause output waveform error.
This commit is contained in:
Song Ruo Jing
2024-12-31 21:28:20 +08:00
parent 19fec9f455
commit a6b47fac12
3 changed files with 27 additions and 4 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -365,6 +365,15 @@ void ledc_hal_get_range_number(ledc_hal_context_t *hal, ledc_channel_t channel_n
* @return None
*/
void ledc_hal_get_fade_param(ledc_hal_context_t *hal, ledc_channel_t channel_num, uint32_t range, uint32_t *dir, uint32_t *cycle, uint32_t *scale, uint32_t *step);
/**
* @brief Clear left-off range fade parameters in LEDC gamma ram
*
* @param hal Context of the HAL layer
* @param channel_num LEDC channel index, select from ledc_channel_t
* @param start_range Start of the range to clear
*/
void ledc_hal_clear_left_off_fade_param(ledc_hal_context_t *hal, ledc_channel_t channel_num, uint32_t start_range);
#endif //SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED
/**