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

C++ GPIOPinIntClear函数代码示例

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

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



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

示例1: main

void main(void)
	{
	SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

	GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_1);
	GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);

	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0); /* led */

    GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
    GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

	GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_RISING_EDGE);
	GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_RISING_EDGE);

	GPIOPinIntEnable(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
	GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_1);

	IntMasterEnable();
    IntEnable(INT_GPIOE);
    IntEnable(INT_GPIOF);
    GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
    GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_1);
    while(1)
    	{
    	}
	}
开发者ID:jeremiaslehmann,项目名称:IntGPIO,代码行数:29,代码来源:main.c


示例2: Keypad

void Keypad(void*data)
{
  while (1)
  {
          // RIT128x96x4StringDraw(" KKEYPAD   ", 20, 80, 15);
     
       keypad *myKey = (keypad*) data;
       if (UpFlag){
       *myKey->driveMotorSpeedInc=TRUE; UpFlag=FALSE;
       }
       if(globalCounter%500==0)
       {
          
          GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_2); 
          IntEnable(INT_GPIOE);
       }
       if(DownFlag){
       *myKey->driveMotorSpeedDec=TRUE;DownFlag=FALSE;
       }
       if(globalCounter%500==0)
       { 
         
          GPIOPinIntClear(GPIO_PORTD_BASE, GPIO_PIN_5);
        IntEnable(INT_GPIOD);
        }

    vTaskDelay(500);
  }
}
开发者ID:suix2,项目名称:InUW,代码行数:29,代码来源:Functions.c


示例3: ctl_buttons_isr_init

