资源描述:
《NIOSII常用函数整理》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、NIOSII常用函数整理TheNIOSIIfunctionsareusuallysorted2009-10-2809:49:02:theniosII10operationsfunctionFunctionprototype:BASE,REGNUMInputparameters:BASEistheBASEaddressforregisters,andREGNUMistheoffsetforregistersFunctionnote:thevalueintheunitoftheREGNUMisreadfromthedevicethatisB
2、ASEonBASE・Thevalueoftheregisteriswithinthescopeoftheaddressbus.Returnvalue:-Functionprototype:IOWR(BASE,REGNUM,DATA)Theinputparameter:BASEistheBASEaddressoftheregister,REGNUMistheoffsetoftheregister,andDATAistheDATAtobewrittenFunctionnote:thedataiswrittentotheREGNUMregis
3、ter・Thevalueoftheregisteriswithinthescopeoftheaddressbus・Returnvalue:一Functionprototype:IORD32DIRECT(BASE,OFFSET)Theinputparameter:BASEistheBASEaddressoftheregister,OFFSETistheOFFSEToftheregisterFunctionnote:32BitdataisreaddirectlyfromtheaddresslocationoftheBASE+OFFSETre
4、gisterReturnvalue:-Functionprototype:IORD16DIRECT(BASE,OFFSET)Theinputparameter:BASEistheBASEaddressoftheregister,OFFSETistheOFFSEToftheregisterFunctionnote:16BitdataisreaddirectlyfromtheaddresslocationoftheBASE+OFFSETregisterReturnvalue:-Functionprototype:IORD8DIRECT(BA
5、SE,OFFSET)Theinputparameter:BASEistheBASEaddressoftheregister,OFFSETistheOFFSEToftheregisterFunctiondescription:thedataof8BitisreaddirectlyfromtheaddresslocationoftheBASE+OFFSETregisterReturnvalue:-Functionprototype:IOWR_32DIRECT(BASE,OFFSET,DATA)Theinputparameter:BASEis
6、theBASEaddressoftheregister,REGNUMistheoffsetoftheregister,andDATAistheDATAtobewrittenFunctiondescription:the32-bitdataisdirectlywrittentotheBASE+OFFSETregisterintheaddresslocationReturnvalue:-Functionprototype:I0WR_16DIRECT(BASE,OFFSET,DATA)Theinputparameter:BASEistheBA
7、SEaddressoftheregister,REGNUMistheoffsetoftheregister,andDATAistheDATAtobewrittenFunctiondescription:thedataof16BitisdirectlywrittentotheaddresslocationoftheBASE+OFFSETregisterReturnvalue:-Functionprototype:I0WR_8DIRECT(BASE,OFFSET,DATA)Theinputparameter:BASEistheBASEadd
8、ressoftheregister,REGNUMistheoffsetoftheregister,andDATAistheDATAtobewrittenFunctiondescription:theBASE