• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PUT32函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: pll_init

//-------------------------------------------------------------------
void pll_init ( void )
{
    //use the main (external) oscillator
    PUT32(SCS,1<<5);
    while((GET32(SCS)&(1<<6))==0) continue;
    PUT32(CLKSRCSEL,1);
}
开发者ID:dwelch67,项目名称:panda_samples,代码行数:8,代码来源:uart01.c


示例2: notmain

//-------------------------------------------------------------------------
int notmain ( void )
{
    unsigned int ra;

    ra=GET32(GPFSEL4);
    ra&=~(7<<21);
    ra|=1<<21;
    PUT32(GPFSEL4,ra);

    //ra=GET32(GPFSEL3);
    //ra&=~(7<<15);
    //ra|=1<<15;
    //PUT32(GPFSEL3,ra);

    while(1)
    {
        PUT32(GPSET1,1<<(47-32));
        //PUT32(GPCLR1,1<<(35-32));
        for(ra=0;ra<0x100000;ra++) dummy(ra);
        PUT32(GPCLR1,1<<(47-32));
        //PUT32(GPSET1,1<<(35-32));
        for(ra=0;ra<0x100000;ra++) dummy(ra);
    }

    return(0);
}
开发者ID:GreenYo0413,项目名称:raspberrypi,代码行数:27,代码来源:blinker01.c


示例3: pdi_command

//------------------------------------------------------------------------
unsigned int pdi_command ( unsigned int cmd )
{
    unsigned int data;

    PUT32(AUX_SPI0_CS,0x004000B0); //TA=1 cs asserted
    while(1)
    {
        if(GET32(AUX_SPI0_CS)&(1<<18)) break; //TXD
    }
    PUT32(AUX_SPI0_FIFO,(cmd>>24)&0xFF);
    PUT32(AUX_SPI0_FIFO,(cmd>>16)&0xFF);
    PUT32(AUX_SPI0_FIFO,(cmd>> 8)&0xFF);
    PUT32(AUX_SPI0_FIFO,(cmd>> 0)&0xFF);
    while(1) if(GET32(AUX_SPI0_CS)&(1<<16)) break;
    while(1) if(GET32(AUX_SPI0_CS)&(1<<17)) break;
    data=GET32(AUX_SPI0_FIFO)&0xFF;
    while(1) if(GET32(AUX_SPI0_CS)&(1<<17)) break;
    data<<=8;
    data|=GET32(AUX_SPI0_FIFO)&0xFF;
    while(1) if(GET32(AUX_SPI0_CS)&(1<<17)) break;
    data<<=8;
    data|=GET32(AUX_SPI0_FIFO)&0xFF;
    while(1) if(GET32(AUX_SPI0_CS)&(1<<17)) break;
    data<<=8;
    data|=GET32(AUX_SPI0_FIFO)&0xFF;
    PUT32(AUX_SPI0_CS,0x00400000); //cs0 comes back up
    return(data);
}
开发者ID:C-Elegans,项目名称:raspberrypi,代码行数:29,代码来源:spi01.c


示例4: notmain

int notmain ( void )
{
    unsigned int beg,end;
    unsigned int one,two;

    uart_init();
    hexstring(0x12345678);

    IRQEN();
    FIQEN();
    PUT32(TIMER1_MATCH,0xFFF);
    PUT32(TIMER_CONTROL,0x0C02);

    beg=GET32(0xD1000000);
    if(onetime()) return(1);
    end=GET32(0xD1000000);
    hexstring(end-beg);
    one=end-beg;

    hexstring(0x12345678);

    cache_enable();

    beg=GET32(0xD1000000);
    if(onetime()) return(1);
    end=GET32(0xD1000000);
    hexstring(end-beg);
    two=end-beg;
    hexstring(0x12345678);

    hexstring(one-two);
    hexstring(0x12345678);

    return(0);
}
开发者ID:HarishCrusher,项目名称:amber_samples,代码行数:35,代码来源:twain.c


示例5: spi_init

//------------------------------------------------------------------------
void spi_init ( void )
{
    unsigned int ra;

    ra=GET32(AUX_ENABLES);
    ra|=2; //enable spi0
    PUT32(AUX_ENABLES,ra);


    ra=GET32(GPFSEL0);
    ra&=~(7<<27); //gpio9
    ra|=4<<27;    //alt0
    ra&=~(7<<24); //gpio8
    ra|=4<<24;    //alt0
    ra&=~(7<<21); //gpio7
    ra|=4<<21;    //alt0
    PUT32(GPFSEL0,ra);
    ra=GET32(GPFSEL1);
    ra&=~(7<<0); //gpio10/
    ra|=4<<0;    //alt0
    ra&=~(7<<3); //gpio11/
    ra|=4<<3;    //alt0
    PUT32(GPFSEL1,ra);

    PUT32(AUX_SPI0_CS,0x0000030);
    PUT32(AUX_SPI0_CLK,0x0000); //slowest possible, could probably go faster here



}
开发者ID:C-Elegans,项目名称:raspberrypi,代码行数:31,代码来源:spi01.c


