2021-08-05 11:35:07 -04:00
|
|
|
/*
|
2023-07-12 03:21:40 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
2021-08-05 11:35:07 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2021-06-23 02:10:07 -04:00
|
|
|
|
2021-06-23 03:11:58 -04:00
|
|
|
#include "esp_check.h"
|
2020-09-08 08:17:18 -04:00
|
|
|
#include "esp_async_memcpy.h"
|
2023-07-12 03:21:40 -04:00
|
|
|
#include "esp_async_memcpy_priv.h"
|
2020-09-08 08:17:18 -04:00
|
|
|
|
2023-07-12 03:21:40 -04:00
|
|
|
static const char *TAG = "async_mcp";
|
2020-09-08 08:17:18 -04:00
|
|
|
|
2023-07-12 03:21:40 -04:00
|
|
|
esp_err_t esp_async_memcpy_uninstall(async_memcpy_handle_t asmcp)
|
2020-09-08 08:17:18 -04:00
|
|
|
{
|
2023-07-12 03:21:40 -04:00
|
|
|
ESP_RETURN_ON_FALSE(asmcp, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
|
|
|
|
return asmcp->del(asmcp);
|
2020-09-08 08:17:18 -04:00
|
|
|
}
|
|
|
|
|
2023-07-12 03:21:40 -04:00
|
|
|
esp_err_t esp_async_memcpy(async_memcpy_handle_t asmcp, void *dst, void *src, size_t n, async_memcpy_isr_cb_t cb_isr, void *cb_args)
|
2020-09-08 08:17:18 -04:00
|
|
|
{
|
2023-07-12 03:21:40 -04:00
|
|
|
ESP_RETURN_ON_FALSE(asmcp && dst && src && n, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
|
|
|
|
return asmcp->memcpy(asmcp, dst, src, n, cb_isr, cb_args);
|
2020-09-08 08:17:18 -04:00
|
|
|
}
|
|
|
|
|
2023-12-05 22:48:04 -05:00
|
|
|
#if SOC_ETM_SUPPORTED
|
2023-07-12 03:21:40 -04:00
|
|
|
esp_err_t esp_async_memcpy_new_etm_event(async_memcpy_handle_t asmcp, async_memcpy_etm_event_t event_type, esp_etm_event_handle_t *out_event)
|
2020-09-08 08:17:18 -04:00
|
|
|
{
|
2023-07-12 03:21:40 -04:00
|
|
|
ESP_RETURN_ON_FALSE(asmcp && out_event, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
|
2023-12-05 22:48:04 -05:00
|
|
|
ESP_RETURN_ON_FALSE(asmcp->new_etm_event, ESP_ERR_NOT_SUPPORTED, TAG, "ETM is not supported");
|
2023-07-12 03:21:40 -04:00
|
|
|
return asmcp->new_etm_event(asmcp, event_type, out_event);
|
2020-09-08 08:17:18 -04:00
|
|
|
}
|
2023-07-12 03:21:40 -04:00
|
|
|
#endif
|