您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xil_printf函数代码示例

51自学网 2021-06-03 10:21:17
  C++
这篇教程C++ xil_printf函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中xil_printf函数的典型用法代码示例。如果您正苦于以下问题:C++ xil_printf函数的具体用法?C++ xil_printf怎么用?C++ xil_printf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了xil_printf函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main() {   static XIntc intc;   Xil_ICacheEnable();   Xil_DCacheEnable();   print("---Entering main---/n/r");      {      int status;            print("/r/n Running IntcSelfTestExample() for xps_intc_0.../r/n");            status = IntcSelfTestExample(XPAR_XPS_INTC_0_DEVICE_ID);            if (status == 0) {         print("IntcSelfTestExample PASSED/r/n");      }      else {         print("IntcSelfTestExample FAILED/r/n");      }   } 	   {       int Status;       Status = IntcInterruptSetup(&intc, XPAR_XPS_INTC_0_DEVICE_ID);       if (Status == 0) {          print("Intc Interrupt Setup PASSED/r/n");       }        else {         print("Intc Interrupt Setup FAILED/r/n");      }    }      {      u32 status;            print("/r/nRunning GpioInputExample() for dip_switches_8bit.../r/n");      u32 DataRead;            status = GpioInputExample(XPAR_DIP_SWITCHES_8BIT_DEVICE_ID, &DataRead);            if (status == 0) {         xil_printf("GpioInputExample PASSED. Read data:0x%X/r/n", DataRead);      }      else {         print("GpioInputExample FAILED./r/n");      }   }      {      u32 status;            print("/r/nRunning GpioOutputExample() for leds_8bit.../r/n");      status = GpioOutputExample(XPAR_LEDS_8BIT_DEVICE_ID,8);            if (status == 0) {         print("GpioOutputExample PASSED./r/n");      }      else {         print("GpioOutputExample FAILED./r/n");      }   }      {      u32 status;            print("/r/nRunning GpioOutputExample() for leds_positions.../r/n");      status = GpioOutputExample(XPAR_LEDS_POSITIONS_DEVICE_ID,5);            if (status == 0) {         print("GpioOutputExample PASSED./r/n");      }      else {         print("GpioOutputExample FAILED./r/n");      }   }      {      u32 status;            print("/r/nRunning GpioInputExample() for push_buttons_5bit.../r/n");      u32 DataRead;            status = GpioInputExample(XPAR_PUSH_BUTTONS_5BIT_DEVICE_ID, &DataRead);            if (status == 0) {//.........这里部分代码省略.........
开发者ID:fpgadeveloper,项目名称:xupv5-bsb,代码行数:101,


示例2: DisplayDemoPrintTest

//.........这里部分代码省略.........			}			if (xcoi < xLeft)			{				fBlue = 0.0;				fRed -= xInc;			}			else if (xcoi < xMid)			{				fBlue += xInc;				fRed += xInc;			}			else if (xcoi < xRight)			{				fBlue -= xInc;				fRed -= xInc;			}			else			{				fBlue += xInc;				fRed = 0;			}		}		/*		 * Flush the framebuffer memory range to ensure changes are written to the		 * actual memory, and therefore accessible by the VDMA.		 */		/*		 * Andrew Powell - Hopefully, when you have memory reserved you won't have to flush the cache hierarchy.		 */		//Xil_DCacheFlushRange((unsigned int) frame, DISPLAYDEMO_MAX_FRAME * 4);		break;	case DISPLAYDEMO_PATTERN_1:		wStride = stride / 4; /* Find the stride in 32-bit words */		xInt = width / 7; //Seven intervals, each with width/7 pixels		xInc = 256.0 / ((double) xInt); //256 color intensities per interval. Notice that overflow is handled for this pattern.		fColor = 0.0;		wCurrentInt = 1;		for(xcoi = 0; xcoi < width; xcoi++)		{			if (wCurrentInt & 0b001)				fRed = fColor;			else				fRed = 0.0;			if (wCurrentInt & 0b010)				fBlue = fColor;			else				fBlue = 0.0;			if (wCurrentInt & 0b100)				fGreen = fColor;			else				fGreen = 0.0;			/*			 * Just draw white in the last partial interval (when width is not divisible by 7)			 */			if (wCurrentInt > 7)			{				wColor = 0x00FFFFFF;			}			else			{				wColor = ((u32) fRed << BIT_DISPLAY_RED) | ((u32) fBlue << BIT_DISPLAY_BLUE) | ( (u32) fGreen << BIT_DISPLAY_GREEN);			}			iPixelAddr = xcoi;			for(ycoi = 0; ycoi < height; ycoi++)			{				frame[iPixelAddr] = wColor;				/*				 * This pattern is printed one vertical line at a time, so the address must be incremented				 * by the stride instead of just 1.				 */				iPixelAddr += wStride;			}			fColor += xInc;			if (fColor >= 256.0)			{				fColor = 0.0;				wCurrentInt++;			}		}		/*		 * Flush the framebuffer memory range to ensure changes are written to the		 * actual memory, and therefore accessible by the VDMA.		 */		/*		 * Andrew Powell - Hopefully, when you have memory reserved you won't have to flush the cache hierarchy.		 */		//Xil_DCacheFlushRange((unsigned int) frame, DISPLAYDEMO_MAX_FRAME * 4);		break;	default :		xil_printf("Error: invalid pattern passed to DisplayDemoPrintTest");	}}
开发者ID:andrewandrepowell,项目名称:zybo_petalinux,代码行数:101,


示例3: print_ip

void print_ip(char *msg, struct ip_addr *ip){	print(msg);	xil_printf("%d.%d.%d.%d/n/r", ip4_addr1(ip), ip4_addr2(ip),			ip4_addr3(ip), ip4_addr4(ip));}
开发者ID:Henk234,项目名称:zedboard_ethernet_io_ctrl,代码行数:6,


示例4: init_axiemac

voidinit_axiemac(xaxiemacif_s *xaxiemac, struct netif *netif){	int rdy;	unsigned mac_address = (unsigned)(netif->state);	unsigned link_speed = 1000;	unsigned options;        unsigned lock_message_printed = 0;	XAxiEthernet *xaxiemacp;	XAxiEthernet_Config *mac_config;	/* obtain config of this emac */	mac_config = lookup_config(mac_address);	xaxiemacp = &xaxiemac->axi_ethernet;	XAxiEthernet_CfgInitialize(xaxiemacp, mac_config, mac_config->BaseAddress);	options = XAxiEthernet_GetOptions(xaxiemacp);	options |= XAE_FLOW_CONTROL_OPTION;#ifdef XLLTEMACIF_USE_JUMBO_FRAMES_EXPERIMENTAL	options |= XAE_JUMBO_OPTION;#endif	options |= XAE_TRANSMITTER_ENABLE_OPTION;	options |= XAE_RECEIVER_ENABLE_OPTION;	options |= XAE_FCS_STRIP_OPTION;	options |= XAE_MULTICAST_OPTION;	XAxiEthernet_SetOptions(xaxiemacp, options);	XAxiEthernet_ClearOptions(xaxiemacp, ~options);	/* set mac address */	XAxiEthernet_SetMacAddress(xaxiemacp, (Xuint8*)(netif->hwaddr));	/* set PHY <--> MAC data clock */#ifdef  CONFIG_LINKSPEED_AUTODETECT	link_speed = get_IEEE_phy_speed(xaxiemacp);	xil_printf("auto-negotiated link speed: %d/r/n", link_speed);#elif	defined(CONFIG_LINKSPEED1000)	link_speed = 1000;#elif	defined(CONFIG_LINKSPEED100)	link_speed = 100;#elif	defined(CONFIG_LINKSPEED10)	link_speed = 10;#endif    	XAxiEthernet_SetOperatingSpeed(xaxiemacp, link_speed);	/* Setting the operating speed of the MAC needs a delay. */	{		volatile int wait;		for (wait=0; wait < 100000; wait++);		for (wait=0; wait < 100000; wait++);	}#ifdef NOTNOW        /* in a soft temac implementation, we need to explicitly make sure that         * the RX DCM has been locked. See xps_ll_temac manual for details.         * This bit is guaranteed to be 1 for hard temac's         */        lock_message_printed = 0;        while (!(XAxiEthernet_ReadReg(xaxiemacp->Config.BaseAddress, XAE_IS_OFFSET)                    & XAE_INT_RXDCMLOCK_MASK)) {                int first = 1;                if (first) {                        print("Waiting for RX DCM to lock..");                        first = 0;                        lock_message_printed = 1;                }        }        if (lock_message_printed)                print("RX DCM locked./r/n");#endif	/* start the temac */    	XAxiEthernet_Start(xaxiemacp);	/* enable MAC interrupts */	XAxiEthernet_IntEnable(xaxiemacp, XAE_INT_RECV_ERROR_MASK);}
开发者ID:Malutan,项目名称:TE060X-GigaBee-Reference-Designs,代码行数:80,


示例5: DisplayDemoChangeRes

void DisplayDemoChangeRes(DisplayCtrl *dispPtr){	char userInput = 0;	int fResSet = 0;	int status;	while (!fResSet)	{		DisplayDemoCRMenu(dispPtr);		/* Store the first character in the UART recieve FIFO and echo it */		userInput = getchar();		xil_printf("%c", userInput);		status = XST_SUCCESS;		switch (userInput)		{		case '1':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_640x480);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '2':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_800x600);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '3':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1280x720);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '4':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1280x1024);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '5':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1920x1080);			DisplayStart(dispPtr);			fResSet = 1;			break;		case 'q':			fResSet = 1;			break;		default :			xil_printf("/n/rInvalid Selection");			{				struct timespec ts;				ts.tv_sec = 0;				ts.tv_nsec = 500000000;				nanosleep( &ts, NULL );			}		}		if (status == XST_DMA_ERROR)		{			xil_printf("/n/rWARNING: AXI VDMA Error detected and cleared/n/r");		}	}}
开发者ID:andrewandrepowell,项目名称:zybo_petalinux,代码行数:64,


