@@ -71,7 +71,7 @@ typedef struct {
7171 uint32_t mark_final : 1 ; /*!< Whether to terminate the DMA link list at this item.
7272 Note, DMA engine will stop at this item and trigger an interrupt.
7373 If `mark_final` is not set, this list item will point to the next item, and
74- wrap around to the head item if it's the one in the list. */
74+ wrap around to the head item if it's the last one in the list. */
7575 } flags ; //!< Flags for buffer mount configurations
7676} gdma_buffer_mount_config_t ;
7777
@@ -105,6 +105,27 @@ esp_err_t gdma_link_mount_buffers(gdma_link_list_handle_t list, uint32_t start_i
105105 */
106106uintptr_t gdma_link_get_head_addr (gdma_link_list_handle_t list );
107107
108+ /**
109+ * @brief Concatenate two link lists as follows:
110+ *
111+ * Link A: A1 --> A2 --> A3 --> A4
112+ * | item_index
113+ * +-----+
114+ * |
115+ * v item_index
116+ * Link B: B1 --> B2 --> B3 --> B4
117+ *
118+ * @param[in] first_link First link list handle, allocated by `gdma_new_link_list`
119+ * @param[in] first_link_item_index Index of the item in the first link list (-1 means the last item)
120+ * @param[in] second_link Second link list handle, allocated by `gdma_new_link_list`
121+ * @param[in] second_link_item_index Index of the item in the second link list (-1 means the last item)
122+ * @return
123+ * - ESP_OK: Concatenate the link lists successfully
124+ * - ESP_ERR_INVALID_ARG: Concatenate the link lists failed because of invalid argument
125+ * - ESP_FAIL: Concatenate the link lists failed because of other error
126+ */
127+ esp_err_t gdma_link_concat (gdma_link_list_handle_t first_link , int first_link_item_index , gdma_link_list_handle_t second_link , int second_link_item_index );
128+
108129/**
109130 * @brief GDMA link list item owner
110131 */
@@ -117,7 +138,7 @@ typedef enum {
117138 * @brief Set the ownership for a DMA link list item
118139 *
119140 * @param[in] list Link list handle, allocated by `gdma_new_link_list`
120- * @param[in] item_index Index of the link list item
141+ * @param[in] item_index Index of the link list item (-1 means the last item)
121142 * @param[in] owner Ownership
122143 * @return
123144 * - ESP_OK: Set the ownership successfully
@@ -130,7 +151,7 @@ esp_err_t gdma_link_set_owner(gdma_link_list_handle_t list, int item_index, gdma
130151 * @brief Get the ownership of a DMA link list item
131152 *
132153 * @param[in] list Link list handle, allocated by `gdma_new_link_list`
133- * @param[in] item_index Index of the link list item
154+ * @param[in] item_index Index of the link list item (-1 means the last item)
134155 * @param[out] owner Ownership
135156 * @return
136157 * - ESP_OK: Get the ownership successfully
0 commit comments