示例6: raspi_okled_action

void raspi_okled_action(doorid_t id, uint16_t size, struct Crate* crate) {
	if (crate->data[0] == 1) {
		PUT32(GPCLR0, OKLED);
	} else {
		PUT32(GPSET0, OKLED);
	}
}
开发者ID:raspberry-alpha-omega,项目名称:cornelius,代码行数:7,代码来源:corn.c


示例7: notmain

int notmain ( void )
{
    unsigned int ra;

    //PUT8(PADIR_L,GET8(PADIR_L)|0x01);
    PUT8(PASEL0_L,GET8(PASEL0_L)& ~0x01);
    PUT8(PASEL1_L,GET8(PASEL1_L)& ~0x01);

    PUT32(SYST_CSR,4);
    PUT32(SYST_RVR,1200000-1);
    PUT32(SYST_CVR,1200000-1);
    PUT32(SYST_CSR,5);

    ra=GET8(PAOUT_L);
    while(1)
    {
        ra^=1;
        PUT8(PAOUT_L,ra);
        delay();
        ra^=1;
        PUT8(PAOUT_L,ra);
        delay();
    }
    return(0);
}
开发者ID:mybays,项目名称:msp432,代码行数:25,代码来源:blinker02.c


示例8: notmain

//------------------------------------------------------------------------
void notmain ( void )
{
    //unsigned int ra;

    switch_to_80Mhz();

    uart_init();
    hexstring(0x87654321);
    hexstring(0x12345678);

    //Cortex-M4 systick timer init
    PUT32(STCTRL,0x00000004);
    PUT32(STRELOAD,1000000-1);
    PUT32(STCURRENT,0); //value is a dont care
    PUT32(STCTRL,0x00000005);

    while(1)
    {
        uart_send(0x55);
        dowait();
        uart_send(0x56);
        dowait();
    }

}
开发者ID:dwelch67,项目名称:tivac_launchpad,代码行数:26,代码来源:uart05.c


示例9: kernel

void
kernel()
{
	unsigned int then, now, delta;
	PUT32(0x40000054, INT_IRQ);		// mboxes 1..3 *do* interrupt, via IRQ
	PUT32(0x40000058, INT_IRQ);
	PUT32(0x4000005C, INT_IRQ);

	flash_lonum(3);

	then = now_usec();
	while (1) {
		now = now_usec();
        delta = usec_diff( now, then );
		//if (delta > ONE_MSEC) {
		if ( delta  > (ONE_SEC) ) {
		//if (delta > ((7 * ONE_SEC) + (500 * ONE_MSEC))) {
			then = now;
//			flash_lonum(3);
//			oldwait(20);
			interrupt_core(1);
//            clear_interrupt(1);
//			while (1) continue;
		}
	}
}
开发者ID:ERJIALI,项目名称:ee447,代码行数:26,代码来源:kernel.c


示例10: polled_sys_timer_interrupt_handler

