当前位置: 首页>>代码示例>>C++>>正文


C++ init_platform函数代码示例

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


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

示例1: main

int main()
{
    init_platform();

    print("Hello World\n\r");

    pwm_set(2000000,20,0);
    pwm_set(2000000,30,1);
    pwm_set(2000000,40,2);
    pwm_set(2000000,50,3);
    pwm_set(2000000,60,4);
    pwm_set(2000000,70,5);

    cleanup_platform();
    return 0;
}
开发者ID:1243246886,项目名称:General-Zynq,代码行数:16,代码来源:helloworld.c

示例2: interruptManager

int interruptManager (unsigned int * framePointer0) {
	init_platform();
	// Initialize the GPIO peripherals.
	int success;

	// Used for CPU utilization. Uncomment if desired
	// XTmrCtr_Initialize(instPtr, 0);

	success = XGpio_Initialize(&gpPB, XPAR_PUSH_BUTTONS_5BITS_DEVICE_ID);
	// Set the push button peripheral to be inputs.
	XGpio_SetDataDirection(&gpPB, 1, 0x0000001F);
	// Enable the global GPIO interrupt for push buttons.
	XGpio_InterruptGlobalEnable(&gpPB);
	// Enable all interrupts in the push button peripheral.
	XGpio_InterruptEnable(&gpPB, 0xFFFFFFFF);

	// Reset the XAC97 Chip
	XAC97_HardReset(XPAR_AXI_AC97_0_BASEADDR);
	XAC97_mSetControl(XPAR_AXI_AC97_0_BASEADDR, AC97_ENABLE_IN_FIFO_INTERRUPT);
	XAC97_mSetControl(AC97_ExtendedAudioStat, AC97_EXTENDED_AUDIO_CONTROL_VRA);
	setVolLevel(AC97_VOL_MAX);
	clearAllSounds();

	microblaze_register_handler(interrupt_handler_dispatcher, NULL);
	XIntc_EnableIntr(XPAR_INTC_0_BASEADDR,
			(XPAR_FIT_TIMER_0_INTERRUPT_MASK | XPAR_PUSH_BUTTONS_5BITS_IP2INTC_IRPT_MASK | XPAR_AXI_AC97_0_INTERRUPT_MASK));
	XIntc_MasterEnable(XPAR_INTC_0_BASEADDR);
	microblaze_enable_interrupts();

	// Uncomment for CPU utilization stats
	/*XTmrCtr Timer;
	XTmrCtr *instPtr = &Timer;
	XTmrCtr_Initialize(instPtr, 0);
	XTmrCtr_Start(instPtr, 0);*/
	while(!isEndOfGame()); // Program never ends.

	// Uncomment for CPU utilization stats
	/*XTmrCtr_Stop(instPtr, 0);
	int val = (int) XTmrCtr_GetValue(instPtr, 0);
	xil_printf("%d\n\r", val);*/
	clearAllSounds();
	XAC97_ClearFifos(XPAR_AXI_AC97_0_BASEADDR);
	drawGameOver();
	cleanup_platform();

	return 0;
}
开发者ID:YazanHalawa,项目名称:ECEn-427,代码行数:47,代码来源:interrupts.c

示例3: testSwitchesAndLEDs

int testSwitchesAndLEDs()
{
    init_platform();
    initGPIO();

	unsigned int switch_val = XGpio_DiscreteRead(&xgpio_switches, 1);
	xil_printf("Switch val: %x \n\r", switch_val);
    while(1)
    {
		switch_val = XGpio_DiscreteRead(&xgpio_switches, 1);
		XGpio_DiscreteWrite(&xgpio_LEDs, 1, switch_val);
    }

    cleanup_platform();

    return 0;
}
开发者ID:embeddedprogrammer,项目名称:spaceinvaders,代码行数:17,代码来源:helloworld.c

示例4: main