//ISR INIT
void ctl_buttons_isr_init(CTL_ISR_FN_t fn)
{
int en; int32u proba;
en=ctl_global_interrupts_set(0);
buttons_isr=fn;
SysCtlPeripheralEnable(PUSHBUTTON_PERIPH);
//UNLOCKOLNI KELL A PF0 REGISZTERT MERT NMI-RE VAN ALLITVA
HWREG(PUSHBUTTON_PORT + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
HWREG(PUSHBUTTON_PORT + GPIO_O_CR) |= 0x01;
HWREG(PUSHBUTTON_PORT + GPIO_O_LOCK) = 0;

GPIODirModeSet(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH , GPIO_DIR_MODE_IN);
GPIOPadConfigSet(PUSHBUTTON_PORT,LEFT_SWITCH | RIGHT_SWITCH , GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOPinIntDisable(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH);
if((GPIOPinIntStatus(PUSHBUTTON_PORT, 1)) == LEFT_SWITCH )
{
 GPIOPinIntClear(PUSHBUTTON_PORT, LEFT_SWITCH );
}
if((GPIOPinIntStatus(PUSHBUTTON_PORT, 1)) == RIGHT_SWITCH )
{
 GPIOPinIntClear(PUSHBUTTON_PORT, RIGHT_SWITCH );
}
ctl_set_priority(PUSHBUTTON_IRQ_PRIORITY, 1);
ctl_unmask_isr(PUSHBUTTON_IRQ_PRIORITY);
ctl_global_interrupts_set(en);
GPIOIntTypeSet(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH , GPIO_BOTH_EDGES); //GPIO_BOTH_EDGES
GPIOPinIntEnable(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH );
}
开发者ID:fegyizoli,项目名称:zolcsirobot,代码行数:29,代码来源:robot_buttons.c


示例4: IntWheelSensor

void IntWheelSensor()
{
	CPU_INT32U         ulStatusR_A;
	CPU_INT32U         ulStatusL_A;

	static CPU_INT08U CountL = 0;
	static CPU_INT08U CountR = 0;

	static CPU_INT08U data = 0;

	ulStatusR_A = GPIOPinIntStatus(RIGHT_IR_SENSOR_A_PORT, DEF_TRUE);
	ulStatusL_A = GPIOPinIntStatus(LEFT_IR_SENSOR_A_PORT, DEF_TRUE);

        if (ulStatusR_A & RIGHT_IR_SENSOR_A_PIN)
        {
          GPIOPinIntClear(RIGHT_IR_SENSOR_A_PORT, RIGHT_IR_SENSOR_A_PIN);           /* Clear interrupt.*/
          CountR = CountR + 1;
        }

        if (ulStatusL_A & LEFT_IR_SENSOR_A_PIN)
        {
          GPIOPinIntClear(LEFT_IR_SENSOR_A_PORT, LEFT_IR_SENSOR_A_PIN);
          CountL = CountL + 1;
        }

	if((CountL >= Left_tgt) && (CountR >= Right_tgt))
        {
          data = 0x11;
          Left_tgt = 0;
          Right_tgt = 0;
          CountL = 0;
          CountR = 0;
          BSP_MotorStop(LEFT_SIDE);
          BSP_MotorStop(RIGHT_SIDE);
        }
        else if(CountL >= Left_tgt)
        {
          data = 0x10;
          Left_tgt = 0;
          CountL = 0;
          BSP_MotorStop(LEFT_SIDE);
        }
        else if(CountR >= Right_tgt)
        {
          data = 0x01;
          Right_tgt = 0;
          CountR = 0;
          BSP_MotorStop(RIGHT_SIDE);
        }
        return;
}
开发者ID:gouravmodi1991,项目名称:6154_Embedded_Operating_System,代码行数:51,代码来源:app.c


示例5: PinChangeIntHandler

// Interrupt handler
void PinChangeIntHandler (void) {
	unsigned long ul_A_Val;
	unsigned long ul_B_Val;
	int current_state;
	// Clear the interrupt (documentation recommends doing this early)
	GPIOPinIntClear (GPIO_PORTF_BASE, GPIO_PIN_7);
	GPIOPinIntClear (GPIO_PORTF_BASE, GPIO_PIN_5);

	ul_A_Val = GPIOPinRead (GPIO_PORTF_BASE, GPIO_PIN_7); // Read the pin
	ul_B_Val = GPIOPinRead (GPIO_PORTF_BASE, GPIO_PIN_5);

	if (!ul_A_Val){ //Check what state the pins at and assign that state to "current state"
		if(!ul_B_Val){
			current_state = 1;
		}
		else{
			current_state = 2;
		}
	}
	else{
		if(ul_B_Val){
			current_state = 3;
		}
		else{
			current_state = 4;
		}
	}
	// Check if the previous state is different from the current state.
	// Determine what direction the encoder is spinning
	if (current_state != prev_state){
		if (abs(prev_state-current_state) == 1){
			if(current_state>prev_state){
				encoder_1 --;
			}
			else{
				encoder_1 ++;
			}
		}
		else{
			if(current_state<prev_state){
				encoder_1 --;
			}
			else{
				encoder_1 ++;
			}
		}
	}
	prev_state = current_state; // Assign current state for next time the interrupt runs
}
开发者ID:taylor123454321,项目名称:c_control,代码行数:50,代码来源:main.c


示例6: portBIntHandler

/* The handler for the GPIOPortB Pin4, Pin5 & Pin6 state change interrupt. */
void portBIntHandler(void) {
    //clear the interrupt
    GPIOPinIntClear (GPIO_PORTB_BASE, (GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6));

    int button;
    //Read the state of the pins

    //Select icon clicked to start/stop heli
    if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_4 )) {
    	xSemaphoreGiveFromISR( xBinarySelectSemaphore, pdFALSE );
	}

    //Up icon clicked
    if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_5 )) {
    	button = UP;
    	xQueueSendFromISR( xButtonQueue, &button, NULL );
	}

    //Down icon clicked
    if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_6 )) {
    	button = DOWN;
    	xQueueSendFromISR( xButtonQueue, &button, NULL );
	}

    //Reset icon clicked
    if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_1 )) {
		SysCtlReset();
	}
}
开发者ID:nick-nz,项目名称:embedded-heli-controller,代码行数:30,代码来源:heli_control.c


示例7: button_init

