1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include <driver/hal/hal_dma_types.h> 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 bk_err_t dma_set_src_pause_addr(dma_id_t id, uint32_t addr); 24 bk_err_t dma_set_dst_pause_addr(dma_id_t id, uint32_t addr); 25 uint32_t dma_get_src_read_addr(dma_id_t id); 26 uint32_t dma_get_dest_write_addr(dma_id_t id); 27 bk_err_t dma_memcpy(void *out, const void *in, uint32_t len); 28 bk_err_t dma_memcpy_by_chnl(void *out, const void *in, uint32_t len, dma_id_t cpy_chnl); 29 bk_err_t bk_dma_set_src_data_width(dma_id_t id, dma_data_width_t data_width); 30 bk_err_t bk_dma_set_dest_data_width(dma_id_t id, dma_data_width_t data_width); 31 32 #ifdef __cplusplus 33 } 34 #endif 35 36