diff --git a/components/esp_driver_ledc/src/ledc.c b/components/esp_driver_ledc/src/ledc.c index 161ef298d43..587a1fc8797 100644 --- a/components/esp_driver_ledc/src/ledc.c +++ b/components/esp_driver_ledc/src/ledc.c @@ -808,7 +808,7 @@ static esp_err_t _ledc_set_pin(int gpio_num, bool out_inv, ledc_mode_t speed_mod if (old_gpio_rsv_mask & BIT64(gpio_num)) { ESP_LOGW(LEDC_TAG, "GPIO %d is not usable, maybe conflict with others", gpio_num); } - gpio_matrix_output(gpio_num, ledc_periph_signal[0].speed_mode[speed_mode].sig_out0_idx + channel, out_inv, false); + gpio_matrix_output(gpio_num, ledc_periph_signal[0].speed_mode[speed_mode].sig_out_idx[channel], out_inv, false); portENTER_CRITICAL(&ledc_spinlock); p_ledc_obj[speed_mode]->occupied_pin_mask[channel] |= BIT64(gpio_num); portEXIT_CRITICAL(&ledc_spinlock); diff --git a/components/esp_hal_ledc/esp32/ledc_periph.c b/components/esp_hal_ledc/esp32/ledc_periph.c index b55bbefb84a..09e7531b8dd 100644 --- a/components/esp_hal_ledc/esp32/ledc_periph.c +++ b/components/esp_hal_ledc/esp32/ledc_periph.c @@ -14,8 +14,30 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_HS_SIG_OUT0_IDX }, - [1] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_HS_SIG_OUT0_IDX, + LEDC_HS_SIG_OUT1_IDX, + LEDC_HS_SIG_OUT2_IDX, + LEDC_HS_SIG_OUT3_IDX, + LEDC_HS_SIG_OUT4_IDX, + LEDC_HS_SIG_OUT5_IDX, + LEDC_HS_SIG_OUT6_IDX, + LEDC_HS_SIG_OUT7_IDX, + } + }, + [1] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + LEDC_LS_SIG_OUT6_IDX, + LEDC_LS_SIG_OUT7_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32c2/ledc_periph.c b/components/esp_hal_ledc/esp32c2/ledc_periph.c index 5f53c404b2f..58316321a4f 100644 --- a/components/esp_hal_ledc/esp32c2/ledc_periph.c +++ b/components/esp_hal_ledc/esp32c2/ledc_periph.c @@ -14,7 +14,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32c3/ledc_periph.c b/components/esp_hal_ledc/esp32c3/ledc_periph.c index 5f53c404b2f..58316321a4f 100644 --- a/components/esp_hal_ledc/esp32c3/ledc_periph.c +++ b/components/esp_hal_ledc/esp32c3/ledc_periph.c @@ -14,7 +14,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32c5/ledc_periph.c b/components/esp_hal_ledc/esp32c5/ledc_periph.c index 57484af7a63..10605ef2840 100644 --- a/components/esp_hal_ledc/esp32c5/ledc_periph.c +++ b/components/esp_hal_ledc/esp32c5/ledc_periph.c @@ -15,7 +15,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32c6/ledc_periph.c b/components/esp_hal_ledc/esp32c6/ledc_periph.c index 0d09047c871..e63da7ee7e3 100644 --- a/components/esp_hal_ledc/esp32c6/ledc_periph.c +++ b/components/esp_hal_ledc/esp32c6/ledc_periph.c @@ -15,7 +15,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32c61/ledc_periph.c b/components/esp_hal_ledc/esp32c61/ledc_periph.c index bbcd7c2c13c..a348bee6cea 100644 --- a/components/esp_hal_ledc/esp32c61/ledc_periph.c +++ b/components/esp_hal_ledc/esp32c61/ledc_periph.c @@ -15,7 +15,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32h2/ledc_periph.c b/components/esp_hal_ledc/esp32h2/ledc_periph.c index 0d09047c871..e63da7ee7e3 100644 --- a/components/esp_hal_ledc/esp32h2/ledc_periph.c +++ b/components/esp_hal_ledc/esp32h2/ledc_periph.c @@ -15,7 +15,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32h21/ledc_periph.c b/components/esp_hal_ledc/esp32h21/ledc_periph.c index 7bcb709d9db..38d428044bc 100644 --- a/components/esp_hal_ledc/esp32h21/ledc_periph.c +++ b/components/esp_hal_ledc/esp32h21/ledc_periph.c @@ -15,7 +15,16 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32h4/ledc_periph.c b/components/esp_hal_ledc/esp32h4/ledc_periph.c index 8e033e06f2f..c55a1d45770 100644 --- a/components/esp_hal_ledc/esp32h4/ledc_periph.c +++ b/components/esp_hal_ledc/esp32h4/ledc_periph.c @@ -15,7 +15,18 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + LEDC_LS_SIG_OUT6_IDX, + LEDC_LS_SIG_OUT7_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32p4/ledc_periph.c b/components/esp_hal_ledc/esp32p4/ledc_periph.c index 432503fe8f3..96231d56703 100644 --- a/components/esp_hal_ledc/esp32p4/ledc_periph.c +++ b/components/esp_hal_ledc/esp32p4/ledc_periph.c @@ -15,7 +15,18 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT_PAD_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT_PAD_OUT0_IDX, + LEDC_LS_SIG_OUT_PAD_OUT1_IDX, + LEDC_LS_SIG_OUT_PAD_OUT2_IDX, + LEDC_LS_SIG_OUT_PAD_OUT3_IDX, + LEDC_LS_SIG_OUT_PAD_OUT4_IDX, + LEDC_LS_SIG_OUT_PAD_OUT5_IDX, + LEDC_LS_SIG_OUT_PAD_OUT6_IDX, + LEDC_LS_SIG_OUT_PAD_OUT7_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32s2/ledc_periph.c b/components/esp_hal_ledc/esp32s2/ledc_periph.c index 6c76cb8753a..9b3697a8c9d 100644 --- a/components/esp_hal_ledc/esp32s2/ledc_periph.c +++ b/components/esp_hal_ledc/esp32s2/ledc_periph.c @@ -14,7 +14,18 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + LEDC_LS_SIG_OUT6_IDX, + LEDC_LS_SIG_OUT7_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/esp32s3/ledc_periph.c b/components/esp_hal_ledc/esp32s3/ledc_periph.c index 6c76cb8753a..9b3697a8c9d 100644 --- a/components/esp_hal_ledc/esp32s3/ledc_periph.c +++ b/components/esp_hal_ledc/esp32s3/ledc_periph.c @@ -14,7 +14,18 @@ const ledc_signal_conn_t ledc_periph_signal[1] = { { .irq_id = ETS_LEDC_INTR_SOURCE, .speed_mode = { - [0] = { .sig_out0_idx = LEDC_LS_SIG_OUT0_IDX }, + [0] = { + .sig_out_idx = { + LEDC_LS_SIG_OUT0_IDX, + LEDC_LS_SIG_OUT1_IDX, + LEDC_LS_SIG_OUT2_IDX, + LEDC_LS_SIG_OUT3_IDX, + LEDC_LS_SIG_OUT4_IDX, + LEDC_LS_SIG_OUT5_IDX, + LEDC_LS_SIG_OUT6_IDX, + LEDC_LS_SIG_OUT7_IDX, + } + }, }, } }; diff --git a/components/esp_hal_ledc/include/hal/ledc_periph.h b/components/esp_hal_ledc/include/hal/ledc_periph.h index 9a430cd7aca..afaa977fab4 100644 --- a/components/esp_hal_ledc/include/hal/ledc_periph.h +++ b/components/esp_hal_ledc/include/hal/ledc_periph.h @@ -28,7 +28,7 @@ extern "C" { typedef struct { const int irq_id; struct { - const int sig_out0_idx; + const int sig_out_idx[SOC_LEDC_CHANNEL_NUM]; } speed_mode[LEDC_SPEED_MODE_MAX]; } ledc_signal_conn_t;