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

C++ GPIOIntClear函数代码示例

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

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



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

示例1: ButtonHandler

void ButtonHandler(){
	uint32_t mask=GPIOIntStatus(GPIO_PORTF_BASE,false);

	uint8_t value=0;

	if(mask & GPIO_PIN_4){
		//Boton izquierdo
		value= GPIOPinRead(GPIO_PORTF_BASE,GPIO_PIN_4);
		if(value==0){
			//boton pulsado
			// Activa el Timer4A (empezara a funcionar)
			TimerEnable(TIMER4_BASE, TIMER_A);
			pulsacionLarga=true;

		}else{
			TimerDisable(TIMER4_BASE,TIMER_A);

			if(pulsacionLarga){
				xEventGroupSetBits(xEventGroup, PilotoAutomaticoBit);
				if((xTaskCreate(PilAuto, (signed portCHAR *)"Piloto Auto", LED1TASKSTACKSIZE,NULL,tskIDLE_PRIORITY + 1, &PilautTaskHandle) != pdTRUE))
				{
					while(1);
				}
			}
		}

	}

	if(mask & GPIO_PIN_0){
		//boton derecho
		xEventGroupClearBits( xEventGroup, PilotoAutomaticoBit );
	}

	GPIOIntClear(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4);
}
开发者ID:joseayebenes,项目名称:TivaFly,代码行数:35,代码来源:main.c


示例2: PortKIntHandler

//*****************************************************************************
//
//! This is the Pulse Per Second (PPS) interrupt handler.
//! The updateCounter is incremented on each Pulse per second call, if equal to
//! the update rate, the GPS data is parsed and logged.
//
//*****************************************************************************
void PortKIntHandler(void) {
    uint32_t intStatus = 0;

    //
    // Get the current interrupt status for Port K
    //
    intStatus = GPIOIntStatus(GPIO_PORTK_BASE,true);

    //
    // Clear the set interrupts for Port K
    //
    GPIOIntClear(GPIO_PORTK_BASE,intStatus);

    //
    // Execute code for PK2 interrupt
    //
    if((intStatus & GPIO_INT_PIN_2) == GPIO_INT_PIN_2){
        if (updateRate == updateCounter++) {
            GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, 0x02);
            gpsData();
            GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, 0x00);
            updateCounter = 0;

            //
            // Disable PPS interrupt after one read if in low power mode
            //
            if (lowPowerOn == 1) {
                IntDisable(INT_GPIOK);
                logComplete = 1;
            }
        }
    }
} // End function PortKIntHandler
开发者ID:idaohang,项目名称:launchpad-gps,代码行数:40,代码来源:main.c


示例3: confGPIO

void confGPIO(){
	//Inicializa el puerto F (LEDs) --> No hace falta si usamos la libreria RGB
	 //   ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	 // ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
	//ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);	//LEDS APAGADOS

	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
	SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_GPIOE);



	//Inicializa los LEDs usando libreria RGB
	RGBInit(1);
	SysCtlPeripheralSleepEnable(GREEN_TIMER_PERIPH);
	SysCtlPeripheralSleepEnable(BLUE_TIMER_PERIPH);
	RGBEnable();

	//Inicializamos los botones y su interrupción
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	ButtonsInit();
	GPIOIntClear(GPIO_PORTF_BASE, GPIO_INT_PIN_0|GPIO_INT_PIN_4);
	GPIOIntRegister(GPIO_PORTF_BASE,ButtonHandler);
	GPIOIntTypeSet(GPIO_PORTF_BASE,GPIO_INT_PIN_0|GPIO_INT_PIN_4, GPIO_BOTH_EDGES);
	GPIOIntEnable(GPIO_PORTF_BASE, GPIO_INT_PIN_0|GPIO_INT_PIN_4);
	SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_GPIOF);


}
开发者ID:joseayebenes,项目名称:TivaFly,代码行数:29,代码来源:main.c


示例4: mode2unset

void mode2unset()
{
	GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);		//Clear any existing interrupts
	GPIOIntDisable(GPIO_PORTF_BASE, GPIO_PIN_4);		//Enable the GPIO Interrupts on Port F
	IntDisable(INT_TIMER1A);
	TimerIntDisable(TIMER1_BASE,TIMER_TIMA_TIMEOUT);
}
开发者ID:anshuman94,项目名称:TIVA-C-123G,代码行数:7,代码来源:main.c


示例5: PIOINT1_IRQHandler

/**
 * @brief	interrupt handler, updates timer, when fired
 *
 * */