int main (void) {

	init_platform();
   
	unsigned int *reset = RESET_REG;
   
	*reset = 1;
	*reset = 0;
   
	unsigned int i  = 0;	

	unsigned int *timer_0 = TIMER_REG_0;	
	unsigned int *timer_1 = TIMER_REG_1;
	unsigned int *count_0 = COUNTER_REG_0;	
	unsigned int *count_1 = COUNTER_REG_1;
	unsigned int *packet_0 = PACKET_REG_0;	
	unsigned int *packet_1 = PACKET_REG_1;
	
	unsigned int *hash_0 = HASH_REG_0;
	unsigned int *hash_1 = HASH_REG_1;
	unsigned int *hash_2 = HASH_REG_2;
	unsigned int *hash_3 = HASH_REG_3;
	
	while(1){
		xil_printf("Press 'g' to read registers, 'r' to reset registers' value");
		char t = inbyte();
		if (t == 'g') {
			xil_printf("\nTimer 0:    %d\n", *timer_0);
			xil_printf("Timer 1:    %d\n", *timer_1);
			xil_printf("Counter 0:  %d\n", *count_0);
			xil_printf("Counter 1:  %d\n", *count_1);
			xil_printf("Packet 0:   %d\n", *packet_0);
			xil_printf("Packet 1:   %d\n", *packet_1);
			xil_printf("Hash: %x %x %x %x\n", *hash_0, *hash_1, *hash_2, *hash_3);
			xil_printf("\n\n");
		}else if (t == 'r') {
			*reset = 1;
			*reset = 0;
		}		
	}

	cleanup_platform();
	return 0;

}
开发者ID:anhnguyen1111,项目名称:pr_hrav_master,代码行数:45,代码来源:helloworld+(copy).c

示例5: main

int main()
{
    init_platform();

    /* Initialize xilkernel */
    xilkernel_init();

    /* add a thread to be launched once xilkernel starts */
    xmk_add_static_thread(sort_main, 0);

    /* start xilkernel - does not return control */
    xilkernel_start();

    /* Never reached */
    cleanup_platform();

    return 0;
}
开发者ID:BBBSnowball,项目名称:reconos,代码行数:18,代码来源:sort_demo.c

示例6: main

int main()
{
	u32 votedresult=0x31;
	u32 delay;
    init_platform();
    for(;;){
    	for(delay=0;delay<10000000;delay++);
        AXITMRMVOTER_mWriteReg(0x44A00000, AXITMRMVOTER_S00_AXI_SLV_REG0_OFFSET, votedresult);
        votedresult=AXITMRMVOTER_mReadReg(0x44A00000,AXITMRMVOTER_S00_AXI_SLV_REG4_OFFSET);
        if(++votedresult>0x39) votedresult=0x30;
        char* cpointer=&votedresult;
    	print((char*) (cpointer+0)); print((char*) (cpointer+1));
    	print((char*) (cpointer+2)); print((char*) (cpointer+3));
    	print(" is the voted value and if it is as expected, guess what TMR is working;) \n\r");
    }
    cleanup_platform();
    return 0;
}
开发者ID:mohamedtajelsir,项目名称:SEUDpublic,代码行数:18,代码来源:helloworld.c

示例7: main

int main()
{
    if (init_platform() < 0) {
        xil_printf("ERROR initializing platform.\r\n");
        return -1;
    }
#ifndef OS_IS_FREERTOS
    /* start the kernel - does not return */
    xilkernel_main();
#else
	sys_thread_new("main_thrd", (void(*)(void*))main_thread, 0,
                THREAD_STACKSIZE,
                DEFAULT_THREAD_PRIO);
	vTaskStartScheduler();
    while(1);
#endif
    return 0;
}
开发者ID:hokim72,项目名称:XIL_EDK,代码行数:18,代码来源:main.c

示例8: main

int main()
{
    int i;

    init_platform();

    print("--Starting Memory Test Application--\n\r");
    print("NOTE: This application runs with D-Cache disabled.");
    print("As a result, cacheline requests will not be generated\n\r");

    for (i = 0; i < n_memory_ranges; i++) {
        test_memory_range(&memory_ranges[i]);
    }

    print("-- My lab1 plus : 326-LiXiang --\n\r");

    return 0;
}
开发者ID:Em15-326-LiXiang,项目名称:RionaLi,代码行数:18,代码来源:memorytest.c

