mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 10:00:57 +02:00
feat(rmt): allow to set init level before any tx transmission
Closes https://github.com/espressif/esp-idf/issues/16068
This commit is contained in:
committed by
Chen Ji Chang
parent
f31ab9c91a
commit
e32a8c0978
@@ -44,6 +44,7 @@ typedef struct {
|
|||||||
uint32_t with_dma: 1; /*!< If set, the driver will allocate an RMT channel with DMA capability */
|
uint32_t with_dma: 1; /*!< If set, the driver will allocate an RMT channel with DMA capability */
|
||||||
uint32_t io_loop_back: 1; /*!< The signal output from the GPIO will be fed to the input path as well */
|
uint32_t io_loop_back: 1; /*!< The signal output from the GPIO will be fed to the input path as well */
|
||||||
uint32_t io_od_mode: 1; /*!< Configure the GPIO as open-drain mode */
|
uint32_t io_od_mode: 1; /*!< Configure the GPIO as open-drain mode */
|
||||||
|
uint32_t init_level: 1; /*!< Set the initial level of the RMT channel signal */
|
||||||
} flags; /*!< TX channel config flags */
|
} flags; /*!< TX channel config flags */
|
||||||
} rmt_tx_channel_config_t;
|
} rmt_tx_channel_config_t;
|
||||||
|
|
||||||
|
@@ -296,7 +296,7 @@ esp_err_t rmt_new_tx_channel(const rmt_tx_channel_config_t *config, rmt_channel_
|
|||||||
// disable carrier modulation by default, can reenable by `rmt_apply_carrier()`
|
// disable carrier modulation by default, can reenable by `rmt_apply_carrier()`
|
||||||
rmt_ll_tx_enable_carrier_modulation(hal->regs, channel_id, false);
|
rmt_ll_tx_enable_carrier_modulation(hal->regs, channel_id, false);
|
||||||
// idle level is determined by register value
|
// idle level is determined by register value
|
||||||
rmt_ll_tx_fix_idle_level(hal->regs, channel_id, 0, true);
|
rmt_ll_tx_fix_idle_level(hal->regs, channel_id, config->flags.init_level, true);
|
||||||
// always enable tx wrap, both DMA mode and ping-pong mode rely this feature
|
// always enable tx wrap, both DMA mode and ping-pong mode rely this feature
|
||||||
rmt_ll_tx_enable_wrap(hal->regs, channel_id, true);
|
rmt_ll_tx_enable_wrap(hal->regs, channel_id, true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user