/**
 * Configures the used button as input source
 * Registers gpio_c interrupt..
 */
void button_init(){
	GPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_USER_BUTTON);
	GPIOIntTypeSet(BSP_BUTTON_BASE,BSP_USER_BUTTON,GPIO_FALLING_EDGE);
	GPIOPortIntRegister(BSP_BUTTON_BASE,GPIO_C_Isr_Handler);
	GPIOPinIntClear(BSP_BUTTON_BASE, BSP_USER_BUTTON);
	GPIOPinIntEnable(BSP_BUTTON_BASE, BSP_USER_BUTTON);
}
开发者ID:barriquello,项目名称:iotstack,代码行数:11,代码来源:board.c


示例8: GPIO_SetInterruptTask

// *************** GPIO_SetInterruptTask *************** 					
void GPIO_SetInterruptTask( GPIO_PORT_T port, GPIO_PIN_T pins,
                            unsigned long int_type, unsigned long priority, 
							void (*task)( void ) )
{
	unsigned long port_base = GPIO_PortBase[port];

	// Set the interrupt task for the specified port and pins
	if     ( pins & 0x01 ) GPIO_PinISR[port][0] = task;
	else if( pins & 0x02 ) GPIO_PinISR[port][1] = task; 
	else if( pins & 0x04 ) GPIO_PinISR[port][2] = task;
	else if( pins & 0x08 ) GPIO_PinISR[port][3] = task;
	else if( pins & 0x10 ) GPIO_PinISR[port][4] = task;
	else if( pins & 0x20 ) GPIO_PinISR[port][5] = task;
	else if( pins & 0x40 ) GPIO_PinISR[port][6] = task;
	else if( pins & 0x80 ) GPIO_PinISR[port][7] = task;

	// Set the event type and priority, and clear the interrupt
	IntPrioritySet( GPIO_IntAssignment[port], priority );	 
	GPIOIntTypeSet( port_base, pins, int_type );
	GPIOPinIntClear( port_base, pins);

	// Enable interrupts
	IntEnable( GPIO_IntAssignment[port] );
 	GPIOPinIntEnable( port_base, pins );
}
开发者ID:yguo89,项目名称:CodeBrain,代码行数:26,代码来源:GPIO_Driver.c


示例9: vs_requesthandler

void vs_requesthandler(void)
{
  unsigned int len, tail;

  GPIOPinIntClear(GPIO_PORTA_BASE, GPIO_PIN_1);

  len = vs_buflen();
  if(len != 0)
  {
    if(len > 16)
    {
      len = 16;
    }
    vs_ssi_writewait(); //ssi transmit fifo full?
    VS_DCS_DISABLE();
    tail = vs_buftail;
    VS_DCS_ENABLE();
    for(; len!=0; len--)
    {
      vs_ssi_write(vs_buf.b8[tail]);
      if(++tail == VS_BUFSIZE)
      {
        tail = 0;
      }
    }
    vs_buftail = tail;
  }
  else
  {
    vs_pause();
  }

  return;
}
开发者ID:Bob4ik888,项目名称:WebRadio,代码行数:34,代码来源:vs.c


示例10: vs_pause

void vs_pause(void)
{
  GPIOPinIntDisable(GPIO_PORTA_BASE, GPIO_PIN_1); //disable dreq irq
  GPIOPinIntClear(GPIO_PORTA_BASE, GPIO_PIN_1);

  return;
}
开发者ID:Bob4ik888,项目名称:WebRadio,代码行数:7,代码来源:vs.c


示例11: GPIO_PortG_ISR