示例6: main

int main (void) {   init_platform();   XEmacLite *EmacLiteInstPtr = &EmacLiteInstance;   XEmacLite_Config *ConfigPtr;   ConfigPtr = XEmacLite_LookupConfig(EMAC_DEVICE_ID);   XEmacLite_CfgInitialize(EmacLiteInstPtr, ConfigPtr, ConfigPtr->BaseAddress);   // Hold AXI4-Stream Packet Generator/Checker   Xil_Out32(XPAR_NF10_AXIS_GEN_CHECK_0_BASEADDR+0x3, 0x1);   Xil_Out32(XPAR_NF10_AXIS_GEN_CHECK_1_BASEADDR+0x3, 0x1);   char s;   int port, dev;   unsigned int value;#if AEL2005_SR   char port_mode_new[4] = {-1,-1,-1,-1};   char port_mode[4] = {-1,-1,-1,-1};#endif   print("hiiiiiiiiiiiiiii");   goto INIT;   while(1){       print("==NetFPGA-10G==/r/n");       print("i : Initialize AEL2005/r/n");       print("s : Dump status/r/n");       print("t : Run AXI4-Stream Gen/Check/r/n");       print("r : Stop AXI4-Stream Gen/Check/r/n");       s = inbyte();       if(s == 'i'){INIT:      for(port = 0; port < 4; port ++){               if(port == 0) dev = 2;    		   if(port == 1) dev = 1;    		   if(port == 2) dev = 0;    		   if(port == 3) dev = 3;    		   xil_printf("Port %d: ", port);    		   ael2005_read (EmacLiteInstPtr, dev, 1, 0xa, &value);    		   /*if(value == 0) {    		       	print("No Signal./r/n");    		       	continue;    		   }*/    		   for(s = 20; s < 36; s++){    		       	ael2005_i2c_read (EmacLiteInstPtr, dev, MODULE_DEV_ADDR, s, &value);    		       	xil_printf("%c", value);    		   }    		   for(s = 40; s < 56; s++){    		       	ael2005_i2c_read (EmacLiteInstPtr, dev, MODULE_DEV_ADDR, s, &value);    		       	xil_printf("%c", value);    		   }    		   print("/r/n");#if AEL2005_SR    		   // Check if we have a 10GBASE-SR cable    		   ael2005_i2c_read (EmacLiteInstPtr, dev, MODULE_DEV_ADDR, 0x3, &value);    		   if((value >> 4) == 1) port_mode_new[port] = MODE_SR;    		   else port_mode_new[port] = MODE_TWINAX;    		   if(port_mode_new[port] != port_mode[port]){    		       xil_printf("Port %d Detected new mode %x/r/n", port, port_mode_new[port]);                   test_initialize(EmacLiteInstPtr, dev, port_mode_new[port]);                   port_mode[port] = port_mode_new[port];               }#else               test_initialize(EmacLiteInstPtr, dev, MODE_TWINAX);#endif           }       }
开发者ID:feiranchen,项目名称:projectNPU,代码行数:71,


示例7: printFloat

void printFloat(float f) {	uint32_t scale = 100;	uint32_t left = (int)(f*scale);	xil_printf("%d", left);}
开发者ID:parkerpatriot,项目名称:space-invaders,代码行数:5,


示例8: Dprx_InterruptHandlerNoVideo

/** * This function is the callback function for when a no video interrupt occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerNoVideo(void *InstancePtr){	xil_printf("> Interrupt: no-video flags in the VBID field after active "						"video has been received./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:15,


示例9: Dprx_InterruptHandlerVideo

/** * This function is the callback function for when a valid video interrupt * occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerVideo(void *InstancePtr){	xil_printf("> Interrupt: a valid video frame is detected on main "								"link./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:16,


示例10: hello_rotary

// Main Loopint hello_rotary(void){    unsigned int data;    int pulses=0, dir=0;	/***    XUartNs550_SetBaud(UART_BASEADDR, UART_CLOCK, UART_BAUDRATE);    XUartNs550_mSetLineControlReg(UART_BASEADDR, XUN_LCR_8_DATA_BITS);    ***/    xil_printf("/n/r********************************************************");    xil_printf("/n/r********************************************************");    xil_printf("/n/r**     KC705 - Rotary Switch Test                     **");    xil_printf("/n/r********************************************************");    xil_printf("/n/r********************************************************/r/n");    xil_printf("Watch the ROTARY pulses count:/r/n");    xil_printf("press any key to exit the test/r/n");    XUartNs550_ReadReg(STDIN_BASEADDRESS, XUN_RBR_OFFSET);    //set GPIO input mode	XGpio_mSetDataReg(XPAR_ROTARY_GPIO_BASEADDR, 4, 0xffffffff);	while(1)	{		/////////////////////////////////////		// STATE 1: Get the direction pulse		//xil_printf("   /r/nState1 /r/n");		do		{			// get hold of a pulse that tells one of below			// 		bits[1:0] = 01 Left rotation			//		bits[1:0] = 10 Right rotation			//		bit 2     =  1 button press			data = XGpio_mGetDataReg(XPAR_ROTARY_GPIO_BASEADDR, 0);			if(data & 0x1)			{				dir = DIR_LEFT;				break;			}			if(data & 0x2)			{				dir = DIR_RIGHT;				break;			}			if( XUartNs550_IsReceiveData(STDIN_BASEADDRESS) )				goto rotary_exit;		} while( (data& 0x3) == 0);		//////////////////////////////////////////////		// STATE 2: Get the pulses from both switches		//xil_printf("   State2 /r/n");		do		{			data = XGpio_mGetDataReg(XPAR_ROTARY_GPIO_BASEADDR, 0);			if( XUartNs550_IsReceiveData(STDIN_BASEADDRESS) )				goto rotary_exit;		} while( (data& 0x3) != 0x3);		/////////////////////////////////////////////////////		// STATE 3: Get the pulses from both switches to NULL		//xil_printf("   State3 /r/n");		do		{			data = XGpio_mGetDataReg(XPAR_ROTARY_GPIO_BASEADDR, 0);			if( XUartNs550_IsReceiveData(STDIN_BASEADDRESS) )				goto rotary_exit;		} while( (data& 0x3) != 0);		// PRESS ANY KEY TO EXIT		if( XUartNs550_IsReceiveData(STDIN_BASEADDRESS) )			goto rotary_exit;		// RESULT TO USER		pulses += dir;		xil_printf("%s-%d  [Exit: press anykey]/r/n",				(dir==DIR_RIGHT) ? "Anti-Clockwise" : "     Clockwise",				abs(pulses) );	}rotary_exit:	XUartNs550_ReadReg(STDIN_BASEADDRESS, XUN_RBR_OFFSET);	return 0;}
开发者ID:fbalakirev,项目名称:kc705,代码行数:91,


示例11: Dprx_InterruptHandlerPowerState

/** * This function is the callback function for when the power state interrupt * occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerPowerState(void *InstancePtr){	xil_printf("> Interrupt: power state change request./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:15,


示例12: XAxiDma_DumpBd

/** * Dump the fields of a BD. * * @param	BdPtr is the BD to operate on. * * @return	None * * @note	This function can be used only when DMA is in SG mode * *****************************************************************************/void XAxiDma_DumpBd(XAxiDma_Bd* BdPtr){	xil_printf("Dump BD %x:/r/n", (unsigned int)BdPtr);	xil_printf("/tNext Bd Ptr: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_NDESC_OFFSET));	xil_printf("/tBuff addr: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_BUFA_OFFSET));	xil_printf("/tMCDMA Fields: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_MCCTL_OFFSET));	xil_printf("/tVSIZE_STRIDE: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr,					XAXIDMA_BD_STRIDE_VSIZE_OFFSET));	xil_printf("/tContrl len: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_CTRL_LEN_OFFSET));	xil_printf("/tStatus: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_STS_OFFSET));	xil_printf("/tAPP 0: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_USR0_OFFSET));	xil_printf("/tAPP 1: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_USR1_OFFSET));	xil_printf("/tAPP 2: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_USR2_OFFSET));	xil_printf("/tAPP 3: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_USR3_OFFSET));	xil_printf("/tAPP 4: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_USR4_OFFSET));	xil_printf("/tSW ID: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_ID_OFFSET));	xil_printf("/tStsCtrl: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr,	           XAXIDMA_BD_HAS_STSCNTRL_OFFSET));	xil_printf("/tDRE: %x/r/n",	    (unsigned int)XAxiDma_BdRead(BdPtr, XAXIDMA_BD_HAS_DRE_OFFSET));	xil_printf("/r/n");}
开发者ID:alown,项目名称:zynq,代码行数:49,


示例13: pong

void pong(DisplayCtrl *video ,u32 uartAddress, XGpio *btn, XGpio *sw){	u32 	height = video->vMode.height,			width = video->vMode.width,			stride = video->stride,			*frame,			speed = 2,			pause=false;	char 	entrada;	frame=video->framePtr[video->curFrame];	xil_printf("/x1B[H"); //Set cursor to top left of terminal	xil_printf("/x1B[2J"); //Clear terminal	Rectangulo bola=crearRectangulo(10,10,RED,ANCHO_BOLA,ALTO_BOLA);	Rectangulo palaIzquierda = crearRectangulo(0,height/2-ALTO_PALA/2,GREEN,ANCHO_PALA,ALTO_PALA);	Rectangulo palaDerecha = crearRectangulo(width-ANCHO_PALA,height/2-ALTO_PALA/2,GREEN,ANCHO_PALA,ALTO_PALA);	int dir_x=true, dir_y=true, indice_frame=0,salir=0,pulsar=0,puntuacionA=0,puntuacionB=0;	salir = XGpio_DiscreteRead(sw, 1);	while(salir & 0x8){		if (salir & 0x1) // 0x1=0b0001=posicion de SW0			bola.color = WHITE;		else			bola.color = RED;		//apunta a al siguente frame		indice_frame=nextFrame(video,&frame);		pintarFondo(frame, BLACK, width,height,stride);		//movimiento y colision		if(dir_x == DERECHA)			if ((bola.x+ANCHO_BOLA > palaDerecha.x) && (bola.y >= palaDerecha.y && bola.y < palaDerecha.y+ALTO_PALA )){				bola.x-=speed;				dir_x = IZQUIERDA;			}else{				bola.x+=speed;			}		else			if ((bola.x < palaIzquierda.x+ANCHO_PALA) && (bola.y >= palaIzquierda.y && bola.y < palaIzquierda.y+ALTO_PALA)){				bola.x+=speed;				dir_x = DERECHA;			}else{				bola.x-=speed;			}		if(dir_y == ABAJO)			bola.y+=speed;		else			bola.y-=speed;		//control de direccion		if (bola.x<0){			bola.x=width/2;			bola.y=height/2;			dir_x=DERECHA;			puntuacionB++;			xil_printf("%d - %d/n/r",puntuacionA,puntuacionB);			TimerDelay(1500000);		}else if(bola.x>width - ANCHO_BOLA){			bola.x=width/2;			bola.y=height/2;			dir_x=IZQUIERDA;			puntuacionA++;			xil_printf("%d - %d/n/r",puntuacionA,puntuacionB);			TimerDelay(1500000);		}		if (bola.y<0){			bola.y=0;			dir_y=ABAJO;		}else if(bola.y>height - ALTO_BOLA){			bola.y=height - ALTO_BOLA;			dir_y=ARRIBA;		}		//pintar la pelota y las palas		pintarRectangulo(frame,&bola,width,height,stride);		pintarRectangulo(frame,&palaDerecha,width,height,stride);		pintarRectangulo(frame,&palaIzquierda,width,height,stride);		//flush		Xil_DCacheFlushRange((unsigned int) frame, DISPLAY_MAX_FRAME * 4);		DisplayChangeFrame(video,indice_frame);		//TimerDelay(17000);		salir = XGpio_DiscreteRead(sw, 1);		pulsar = XGpio_DiscreteRead(btn, 1);		//control de las palas		if (pulsar & 0x1){  	//Pala derecha			if (palaDerecha.y+ALTO_PALA < height){				palaDerecha.y+=speed;			}		}else if(pulsar & 0x2){			if (palaDerecha.y >= 0){				palaDerecha.y-=speed;			}		}		if (pulsar & 0x4 ){		//Pala izquierda			if (palaIzquierda.y+ALTO_PALA < height){				palaIzquierda.y+=speed;//.........这里部分代码省略.........
开发者ID:felipebetancur,项目名称:Zybo,代码行数:101,


示例14: DisplayDemoChangeRes

void DisplayDemoChangeRes(DisplayCtrl *dispPtr, u32 uartAddr){	char userInput = 0;	int fResSet = 0;	int status;	/* Flush UART FIFO */	while (XUartPs_IsReceiveData(uartAddr))	{		XUartPs_ReadReg(uartAddr, XUARTPS_FIFO_OFFSET);	}	while (!fResSet)	{		DisplayDemoCRMenu(dispPtr);		/* Wait for data on UART */		while (!XUartPs_IsReceiveData(uartAddr))		{}		/* Store the first character in the UART recieve FIFO and echo it */		userInput = XUartPs_ReadReg(uartAddr, XUARTPS_FIFO_OFFSET);		xil_printf("%c", userInput);		status = XST_SUCCESS;		switch (userInput)		{		case '1':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_640x480);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '2':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_800x600);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '3':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1280x720);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '4':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1280x1024);			DisplayStart(dispPtr);			fResSet = 1;			break;		case '5':			status = DisplayStop(dispPtr);			DisplaySetMode(dispPtr, &VMODE_1920x1080);			DisplayStart(dispPtr);			fResSet = 1;			break;		case 'q':			fResSet = 1;			break;		default :			xil_printf("/n/rInvalid Selection");			TimerDelay(500000);		}		if (status == XST_DMA_ERROR)		{			xil_printf("/n/rWARNING: AXI VDMA Error detected and cleared/n/r");		}	}}
开发者ID:felipebetancur,项目名称:Zybo,代码行数:69,