示例9: main

int main()
{
    u32 uDevId = XPAR_IOMODULE_0_DEVICE_ID;
    XIOModule mcsIOMdule;
    u8 read_data_8;
    u8 read_data_8_old;
    init_platform();
    XIOModule_Initialize(&mcsIOMdule, uDevId);
    print("Hello World + GPIO \n\r");
    while(1){
      read_data_8 = XIOModule_DiscreteRead(&mcsIOMdule, 1);
      if( read_data_8 !=  read_data_8_old){
        XIOModule_DiscreteWrite(&mcsIOMdule, 1, read_data_8);
        xil_printf("sw %02x\n\r",read_data_8);
        read_data_8_old = read_data_8;
      }
    }
    return 0;
}
开发者ID:shohei,项目名称:papilio-book,代码行数:19,代码来源:helloworld.c

示例10: main

int main()
{
	init_platform();
	XIOModule_Initialize(&iomodule, XPAR_IOMODULE_0_DEVICE_ID);
	XIOModule_Start(&iomodule);
	XIOModule_CfgInitialize(&iomodule, NULL, 1);

	xil_printf ("\n\r\n\rRobot Console v0.01\n\r\n\r");

	Xil_Out32 (MX_LIMIT_LO, -14400);	// gripper rotate
	Xil_Out32 (MX_LIMIT_HI,  14400);
	Xil_Out32 (MX_POSITION,      0);

	Xil_Out32 (MY_LIMIT_LO,  -2800);	// wrist
	Xil_Out32 (MY_LIMIT_HI,   3960);
	Xil_Out32 (MY_POSITION,   3960);

	Xil_Out32 (MZ_LIMIT_LO,  -7200);	// lower arm rotate
	Xil_Out32 (MZ_LIMIT_HI,   7200);
	Xil_Out32 (MZ_POSITION,      0);

	Xil_Out32 (MA_LIMIT_LO,  -9257);	// elbow
	Xil_Out32 (MA_LIMIT_HI,  12750);
	Xil_Out32 (MA_POSITION,  12750);

	Xil_Out32 (MB_LIMIT_LO,  -5520);	// shoulder
	Xil_Out32 (MB_LIMIT_HI,   6900);
	Xil_Out32 (MB_POSITION,  -5520);

	Xil_Out32 (MC_LIMIT_LO,  -2823);	// base
	Xil_Out32 (MC_LIMIT_HI,   2823);
	Xil_Out32 (MC_POSITION,      0);

	Xil_Out32 (MOTION_ALARM, 0x3f);

	InitCommandProcessing ();

	for (;;) {
		if (GetCommand ()) {
			ProcessCommand ();
		}
	}
}
开发者ID:bikerglen,项目名称:robot-arm-v01,代码行数:43,代码来源:helloworld.c

示例11: main

int main () {
	unsigned int DataRead;
	unsigned int OldData;
	init_platform();
	// Clear the screen
	xil_printf("%c[2J",27);
	OldData = (unsigned int) 0xffffffff;
	while(1){
	// Read the state of the DIP switches
		DataRead = XIo_In32(XPAR_MY_PERIPHERAL_0_BASEADDR);
	// Send the data to the UART if the settings change
		if(DataRead != OldData){
			xil_printf("DIP Switch settings: 0x%2X\r\n", DataRead);
			// Set the LED outputs to the DIP switch values
			XIo_Out32(XPAR_MY_PERIPHERAL_0_BASEADDR, DataRead);
			// Record the DIP switch settings
			OldData = DataRead;
		}
	}
}
开发者ID:salelsu,项目名称:lab4,代码行数:20,代码来源:helloworld.c

示例12: main

