RMT examples must be updated in esp-idf5.2

profjmer
Posts: 3
Joined: Sun Mar 24, 2024 5:34 pm

RMT examples must be updated in esp-idf5.2

Postby profjmer » Fri Apr 05, 2024 6:39 pm

Channels configuration for rmt examples in esp-idf-5.2 do not follow structure definition in rmt_tx.h

Code: Select all

    rmt_tx_channel_config_t tx_chan_config = {
        .clk_src = RMT_CLK_SRC_DEFAULT, // select clock source
        .gpio_num = STEP_MOTOR_GPIO_STEP,
        .mem_block_symbols = 64,
        .resolution_hz = STEP_MOTOR_RESOLUTION_HZ,
        .trans_queue_depth = 10, // set the number of transactions that can be pending in the background
    };
According to rmt_tx.h
/**
* @brief RMT TX channel specific configuration
*/

Code: Select all

typedef struct {
    gpio_num_t gpio_num;        /*!< GPIO number used by RMT TX channel. Set to -1 if unused */
    rmt_clock_source_t clk_src; /*!< Clock source of RMT TX channel, channels in the same group must use the same clock source */
    uint32_t resolution_hz;     /*!< Channel clock resolution, in Hz */
    size_t mem_block_symbols;   /*!< Size of memory block, in number of `rmt_symbol_word_t`, must be an even.
                                     In the DMA mode, this field controls the DMA buffer size, it can be set to a large value;
                                     In the normal mode, this field controls the number of RMT memory block that will be used by the channel. */
    size_t trans_queue_depth;   /*!< Depth of internal transfer queue, increase this value can support more transfers pending in the background */
    int intr_priority;          /*!< RMT interrupt priority,
                                     if set to 0, the driver will try to allocate an interrupt with a relative low priority (1,2,3) */
    struct {
        uint32_t invert_out: 1;   /*!< Whether to invert the RMT channel signal before output to GPIO pad */
        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_od_mode: 1;   /*!< Configure the GPIO as open-drain mode */
    } flags;                      /*!< TX channel config flags */
} rmt_tx_channel_config_t;
This one is an easy fix but all the examples do not seem to use the new driver correctly

Who is online

Users browsing this forum: No registered users and 211 guests