AG903ライブラリリファレンス
内容インデックスホーム
Body Source
本文ソース
1: int32_t AG903_TIMRMgrSetIntHandler(AG903_TIMRMgrHandle* handle, void* func, void* param) 2: { 3: AG903_INTMgrHdrPrm inthdr; 4: int32_t retval = AG903_ENONE; 5: int32_t result; 6: int32_t hdrid; 7: uint32_t loop; 8: uint8_t ch; 9: 10: result = TIMRMgr_CheckHandle(handle, &ch); 11: if(AG903_ENONE != result) { 12: return -AG903_EINVAL; 13: } 14: if(NULL == func) { 15: return -AG903_EINVAL; 16: } 17: for(loop=0; loop<AG903_TIMR_INTHDR_NUM; loop++) { 18: if(NULL == TimrChStat[ch].inthdr[loop].func) { 19: break; 20: } 21: } 22: if(AG903_TIMR_INTHDR_NUM <= loop) { 23: return -AG903_EFAULT; 24: } 25: 26: inthdr.atr = AG903_INT_HLNG; 27: inthdr.intno = AG903_IRQ0_TIM0+ch; 28: inthdr.func = func; 29: inthdr.exinf = param; 30: hdrid = AG903_INTMgrSetHandler(&inthdr); 31: if(0 >= hdrid) { 32: return -AG903_EFAULT; 33: } 34: AG903_INTMgrEnableInt(AG903_IRQ0_TIM0+ch); 35: TimrChStat[ch].inthdr[loop].hdrid = hdrid; 36: TimrChStat[ch].inthdr[loop].func = func; 37: 38: return retval; 39: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.