參數(shù)資料
型號(hào): HIF_IOCTL
英文描述: Using Slow Peripherals with 29K Family Processors Using the HIF ioctl Service for Nonblocking Reads
中文描述: 使用29K型系列處理器慢周邊使用非阻塞讀取誘導(dǎo)因子的ioctl服務(wù)
文件頁(yè)數(shù): 2/3頁(yè)
文件大?。?/td> 61K
代理商: HIF_IOCTL
PID No. 18413B
2 of 3
#include <stdio.h>
#include <hif.h>
#include <stdlib.h>
showmen() {
/**********************************************************************************/
/* The following subroutine will display a menu to standard output. The _write() */
/* HIF service was used rather than printf for the following reasons: */
/* - To show the usage of the _write() HIF service */
/* - When characters are sent to standard output using printf, the output is */
/* buffered and will not be displayed until a '\n' is used. Therefore, the */
/* "Enter your selection ->" line would not appear on standard output if */
/* printf were used because there is no '\n' character at the end of the */
/* string. */
/**********************************************************************************/
_write(1,"\nMenu:\n",7);
_write(1,"\t1) Selection #1\n",17);
_write(1,"\t2) Selection #2\n",17);
_write(1,"\t3) Exit\n",9);
_write(1,"\nEnter your selection -> ",25);
}
void main() {
/* Declare necessary variables */
int terminate=0, proc=0;
/* Create a 1-character buffer to hold input */
char *input=(char *) malloc(sizeof(char));
/* Set standard input to NBLOCK mode using the _ioctl() HIF service */
_ioctl(0,0x0010);
showmen();
/********************************************************************************/
/* Following is the main loop where processing occurs. The exit condition is */
/* set by selecting the appropriate menu item. */
/********************************************************************************/
while(!terminate) {
/******************************************************************************/
/* Because standard input has been set to NBLOCK mode using the _ioctl() HIF */
/* service, the _read() HIF service will return a negative number if there is */
/* no input available. If there is input available, _read() will return a non-*/
/* negative number and the character read will be contained in the input */
/* buffer. */
/******************************************************************************/
if(_read(0,input,1)>=0) {
/* React to the input received */
switch(input[0]) {
case '1':
printf("\n\nYou selected choice #1.\n");
showmen();
break;
case '2':
printf("\n\nYou selected choice #2.\n");
showmen();
break;
case '3':
/* Choice #3 is to exit, so set a flag to end the main loop */
terminate++;
break;
default:
printf("\n\nInvalid selection.\n");
showmen();
break;
}
}
相關(guān)PDF資料
PDF描述
HIF_SPEC EZ-030 Demonstration Board Theory of Operation Host Interface (HIF) Specification
HIGHCURRENTSWITCHINGAPPLICATION (286.88 k)
DC-DCCONVERTERANDMOTORDRIVEAPPLICATIONS (286.88 k)
HIGHVOLTAGECAPACITORS(DATASHEETS) Ceramic Capacitors. 1000 V-5000 V
HIGHVOLTAGECERAMICCAPACITORS(GENERALINFO) Ceramic Capacitors. 1000 V-5000 V
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
HIFLEX PRESS HHP502 功能描述:手工工具 Press Tool FX2 series RoHS:否 制造商:Molex 產(chǎn)品:Extraction Tools 類(lèi)型: 描述/功能:Extraction tool
HI-FLEX-HHP502 制造商:Hirose 功能描述:550-0082-2-00 EACH 制造商:Hirose 功能描述:HI-FLEX-HHP502
HI-FLEX-HHP502(61) 功能描述:手工工具 HI FLEX CONN PRESS HT 440MM W 160MM RoHS:否 制造商:Molex 產(chǎn)品:Extraction Tools 類(lèi)型: 描述/功能:Extraction tool
HI-FLEX-HHP502(62) 功能描述:手工工具 HI FLEX CONN PRESS HT 440MM W 160MM RoHS:否 制造商:Molex 產(chǎn)品:Extraction Tools 類(lèi)型: 描述/功能:Extraction tool