void GPIO_PortG_ISR( void )
{ 
	unsigned char int_status = 0;
	GPIO_PIN_T    pin        = 0;

	// Figure out which pin caused the interrupt
	int_status = GPIOPinIntStatus( GPIO_PORTG_BASE, true );
	if( int_status & 0x01 )      pin = 0;				  
	else if( int_status & 0x02 ) pin = 1;	 	  
	else if( int_status & 0x04 ) pin = 2;	  
	else if( int_status & 0x08 ) pin = 3;	  
	else if( int_status & 0x10 ) pin = 4;	 
	else if( int_status & 0x20 ) pin = 5;
	else if( int_status & 0x40 ) pin = 6;
	else if( int_status & 0x80 ) pin = 7;

	// Acknowledge and diable interrupts for this pin.
   // GPIOPinIntDisable( GPIO_PORTG_BASE, int_status ); 
    GPIOPinIntClear( GPIO_PORTG_BASE, int_status );  

	// Call the task function for this pin's interrupt
	GPIO_PinISR[GPIO_PORT_G][pin]();

	// Enable interrupts for the pin. XXX Does this provide enough
	// debouncing for GPIO interrupts? If not, we can set a flag in
	// main that enables interrupts after a set amount of time. 
    //GPIOPinIntEnable( GPIO_PORTG_BASE, int_status ); 					  
}
开发者ID:yguo89,项目名称:CodeBrain,代码行数:28,代码来源:GPIO_Driver.c


示例12: GPIOFIntHandler

void
GPIOFIntHandler(void)
{
    // Clear the GPIO interrupt.
    GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_1);

    y = 0;
    // Counter for how long the snooze button was pressed
    while (GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_1)==0){
    	y++;
       }
    // If the snooze button was held long enough, add 5 minutes to the alarm
    if (y>500000){
    	int z;
    	for (z=0; z<5; z++){
    		IncrementTimeA();
        }
    }
    // Clear the screen
    RIT128x96x4Clear();
    // Turn off the LED
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);
    // Turn off the alarm
    PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT | PWM_OUT_1_BIT, false);
    PWMGenDisable(PWM0_BASE, PWM_GEN_0);
    // Disable the interrupt so that snooze and turn off alarm cannot be used
    GPIOPinIntDisable(GPIO_PORTF_BASE, GPIO_PIN_1);
}
开发者ID:drosales007,项目名称:EmbeddedHW,代码行数:28,代码来源:alarmClock.c


示例13: PortBIntHandler

void PortBIntHandler (void)	// Interrupt handler called upon IR receive
{
	// Reset delay counter
	waitTime=0;		

	// Turn on Status light upon first IR receive
	GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_0,0x01);	
	
	// skip repeating IR pulse sequences
	if(!checkProtocol())							
		return;
		
	// 2 second delay between button presses	
	if(waitTime2 < 20000)							
	{
		flag = 1;
	}
	else
	{
		flag = 0;
	}
			
	// parse IR pulse sequence data
	getData();
	
	// concatenate corresponding character to display buffer
	decodeLetter(decode(string));

	
	// clear interrupt
	GPIOPinIntClear(GPIO_PORTB_BASE, GPIO_PIN_1);
	
	// reset delay between button presses
	waitTime2=0;
}
开发者ID:richardszeto,项目名称:Embedded_Systems,代码行数:35,代码来源:Lab3_8962.c


示例14: GPIO_PortF_IntHandler

void GPIO_PortF_IntHandler(void) {
	GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);
	GPIOPinIntDisable(GPIO_PORTF_BASE, GPIO_PIN_4);
	Encoder_Count++;
	GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4);

}
开发者ID:AlpNov,项目名称:Embedded-Robot,代码行数:7,代码来源:shaft_encoder.c


示例15: GPIOPinIntClear

void GpioIn::enableInterrupts(void)
{
    // Clear the interrupt
    GPIOPinIntClear(gpio_.port, gpio_.pin);

    // Enable the interrupt
    GPIOPinIntEnable(gpio_.port, gpio_.pin);
}
开发者ID:openwarelab,项目名称:firmware,代码行数:8,代码来源:GpioIn.cpp


示例16: SW_IntHandler

void SW_IntHandler(void)
{
    GPIOPinIntClear(GPIO_PORTC_BASE, GPIO_PIN_5);
    printf("Switch PUSH\r\n");

    QEIPositionSet(QEI0_BASE, 0);

}
开发者ID:choeunsol,项目名称:myCortex-LM8962_example,代码行数:8,代码来源:encoder.c