示例15: MainDemoPrintMenu

void MainDemoPrintMenu(){	xil_printf("/x1B[H"); //Set cursor to top left of terminal	xil_printf("/x1B[2J"); //Clear terminal	xil_printf("**************************************************/n/r");	xil_printf("**************************************************/n/r");	xil_printf("*         ZYBO Base System User Demo             */n/r");	xil_printf("**************************************************/n/r");	xil_printf("**************************************************/n/r");	xil_printf("/n/r");	xil_printf("1 - Audio Demo/n/r");	xil_printf("2 - VGA output demo/n/r");	xil_printf("3 - HDMI output demo/n/r");	xil_printf("q - Quit/n/r");	xil_printf("/n/r");	xil_printf("Select a demo to run:");}
开发者ID:felipebetancur,项目名称:Zybo,代码行数:17,


示例16: Dprx_InterruptHandlerTrainingDone

/** * This function is the callback function for when a training done interrupt * occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerTrainingDone(void *InstancePtr){	xil_printf("> Interrupt: training done./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:15,


示例17: main

int main(void){	u32 *vgaPtr[DISPLAY_NUM_FRAMES];	u32 *hdmiPtr[DISPLAY_NUM_FRAMES];	int i;	char userInput = 0;	for (i = 0; i < DISPLAY_NUM_FRAMES; i++)	{		vgaPtr[i] = vgaBuf[i];		hdmiPtr[i] = hdmiBuf[i];	}	xil_printf("/x1B[H"); //Set cursor to top left of terminal	xil_printf("/x1B[2J"); //Clear terminal	DisplayDemoInitialize(&vgaCtrl, VGA_VDMA_ID, SCU_TIMER_ID, VGA_BASEADDR, DISPLAY_NOT_HDMI, vgaPtr);	xil_printf("OK/n/r");	DisplayDemoInitialize(&hdmiCtrl, HDMI_VDMA_ID, SCU_TIMER_ID, HDMI_BASEADDR, DISPLAY_HDMI, hdmiPtr);	xil_printf("OK/n/r");	TimerInitialize(SCU_TIMER_ID);	xil_printf("OK/n/r");	//AudioInitialize(SCU_TIMER_ID, AUDIO_IIC_ID, AUDIO_CTRL_BASEADDR);	xil_printf("OK/n/r");	/* Flush UART FIFO */	while (XUartPs_IsReceiveData(UART_BASEADDR))	{		XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);	}	while (userInput != 'q')	{		MainDemoPrintMenu();		/* Wait for data on UART */		while (!XUartPs_IsReceiveData(UART_BASEADDR))		{}		/* Store the first character in the UART recieve FIFO and echo it */		userInput = XUartPs_ReadReg(UART_BASEADDR, XUARTPS_FIFO_OFFSET);		xil_printf("%c", userInput);		switch (userInput)		{		case '1':			//AudioRunDemo(AUDIO_CTRL_BASEADDR, UART_BASEADDR, SW_BASEADDR, BTN_BASEADDR);			xil_printf("/n/rInvalid Selection");			break;		case '2':			DisplayDemoRun(&vgaCtrl, UART_BASEADDR);			break;		case '3':			DisplayDemoRun(&hdmiCtrl, UART_BASEADDR);			break;		case 'q':			break;		default :			xil_printf("/n/rInvalid Selection");			TimerDelay(500000);		}	}	return 0;}
开发者ID:felipebetancur,项目名称:Zybo,代码行数:67,


示例18: Dprx_InterruptHandlerBwChange

/** * This function is the callback function for when a bandwidth change interrupt * occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerBwChange(void *InstancePtr){	xil_printf("> Interrupt: bandwidth change./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:15,


示例19: demo_init

int demo_init( demo_t *pdemo ){	int status;	pdemo->paxivdma0 = &(pdemo->axivdma0);	pdemo->paxivdma1 = &(pdemo->axivdma1);	pdemo->posd = &(pdemo->osd);	pdemo->pcfa = &(pdemo->cfa);	pdemo->pfmc_ipmi_iic = &(pdemo->fmc_ipmi_iic);	pdemo->pfmc_hdmi_cam_iic = &(pdemo->fmc_hdmi_cam_iic);	pdemo->pfmc_hdmi_cam = &(pdemo->fmc_hdmi_cam);	pdemo->ppython_receiver = &(pdemo->python_receiver);	pdemo->cam_alpha = 0xFF;	pdemo->hdmi_alpha = 0x00;	pdemo->bVerbose = 0;	pdemo->ipmi_info_valid = 0;	pdemo->fmc_hdmi_cam_board_info.serial = "n/a";	XAxiVdma_Config *paxivdma_config;	XOSD_Config *posd_config;	XCfa_Config *pcfa_config;	paxivdma_config = XAxiVdma_LookupConfig(XPAR_AXIVDMA_0_DEVICE_ID);	XAxiVdma_CfgInitialize(pdemo->paxivdma0, paxivdma_config,			paxivdma_config->BaseAddress);	paxivdma_config = XAxiVdma_LookupConfig(XPAR_AXIVDMA_1_DEVICE_ID);	XAxiVdma_CfgInitialize(pdemo->paxivdma1, paxivdma_config,			paxivdma_config->BaseAddress);	posd_config = XOSD_LookupConfig(XPAR_OSD_0_DEVICE_ID);	XOSD_CfgInitialize(pdemo->posd, posd_config, posd_config->BaseAddress);	pcfa_config = XCfa_LookupConfig(XPAR_V_CFA_0_DEVICE_ID);	XCfa_CfgInitialize(pdemo->pcfa, pcfa_config, pcfa_config->BaseAddress);	if ( pdemo->bVerbose )	{		xil_printf( "FMC-IPMI Initialization .../n/r" );	}   status = fmc_iic_xps_init(pdemo->pfmc_ipmi_iic,"FMC-IPMI I2C Controller", XPAR_FMC_IPMI_IIC_0_BASEADDR );   if ( !status )   {      xil_printf( "ERROR : Failed to open FMC-IIC driver/n/r" );      exit(0);   }   // FMC Module Validation	if ( pdemo->bVerbose )	{		xil_printf( "FMC-HDMI-CAM Identification .../n/r" );	}   //if ( fmc_ipmi_detect( pdemo->pfmc_ipmi_iic, "FMC-HDMI-CAM", FMC_ID_SLOT1 ) )   {      int ret;      ret = fmc_ipmi_get_common_info( pdemo->pfmc_ipmi_iic, 0xA0, &(pdemo->fmc_hdmi_cam_common_info) );      if ( ret == FRU_SUCCESS )      {         ret = fmc_ipmi_get_board_info(pdemo->pfmc_ipmi_iic, 0xA0, &(pdemo->fmc_hdmi_cam_board_info) );         if ( ret == FRU_SUCCESS )         {            pdemo->ipmi_info_valid = 1;         }      }      //fmc_ipmi_enable(pdemo->pfmc_ipmi_iic, FMC_ID_SLOT1 );   }   if ( pdemo->ipmi_info_valid == 1 )   {	   xil_printf( "FMC-IPMI programmed as %s (Serial Number = %s)/n/r", pdemo->fmc_hdmi_cam_board_info.part, pdemo->fmc_hdmi_cam_board_info.serial );   }   else   {	   xil_printf( "FMC-IPMI not programmed yet .../n/r" );   }	if ( pdemo->bVerbose )	{		xil_printf( "FMC-HDMI-CAM Initialization .../n/r" );	}   status = fmc_iic_xps_init(pdemo->pfmc_hdmi_cam_iic,"FMC-HDMI-CAM I2C Controller", XPAR_FMC_HDMI_CAM_IIC_0_BASEADDR );   if ( !status )   {	  xil_printf( "ERROR : Failed to open FMC-IIC driver/n/r" );	  exit(0);   }   fmc_hdmi_cam_init(pdemo->pfmc_hdmi_cam, "FMC-HDMI-CAM", pdemo->pfmc_hdmi_cam_iic);   pdemo->pfmc_hdmi_cam->bVerbose = pdemo->bVerbose;   // Configure Video Clock Synthesizer	if ( pdemo->bVerbose )	{		xil_printf( "Video Clock Synthesizer Configuration .../n/r" );	}   fmc_hdmi_cam_vclk_init( pdemo->pfmc_hdmi_cam );//.........这里部分代码省略.........
开发者ID:pbomel,项目名称:hdl,代码行数:101,


示例20: Dprx_InterruptHandlerTp3

/** * This function is the callback function for when a training pattern 3 * interrupt occurs. * * @param	InstancePtr is a pointer to the XDp instance. * * @return	None. * * @note	None. ********************************************************************************/static void Dprx_InterruptHandlerTp3(void *InstancePtr){	xil_printf("> Interrupt: training pattern 3./n");}
开发者ID:bisptop,项目名称:embeddedsw,代码行数:15,


示例21: main

int main() {    init_platform();    ble_init();    print("*************** BLE Test *****************/n/r/n/r");//    while(1) {//    	if (ble_available()) {//    		// get the stuff from the BLE buffer//    		char buffer[BLE_UART_BUFF_SIZE];//    		ble_read(buffer, BLE_UART_BUFF_SIZE);////    		// print//    		xil_printf("Got something: %s/r/n", buffer);//    	}//    }    while (1) {    	if (readPacket(10000)) {//    		xil_printf("Got something: %s/r/n", packetbuffer);			// Buttons			if (packetbuffer[1] == 'B') {				uint8_t buttnum = packetbuffer[2] - '0';				uint8_t pressed = packetbuffer[3] - '0';				printf("Button %d", buttnum);				if (pressed) xil_printf(" pressed/r/n");				else 		 xil_printf(" released/r/n");			}			// Accelerometer			if (packetbuffer[1] == 'A') {				float x, y, z;//				x = parsefloat(packetbuffer+2);//				y = parsefloat(packetbuffer+6);//				z = parsefloat(packetbuffer+10);//				printf("Y: %.4f/r/n", 1.1f);//				xil_printf("A: %c%c 0x",packetbuffer[0], packetbuffer[1]);				// There seems to be an endian mismatch...				uint32_t tempX = ((uint8_t)packetbuffer[2]) << 0;				tempX = tempX | ((uint8_t)packetbuffer[3]) << 8;				tempX = tempX | ((uint8_t)packetbuffer[4]) << 16;				tempX = tempX | ((uint8_t)packetbuffer[5]) << 24;				uint32_t tempY = ((uint8_t)packetbuffer[6]) << 0;				tempY = tempY | ((uint8_t)packetbuffer[7]) << 8;				tempY = tempY | ((uint8_t)packetbuffer[8]) << 16;				tempY = tempY | ((uint8_t)packetbuffer[9]) << 24;				uint32_t tempZ = ((uint8_t)packetbuffer[10]) << 0;				tempZ = tempZ | ((uint8_t)packetbuffer[11]) << 8;				tempZ = tempZ | ((uint8_t)packetbuffer[12]) << 16;				tempZ = tempZ | ((uint8_t)packetbuffer[13]) << 24;				// having printed out the data in this format,				// you can load it into MATLAB to process it				// and view what the accelerometer data looks like//				xil_printf("%x %x %x/r/n", tempX, tempY, tempZ);				x = parsefloat(tempX);				y = parsefloat(tempY);				z = parsefloat(tempZ);				/** Here are some thresholds **/				if (y < -0.8) {					xil_printf("move right 4x/r/n");				} else if (y < -0.55) {					xil_printf("move right 3x/r/n");				} else if (y < -0.3) {					xil_printf("move right 2x/r/n");				} else if (y < -0.1) {					xil_printf("move right 1x/r/n");				}				if (y > 0.8) {					xil_printf("move left 4x/r/n");				} else if (y > 0.55) {					xil_printf("move left 3x/r/n");				} else if (y > 0.3) {					xil_printf("move left 2x/r/n");				} else if (y > 0.1) {					xil_printf("move left 1x/r/n");				}//				xil_printf("Accel/tx: "); printFloat(x);//				xil_printf("/t/ty:"); printFloat(y);//				xil_printf("/t/tz:"); printFloat(z);//				xil_printf("/r/n");			}//.........这里部分代码省略.........
开发者ID:parkerpatriot,项目名称:space-invaders,代码行数:101,


示例22: BuildHTTPOKStr

//.........这里部分代码省略......... *          The number of bytes in the HTTP OK directive; less the null terminator *          zero is return on error of if szHTTPOKStr was not big enough to hold the whole directive * *    Description:  *     *      This builds an HTTP OK directive. szHTTPOK must be large enough to hold the whole directive or zero will be returned *     * ------------------------------------------------------------ */uint32_t BuildHTTPOKStr(bool fNoCache, uint32_t cbContentLen, const char * szFile, char * szHTTPOKStr, uint32_t cbHTTPOK){    uint32_t i = 0;    char szContentLenStr[36];    sprintf(szContentLenStr, "%d", (int)cbContentLen);    uint32_t cbContentLenStr = strlen(szContentLenStr);    const char * szContentTypeStr = GetContentTypeFromExt(strchr(szFile, '.'));    uint32_t cbContentTypeStr = 0;    uint32_t cb = sizeof(szHTTPOK) + sizeof(szLineTerminator) - 2;    if(fNoCache)    {        cb += sizeof(szNoCache) - 1;    }    cb += sizeof(szConnection) - 1;    if(szContentTypeStr == NULL)    {        // this will always pass        // by default if we have no ext on the file and thus no content type        // we will assume a txt content        szContentTypeStr = GetContentTypeFromExt("txt");    }    cbContentTypeStr = strlen(szContentTypeStr);    cb += cbContentTypeStr + sizeof(szContentType) + sizeof(szLineTerminator) - 2;    // we don't have to have a content length, but the browser will shutdown faster if we do    if(cbContentLen > 0)    {        cb += cbContentLenStr + sizeof(szContentLength) + sizeof(szLineTerminator) - 2;    }    // make sure we have enough room    // we say >= because we must leave room for the terminating NULL    if(cb >= cbHTTPOK)    {        return(0);    }    // now start to build the HTTP OK header    memcpy(szHTTPOKStr, szHTTPOK, sizeof(szHTTPOK) - 1);    i = sizeof(szHTTPOK) - 1;    // put in the no cache line if requested    if(fNoCache)    {        memcpy(&szHTTPOKStr[i], szNoCache, sizeof(szNoCache) - 1);        i += sizeof(szNoCache) - 1;    }    // put in the connection type    memcpy(&szHTTPOKStr[i], szConnection, sizeof(szConnection) - 1);    i += sizeof(szConnection) - 1;    // put in the content type    if(szContentTypeStr != NULL)    {        memcpy(&szHTTPOKStr[i], szContentType, sizeof(szContentType) - 1);        i += sizeof(szContentType) - 1;        memcpy(&szHTTPOKStr[i], szContentTypeStr, cbContentTypeStr);        i += cbContentTypeStr;        memcpy(&szHTTPOKStr[i], szLineTerminator, sizeof(szLineTerminator) - 1);        i += sizeof(szLineTerminator) - 1;    }    // put in the content length    if(cbContentLen > 0)    {        memcpy(&szHTTPOKStr[i], szContentLength, sizeof(szContentLength) - 1);        i += sizeof(szContentLength) - 1;        memcpy(&szHTTPOKStr[i], szContentLenStr, cbContentLenStr);        i += cbContentLenStr;        memcpy(&szHTTPOKStr[i], szLineTerminator, sizeof(szLineTerminator) - 1);        i += sizeof(szLineTerminator) - 1;    }    // terminate the HTTP header    memcpy(&szHTTPOKStr[i], szLineTerminator, sizeof(szLineTerminator) - 1);    i += sizeof(szLineTerminator) - 1;    // put in the null terminator    szHTTPOKStr[i] = '/0';    xil_printf("HTTP directive: %s End of directive/r/n", szHTTPOKStr);    return(i);}
开发者ID:Digilent,项目名称:vivado-library,代码行数:101,


示例23: main

//.........这里部分代码省略.........                    LCD_setcursor(1,0);                    LCD_wrstring(s);                    LCD_setcursor(2,0);                    LCD_wrstring("RotBtn to start");                }                NX3_writeleds(0x01);                if (test == TEST_BANG)  // perform bang bang calculations                {                    calc_bang();                }                else  // perform PID tests                {                    calc_PID();                }                NX3_writeleds(0x00);                //FEATURE: wait for user input to send data over                NX3_readBtnSw(&btnsw);                if ((btnsw ^ old_btnsw) && (msk_BTN_ROT & btnsw))                {                    // light "Transfer" LED to indicate that data is being transmitted                    // Show the traffic on the LCD                    NX3_writeleds(0x02);                    LCD_clrd();                    LCD_setcursor(1, 0);                    LCD_wrstring("Sending Data....");                    LCD_setcursor(2, 0);                    LCD_wrstring("S:    DATA:     ");                    // print the descriptive heading followed by the data                    if (test == TEST_BANG)                    {                        xil_printf("/n/rBang Bang! Test Data/t/tAppx. Sample Interval: %d msec/n/r", frq_smple_interval);                    }                    else                    {                        xil_printf("/n/rPID Test Data/t/tAppx. Sample Interval: %d msec/n/r", frq_smple_interval);                    }                    // trigger the serial charter program)                    xil_printf("===STARTPLOT===/n");                    // start with the second sample.  The first sample is not representative of                    // the data.  This will pretty-up the graph a bit                    for (smpl_idx = 1; smpl_idx < NUM_FRQ_SAMPLES; smpl_idx++)                    {                        u16 count;                        count = sample[smpl_idx];                        if (count > 4096)                            count = 4095;                        v = (-3.3 / 4095.0) * (count) + 3.3;                        voltstostrng(v, s);                        xil_printf("%d/t%d/t%s/n/r", smpl_idx, count, s);                        LCD_setcursor(2, 2);                        LCD_wrstring("   ");                        LCD_setcursor(2, 2);                        LCD_putnum(smpl_idx, 10);                        LCD_setcursor(2, 11);                        LCD_wrstring("     ");                        LCD_setcursor(2, 11);                        LCD_putnum(count, 10);
开发者ID:rhodeser,项目名称:cockroach-sunset,代码行数:67,


示例24: xilsock_print_error_msg

void xilsock_print_error_msg( unsigned int eth_dev_num ) {    xil_printf("  **** ERROR:  Ethernet device %d is not supported by the WARPxilnet library.  /n", (eth_dev_num+1) );    xil_printf("               Please check library configuration in the BSP.   /n" );}
开发者ID:domenico-garlisi,项目名称:wireless-mac-processor,代码行数:4,


示例25: DisplayDemoCRMenu

void DisplayDemoCRMenu(DisplayCtrl *dispPtr){	xil_printf("/x1B[H"); //Set cursor to top left of terminal	xil_printf("/x1B[2J"); //Clear terminal	xil_printf("**************************************************/n/r");	xil_printf("*           ZYBO Display User Demo               */n/r");	xil_printf("**************************************************/n/r");	xil_printf("*Port: %42s*/n/r", (dispPtr->fHdmi == DISPLAY_HDMI) ? "HDMI" : "VGA");	xil_printf("*Current Resolution: %28s*/n/r", dispPtr->vMode.label);	printf("*Pixel Clock Freq. (MHz): %23.3f*/n/r", (dispPtr->fHdmi == DISPLAY_HDMI) ? (dispPtr->pxlFreq / 5.0) : (dispPtr->pxlFreq));	xil_printf("**************************************************/n/r");	xil_printf("/n/r");	xil_printf("1 - %s/n/r", VMODE_640x480.label);	xil_printf("2 - %s/n/r", VMODE_800x600.label);	xil_printf("3 - %s/n/r", VMODE_1280x720.label);	xil_printf("4 - %s/n/r", VMODE_1280x1024.label);	xil_printf("5 - %s/n/r", VMODE_1920x1080.label);	xil_printf("q - Quit (don't change resolution)/n/r");	xil_printf("/n/r");	xil_printf("Select a new resolution:");}
开发者ID:andrewandrepowell,项目名称:zybo_petalinux,代码行数:21,


示例26: RtcPsuAlarmIntrExample

/**** This function does a minimal test on the Rtc device and driver as a* design example. The purpose of this function is to illustrate* how to use alarm feature in the XRtcPsu driver.** This function sets alarm for a specified time from the current time.** @param	IntcInstPtr is a pointer to the instance of the ScuGic driver.* @param	RtcInstPtr is a pointer to the instance of the RTC driver*		which is going to be connected to the interrupt controller.* @param	DeviceId is the device Id of the RTC device and is typically*		XPAR_<RTCPSU_instance>_DEVICE_ID value from xparameters.h.* @param	RtcIntrId is the interrupt Id and is typically*		XPAR_<RTCPSU_instance>_INTR value from xparameters.h.** @return	XST_SUCCESS if successful, otherwise XST_FAILURE.** @note** This function contains an infinite loop such that if interrupts are not* working it may never return.***************************************************************************/int RtcPsuAlarmIntrExample(XScuGic *IntcInstPtr, XRtcPsu *RtcInstPtr,			u16 DeviceId, u16 RtcIntrId){	int Status;	XRtcPsu_Config *Config;	u32 CurrentTime, Alarm;	XRtcPsu_DT dt0;	/*	 * Initialize the RTC driver so that it's ready to use	 * Look up the configuration in the config table, then initialize it.	 */	Config = XRtcPsu_LookupConfig(DeviceId);	if (NULL == Config) {		return XST_FAILURE;	}	Status = XRtcPsu_CfgInitialize(RtcInstPtr, Config, Config->BaseAddr);	if (Status != XST_SUCCESS) {		return XST_FAILURE;	}	/* Check hardware build */	Status = XRtcPsu_SelfTest(RtcInstPtr);	if (Status != XST_SUCCESS) {		return XST_FAILURE;	}	xil_printf("/n/rDay Convention : 0-Fri, 1-Sat, 2-Sun, 3-Mon, 4-Tue, 5-Wed, 6-Thur/n/r");	xil_printf("Current RTC time is../n/r");	CurrentTime = XRtcPsu_GetCurrentTime(RtcInstPtr);	XRtcPsu_SecToDateTime(CurrentTime,&dt0);	xil_printf("YEAR:MM:DD HR:MM:SS /t %04d:%02d:%02d %02d:%02d:%02d/t Day = %d/n/r",			dt0.Year,dt0.Month,dt0.Day,dt0.Hour,dt0.Min,dt0.Sec,dt0.WeekDay);	/*	 * Connect the RTC to the interrupt subsystem such that interrupts	 * can occur. This function is application specific.	 */	Status = SetupInterruptSystem(IntcInstPtr, RtcInstPtr, RtcIntrId);	if (Status != XST_SUCCESS) {		return XST_FAILURE;	}	/*	 * Setup the handlers for the RTC that will be called from the	 * interrupt context when alarm and seconds interrupts are raised,	 * specify a pointer to the RTC driver instance as the callback reference	 * so the handlers are able to access the instance data	 */	XRtcPsu_SetHandler(RtcInstPtr, (XRtcPsu_Handler)Handler, RtcInstPtr);	/*	 * Enable the interrupt of the RTC device so interrupts will occur.	 */	XRtcPsu_SetInterruptMask(RtcInstPtr, XRTC_INT_EN_ALRM_MASK );	CurrentTime = XRtcPsu_GetCurrentTime(RtcInstPtr);	Alarm = CurrentTime + ALARM_PERIOD;	XRtcPsu_SetAlarm(RtcInstPtr,Alarm,0);	while( IsAlarmGen != 1);	/*	 * Disable the interrupt of the RTC device so interrupts will not occur.	 */	XRtcPsu_ClearInterruptMask(RtcInstPtr,XRTC_INT_DIS_ALRM_MASK);	return XST_SUCCESS;}
开发者ID:Hunter-why,项目名称:embeddedsw,代码行数:94,


示例27: DisplayDemoPrintMenu

void DisplayDemoPrintMenu(DisplayCtrl *dispPtr){	xil_printf("/x1B[H"); //Set cursor to top left of terminal	xil_printf("/x1B[2J"); //Clear terminal	xil_printf("**************************************************/n/r");	xil_printf("*           ZYBO Display User Demo               */n/r");	xil_printf("**************************************************/n/r");	xil_printf("*Port: %42s*/n/r", (dispPtr->fHdmi == DISPLAY_HDMI) ? "HDMI" : "VGA");	xil_printf("*Current Resolution: %28s*/n/r", dispPtr->vMode.label);	printf("*Pixel Clock Freq. (MHz): %23.3f*/n/r", (dispPtr->fHdmi == DISPLAY_HDMI) ? (dispPtr->pxlFreq / 5.0) : (dispPtr->pxlFreq));	xil_printf("*Current Frame Index: %27d*/n/r", dispPtr->curFrame);	xil_printf("**************************************************/n/r");	xil_printf("/n/r");	xil_printf("1 - Change Resolution/n/r");	xil_printf("2 - Change Frame/n/r");	xil_printf("3 - Print Blended Test Pattern to current Frame/n/r");	xil_printf("4 - Print Color Bar Test Pattern to current Frame/n/r");	xil_printf("5 - Invert Current Frame colors/n/r");	xil_printf("6 - Invert Current Frame colors seamlessly*/n/r");	xil_printf("q - Quit/n/r");	xil_printf("/n/r");	xil_printf("*Note that option 6 causes the current frame index to be /n/r");	xil_printf(" incremented. This is because the inverted frame is drawn/n/r");	xil_printf(" to an inactive frame. After the drawing is complete, this/n/r");	xil_printf(" frame is then set to be the active frame. This demonstrates/n/r");	xil_printf(" how to properly update what is being displayed without image/n/r");	xil_printf(" tearing. Options 3-5 all draw to the currently active frame,/n/r");	xil_printf(" which is why not all pixels appear to be updated at once./n/r");	xil_printf("/n/r");	xil_printf("Enter a selection:");}
开发者ID:andrewandrepowell,项目名称:zybo_petalinux,代码行数:31,


示例28: print_web_app_header

voidprint_web_app_header(){    xil_printf("%20s %6d %s/n/r", "http server",               http_port, "Point your web browser to http://192.168.1.10");}
开发者ID:fbalakirev,项目名称:kc705,代码行数:6,


示例29: main

int main (void) {      XGpio sw, led;	  int i, pshb_check, sw_check;	  XGpioPs_Config*GpioConfigPtr;	  int xStatus;	  int iPinNumberEMIO = 54;	  u32 uPinDirectionEMIO = 0x0;	  u32 uPinDirection = 0x1;		  xil_printf("-- Start of the Program --/r/n");	  // AXI GPIO switches Intialization	  XGpio_Initialize(&sw, XPAR_SWITCHES_DEVICE_ID);	  // AXI GPIO leds Intialization	  XGpio_Initialize(&led, XPAR_LEDS_DEVICE_ID);	  // PS GPIO Intialization	  GpioConfigPtr = XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID);	  if(GpioConfigPtr == NULL)	    return XST_FAILURE;	  xStatus = XGpioPs_CfgInitialize(&psGpioInstancePtr,	      GpioConfigPtr,	      GpioConfigPtr->BaseAddr);	  if(XST_SUCCESS != xStatus)	    print(" PS GPIO INIT FAILED /n/r");	  //PS GPIO pin setting to Output	  XGpioPs_SetDirectionPin(&psGpioInstancePtr, iPinNumber,uPinDirection);	  XGpioPs_SetOutputEnablePin(&psGpioInstancePtr, iPinNumber,1);	  //EMIO PIN Setting to Input port	  XGpioPs_SetDirectionPin(&psGpioInstancePtr,	      iPinNumberEMIO,uPinDirectionEMIO);	  XGpioPs_SetOutputEnablePin(&psGpioInstancePtr, iPinNumberEMIO,0);	  xil_printf("-- Press BTNR (Zedboard) or BTN3 (Zybo) to see the LED light --/r/n");	  xil_printf("-- Change slide switches to see corresponding output on LEDs --/r/n");	  xil_printf("-- Set slide switches to 0x0F to exit the program --/r/n");	  while (1)	  {		  sw_check = XGpio_DiscreteRead(&sw, 1);		  XGpio_DiscreteWrite(&led, 1, sw_check);	      pshb_check = XGpioPs_ReadPin(&psGpioInstancePtr,iPinNumberEMIO);          XGpioPs_WritePin(&psGpioInstancePtr,iPinNumber,pshb_check);          if((sw_check & 0x0f)==0x0F)        	  break;		  for (i=0; i<9999999; i++); // delay loop	   }	  xil_printf("-- End of Program --/r/n");#ifdef MULTIBOOT	  // Driver Instantiations	  XDcfg XDcfg_0;	  u32 MultiBootReg = 0;	  #define PS_RST_CTRL_REG	(XPS_SYS_CTRL_BASEADDR + 0x200)	  #define PS_RST_MASK	0x1	/* PS software reset */	  #define SLCR_UNLOCK_OFFSET 0x08	  // Initialize Device Configuration Interface	  XDcfg_Config *Config = XDcfg_LookupConfig(XPAR_XDCFG_0_DEVICE_ID);	  XDcfg_CfgInitialize(&XDcfg_0, Config, Config->BaseAddr);	  MultiBootReg = 0; // Once done, boot the master image stored at 0xfc00_0000	  Xil_Out32(0xF8000000 + SLCR_UNLOCK_OFFSET, 0xDF0DDF0D); // unlock SLCR	  XDcfg_WriteReg(XDcfg_0.Config.BaseAddr, XDCFG_MULTIBOOT_ADDR_OFFSET, MultiBootReg); // write to multiboot reg	  // synchronize		__asm__(			"dsb/n/t"			"isb"		);      Xil_Out32(PS_RST_CTRL_REG, PS_RST_MASK);#endif	  return 0;}
开发者ID:AlexanderRasborgKnudsen,项目名称:Thesis,代码行数:75,


示例30: MessageSendDone

void MessageSendDone(void){   xil_printf("The message is sent /n/r");}
开发者ID:ameena3,项目名称:Anubhav_projects,代码行数:6,



注:本文中的xil_printf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ xioctl函数代码示例
C++ xiic_getreg8函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。