void PIOINT1_IRQHandler(void)
{
    GPIOIntClear( TRIG_IN_PORT_1, TRIG_IN_PIN_1);
    /* detect change time */
    timeLast1 = timeEdge1;
    timeEdge1 = millis();
}
开发者ID:opprud,项目名称:remote_2_0,代码行数:11,代码来源:trigInput.c


示例6: GPIO_PORTF_isr

//definition of isr for PORT F
void GPIO_PORTF_isr(void)
{
	uint32_t actual_GPIO_PORTF_status=((GPIO_PIN_0 | GPIO_PIN_4) & ~GPIOPinRead(GPIO_PORTF_BASE,GPIO_PIN_0 | GPIO_PIN_4));

	switch (actual_GPIO_PORTF_status)
	{
	case GPIO_PIN_4:																			//if SW1 is pressed
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_PIN_1);								//turn on RED LED
		UARTprintf("RED LED on\n\r");
	break;

	case GPIO_PIN_0:																			//if SW2 is pressed
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);								//turn on BLUE LED
		UARTprintf("BLUE LED on\n\r");
	break;

	case (GPIO_PIN_0|GPIO_PIN_4):																//either SW1 and SW2 are pressed
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_1, GPIO_PIN_2 | GPIO_PIN_1);	//turn on RED & BLUE LEDs
		UARTprintf("RED & BLUE LEDs on\n\r");
	break;

	default:																					//neither SW1 nor SW2 are pressed
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_1 , 0);							//turn off RED & BLUE LEDs
		UARTprintf("RED & BLUE LEDs off\n\r");
	break;

	}

	GPIOIntClear(GPIO_PORTF_BASE, GPIO_INT_PIN_0 | GPIO_INT_PIN_4);

}
开发者ID:Lucast85,项目名称:tm4c123g-communication-expansion-board,代码行数:32,代码来源:main.c


示例7: IntHandlerGPIOPortE

//*****************************************************************************
//
// Called by the NVIC as a result of GPIO port E interrupt event. For this
// application GPIO port E pin 5 is the interrupt line for the ISL29023
//
// Notifies the application that light is outside of threshold limits.
// Task will poll the semaphore and adjust the ranges accordingly.
//
//*****************************************************************************
void
IntHandlerGPIOPortE(void)
{
    unsigned long ulStatus;
    portBASE_TYPE xHigherPriorityTaskWoken;

    ulStatus = GPIOIntStatus(GPIO_PORTE_BASE, true);

    //
    // Clear all the pin interrupts that are set
    //
    GPIOIntClear(GPIO_PORTE_BASE, ulStatus);

    if(ulStatus & GPIO_PIN_5)
    {
        //
        // ISL29023 has indicated that the light level has crossed outside of
        // the intensity threshold levels set in INT_LT and INT_HT registers.
        //
        xSemaphoreGiveFromISR(g_xISL29023AdjustRangeSemaphore,
                              &xHigherPriorityTaskWoken);

        //
        // If the give of this semaphore causes a task to be ready then
        // make sure it has opportunity to run immediately upon return from
        // this ISR.
        //
        if(xHigherPriorityTaskWoken == pdTRUE)
        {
            portYIELD_FROM_ISR(true);
        }
    }
}
开发者ID:nguyenvuhung,项目名称:TivaWare_C_Series-2.1.2.111,代码行数:42,代码来源:isl29023_task.c


示例8: decodeMatrixInput

void decodeMatrixInput() {
	SysCtlDelay(1000000); // debounce wait
	uint32_t input = GPIOPinRead(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);

	if ((input & 0xF0) != 0xF0) // try to decode if something is pushed.
		{
			int i, row = -1, col = -1;
			for (i = 1; i < 5; i++) // get row
			{
				if (!(input & (8 << i)))
					row = i - 1;
			}

			for(i = 0; i < 4; i++) // get col
			{
				GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5, 4 << i);
				if (GPIOPinRead(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7) & (16 << row))
				{
					col = i;
					break;
				}
			}

			if (col != -1 && row != -1)
				activePattern = row * 4 + col; // get the char of the button.
		}

	GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5, 0);

	GPIOIntClear(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
	SysCtlDelay(1000000); // wait to allow button to be lifted
}
开发者ID:samvbeckmann,项目名称:christmas-lights,代码行数:32,代码来源:main.c


示例9: PIOINT2_IRQHandler

/**
 * @brief	interrupt handler, updates timer, when fired
 *
 * */
void PIOINT2_IRQHandler(void)
{
    GPIOIntClear( TRIG_IN_PORT_2, TRIG_IN_PIN_2);
    /* detect change time */
    timeLast2 = timeEdge2;
    timeEdge2 = millis();
}
开发者ID:opprud,项目名称:remote_2_0,代码行数:11,代码来源:trigInput.c


