AG903ライブラリリファレンス
内容インデックスホーム
Body Source
本文ソース
1: int32_t AG903_DMACMgrSetIntCallback(AG903_DMACMgrHandle *handle, 2: void (*cb_term)(AG903_DMACMgrHandle*, AG903_DMACMgrDesc**, uint8_t*), 3: void (*cb_abt)(AG903_DMACMgrHandle*), 4: void (*cb_error)(AG903_DMACMgrHandle*)) 5: { 6: uint32_t unit = ((AG903_DMACMgrHandleStat*)handle - handle_list); 7: AG903_INTMgrHdrPrm inthdr; 8: 9: 10: if(unit >= AG903_DMAC_UNIT_NUM || &handle_list[unit] != (AG903_DMACMgrHandleStat*)handle) 11: { 12: return -AG903_EINVAL; 13: } 14: 15: 16: if(dmac_int_init_flag == false) 17: { 18: inthdr.atr = AG903_INT_HLNG; 19: inthdr.intno = AG903_IRQ26_DMAC; 20: inthdr.func = (void*)DMACMgrDmactcIntHandler; 21: dmac_int_dmactc_hdrid = AG903_INTMgrSetHandler(&inthdr); 22: if(0 >= dmac_int_dmactc_hdrid) 23: { 24: return -AG903_EFAULT; 25: } 26: dmac_int_init_flag = true; 27: } 28: 29: handle_list[unit].cb_term = (void*)cb_term; 30: handle_list[unit].cb_abt = (void*)cb_abt; 31: handle_list[unit].cb_error = (void*)cb_error; 32: 33: AG903_INTMgrEnableInt(AG903_IRQ26_DMAC); 34: 35: return AG903_ENONE; 36: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.