示例17: RF22_PinIntHandler

void RF22_PinIntHandler(void)
{
	if(GPIOPinIntStatus(RFM_22_PORT_INT, false) & RFM_22_PIN_INT)
	{
		RF22_isr0();
	}
	GPIOPinIntClear(RFM_22_PORT_INT, RFM_22_PIN_INT);
}
开发者ID:igbt6,项目名称:MeteoStation,代码行数:8,代码来源:RF22.c


示例18: EncoderInterruptHandler

void EncoderInterruptHandler(void)
{
	int temp = 0;
	unsigned char pin, pinA, pinB;
	unsigned port;
	signed dir;
	volatile encoder_count_t *p_encCount;
	
	if((GPIOPinIntStatus(port=GPIO_PORTC_BASE, false) & (pin=GPIO_PIN_5)))
	{
		// encoder 0 fired!
		pinA = GPIO_PIN_5;
		pinB = GPIO_PIN_4;
		dir = dir0;
		p_encCount = &enc0;
	}
	else if(GPIOPinIntStatus(port=GPIO_PORTB_BASE, false) & (pin=GPIO_PIN_4))
	{
		// encoder 0 fired!
		pinA = GPIO_PIN_5;
		pinB = GPIO_PIN_4;
		dir = -dir0;
		p_encCount = &enc0;
	}
	else if(GPIOPinIntStatus(port=GPIO_PORTC_BASE, false) & (pin=GPIO_PIN_6))
	{
		// encoder 1 fired!
		pinA = GPIO_PIN_6;
		pinB = GPIO_PIN_6;
		dir = dir1;
		p_encCount = &enc1;
	} 
	else if (GPIOPinIntStatus(port=GPIO_PORTB_BASE, false) & (pin=GPIO_PIN_6))
	{
		// encoder 1 fired!
		pinA = GPIO_PIN_6;
		pinB = GPIO_PIN_6;
		dir = -dir1;
		p_encCount = &enc1;
	} else return;
	GPIOPinIntClear(port, pin);
	
	if(GPIOPinRead(GPIO_PORTC_BASE, pinA))	++temp;	// channel A
	if(GPIOPinRead(GPIO_PORTB_BASE, pinB))	++temp;	// channel B

	switch(temp)
	{
	case 0:	// both channels == 0
	case 2:	// both channels == 1
		// channel A == channel B
		*p_encCount += dir;	// --> moving forward
		break;
	case 1:	// one channel == 1 and the other == 0
		// channel A != channel B
		*p_encCount -= dir;	// --> moving backward
		break;
	}
}
开发者ID:weng-frank,项目名称:RAS_LM3S811,代码行数:58,代码来源:encoder.c


示例19: IntGPIOe

/** Port E interrupt service routine
@note Must be configured in startup_ccs.c or else will not be called.
*/
void IntGPIOe(void)
{
    buttonIsr(0);   // Button 0 was pressed
#ifdef TIVA
    GPIOIntClear(GPIO_PORTE_BASE, GPIO_PIN_4);					//Clear interrupts
#else
    GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_4);					//Clear interrupts
#endif
}
开发者ID:vtoanb,项目名称:msp430lioamaintain,代码行数:12,代码来源:hal_ek-lm4f120XL.c


示例20: GPIO_3A_ISR

void GPIO_3A_ISR(void)
{
    if(GPIOPinIntStatus(SOC_GPIO_3_REGS, GPIO_INT_LINE_1, LCD_INT_PIN))
    {
    	LCD_Interrupt(FALSE);
    	LCD_SetInterruptFlag();
        GPIOPinIntClear(SOC_GPIO_3_REGS, GPIO_INT_LINE_1, LCD_INT_PIN);
    }
}
开发者ID:dwhitfield6,项目名称:BeagleBone_Smart_Controler,代码行数:9,代码来源:INTERRUPTS.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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