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

C++ set_register函数代码示例

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

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



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

示例1: timer2_enable

void timer2_enable()
{
	int i;

	map_mem(TIMER2_BASE, TIMER2_BASE, MMU_SECTION, USER_NO_ACCESS);

	for(i = 0; i < NUM_CALLBACKS; i++)
	{
		callback_vectors[i] = 0x00000000;
	}

        set_register_bit_value(TIMER2_BASE + TIOCP_CFG, 0, 1);

        while(get_register_bit(TIMER2_BASE + TIOCP_CFG, 0));

        set_register_bit_value(TIMER2_BASE + IRQENABLE_SET, 1, 1); // Enable overflow interrupt

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TCLR));

        set_register_bit_value(TIMER2_BASE + TCLR, 1, 1); // Auto reload

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TLDR));

        set_register(TIMER2_BASE + TLDR, 0xff000000); // Load value on reload

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TTGR));
        set_register(TIMER2_BASE + TTGR, 0x00000000);

        while(get_register_bit(TIMER2_BASE + TWPS, W_PEND_TCLR));
        set_register_bit_value(TIMER2_BASE + TCLR, 0, 1); // Start!
}
开发者ID:dankar,项目名称:boneos,代码行数:31,代码来源:timer.c


示例2: exADD

void exADD(enum addr_mode mode, char src,char dst)
{
    char val;
    switch( mode )
    {
        case VAL_REG :
            if(set_register(src, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case REG_REG:
            if(get_register(&val, src)) {
                printf("Bad register access\n");
                exit(-1);
            }
            if(set_register(val, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        default :
            printf("Bad addressing mode\n");
    }
}
开发者ID:dinesh121991,项目名称:M2R-PDES-MOSIG,代码行数:25,代码来源:Emulate-Processor.c


示例3: first_stage

void first_stage(int r2_missing){
  inputs_vector_state[7] = 1; //r7 pending
  inputs_vector_values[7] = 11;
  inputs_vector_refs[7] = 0;

  // Beginning of payload building //

  add_node_to_payload(key_instructions.svc->addr, 0, key_instructions.svc->string, 0, 0, 0);

  // If writer r0 doesn't write into r1 ... //
  if(!gadget_writes_r(key_instructions.write_r0, 1)){
    set_register(1);
  }

  if(!state[0]){
    set_register(0);
  }

  if(!state[2] && !r2_missing){
    set_register(2);
  }

  if(!state[3] && !store_writes_r(7)){
    set_register(7);
  }
}
开发者ID:fervagar,项目名称:frop,代码行数:26,代码来源:p_sh.c


示例4: preSetAbortStates

preSetAbortStates()
{
   SafeGateVal = 0;
   set_register(DDR,SoftwareGates,0);
   set_register(DDR,SoftwareGain,0);
   set_register(DDR,SoftwareAUX,0);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:7,代码来源:ddrFifo.c


示例5: set_register

void Value::assign_register() {
  if (in_register()) {
    return;
  }

#if ENABLE_ARM_VFP
  if (stack_type() == T_FLOAT) {
    set_register(RegisterAllocator::allocate_float_register());
  } else if (stack_type() == T_DOUBLE) {
    set_vfp_double_register(RegisterAllocator::allocate_double_register());
  } else
#endif
  {
    if (!is_two_word()) {
      set_register(RegisterAllocator::allocate());
    } else {
      // NOTE: avoid doing this: set_registers(allocate(), allocate());
      // The order of parameter list evaluation is undefined in C, and
      // on linux/i386 and solaris/sparc the orders are opposite. The following
      // code forces the same order, so AOT generator will generate exact
      // same code on both Linux and Solaris hosts.
      Assembler::Register hi  = RegisterAllocator::allocate();
      Assembler::Register low = RegisterAllocator::allocate();
      set_registers(low, hi);
    }
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:27,代码来源:Value.cpp


示例6: setup_pegasus_II

static inline void setup_pegasus_II(pegasus_t * pegasus)
{
	u16 data = 0xa5;
	
	set_register(pegasus, Reg1d, 0);
	set_register(pegasus, Reg7b, 1);
	mdelay(100);
	if ((pegasus->features & HAS_HOME_PNA) && mii_mode)
		set_register(pegasus, Reg7b, 0);
	else
		set_register(pegasus, Reg7b, 2);

	set_register(pegasus, 0x83, data);
	get_registers(pegasus, 0x83, 1, &data);

	if (data == 0xa5) {
		pegasus->chip = 0x8513;
	} else {
		pegasus->chip = 0;
	}

	set_register(pegasus, 0x80, 0xc0);
	set_register(pegasus, 0x83, 0xff);
	set_register(pegasus, 0x84, 0x01);
	
	if (pegasus->features & HAS_HOME_PNA && mii_mode)
		set_register(pegasus, Reg81, 6);
	else
		set_register(pegasus, Reg81, 2);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:30,代码来源:pegasus.c


示例7: execute

void execute(ARCH arch, uint32_t word)
{
    uint rs, rt, rd, sa;
	uint q, reste;
	uint val_rs, val_rt;
	uint bit_sign;

    parser_typeR(word, &rs, &rt, &rd, &sa);
	val_rs = (arch->registers)[rs];
	val_rt = (arch->registers)[rt];
	
	if (val_rt == 0) {
		set_register(arch, SR, 4096);
		print_error("can't divide by zero");
	}
	else {
		q = val_rs / val_rt;
		reste = val_rs % val_rt;
		set_register(arch, HI, q);
		set_register(arch, LO, reste);
		
		bit_sign = parser_instr(q, 31, 31);
		if (bit_sign == 1)
			set_register_bit(arch, SR, 7);	

		if (q == 0 && reste == 0) 
			set_register_bit(arch, SR, 6);	
	}
}
开发者ID:jeanbroid,项目名称:mips,代码行数:29,代码来源:div.c


示例8: disable_eprom_write

static inline void disable_eprom_write(pegasus_t * pegasus)
{
	__u8 tmp;

	get_registers(pegasus, EthCtrl2, 1, &tmp);
	set_register(pegasus, EpromCtrl, 0);
	set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:8,代码来源:pegasus.c


示例9: setXY

static int setXY(int address,unsigned char row,unsigned char col)
{
	if(set_register(address,COMMAND_MODE,0xb0+row))
		return -1;
	if(set_register(address,COMMAND_MODE,0x00+(8*col&0x0f)))
		return -1;
	return set_register(address,COMMAND_MODE,0x10+((8*col>>4)&0x0f));
}
开发者ID:Ourobooros,项目名称:grove-nest,代码行数:8,代码来源:oled.c


示例10: preSetAbortStates

preSetAbortStates()
{
   SafeGateVal = 0;		
   set_register(MASTER,SoftwareGates,0);
   set_register(MASTER,SoftwareSpi0,0);
   set_register(MASTER,SoftwareSpi1,0);
   set_register(MASTER,SoftwareSpi2,0);
   set_register(MASTER,SoftwareAUX,0);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:9,代码来源:masterFifo.c


示例11: test_registers

// Read a bunch of registers to see what happens, for initial debugging
void test_registers()
{
    u_long id;

    id = idcode(id);
    id = get_cpsr();
    id = 0x87654321;
    ice_set(watchpoint0_adr, id);
    id = idcode();
    id = ice_get(watchpoint0_adr);
    set_register(5, 0xaa5533cc);
    set_register(12, 0x1234fedc);
    id = get_register(5);
    id = get_register(12);
}
开发者ID:MitchBradley,项目名称:cforth,代码行数:16,代码来源:at91sam7jtag.c


示例12: exMOV

void exMOV(enum addr_mode mode, char src, char dst)
{
    char val;
    switch( mode )
    {
        case VAL_REG :
            if(set_register(src, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case REG_REG:
            if(get_register(&val, src)) {
                printf("Bad register access\n");
                exit(-1);
            }
            if(set_register(val, dst)) {
                printf("Bad register access\n");
                exit(-1);
            }
            break;
        case ADDR_REG :
            if( get_address( &val,src ))
            {
                printf("Bad Address Location -RO\n");
                exit(-1);
            }
            if( set_register( val, dst ))
            {
                printf("Bad Register access \n");
                exit(-1);
            }
            break;
        case REG_ADDR :
            if( get_register( &val,src ))
            {
                printf("Bad Register Access \n");
                exit(-1);
            }
            if( set_address( val,dst))
            {
                printf("Bad Address Location -RO \n");
            }
            break;
        default :
            printf("Bad addressing mode\n");
    }
}
开发者ID:dinesh121991,项目名称:M2R-PDES-MOSIG,代码行数:48,代码来源:Emulate-Processor.c


示例13: Radio_Transmit

uint8_t Radio_Transmit(radiopacket_t* payload, RADIO_TX_WAIT wait)
{
	//if (block && transmit_lock) while (transmit_lock);
	//if (!block && transmit_lock) return 0;
	uint8_t len = 32;

	// indicate that the driver is transmitting.
    transmit_lock = 1;

	// disable the radio while writing to the Tx FIFO.
    ioport_set_pin_low (CE);

	set_tx_mode();

    // for auto-ack to work, the pipe0 address must be set to the Tx address while the radio is transmitting.
    // The register will be set back to the original pipe 0 address when the TX_DS or MAX_RT interrupt is asserted.
    set_register(RX_ADDR_P0, (uint8_t*)tx_address, ADDRESS_LENGTH);

    // transfer the packet to the radio's Tx FIFO for transmission
    send_instruction(W_TX_PAYLOAD, payload, NULL, len);

    // start the transmission.
    ioport_set_pin_high (CE);

    if (wait == RADIO_WAIT_FOR_TX)
    {
    	while (transmit_lock);
    	return tx_last_status;
    }

    return RADIO_TX_SUCCESS;
}
开发者ID:magnealvnor,项目名称:TTK4155_Gruppe2_TermProject,代码行数:32,代码来源:radio.c


示例14: reset_pipe0_address

/**
 * Reset the pipe 0 address if pipe 0 is enabled.  This is necessary when the radio is using Enhanced Shockburst, because
 * the pipe 0 address is set to the transmit address while the radio is transmitting (this is how the radio receives
 * auto-ack packets).
 */
static void reset_pipe0_address(void)
{
	if (rx_pipe_widths[RADIO_PIPE_0] != 0)
	{
		// reset the pipe 0 address if pipe 0 is enabled.
		set_register(RX_ADDR_P0, (uint8_t*)rx_pipe0_address, ADDRESS_LENGTH);
	}
}
开发者ID:magnealvnor,项目名称:TTK4155_Gruppe2_TermProject,代码行数:13,代码来源:radio.c


示例15: GUARANTEE

void Value::force_to_byte_register() {
  GUARANTEE(in_register(), "must be in register");
  if (!Assembler::is_valid_byte_register(lo_register())) {
    Assembler::Register byte_register = RegisterAllocator::allocate_byte_register();
    Compiler::code_generator()->movl(byte_register, lo_register());
    set_register(byte_register);
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:8,代码来源:Value.cpp


示例16: resetSafeVals

/*
 * reset fpga SW register to their safe values
 * used if other code uses the SW register to set hardware
 *
 *  Author Greg Brissey    1/12/05
 */
void resetSafeVals()
{
   extern void resetClearReg();
   extern void resetDelays();
   set_register(GRADIENT,SoftwareGates,SafeGateVal);
   set_register(GRADIENT,SoftwareUser,0);
   set_register(GRADIENT,SoftwareXAmp,SafeXAmpVal);
   set_register(GRADIENT,SoftwareYAmp,SafeYAmpVal);
   set_register(GRADIENT,SoftwareZAmp,SafeZAmpVal);
   set_register(GRADIENT,SoftwareB0Amp,SafeB0AmpVal);
   set_register(GRADIENT,SoftwareXEcc,SafeXEccVal);
   set_register(GRADIENT,SoftwareYEcc,SafeYEccVal);
   set_register(GRADIENT,SoftwareZEcc,SafeZEccVal);
   set_register(GRADIENT,SoftwareB0Ecc,SafeB0EccVal);
   resetClearReg();
   resetDelays();
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:23,代码来源:gradient.c


示例17: Oled_set

static int Oled_set (void * _self, va_list *app)
{
	struct Oled *self = _self;
	char *text =  va_arg(*app, char *);
	BYTE type =  va_arg(*app, const BYTE);	
	BYTE bkground_colour =  va_arg(*app, const BYTE);	
	BYTE x =  va_arg(*app, const BYTE);
	BYTE y =  va_arg(*app, const BYTE);
	if(set_register(self->devaddress,COMMAND_MODE,bkground_colour))//Reset Mode register
		return -1;
	
	if(type != IMAGE)
	{
		setXY(self->devaddress,x,y);
		int i;
		while(*text)
		{
			for(i=0;i<8;i++)
			{
				SendChar(self->devaddress,myFont[(*text-0x20)][i]);
			}			
			text++;
		}
	}
	else
	{
		int dim =  va_arg(*app, const int);
		int i = 0;
		//set memory addressing
		if(set_register(self->devaddress,COMMAND_MODE,0x00))//Reset memory addressing
			return -1;
		if(set_register(self->devaddress,COMMAND_MODE,x))//Reset memory addressing
			return -1;
		if(set_register(self->devaddress,COMMAND_MODE,y))//Reset memory addressing
			return -1;
		for(i=0;i<dim;i++)
		{
			SendChar(self->devaddress,*text);
			text++;

		}
	}	
			
	
	return 0;
}
开发者ID:Ourobooros,项目名称:grove-nest,代码行数:46,代码来源:oled.c


示例18: send_reload_radio

void send_reload_radio (){
  
  set_rf_mode(RF_STANDBY);
  set_rf_mode(RF_SYNTHESIZER);
  set_register(FTPRIREG, (FTPRIREG_SET & 0xFD) | 0x02);
  set_rf_mode(RF_STANDBY);
  set_rf_mode(RF_RECEIVER);
}
开发者ID:BeeeOn,项目名称:sensors,代码行数:8,代码来源:phy.c


示例19: Radio_Set_Tx_Addr

// default transmitter address is 0xe7e7e7e7e7.
void Radio_Set_Tx_Addr(uint8_t* address)
{
	tx_address[0] = address[0];
	tx_address[1] = address[1];
	tx_address[2] = address[2];
	tx_address[3] = address[3];
	tx_address[4] = address[4];
	set_register(TX_ADDR, address, ADDRESS_LENGTH);
}
开发者ID:magnealvnor,项目名称:TTK4155_Gruppe2_TermProject,代码行数:10,代码来源:radio.c


示例20: initBrdSpecific

/*
 * all board type specific initializations done here.
 *
 */
initBrdSpecific(int bringup_mode)
{
   XYZshims[0] = XYZshims[1] = XYZshims[2];
   initSPI();   /* initialize SPI to proper configuration */
   startGradParser(GRADPARSER_TASK_PRIORITY, STD_TASKOPTIONS, STD_STACKSIZE);
   set_register(GRADIENT,FIFOECCCalcSelect,3);
   gradCmdPubPatternSub();
   startShimRestorer(200,STD_TASKOPTIONS, STD_STACKSIZE);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:13,代码来源:gradient.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ set_rounding函数代码示例发布时间:2022-05-30
下一篇:
C++ set_reg_field_value函数代码示例发布时间: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