int main() {
    init_platform();

    print("Hello World\n\r");

    // apparently we don't need to init it, just HardReset
    XAC97_HardReset(XPAR_AXI_AC97_0_BASEADDR);

    XAC97_WriteReg(XPAR_AXI_AC97_0_BASEADDR, AC97_ExtendedAudioStat, 1);
    XAC97_WriteReg(XPAR_AXI_AC97_0_BASEADDR, AC97_PCM_DAC_Rate, AC97_PCM_RATE_11025_HZ);

    while (1) {
    	XAC97_PlayAudio(XPAR_AXI_AC97_0_BASEADDR, tankFireSound, &tankFireSound[tankFireSoundFrames]);

    	XAC97_Delay(1000000);
    }

    cleanup_platform();

    return 0;
}
开发者ID:parkerpatriot,项目名称:space-invaders,代码行数:21,代码来源:soundTest_polling.c

示例13: main

int main()
{
	XStatus Status;


    init_platform();

    xil_printf("running test\r\n");

    SF3_begin(&mySF3, &ivt[0], XPAR_PMODSF3_0_AXI_LITE_SPI_BASEADDR);

    Status = SF3_QuadSpiTest(&mySF3);
    if (Status != XST_SUCCESS) {
    	xil_printf("\r\nError running Qspi test");
    }
    else{
    	xil_printf("\r\nTest successful!");
    }
    cleanup_platform();
    return 0;
}
开发者ID:Digilent,项目名称:vivado-library,代码行数:21,代码来源:main.c

示例14: main

int main()
{
	int my_addr;
	
    init_platform();

	print("What's up World!\n");
	
	/* to set up the empty allocation tree */
    init_ddr(); 
    init_ddr();

	my_addr = hw_malloc(1000); //malloc
	
	print("Allocated memory address is ");
    putnum(result);
	
	hw_mfree(my_addr);//mfree   

	return 0;
}
开发者ID:wg88719,项目名称:SysAlloc-AXI-IP,代码行数:21,代码来源:main.c

示例15: main

int main()
{
    XGpio gpio0, gpio1, gpio2, gpio3, gpio4;
    unsigned int a, b, c, d, e, f, g, h, i, j, k;

    init_platform();

    while (1) {
        XGpio_Initialize(&gpio0, XPAR_AXI_GPIO_0_DEVICE_ID);
        XGpio_Initialize(&gpio1, XPAR_AXI_GPIO_1_DEVICE_ID);
        XGpio_Initialize(&gpio2, XPAR_AXI_GPIO_2_DEVICE_ID);
        XGpio_Initialize(&gpio3, XPAR_AXI_GPIO_3_DEVICE_ID);
        XGpio_Initialize(&gpio4, XPAR_AXI_GPIO_4_DEVICE_ID);

        a = XGpio_DiscreteRead (&gpio0, 1); // Timer LSB
        b = XGpio_DiscreteRead (&gpio0, 2); // Timer MSB
        c = XGpio_DiscreteRead (&gpio1, 1); // BRAM Single
        d = XGpio_DiscreteRead (&gpio1, 2); // BRAM Double
        e = XGpio_DiscreteRead (&gpio2, 1); // DSP Global
        f = XGpio_DiscreteRead (&gpio2, 2); // DSP Single
        g = XGpio_DiscreteRead (&gpio3, 1); // DSP Double
        h = XGpio_DiscreteRead (&gpio3, 2); // DSP Triple
        i = XGpio_DiscreteRead (&gpio4, 1); // CLB Level1
        j = XGpio_DiscreteRead (&gpio4, 2); // CLB Level2

        printf("T\t%d%d\n\r", b, a);
        printf("BS\t%d\n\r", c);
        printf("BD\t%d\n\r", d);
        printf("DG\t%d\n\r", e);
        printf("DS\t%d\n\r", f);
        printf("DD\t%d\n\r", g);
        printf("DT\t%d\n\r", h);
        printf("C1\t%d\n\r", i);
        printf("C2\t%d\n\r", j);

        for (i = 0; i < 1000; ++i);
    }

    return 0;
}
开发者ID:thomaslenzi,项目名称:IrradiationTests,代码行数:40,代码来源:helloworld.c


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