diff --git a/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c b/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c index e9b24ccf77..bf210f10db 100644 --- a/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c +++ b/components/esp_driver_parlio/test_apps/parlio/main/test_parlio_rx.c @@ -379,7 +379,7 @@ TEST_CASE("parallel_rx_unit_pulse_delimiter_test_via_i2s", "[parlio_rx]") { parlio_rx_pulse_delimiter_config_t pls_deli_cfg = { .valid_sig_line_id = TEST_VALID_SIG, - .sample_edge = PARLIO_SAMPLE_EDGE_NEG, + .sample_edge = PARLIO_SAMPLE_EDGE_POS, .bit_pack_order = PARLIO_BIT_PACK_ORDER_MSB, .eof_data_len = TEST_EOF_DATA_LEN, .timeout_ticks = 0, diff --git a/components/esp_hal_parlio/esp32c5/include/hal/parlio_ll.h b/components/esp_hal_parlio/esp32c5/include/hal/parlio_ll.h index 190389866d..7a48056285 100644 --- a/components/esp_hal_parlio/esp32c5/include/hal/parlio_ll.h +++ b/components/esp_hal_parlio/esp32c5/include/hal/parlio_ll.h @@ -264,8 +264,9 @@ static inline void parlio_ll_rx_start_soft_recv(parl_io_dev_t *dev, bool en) __attribute__((always_inline)) static inline void parlio_ll_rx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->rx_clk_cfg.rx_clk_i_inv = edge; - dev->rx_clk_cfg.rx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->rx_clk_cfg.rx_clk_i_inv = invert; + dev->rx_clk_cfg.rx_clk_o_inv = invert; } /** @@ -568,8 +569,9 @@ static inline bool parlio_ll_tx_set_valid_delay(parl_io_dev_t *dev, uint32_t sta */ static inline void parlio_ll_tx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->tx_clk_cfg.tx_clk_i_inv = edge; - dev->tx_clk_cfg.tx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->tx_clk_cfg.tx_clk_i_inv = invert; + dev->tx_clk_cfg.tx_clk_o_inv = invert; } /** diff --git a/components/esp_hal_parlio/esp32h2/include/hal/parlio_ll.h b/components/esp_hal_parlio/esp32h2/include/hal/parlio_ll.h index 44350539c1..b9dfbdb566 100644 --- a/components/esp_hal_parlio/esp32h2/include/hal/parlio_ll.h +++ b/components/esp_hal_parlio/esp32h2/include/hal/parlio_ll.h @@ -266,8 +266,9 @@ static inline void parlio_ll_rx_start_soft_recv(parl_io_dev_t *dev, bool en) __attribute__((always_inline)) static inline void parlio_ll_rx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->rx_clk_cfg.rx_clk_i_inv = edge; - dev->rx_clk_cfg.rx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->rx_clk_cfg.rx_clk_i_inv = invert; + dev->rx_clk_cfg.rx_clk_o_inv = invert; } /** @@ -575,8 +576,9 @@ static inline bool parlio_ll_tx_set_valid_delay(parl_io_dev_t *dev, uint32_t sta */ static inline void parlio_ll_tx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->tx_clk_cfg.tx_clk_i_inv = edge; - dev->tx_clk_cfg.tx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->tx_clk_cfg.tx_clk_i_inv = invert; + dev->tx_clk_cfg.tx_clk_o_inv = invert; } /** diff --git a/components/esp_hal_parlio/esp32h4/include/hal/parlio_ll.h b/components/esp_hal_parlio/esp32h4/include/hal/parlio_ll.h index d8d08a9a4b..e245951c98 100644 --- a/components/esp_hal_parlio/esp32h4/include/hal/parlio_ll.h +++ b/components/esp_hal_parlio/esp32h4/include/hal/parlio_ll.h @@ -264,8 +264,9 @@ static inline void parlio_ll_rx_start_soft_recv(parl_io_dev_t *dev, bool en) __attribute__((always_inline)) static inline void parlio_ll_rx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->rx_clk_cfg.rx_clk_i_inv = edge; - dev->rx_clk_cfg.rx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->rx_clk_cfg.rx_clk_i_inv = invert; + dev->rx_clk_cfg.rx_clk_o_inv = invert; } /** @@ -568,8 +569,9 @@ static inline bool parlio_ll_tx_set_valid_delay(parl_io_dev_t *dev, uint32_t sta */ static inline void parlio_ll_tx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->tx_clk_cfg.tx_clk_i_inv = edge; - dev->tx_clk_cfg.tx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->tx_clk_cfg.tx_clk_i_inv = invert; + dev->tx_clk_cfg.tx_clk_o_inv = invert; } /** diff --git a/components/esp_hal_parlio/esp32p4/include/hal/parlio_ll.h b/components/esp_hal_parlio/esp32p4/include/hal/parlio_ll.h index 5b1c8be554..37183fe8d6 100644 --- a/components/esp_hal_parlio/esp32p4/include/hal/parlio_ll.h +++ b/components/esp_hal_parlio/esp32p4/include/hal/parlio_ll.h @@ -320,8 +320,9 @@ static inline void parlio_ll_rx_start_soft_recv(parl_io_dev_t *dev, bool en) __attribute__((always_inline)) static inline void parlio_ll_rx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->rx_clk_cfg.rx_clk_i_inv = edge; - dev->rx_clk_cfg.rx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->rx_clk_cfg.rx_clk_i_inv = invert; + dev->rx_clk_cfg.rx_clk_o_inv = invert; } /** @@ -629,8 +630,9 @@ static inline void parlio_ll_tx_start(parl_io_dev_t *dev, bool en) */ static inline void parlio_ll_tx_set_sample_clock_edge(parl_io_dev_t *dev, parlio_sample_edge_t edge) { - dev->tx_clk_cfg.tx_clk_i_inv = edge; - dev->tx_clk_cfg.tx_clk_o_inv = edge; + bool invert = edge == PARLIO_SAMPLE_EDGE_NEG; + dev->tx_clk_cfg.tx_clk_i_inv = invert; + dev->tx_clk_cfg.tx_clk_o_inv = invert; } /**