欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    nios ii常用函数整理(Nios II commonly used function arrangement).doc

    • 资源ID:11227748       资源大小:24.56KB        全文页数:25页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    nios ii常用函数整理(Nios II commonly used function arrangement).doc

    nios ii常用函数整理(Nios II commonly used function arrangement)NIOS II commonly used function arrangement2009-10-28 09:49:02|: Nios II | subscription name classificationIO operation functionPrototype of function: IORD (BASE, REGNUM)Input parameters: BASE base address register, REGNUM offset registerFunction Description: from the base address for the BASE device reads the REGNUM offset register unit inside value. The register value within the scope of the address bus.Return value: -Prototype of function: IOWR (BASE, REGNUM, DATA)Input parameters: BASE base address register, REGNUM offset register, DATA data to be writtenFunction Description: to offset write data in the REGNUM register. The register value within the scope of the address bus.Return value: -Prototype of function: IORD_32DIRECT (BASE, OFFSET)Input parameters: BASE base address register, the register offset for OFFSETFunction Description: from the address position is directly read 32Bit BASE+OFFSET data in the registerReturn value: -Prototype of function: IORD_16DIRECT (BASE, OFFSET)Input parameters: BASE base address register, the register offset for OFFSETFunction Description: from the address position is directly read 16Bit BASE+OFFSET data in the registerReturn value: -Prototype of function: IORD_8DIRECT (BASE, OFFSET)Input parameters: BASE base address register, the register offset for OFFSETFunction Description: from the address position is directly read 8Bit BASE+OFFSET data in the registerReturn value: -The function prototype: IOWR_32DIRECT (BASE, OFFSET, DATA)Input parameters: BASE base address register, REGNUM offset register, DATA data to be writtenFunction Description: to address location directly into the 32Bit BASE+OFFSET register dataReturn value: -The function prototype: IOWR_16DIRECT (BASE, OFFSET, DATA)Input parameters: BASE base address register, REGNUM offset register, DATA data to be writtenFunction Description: to address location directly into the 16Bit BASE+OFFSET register dataReturn value: -The function prototype: IOWR_8DIRECT (BASE, OFFSET, DATA)Input parameters: BASE base address register, REGNUM offset register, DATA data to be writtenFunction Description: to address location directly into the 8Bit BASE+OFFSET register dataReturn value: -Dma:The function prototype: int alt_dma_rxchan_close (alt_dma_rxchan rxchan)Input parameter: rxchan is the receive channelFunction: function (alt_dma_rxchan_close) notification system: application has been completed DMAThe receiving channel rxchan, the current implementation is successfulReturns: 0, and 1The function prototype: alt_dma_rxchan_depth (alt_dma_rxchan DMA)Input parameter: DMAFunction: function alt_dma_rxchan_depth () returns the maximum number of transmitted to the special DMA (depth) of the received requestReturn value: the maximum number of DMAThe function prototype: int alt_dma_rxchan_ioctl (alt_dma_rxchan DMA, int req, void* ARG)Input parameters: DMA direct memory, req lists the requested operation, Arg decided by the requestFunction Description: received through the DMA channel to perform equipment specific I/O operationReturns: request specific value, otherwise return is negativeRequest typeRequest type request specificationTransmission of ALT_DMA_SET_MODE_8 data in 8Bit Arg ignoreTransmission of ALT_DMA_SET_MODE_16 data in 16Bit Arg ignoreTransmission of ALT_DMA_SET_MODE_32 data in 32Bit Arg ignoreTransmission of ALT_DMA_SET_MODE_64 data in 64Bit Arg ignoreTransmission of ALT_DMA_SET_MODE_128 data in 128Bit Arg ignoreALT_DMA_TX_ONLY_ON (1) under the control of software can only sendALT_DMA_TX_ONLY_OFF (1) custom mode, under the control of software can receive, sendALT_DMA_RX_ONLY_ON (1) under the control of software can only receiveALT_DMA_RX_ONLY_OFF (1) custom mode, under the control of software can receive, sendThe function prototype: alt_dma_rxchan alt_dma_rxchan_open (const char* name)Input parameters: name constant character pointer, such as /dev/dma_0Function Description: get a alt_dma_rxchan descriptor for the DMA receiving channelReturns: 0, and returns to 0The function prototype: int alt_dma_rxchan_prepare (alt_dma_rxchan DMA, void* data,Alt_u32 length, alt_rxchan_done * done, void* handle)Input parameters: DMA use channel; data receive data position pointer; length maximum receive data length; done once data is received, call the return function; handle, non transparent value to doneFunction Description: Send a request to the DMA receiver receiving channel,Returns: 0, whereas the return is negativeThe function prototype: int alt_dma_rxchan_reg (alt_dma_rxchan_dev * DEV)Input parameter: dev receive channel device nameFunction Description: system to register DMA receiving channelReturns: 0, whereas the return is negativeThe function prototype: int alt_dma_txchan_close (alt_dma_txchan txchan)Input parameter: txchan transmit channel nameFunction Description: notification system: application has been completed DMA transmission channel txchanReturns: 0, whereas the return is negativeThe function prototype: int alt_dma_txchan_ioctl (alt_dma_txchan DMA, int req, void* ARG)Input parameters: DMA direct memory name; req for enumeration of request operations; additional parameters of Arg request determined by requestFunction Description: DMA sent through the channel to implement equipment specific I/O operationReturns: request specific value, otherwise return is negativeThe function prototype: alt_dma_txchan alt_dma_txchan_open (const char* name)Input parameters: name constant character pointer, such as /dev/dma_0Function Description: get a alt_dma_rxchan descriptor for DMA transmission channelReturns: 0, and returns to 0The function prototype: int alt_dma_txchan_reg (alt_dma_txchan_dev* DEV)Input parameter: dev receive channel device nameFunction Description: system to register DMA transmission channelReturns: 0, whereas the return is negativeThe function prototype: int alt_dma_txchan_send (alt_dma_txchan DMA, const void* from,Alt_u32 length, alt_txchan_done* done, void* handle)Input parameters: DMA use channel; data receive data position pointer; length maximum receive data length; done once data is received, call the return function; handle, non transparent value to doneFunction Description: Send a send request to DMA transmission channel,Return value: Send a successful return 0, otherwise return is negativeThe function prototype: NT alt_dma_txchan_space (alt_dma_txchan DMA)Input parameter: DMA direct memory nameFunction Description: return is send to the specific DMA transmission channel request numberReturn value: returns the number of send requestsFlashInt length)Input parameters: src_addr source address; FD, flash; offset offset length byte length;Function Description: write the data to the flsah, to write the data in the source address in src_addrReturn value: successfully returned 0, and vice versa for 0The function prototype: int alt_write_flash_block (alt_flash_fd* FD, int block_offset, int data_offset,Const void *data, int length)Input parameters: FD; data_offset start write offset data; length to write data lengthFunction Description: write to a flash module has been erasedReturn value: successfully returned 0, and vice versa for 0Function prototype: int close (int filedes)Input parameter: filedes, descriptorFunction Description: UNIX function close standard (), close the file descriptor filedesReturns: 0, and 1The function prototype: int open (const char* pathname, int flags, mode_t mode)Input parameters: pathname, path name; flags, O_RDONLY or O_WRONLY or O_RDWR, corresponding to read only, write only, or read write operations; mode, use license specificationFunction Description: open a file or device and return a file descriptor (non negative integer used in reading and writing)Returns: file descriptor, and return - 1The function prototype: int read (int file, void *ptr, size_t len)Input parameter: file file descriptor; PTR is read data position pointer, len read data length, unit is byteFunction Description: read data from the file or device.Returns: the number of bytes read, and return - 1The function prototype: clock_t times (struct TMS *buf)Input parameter: buf struct pointerFunction Description: compatible with newlib, struct TMS as follows:Type structclock_t tms_utime;Clock_t tms_stime;Clock_t tms_cutime;Clock_t tms_sutime;Tms_utime:CPU for user instruction execution timeThe tms_stime:CPU request process represented by the system of execution timeTms_cutime: all the sub processes tms_utime and tms_cutime times.Tms_sutime: all the sub processes tms_stime and tms_sutime times.The return value is the number of clock, no clock returns 0Function prototype: int usleep (int US)Input parameter: US, unit is microsecondFunction Description: until us microseconds after the lifting of obstruction, its function is equivalent to us microsecond delayReturns: 0, whereas for 1, there is an error that causes the errorFunction prototype: int wait (int *status)Input parameter: status process status pointerFunction Description: the function is to wait for all child processes to exit. Because the HAL does not support the decentralized child process, the function returns immediatelyReturn value: status content is 0, indicating no child process; return value is - 1, and errno is set to ECHILD, indicating no child process waitingThe function prototype: int write (int file, const void *ptr, size_t len)Input parameter: file file descriptor; PTR is read data position pointer, len read data length, unit is byteFunction Description: to write the file or device data block,Return value: the number of bytes written back, may also be less than the length of the request; otherwise returns 1, if the error occurs, errno is set to the causeThe standard type of dataType descriptionAlt_8 symbol 8 bit integerAlt_u8 unsigned 8 bit integerAlt_16 symbol 16 bit integerAlt_u16 unsigned 16 bit integerAlt_32 symbol 32 bit integerAlt_u32 unsigned 32 bit integerThe following for their own finishingThe function prototype: int fopen (char * file_name, way_use);Input parameter: file_name file name, way_use using file mode, such as R, w correspond to read and writeFunction Description: open the file, a file on itReturn value: not open then the error, returns a null pointer NULLPrototype of function: int Fclose (FP)Input parameter: FP is defined as: FILE *fpFunction Description: close file FpReturns: 0, and 1 (EOF)The function prototype: int FREAD (void *ptr, int size, int count, FILE * FP);Input parameter: buffer is pointer; read data address; size read byte number; count read byte number; FP file pointerFunction Description: read data from a streamReturn value: the successful return value is countThe function prototype: int fwrite (void *ptr, int size, int count, FILE *fp)Input parameter: buffer is pointer; read data address; size read byte number; count read byte number; FP file pointer,Function Description: write content to streamReturn value: the successful return value is countThe function prototype: int fprintf (FILE *fp, char *format, argument,.);Input parameters: FP file pointer; format format string; argument, the output list, such as.:Fprintf (FP, "%d,%f", I, t)Function Description: transmitting the formatted output to a streamReturn value: -The function prototype: int fscanf (FILE * FP, char *format, argument.)Input parameters: FP file pointer; format format string; , argument,. input list, such as:Fscanf (FP, "%d,%f", I, t)Function Description: the implementation of the formatted input from a streamReturn value: -Function prototype: int fputc (int ch, FILE *fp)Input parameters: ch characters; FP: file pointerFunction Description: Send a character to a streamReturns: character and return - 1 (EOF)Function prototype: int fgetc (FILE *fp);Input parameter: FP: file pointerFunction Description: read characters from the streamReturn value: encounter end of file return - 1 (EOF)Function prototype: int putw (int w, FILE *fp)Input parameters: w: character or word; FP: file pointerFunction Description: a character or word to streamReturn value: -Function prototype: int getw (FILE *fp)Input parameter: FP: file pointerFunction Description: take an integer from the streamReturn value: -Function prototype: int rewind (FILE *fp)Input parameter: FP: file pointerFunction Description: the file pointer to pointer to a stream at the beginningReturn value: -The function prototype: int fseek (FILE *fp, long offset, int fromwhere);Input parameters: FP: file pointer; offset:long type offset; fromwhere: the starting pointThe starting point for the 0, 1, 2 respectively represent the beginning of file, the current location, at the end of the fileFunction Description: relocation stream file pointerReturn value: -Function prototype: int ferror (FILE *fp)Input parameter: FP: file pointerFunction Description: detecting errors on the streamReturn value: no return value is 0, otherwise 0Function prototype: long fTell (FILE *fp)Input parameter: FP: file pointerFunction Description: returns the current file pointer, get the current positionReturns: the return value is 1 to indicate an error, otherwise 0Function prototype: void clearerr (FILE *fp)Input parameter: FP: file pointerFunction Description: reset error flagReturn value: error is not 0, and vice versa is 0The function prototype: char *fgets (char *string, int n, FILE *fp)Input parameters: String: FP: string pointer; file pointerFunction Description: read a string from the stream, but only enter n - 1 characters from the file, and the last is the 0 end flagReturn value: -The function prototype: NT fputs (char *string, FILE *fp)Input parameters: String: FP: string pointer; file pointerFunction Description: Send a string to a streamReturn value: -Function prototype: int feof (FILE *fp)Input parameter: FP: file pointerFunction Description: end of file detection on the flow characterReturn value: -Nios II IDE Command Line ToolsTool DescriptorCreate a new database system engineering nios2-create-system-libraryCreate a C/C+ application librar

    注意事项

    本文(nios ii常用函数整理(Nios II commonly used function arrangement).doc)为本站会员(scccc)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开