示例10: GPIOPortMIntHandler

//*****************************************************************************
//
// Called by the NVIC as a result of GPIO port M interrupt event. For this
// application GPIO port M pin 3 is the interrupt line for the MPU9150
//
// For BoosterPack 2 Interface use Port M pin 7.
//
//*****************************************************************************
void
GPIOPortMIntHandler(void)
{
    unsigned long ulStatus;

    //
    // Get the status flags to see which pin(s) caused the interrupt.
    //
    ulStatus = GPIOIntStatus(GPIO_PORTM_BASE, true);

    //
    // Clear all the pin interrupts that are set
    //
    GPIOIntClear(GPIO_PORTM_BASE, ulStatus);

    //
    // Check if this is an interrupt on the MPU9150 interrupt line.
    //
    // For BoosterPack 2 use Pin 7 instead.
    //
    if(ulStatus & GPIO_PIN_3) {
        //
        // Turn on the LED to show that transaction is starting.
        //
        LEDWrite(CLP_D3 | CLP_D4, CLP_D3);

        //
        // MPU9150 Data is ready for retrieval and processing.
        //
        MPU9150DataRead(&g_sMPU9150Inst, MPU9150AppCallback, &g_sMPU9150Inst);
    }
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:40,代码来源:compdcm_mpu9150.c


示例11: init_BtnHandler

/*****************************************************
 * 	Function: init_BtnHandler
 *	Description: Initializes button interrupt
 *			Initializes timer for button counter
 *	Input: NONE
 *	Output: NONE
 *****************************************************/
void init_BtnHandler(void)
{
	// Unlock un-maskable pin
	HWREG(BTN_OVERRIDE_REG + GPIO_O_LOCK) = GPIO_LOCK_KEY;

	// Set up our interrupt for button presses
	IntMasterDisable();																				// Disable all interrupts
	GPIOIntDisable(BTN_OVERRIDE_REG, BTN_OVERRIDE);
	GPIOPinTypeGPIOInput(BTN_OVERRIDE_REG, BTN_OVERRIDE);
	GPIOPadConfigSet(BTN_OVERRIDE_REG, BTN_OVERRIDE, GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);		// Set Pull-up
	GPIOIntTypeSet(BTN_OVERRIDE_REG, BTN_OVERRIDE, GPIO_BOTH_EDGES); 								// Set edge to trigger on
	GPIOIntClear(BTN_OVERRIDE_REG, BTN_OVERRIDE); 													// Clear the interrupt bit
	GPIOIntEnable(BTN_OVERRIDE_REG, BTN_OVERRIDE); 													// Enable the interrupt
	IntEnable(INT_GPIOE);

	// Lock un-maskable pin
	HWREG(BTN_OVERRIDE_REG + GPIO_O_LOCK) = 0;

	// Setup timer interrupt for button pressing
	// This timer will run up and when it is released we will check how long it was running
	SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
	TimerConfigure(BTN_OVERRIDE_TIM_BASE, TIMER_CFG_PERIODIC);					// Setup interrupt as 32 bit timer counting up
	TimerLoadSet(BTN_OVERRIDE_TIM_BASE, BTN_OVERRIDE_TIM, clockTime/1000);		// Load Timer
	IntEnable(INT_TIMER0A);
	TimerIntEnable(BTN_OVERRIDE_TIM_BASE, TIMER_TIMA_TIMEOUT);

	// Turn the input pin to the button high
	GPIOPinTypeGPIOOutput(BTN_OVERRIDE_CONTROL_REG, BTN_OVERRIDE_CONTROL);
	GPIOPinWrite(BTN_OVERRIDE_CONTROL_REG, BTN_OVERRIDE_CONTROL, BTN_OVERRIDE_CONTROL);
}
开发者ID:BooRan,项目名称:Auto_Water_TM4,代码行数:37,代码来源:main.c


示例12: mode2set

void mode2set()
{
	GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);		//Clear any existing interrupts
	GPIOIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4);		//Enable the GPIO Interrupts on Port F
	TimerLoadSet(TIMER1_BASE, TIMER_A,SysCtlClockGet()/3);	//Set the Max Value of the timer
	IntEnable(INT_TIMER1A);
	TimerIntEnable(TIMER1_BASE,TIMER_TIMA_TIMEOUT);	//Enable Timer1 Interrupt
}
开发者ID:anshuman94,项目名称:TIVA-C-123G,代码行数:8,代码来源:main.c


示例13: 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


示例14: Interrupt_PB3Init

void Interrupt_PB3Init(void)
{
		GPIOIntRegister(GPIO_PORTB_BASE,Interrupt_PB3Handler);
		ROM_GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_3);
		ROM_GPIOPadConfigSet(GPIO_PORTB_BASE,GPIO_PIN_3,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);
		GPIOIntDisable(GPIO_PORTB_BASE,GPIO_INT_PIN_3);
	  GPIOIntClear(GPIO_PORTB_BASE,GPIO_INT_PIN_3);
		GPIOIntTypeSet(GPIO_PORTB_BASE,GPIO_INT_PIN_3,GPIO_LOW_LEVEL);
}
开发者ID:lengmi,项目名称:PlasterV2_0,代码行数:9,代码来源:Interrupt.c


示例15: onButtonUp

void onButtonUp(void) {
    if (GPIOIntStatus(GPIO_PORTF_BASE, false) & GPIO_PIN_4) {
        // PF4 was interrupt cause
        printf("Button Up\n");
        GPIOIntRegister(GPIO_PORTF_BASE, onButtonDown); // Register our handler function for port F
        GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_FALLING_EDGE);         // Configure PF4 for falling edge trigger
        GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);  // Clear interrupt flag
    }
}
开发者ID:jeetbuz,项目名称:embedded_lab,代码行数:9,代码来源:lab-2.c


示例16: GPIOMotionDetectorIsr

// Interrupt handler for the GPIO motion detector signal
void GPIOMotionDetectorIsr(void) {
	GPIOIntClear(GPIO_PORTA_BASE, GPIO_INT_PIN_2 | GPIO_INT_PIN_5);
#ifdef RUN_AS_MASTER
	motionDetectorTrigged = 1;
#else
	IRIntHandler();
#endif

}
开发者ID:jjaas,项目名称:sparkle,代码行数:10,代码来源:sparkle_main.c


示例17: POLL

//Called when detect SRDY goes low first
  void  POLL(){
	//MRDY Goes LOW (assuming SRDY is LOW)
		MRDY_write(0);

	//Send POLL command to CC2530
	//TODO: Check if the the Type data is also Zero
   		uint8_t *nullByte = (uint8_t *)malloc(1);
		nullByte = "";

			SPI_transfer(nullByte,1);
		//free(nullByte);

	//Start To Recieve Data when SRDY goes HIGH
		uint8_t *RX_data  = malloc(254);
		uint16_t count = 0;
		while (!SRDY_read()){
			SPI_receive(RX_data+count,1);
			count++;
		}

	//call a management function
		//Give the data return from function to cc2530
			//Here We call the registerd function to provide dataToReturn
			commandPasre(RX_data);




		//MRDY Goes HIGH
			MRDY_write(1);


		free(RX_data);

		//Clear Interrupt
		//GPIO_PORTA_ICR_R = 0xFFFFFFFF;
		GPIOIntClear(GPIO_PORTA_BASE,0x00000080);


/*

		SPI_receive(RX_data,1);
		length = *RX_data;

		free(RX_data);
		RX_data= malloc(sizeof(length+3));

		RX_data[0] = length;

		SPI_receive(RX_data+1,length+2);
*/




}
开发者ID:hp5588,项目名称:Tiva_slave,代码行数:57,代码来源:CC2530_Communication.c


示例18: interrupt_handler

void interrupt_handler(void)
{

  GPIOIntClear(GPIO_PORTB_BASE, GPIO_INT_PIN_2);

  if(GPIOPinRead(GPIO_PORTB_BASE, GPIO_PIN_2) == 0x0) {
    isr_flag = 1;

  }
}
开发者ID:phuongtg,项目名称:micro2-1,代码行数:10,代码来源:7segment.c


示例19: interrupt_handler

void interrupt_handler(void)
{
	GPIOIntClear(GPIO_PORTF_BASE, GPIO_INT_PIN_2 | GPIO_INT_PIN_3);
	
	if(GPIOPinRead(port_F, GPIO_PIN_2) == 0x0) { 
		display_flag = 1;

	} 

}
开发者ID:phuongtg,项目名称:micro2-1,代码行数:10,代码来源:random_number.c


示例20: brakeHandler

void brakeHandler(){

	GPIOIntClear(GPIO_PORTB_BASE, GPIO_INT_PIN_0);

	if(GPIOPinRead(GPIO_PORTB_BASE, GPIO_PIN_0) == 0x0)
	{
		enableSys = 0;
	}

}
开发者ID:phuongtg,项目名称:micro2-1,代码行数:10,代码来源:Main+Program.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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