mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-11 13:00:19 +00:00
Merge branch 'feat/support_cs_signal_in_parlio_tx' into 'master'
feat(parlio_tx): support cs signal on esp32c5 v1.0 Closes IDF-12836 and IDF-12633 See merge request espressif/esp-idf!38646
This commit is contained in:
@@ -32,11 +32,8 @@
|
||||
#define PARLIO_LL_EVENT_TX_MASK (PARLIO_LL_EVENT_TX_FIFO_EMPTY | PARLIO_LL_EVENT_TX_EOF)
|
||||
#define PARLIO_LL_EVENT_RX_MASK (PARLIO_LL_EVENT_RX_FIFO_FULL)
|
||||
|
||||
#define PARLIO_LL_TX_DATA_LINE_AS_VALID_SIG 7 // TXD[7] can be used a valid signal
|
||||
#define PARLIO_LL_TX_DATA_LINE_AS_CLK_GATE 7 // TXD[7] can be used as clock gate signal
|
||||
|
||||
#define PARLIO_LL_CLK_DIVIDER_MAX (0) // Not support fractional divider
|
||||
|
||||
#define PARLIO_LL_TX_VALID_MAX_DELAY 32767
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -526,18 +523,34 @@ static inline void parlio_ll_tx_start(parl_io_dev_t *dev, bool en)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Whether to treat the MSB of TXD as the valid signal
|
||||
*
|
||||
* @note If enabled, TXD[7] will work as valid signal, which stay high during data transmission.
|
||||
* @brief Set the clock gating from the valid signal
|
||||
*
|
||||
* @param dev Parallel IO register base address
|
||||
* @param en True to enable, False to disable
|
||||
* @param en If set to true, the clock is gated by the valid signal, otherwise it is gated by the MSB of the data line.
|
||||
*/
|
||||
static inline void parlio_ll_tx_treat_msb_as_valid(parl_io_dev_t *dev, bool en)
|
||||
static inline void parlio_ll_tx_clock_gating_from_valid(parl_io_dev_t *dev, bool en)
|
||||
{
|
||||
dev->tx_genrl_cfg.tx_valid_output_en = en;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set TX valid signal delay
|
||||
*
|
||||
* @param dev Parallel IO register base address
|
||||
* @param start_delay Number of clock cycles to delay
|
||||
* @param stop_delay Number of clock cycles to delay
|
||||
* @return true: success, false: valid delay is not supported
|
||||
*/
|
||||
static inline bool parlio_ll_tx_set_valid_delay(parl_io_dev_t *dev, uint32_t start_delay, uint32_t stop_delay)
|
||||
{
|
||||
if (start_delay > PARLIO_LL_TX_VALID_MAX_DELAY || stop_delay > PARLIO_LL_TX_VALID_MAX_DELAY) {
|
||||
return false;
|
||||
}
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->tx_cs_cfg, tx_cs_start_delay, start_delay);
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->tx_cs_cfg, tx_cs_stop_delay, stop_delay);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the sample clock edge
|
||||
*
|
||||
|
Reference in New Issue
Block a user