1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 * Description: Provides hal DMA \n 16 * 17 * History: \n 18 * 2022-10-16, Create file. \n 19 */ 20 #ifndef HAL_DMA_H 21 #define HAL_DMA_H 22 23 #include <stdint.h> 24 #include <stdbool.h> 25 #include "common_def.h" 26 #include "errcode.h" 27 #include "dma_porting.h" 28 29 #ifdef __cplusplus 30 #if __cplusplus 31 extern "C" { 32 #endif /* __cplusplus */ 33 #endif /* __cplusplus */ 34 /** 35 * @defgroup drivers_hal_dma_api DMA 36 * @ingroup drivers_hal_dma 37 * @{ 38 */ 39 40 /** 41 * @if Eng 42 * @brief DMA channel transfer done/error callback function pointer type of user for hal. 43 * @param [in] intr DMA interrupt type. 44 * @param [in] channel DMA channel that generates interrupts. 45 * @param [in] arg Private param pointer for storing self information, which can be passed to DMA callback 46 * when transfer completed. 47 * @else 48 * @brief hal层DMA通道传输完成/错误所触发的回调函数指针 49 * @param [in] intr DMA中断类型 50 * @param [in] channel 产生中断的DMA通道。 51 * @param [in] arg 用于存储自定义信息的私有参数指针,传输完成时回传给dma回调函数。 52 * @endif 53 */ 54 typedef void (*hal_dma_transfer_cb_t)(uint8_t intr, uint8_t channel, uintptr_t arg); 55 56 /** 57 * @if Eng 58 * @brief DMA transfer data width. 59 * @else 60 * @brief DMA传输数据宽度 61 * @endif 62 */ 63 typedef enum hal_dma_data_width { 64 HAL_DMA_TRANSFER_WIDTH_8, 65 HAL_DMA_TRANSFER_WIDTH_16, 66 HAL_DMA_TRANSFER_WIDTH_32, 67 HAL_DMA_TRANSFER_WIDTH_64, 68 HAL_DMA_TRANSFER_WIDTH_128, 69 HAL_DMA_TRANSFER_WIDTH_256 70 } hal_dma_data_width_t; 71 72 /** 73 * @if Eng 74 * @brief DMA transfer burst length. 75 * @else 76 * @brief DMA传输burst长度 77 * @endif 78 */ 79 typedef enum hal_dma_burst_transaction_length { 80 HAL_DMA_BURST_TRANSACTION_LENGTH_1, 81 HAL_DMA_BURST_TRANSACTION_LENGTH_4, 82 HAL_DMA_BURST_TRANSACTION_LENGTH_8, 83 HAL_DMA_BURST_TRANSACTION_LENGTH_16, 84 HAL_DMA_BURST_TRANSACTION_LENGTH_32, 85 HAL_DMA_BURST_TRANSACTION_LENGTH_64, 86 HAL_DMA_BURST_TRANSACTION_LENGTH_128, 87 HAL_DMA_BURST_TRANSACTION_LENGTH_256 88 } hal_dma_burst_transaction_length_t; 89 90 /** 91 * @if Eng 92 * @brief DMA src/dst address increment. 93 * @else 94 * @brief DMA源/目的端地址增量模式长度 95 * @endif 96 */ 97 typedef enum hal_dma_address_inc { 98 HAL_DMA_ADDRESS_INC_INCREMENT, 99 HAL_DMA_ADDRESS_INC_DECREMENT, 100 HAL_DMA_ADDRESS_INC_NO_CHANGE, 101 HAL_DMA_ADDRESS_INC_TYPES 102 } hal_dma_address_inc_t; 103 104 /** 105 * @if Eng 106 * @brief DMA Channel priority. 107 * @else 108 * @brief DMA传输优先级 109 * @endif 110 */ 111 typedef enum hal_dma_ch_priority { 112 HAL_DMA_CH_PRIORITY_0, 113 HAL_DMA_CH_PRIORITY_1, 114 HAL_DMA_CH_PRIORITY_2, 115 HAL_DMA_CH_PRIORITY_3 116 } hal_dma_ch_priority_t; 117 118 /** 119 * @if Eng 120 * @brief DMA transfer type. 121 * @else 122 * @brief DMA传输类型 123 * @endif 124 */ 125 typedef enum hal_dma_trans_type { 126 HAL_DMA_TRANS_MEMORY_TO_MEMORY_DMA, 127 HAL_DMA_TRANS_MEMORY_TO_PERIPHERAL_DMA, 128 HAL_DMA_TRANS_PERIPHERAL_TO_MEMORY_DMA, 129 HAL_DMA_TRANS_PERIPHERAL_TO_PERIPHERAL_DMA, 130 HAL_DMA_TRANS_PERIPHERAL_TO_MEMORY_PERIPHERAL, 131 HAL_DMA_TRANS_PERIPHERAL_TO_PERIPHERAL_SRC, 132 HAL_DMA_TRANS_MEMORY_TO_PERIPHERAL_PERIPHERAL, 133 HAL_DMA_TRANS_PERIPHERAL_TO_PERIPHERAL_DST 134 } hal_dma_trans_type_t; 135 136 /** 137 * @if Eng 138 * @brief DMA protection control bits used to drive the AHB HPROT[3:1] bus. 139 * @else 140 * @brief DMA保护控制位,用于驱动AHB HPRO[3:1]总线 141 * @endif 142 */ 143 typedef enum hal_dma_protection_control { 144 /** @if Eng The access is in user mode, and can not be buffered or cached. 145 * @else 访问处于用户模式,不能缓存或者cache。 146 * @endif */ 147 HAL_DMA_PROTECTION_CONTROL_NONE, 148 /** @if Eng The access is in privileged mode, and can not be buffered or cached. 149 * @else 访问处于特权模式,不能缓存或者cache。 150 * @endif */ 151 HAL_DMA_PROTECTION_CONTROL_PRIVILEGED, 152 /** @if Eng The access is in user mode, and can be buffered but can not be cached. 153 * @else 访问处于用户模式,能缓存但是不能cache。 154 * @endif */ 155 HAL_DMA_PROTECTION_CONTROL_BUFFERABLE, 156 /** @if Eng The access is in privileged mode, and can be buffered but can not be cached. 157 * @else 访问处于特权模式,能缓存但是不能cache。 158 * @endif */ 159 HAL_DMA_PROTECTION_CONTROL_PRIVILEGED_BUFFERABLE, 160 /** @if Eng The access is in user mode, and can not be buffered but can be cached. 161 * @else 访问处于用户模式,不能缓存但是能cache。 162 * @endif */ 163 HAL_DMA_PROTECTION_CONTROL_CACHEABLE, 164 /** @if Eng The access is in privileged mode, and can not be buffered but can be cached. 165 * @else 访问处于特权模式,不能缓存但是能cache。 166 * @endif */ 167 HAL_DMA_PROTECTION_CONTROL_PRIVILEGED_CACHEABLE, 168 /** @if Eng The access is in user mode, and can be buffered or cached. 169 * @else 访问处于用户模式,能缓存或者cache。 170 * @endif */ 171 HAL_DMA_PROTECTION_CONTROL_BUFFERABLE_CACHEABLE, 172 /** @if Eng The access is in privileged mode, and can be buffered or cached. 173 * @else 访问处于特权模式,能缓存或者cache。 174 * @endif */ 175 HAL_DMA_PROTECTION_CONTROL_ALL 176 } hal_dma_protection_control_t; 177 178 /** 179 * @if Eng 180 * @brief DMA handshaking status. 181 * @else 182 * @brief DMA外设握手状态 183 * @endif 184 */ 185 typedef enum hal_dma_mux_handshaking_status { 186 HAL_DMA_MUX_HANDSHAKING_IDLE, 187 HAL_DMA_MUX_HANDSHAKING_USING 188 } hal_dma_mux_handshaking_status_t; 189 190 /** 191 * @if Eng 192 * @brief DMA transfer direction. 193 * @else 194 * @brief DMA传输方向 195 * @endif 196 */ 197 typedef enum dma_ch_transfer_dir { 198 HAL_DMA_TRANSFER_DIR_MEM_TO_PERIPHERAL, 199 HAL_DMA_TRANSFER_DIR_PERIPHERAL_TO_MEM, 200 HAL_DMA_TRANSFER_DIR_PERIPHERAL_TO_PERIPHERAL 201 } dma_ch_transfer_dir_t; 202 203 /** 204 * @if Eng 205 * @brief DMA Handshaking Select 206 * @else 207 * @brief DMA握手选择 208 * @endif 209 */ 210 typedef enum hal_dma_handshaking_select { 211 HAL_DMA_HARDWARE_HANDSHAKING = 0x0, 212 HAL_DMA_SOFTWARE_HANDSHAKING = 0x1 213 } hal_dma_handshaking_select_t; 214 215 /** 216 * @if Eng 217 * @brief DMA Interrupt type. 218 * @else 219 * @brief DMA中断类型 220 * @endif 221 */ 222 typedef enum hal_dma_interrupt { 223 HAL_DMA_INTERRUPT_TFR, 224 HAL_DMA_INTERRUPT_BLOCK, 225 HAL_DMA_INTERRUPT_SRCTRAN, 226 HAL_DMA_INTERRUPT_DSTTRAN, 227 HAL_DMA_INTERRUPT_ERR 228 } hal_dma_interrupt_t; 229 230 /** 231 * @if Eng 232 * @brief DMA Master Select. 233 * @else 234 * @brief DMA主机选择 235 * @endif 236 */ 237 typedef enum hal_dma_master_select { 238 HAL_DMA_MASTER_SELECT_DEFAULT = 0x0, 239 HAL_DMA_MASTER_SELECT_0 = 0x0, 240 HAL_DMA_MASTER_SELECT_1 = 0x1, 241 HAL_DMA_MASTER_SELECT_2 = 0x2, 242 HAL_DMA_MASTER_SELECT_3 = 0x3, 243 HAL_DMA_MASTER_SELECT_HIGHEST = 0x3, 244 HAL_DMA_MASTER_SELECT_ERROR = 0x4 245 } hal_dma_master_select_t; 246 247 /** 248 * @if Eng 249 * @brief DMA channel working state. 250 * @else 251 * @brief DMA通道工作状态 252 * @endif 253 */ 254 typedef enum hal_dma_ch_state { 255 /** @if Eng The DMA channel is closed. 256 * @else DMA通道关闭中 257 * @endif */ 258 HAL_DMA_CH_STATE_CLOSED, 259 /** @if Eng The DMA channel has been opend but its logic configuration queue has no configurations to be sent. 260 * @else DMA通道已打开,但其配置队列中没有要发送的数据 261 * @endif */ 262 HAL_DMA_CH_STATE_IDLE, 263 /** @if Eng The DMA channel is transferring data or has been done the data transferring. 264 * @else DMA通道正在传输数据或已完成数据传输 265 * @endif */ 266 HAL_DMA_CH_STATE_ACTIVE, 267 /** @if Eng The DMA channel has had error while transferring data. 268 * @else DMA通道在传输数据时出错 269 * @endif */ 270 HAL_DMA_CH_STATE_ERROR 271 } hal_dma_ch_state_t; 272 273 /** 274 * @if Eng 275 * @brief DMA transfer base config. 276 * @else 277 * @brief DMA传输基本配置 278 * @endif 279 */ 280 typedef struct hal_dma_transfer_base_config { 281 uint32_t src; 282 uint32_t dest; 283 uint16_t transfer_num; 284 hal_dma_ch_priority_t priority; 285 hal_dma_data_width_t src_width; 286 hal_dma_data_width_t dest_width; 287 hal_dma_address_inc_t src_inc; 288 hal_dma_address_inc_t dest_inc; 289 hal_dma_burst_transaction_length_t src_burst_trans_length; 290 hal_dma_burst_transaction_length_t dest_burst_trans_length; 291 hal_dma_transfer_cb_t callback; 292 uintptr_t priv_arg; 293 } hal_dma_transfer_base_config_t; 294 295 /** 296 * @if Eng 297 * @brief DMA transfer peripheral config. 298 * @else 299 * @brief DMA传输外设配置 300 * @endif 301 */ 302 typedef struct hal_dma_transfer_peri_config { 303 hal_dma_trans_type_t trans_type; 304 dma_ch_transfer_dir_t trans_dir; 305 hal_dma_handshaking_source_t hs_source; 306 hal_dma_handshaking_source_t hs_dest; 307 hal_dma_protection_control_t protection; 308 } hal_dma_transfer_peri_config_t; 309 310 /** 311 * @if Eng 312 * @brief Distinguish DMA type. 313 * @else 314 * @brief 区分DMA类型 315 * @endif 316 */ 317 typedef enum hal_dma_type { 318 /** @if Eng Big dma, used for spi, opi, qspi0, qpsi1. 319 * @else 大dma,用于spi、opi、qspi0、qpsi1 320 * @endif */ 321 HAL_DMA_TYPE_BDMA, 322 /** @if Eng small dma, used for i2c, uart L0, uart H0, uart H1, IR. 323 * @else 小dma,用于i2c、uart L0、uart H0、uart H1、IR 324 * @endif */ 325 HAL_DMA_TYPE_SDMA 326 } hal_dma_type_t; 327 328 /** 329 * @if Eng 330 * @brief Initialize device for hal DMA. 331 * @retval ERRCODE_SUCC Success. 332 * @retval Other Failure. For details, see @ref errcode_t 333 * @else 334 * @brief HAL层DMA的初始化接口 335 * @retval ERRCODE_SUCC 成功 336 * @retval Other 失败,参考 @ref errcode_t 337 * @endif 338 */ 339 errcode_t hal_dma_init(void); 340 341 /** 342 * @if Eng 343 * @brief Deinitialize device for hal DMA. 344 * @else 345 * @brief HAL层DMA的去初始化接口 346 * @endif 347 */ 348 void hal_dma_deinit(void); 349 350 /** 351 * @if Eng 352 * @brief Open interface for hal DMA. 353 * @else 354 * @brief HAL层DMA开启接口 355 * @endif 356 */ 357 void hal_dma_open(void); 358 359 /** 360 * @if Eng 361 * @brief Close interface for hal DMA. 362 * @else 363 * @brief HAL层DMA关闭接口 364 * @endif 365 */ 366 void hal_dma_close(void); 367 368 /** 369 * @if Eng 370 * @brief Channel enable/disable interface for hal DMA. 371 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 372 * @param [in] en flag of enable or disable. 373 * @else 374 * @brief HAL层通道使能/去使能接口 375 * @param [in] ch DMA通道 参考 @ref dma_channel_t 376 * @param [in] en 使能/去使能标志 377 * @endif 378 */ 379 void hal_dma_enable(dma_channel_t ch, bool en); 380 381 /** 382 * @if Eng 383 * @brief Get the number of data transferred by the DMA for hal DMA. 384 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 385 * @retval The number of data transferred by the DMA. 386 * @else 387 * @brief HAL层获取DMA传输的数据量接口 388 * @param [in] ch DMA通道 参考 @ref dma_channel_t 389 * @retval DMA传输的数据数 390 * @endif 391 */ 392 uint32_t hal_dma_get_block(dma_channel_t ch); 393 394 /** 395 * @if Eng 396 * @brief Interrupt clear interface for hal DMA. 397 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 398 * @param [in] int_type Interrupt type. For details, see @ref hal_dma_interrupt_t 399 * @else 400 * @brief HAL层清除中断接口 401 * @param [in] ch DMA通道 参考 @ref dma_channel_t 402 * @param [in] int_type 中断类型 参考 @ref hal_dma_interrupt_t 403 * @endif 404 */ 405 void hal_dma_interrupt_clear(dma_channel_t ch, hal_dma_interrupt_t int_type); 406 407 /** 408 * @if Eng 409 * @brief Get the idle channel interface for hal DMA. 410 * @param [in] source DMA handshaking source select. For details, see @ref hal_dma_handshaking_source_t 411 * @param [in] burst_length DMA transfer burst length. For details, see @ref hal_dma_burst_transaction_length_t 412 * @retval The DMA channel. For details, see @ref dma_channel_t 413 * @else 414 * @brief HAL层获取闲置通道接口 415 * @param [in] source DMA握手来源选择 416 * @param [in] burst_length DMA传输burst长度 417 * @retval DMA通道 参考 @ref dma_channel_t 418 * @endif 419 */ 420 dma_channel_t hal_dma_get_idle_ch(hal_dma_handshaking_source_t source, 421 hal_dma_burst_transaction_length_t burst_length); 422 423 /** 424 * @if Eng 425 * @brief Configure a Single-block Transfer interface for hal DMA. 426 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 427 * @param [in] base_cfg Base config for this transfer. For details, see @ref hal_dma_transfer_base_config_t 428 * @param [in] periph_cfg Peripheral config for this transfer. For details, see @ref hal_dma_transfer_peri_config_t 429 * @retval ERRCODE_SUCC Success. 430 * @retval Other Failure. For details, see @ref errcode_t 431 * @else 432 * @brief HAL层配置单块传输 433 * @param [in] ch DMA通道 参考 @ref dma_channel_t 434 * @param [in] base_cfg 传输的基本配置 参考 @ref hal_dma_transfer_base_config_t 435 * @param [in] periph_cfg 传输的外设配置 参考 @ref hal_dma_transfer_peri_config_t 436 * @retval ERRCODE_SUCC 成功 437 * @retval Other 失败,参考 @ref errcode_t 438 * @endif 439 */ 440 errcode_t hal_dma_config_single_block(dma_channel_t ch, 441 const hal_dma_transfer_base_config_t *base_cfg, 442 hal_dma_transfer_peri_config_t *periph_cfg); 443 444 /** 445 * @if Eng 446 * @brief Dma lli transfer config interface for hal DMA. 447 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 448 * @param [in] base_cfg Base config for this transfer. For details, see @ref hal_dma_transfer_base_config_t 449 * @param [in] periph_cfg Peripheral config for this transfer. For details, see @ref hal_dma_transfer_peri_config_t 450 * @retval ERRCODE_SUCC Success. 451 * @retval Other Failure. For details, see @ref errcode_t 452 * @else 453 * @brief HAL层配置链表传输 454 * @param [in] ch DMA通道 参考 @ref dma_channel_t 455 * @param [in] base_cfg 传输的基本配置 参考 @ref hal_dma_transfer_base_config_t 456 * @param [in] periph_cfg 传输的外设配置 参考 @ref hal_dma_transfer_peri_config_t 457 * @retval ERRCODE_SUCC 成功 458 * @retval Other 失败,参考 @ref errcode_t 459 * @endif 460 */ 461 errcode_t hal_dma_add_lli_transfer(dma_channel_t ch, 462 const hal_dma_transfer_base_config_t *base_cfg, 463 hal_dma_transfer_peri_config_t *periph_cfg); 464 465 /** 466 * @if Eng 467 * @brief Check whether the DMA channel is enabled interface for hal DMA. 468 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 469 * @retval true enabled. 470 * @retval false disable. 471 * @else 472 * @brief HAL层检查DMA通道是否使能接口 473 * @param [in] ch DMA通道 参考 @ref dma_channel_t 474 * @retval true 使能 475 * @retval false 未使能 476 * @endif 477 */ 478 bool hal_dma_is_enabled(dma_channel_t ch); 479 480 /** 481 * @if Eng 482 * @brief Enable dma lli transfer interface for hal DMA. 483 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 484 * @param [in] callback Channel transfer callback function. For details, see @ref hal_dma_transfer_cb_t. 485 * @param [in] arg Private param pointer for storing self information, which can be passed to DMA callback 486 * @ref hal_dma_transfer_cb_t when transfer completed. 487 * @else 488 * @brief HAL层使能链表传输接口 489 * @param [in] ch DMA通道 参考 @ref dma_channel_t 490 * @param [in] callback 通道传输回调函数 For details, see @ref hal_dma_transfer_cb_t 。 491 * @param [in] arg 用于存储自定义信息的私有参数指针,传输完成时回传给dma回调函数 @ref hal_dma_transfer_cb_t 。 492 * @endif 493 */ 494 void hal_dma_enable_lli(dma_channel_t ch, hal_dma_transfer_cb_t callback, uintptr_t arg); 495 496 /** 497 * @if Eng 498 * @brief Set the handshaking channel mux. 499 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 500 * @param [out] per_cfg DMA channel peripheral configuration. For details, see @ref hal_dma_transfer_peri_config_t 501 * @return ERRCODE_SUCC Success. 502 * @retval Other Failure. For details, see @ref errcode_t 503 * @else 504 * @brief 设置硬件握手号复用 505 * @param [in] ch DMA通道,参考 @ref dma_channel_t 506 * @param [out] per_cfg DMA外设配置,参考 @ref hal_dma_transfer_peri_config_t 507 * @return ERRCODE_SUCC 成功 508 * @retval Other 失败,参考 @ref errcode_t 509 * @endif 510 */ 511 errcode_t dma_port_set_mux_channel(dma_channel_t ch, hal_dma_transfer_peri_config_t *per_cfg); 512 513 /** 514 * @if Eng 515 * @brief Set the channel select of handshaking. 516 * @param [in] ch The handshaking channel. For details, see @ref hal_dma_hardshaking_channel_t 517 * @param [in] source The handshaking select. For details, see @ref hal_dma_handshaking_source_t 518 * @else 519 * @brief 设置硬件握手选择. 520 * @param [in] ch 硬件握手通道号,参考 @ref hal_dma_hardshaking_channel_t 521 * @param [in] source 硬件握手选择,参考 @ref hal_dma_handshaking_source_t 522 * @endif 523 */ 524 void dma_port_set_channel_handshaking_source(hal_dma_hardshaking_channel_t ch, hal_dma_handshaking_source_t source); 525 526 /** 527 * @if Eng 528 * @brief Get the master select. 529 * @param [in] ch The DMA channel. For details, see @ref dma_channel_t 530 * @param [in] addr Source/destination address. 531 * @retval The master select. For details, see @ref hal_dma_master_select_t 532 * @else 533 * @brief 获取master选择. 534 * @param [in] ch DMA通道,参考 @ref dma_channel_t 535 * @param [in] addr 源或目的地址 536 * @retval master选择,参考 @ref hal_dma_master_select_t 537 * @endif 538 */ 539 hal_dma_master_select_t dma_port_get_master_select(dma_channel_t ch, uint32_t addr); 540 541 /** 542 * @if Eng 543 * @brief Init the dma which will set the base address of registers. 544 * @retval ERRCODE_SUCC Success. 545 * @retval Other Failure. For details, see @ref errcode_t. 546 * @else 547 * @brief 初始化DMA,设置寄存器的基地址。 548 * @retval ERRCODE_SUCC 成功。 549 * @retval Other 失败,参考 @ref errcode_t 。 550 * @endif 551 */ 552 errcode_t hal_dma_regs_init(void); 553 554 #if defined (CONFIG_DMA_SUPPORT_LPM) 555 /** 556 * @if Eng 557 * @brief Suspend all of the dma channels. 558 * @param [in] arg Argument for suspend. 559 * @retval ERRCODE_SUCC Success. 560 * @retval Other Failure. For details, see @ref errcode_t. 561 * @else 562 * @brief 挂起所有DMA通道。 563 * @param [in] arg 挂起所需要的参数。 564 * @retval ERRCODE_SUCC 成功。 565 * @retval Other 失败,参考 @ref errcode_t 。 566 * @endif 567 */ 568 errcode_t hal_dma_suspend(uintptr_t arg); 569 570 /** 571 * @if Eng 572 * @brief Resume all of the dma channels. 573 * @param [in] arg Argument for resume. 574 * @retval ERRCODE_SUCC Success. 575 * @retval Other Failure. For details, see @ref errcode_t. 576 * @else 577 * @brief 恢复所有DMA通道。 578 * @param [in] arg 恢复所需要的参数。 579 * @retval ERRCODE_SUCC 成功。 580 * @retval Other 失败,参考 @ref errcode_t 。 581 * @endif 582 */ 583 errcode_t hal_dma_resume(uintptr_t arg); 584 #endif 585 586 /** 587 * @} 588 */ 589 590 #ifdef __cplusplus 591 #if __cplusplus 592 } 593 #endif /* __cplusplus */ 594 #endif /* __cplusplus */ 595 596 #endif