void polled_sys_timer_interrupt_handler(void)
{
	static int led_on =0;
	if(is_system_timer_interrupt_pending() == 1)
	{
		//Reset the counter match register
		unsigned int start_tick = GET32(SYSTEM_TIMER_CL0_REG_LSB);
		PUT32(SYSTEM_TIMER_CMP1,(start_tick + (time_ms*1000)));
		
		//Clear the system timer match register
		System_timer_control_Reg_t systimctrl;
		systimctrl = (System_timer_control_Reg_t) GET32(SYSTEM_TIMER_CS_REG);
		systimctrl.mBits.System_timer1_match = 1;
		PUT32(SYSTEM_TIMER_CS_REG,systimctrl.mAsU32);
		
		if(led_on == 0)
		{
			LEDTurnon();
			led_on = 1;
		}
		else
		{
			LEDTurnoff();
			led_on = 0;
		}
	}
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:27,代码来源:Interrupt_handler.c


示例11: switch_to_mosc

//------------------------------------------------------------------------
static void switch_to_mosc ( void )
{
    unsigned int ra;

    PUT32(MOSCCTL,3);

    ra=GET32(RCC);
    ra|=1<<11; //BYPASS
    ra&=~(1<<22); //USESYS
    PUT32(RCC,ra);

    PUT32(MISC,1<<8);

    ra=GET32(RCC);
    ra&=~(1<<0); //MOSCDIS
    PUT32(RCC,ra);

    while(1) if(GET32(RIS)&(1<<8)) break;

    //0x15  16mhz
    ra=GET32(RCC);
    ra&=~(0x1F<<6); //XTAL
    ra|=0x15<<6; //XTAL
    ra&=~(0x3<<4); //OSCSRC
    ra|=0x0<<4; //OSCSRC
    ra|=(1<<13); //PWRDN
    PUT32(RCC,ra);
}
开发者ID:dwelch67,项目名称:tivac_launchpad,代码行数:29,代码来源:uart07.c


示例12: raspi_okled_set

void raspi_okled_set(int state) {
  if (state) {
    PUT32(GPCLR0, OKLED);
  } else {
    PUT32(GPSET0, OKLED);
  }
}
开发者ID:raspberry-alpha-omega,项目名称:corn-morse,代码行数:7,代码来源:gpio.c


示例13: setup_for_jtag

void setup_for_jtag( void ){

    unsigned int ra;

    //for jtag
    //alt4 = 0b011 3
    //alt5 = 0b010 2

    ra=GET32(GPFSEL0);
    ra&=~(7<<12); //gpio4
    ra|=2<<12; //gpio4 alt5 ARM_TDI
    PUT32(GPFSEL0,ra);

    ra=GET32(GPFSEL2);
    ra&=~(7<<6); //gpio22
    ra|=3<<6; //alt4 ARM_TRST
    ra&=~(7<<12); //gpio24
    ra|=3<<12; //alt4 ARM_TDO
    ra&=~(7<<15); //gpio25
    ra|=3<<15; //alt4 ARM_TCK
    ra&=~(7<<21); //gpio27
    ra|=3<<21; //alt4 ARM_TMS
    PUT32(GPFSEL2,ra);

}
开发者ID:stestagg,项目名称:baremetalpi,代码行数:25,代码来源:platform.c


示例14: uart_init

//------------------------------------------------------------------------
void uart_init ( void )
{
    unsigned int ra;

    PUT32(UART0_CR,0);

    ra=GET32(GPFSEL1);
    ra&=~(7<<12); //gpio14
    ra|=4<<12;    //alt0
    ra&=~(7<<15); //gpio15
    ra|=4<<15;    //alt0
    PUT32(GPFSEL1,ra);

    PUT32(GPPUD,0);
    for(ra=0;ra<150;ra++) dummy(ra);
    PUT32(GPPUDCLK0,(1<<14)|(1<<15));
    for(ra=0;ra<150;ra++) dummy(ra);
    PUT32(GPPUDCLK0,0);

    PUT32(UART0_ICR,0x7FF);
    PUT32(UART0_IBRD,1);
    PUT32(UART0_FBRD,40);
    PUT32(UART0_LCRH,0x70);
    PUT32(UART0_CR,0x301);
}
开发者ID:optixx,项目名称:raspberrypi,代码行数:26,代码来源:uartx01.c


示例15: spi_init

void spi_init(void)
{
	//Alternate fn 0 for GPIO 7,8,9,10,11
	GPIO_Funtion_Select0_t gpiofnsel0;
	gpiofnsel0 = (GPIO_Funtion_Select0_t) GET32(GPIO_REG_GPFSEL0);
	gpiofnsel0.mBits.FunctionSelGPIO7 = GPIO_SET_alternate_function_0;
	gpiofnsel0.mBits.FunctionSelGPIO8 = GPIO_SET_alternate_function_0;
	gpiofnsel0.mBits.FunctionSelGPIO9 = GPIO_SET_alternate_function_0;
	PUT32(GPIO_REG_GPFSEL0,gpiofnsel0.mAsU32);
	
	GPIO_Funtion_Select1_t gpiofnsel1;
	gpiofnsel1 = (GPIO_Funtion_Select1_t) GET32(GPIO_REG_GPFSEL1);
	gpiofnsel1.mBits.FunctionSelGPIO10 = GPIO_SET_alternate_function_0;
	gpiofnsel1.mBits.FunctionSelGPIO11 = GPIO_SET_alternate_function_0;
	PUT32(GPIO_REG_GPFSEL1,gpiofnsel1.mAsU32);
	
	//Configure gpio 24,25 as output. 25 is for data/command selection. 24 is for Interrupt
	volatile GPIO_Funtion_Select2_t GPIOFnsel2;
	GPIOFnsel2 = (GPIO_Funtion_Select2_t)GET32(GPIO_REG_GPFSEL2);
	GPIOFnsel2.mBits.FunctionSelGPIO25 = GPIO_SET_AS_OUTPUT;
	PUT32(GPIO_REG_GPFSEL2,GPIOFnsel2.mAsU32);
		
	//Set clk speed
	SPI_clk_Reg_t spiclkspeed;
	spiclkspeed = (SPI_clk_Reg_t)GET32(SPI_CLK_DIVIDER);
	spiclkspeed.mBits.clk_div = BCM2835_SPI_CLOCK_DIVIDER_4;
	PUT32(SPI_CLK_DIVIDER,spiclkspeed.mAsU32);
	
	//Set the SPI control register
	SPI_control_Reg_t spictrlreg;
	spictrlreg = (SPI_control_Reg_t) GET32(SPI_CONTROL_STATUS_REGISTER);
	spictrlreg.mAsU32 = 0x00000030;
	PUT32(SPI_CONTROL_STATUS_REGISTER,spictrlreg.mAsU32);	
}
开发者ID:arjunhary,项目名称:Raspberry_pi_baremetal_arjun,代码行数:34,代码来源:SPI.c


示例16: audioixp_chip_init

/*
 * audioixp_chip_init()
 *
 * Description:
 *	This routine initializes ATI IXP audio controller and the AC97
 *	codec.
 *
 * Arguments:
 *	audioixp_state_t	*state		The device's state structure
 *
 * Returns:
 *	DDI_SUCCESS	The hardware was initialized properly
 *	DDI_FAILURE	The hardware couldn't be initialized properly
 */
static int
audioixp_chip_init(audioixp_state_t *statep)
{
	/*
	 * put the audio controller into quiet state, everything off
	 */
	CLR32(IXP_AUDIO_CMD, IXP_AUDIO_CMD_EN_OUT_DMA);
	CLR32(IXP_AUDIO_CMD, IXP_AUDIO_CMD_EN_IN_DMA);

	/* AC97 reset */
	if (audioixp_reset_ac97(statep) != DDI_SUCCESS) {
		audio_dev_warn(statep->adev, "AC97 codec reset failed");
		return (DDI_FAILURE);
	}

	if (audioixp_codec_ready(statep) != DDI_SUCCESS) {
		audio_dev_warn(statep->adev, "AC97 codec not ready");
		return (DDI_FAILURE);
	}

	/* enable interrupts */
	PUT32(IXP_AUDIO_INT, 0xffffffff);
	PUT32(
	    IXP_AUDIO_INT_EN,
	    IXP_AUDIO_INT_EN_IN_DMA_OVERFLOW |
	    IXP_AUDIO_INT_EN_STATUS |
	    IXP_AUDIO_INT_EN_OUT_DMA_UNDERFLOW);
	return (DDI_SUCCESS);

}	/* audioixp_chip_init() */
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:44,代码来源:audioixp.c


示例17: blink

static void blink(void)
{
	PUT32(GPSET0,1<<BIT);
	mdelay(500);
	PUT32(GPCLR0,1<<BIT);
	mdelay(500);
}
开发者ID:bartjanisse,项目名称:BeerTender,代码行数:7,代码来源:blink_pi_module.c


示例18: disable_watchdog

void disable_watchdog ( void )
{
    PUT32(WDT_WSPR,0xAAAA);
    while(GET32(WDT_WWPS)&(1<<4)) continue;
    PUT32(WDT_WSPR,0x5555);
    while(GET32(WDT_WWPS)&(1<<4)) continue;
}
开发者ID:dwelch67,项目名称:beaglebone_samples,代码行数:7,代码来源:uart01.c


示例19: timer_init

//------------------------------------------------------------------------
void  timer_init ( void )
{
    //0xF9+1 = 250
    //250MHz/250 = 1MHz
    PUT32(ARM_TIMER_CTL,0x00F90000);
    PUT32(ARM_TIMER_CTL,0x00F90200);
}
开发者ID:3100102709,项目名称:raspberrypi,代码行数:8,代码来源:periph.c


示例20: init_hw

/*
 * Start_hw
 */
void
init_hw()
{
    unsigned int ra;
    unsigned int rx;

    for(unsigned int i=bss_start;i<bss_end;i+=4)
      PUT32(i,0);
    uart_init();
    
    /* Init audio interface */
    /* music_init(); */

    /* /\* Make gpio pin tied to the led an output *\/ */
    /* ra=GET32(GPFSEL1); */
    /* ra&=~(7<<18); */
    /* ra|=1<<18; */
    /* PUT32(GPFSEL1,ra); */
    /* PUT32(GPSET0,1<<16); //led off */

    
    /* Set up delay before timer interrupt (we use CM1) */
    rx=GET32(SYSTIMERCLO);
    rx += INTERVAL;
    PUT32(C1,rx);
    
    /* Enable irq triggering by the *system timer* peripheral */
    /*   - we use the compare module CM1 */
    enable_timer_irq();
    
    /* Enable interrupt *line* */
    PUT32(0x2000B210, 0x00000002);
}
开发者ID:halflings,项目名称:process-scheduler,代码行数:36,代码来源:hw.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PUTC函数代码示例发布时间:2022-05-30
下一篇:
C++ PUT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap