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


C++ GPIOIntClear函数代码示例

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


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


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