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


C++ GPIOIntTypeSet函数代码示例

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


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

示例1: Input_Init

void Input_Init(void) {
    // Mo clock cho ngoai vi
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

    // Cau hinh la ngo vao cho port F
    GPIODirModeSet(GPIO_PORTF_BASE, 0x1F,
    GPIO_DIR_MODE_IN);

    // Cau hinh la ngo vao cho port E
    GPIODirModeSet(GPIO_PORTE_BASE, 0x0F,
    GPIO_DIR_MODE_IN);

    // Cau hinh tro keo len cho port F
    GPIOPadConfigSet(GPIO_PORTF_BASE, 0x1F,
    GPIO_STRENGTH_2MA,
    GPIO_PIN_TYPE_STD_WPU);

    GPIOPadConfigSet(GPIO_PORTE_BASE, 0x0F,
    GPIO_STRENGTH_2MA,
    GPIO_PIN_TYPE_STD_WPU);

    // Cau hinh va enable ngat cho port F
    GPIOIntTypeSet(GPIO_PORTF_BASE, 0x1F, GPIO_RISING_EDGE);
    IntEnable(INT_GPIOF);
    GPIOIntEnable(GPIO_PORTF_BASE, 0x1F);

    GPIOIntTypeSet(GPIO_PORTE_BASE, 0x0F, GPIO_RISING_EDGE);
    IntEnable(INT_GPIOE);
    GPIOIntEnable(GPIO_PORTE_BASE, 0x0F);
}
开发者ID:datho1801,项目名称:TivaC_TUT,代码行数:31,代码来源:main_alt.c

示例2: setup

void setup(void){
	//Enable the driver layer
	SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
	                       SYSCTL_XTAL_16MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

	//Pinout connections:
	//
	GPIOPinTypeGPIOInput(GPIO_PORTA_BASE,GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
	GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7, GPIO_STRENGTH_2MA,
	                     GPIO_PIN_TYPE_STD_WPU);
	GPIOIntTypeSet(GPIO_PORTA_BASE, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7,GPIO_FALLING_EDGE);
	GPIOPinTypeGPIOInput(GPIO_PORTB_BASE,GPIO_PIN_4);
	GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA,
		                     GPIO_PIN_TYPE_STD_WPU);
	GPIOIntTypeSet(GPIO_PORTB_BASE,GPIO_PIN_4,GPIO_FALLING_EDGE);
	GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_5|GPIO_PIN_4);
	GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_1|GPIO_PIN_0);
	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_2|GPIO_PIN_1|GPIO_PIN_3);

	GPIOPinIntEnable(GPIO_PORTA_BASE, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
	GPIOPinIntEnable(GPIO_PORTB_BASE,GPIO_PIN_4);
	IntMasterEnable();
	IntEnable(INT_GPIOA);
	IntEnable(INT_GPIOB);
	GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_0, 0);
	GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0);
	GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0);
	GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_5, 0);

}
开发者ID:dmanchon,项目名称:stellaris-launchpad-keypad-4x4,代码行数:35,代码来源:usb_dev_keyboard.c

示例3: initYaw

// *****************************************************************************
void initYaw (void)
{
    // Register the handler for Port F into the vector table
    GPIOPortIntRegister (GPIO_PORTF_BASE, YawChangeIntHandler);

    // Enable and configure the port and pin used:  input on PF5: Pin 27 & PF7: Pin 29
    SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOF);
    GPIOPadConfigSet (GPIO_PORTF_BASE, GPIO_PIN_5 | GPIO_PIN_7, GPIO_STRENGTH_2MA,
       GPIO_PIN_TYPE_STD_WPU);

    // Set up the pin change interrupt (both edges)
    GPIOIntTypeSet (GPIO_PORTF_BASE, GPIO_PIN_5 | GPIO_PIN_7, GPIO_BOTH_EDGES);

    // Enable the pin change interrupt
    GPIOPinIntEnable (GPIO_PORTF_BASE, GPIO_PIN_5 | GPIO_PIN_7);
    IntEnable (INT_GPIOF);	// Note: INT_GPIOF defined in inc/hw_ints.h

    //Registering Port D into the vector Table (Refwewnce point)
    GPIOPortIntRegister (GPIO_PORTD_BASE, referencePosIntHandler);

    GPIOPadConfigSet (GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
	//
	// Set up the pin change interrupt (both edges)
    GPIOIntTypeSet (GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_BOTH_EDGES);
    //
    // Enable the pin change interrupt for PD0
    GPIOPinIntEnable (GPIO_PORTD_BASE, GPIO_PIN_0);

}
开发者ID:Yamoahs,项目名称:ENCE361_Helicopter_project,代码行数:30,代码来源:milestone2_MotorControl(PID)3.c

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

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

示例6: vs_init

void vs_init(void)
{
  DEBUGOUT("VS: init\n");

  vs_playing = 0;

  //reset vs buffer
  vs_bufreset();

  //reset vs
  vs_reset();

  //set volume, bass, treble
  vs_setvolume(DEFAULT_VOLUME);
  vs_setbassfreq(DEFAULT_BASSFREQ);
  vs_setbassamp(DEFAULT_BASSAMP);
  vs_settreblefreq(DEFAULT_TREBLEFREQ); 
  vs_settrebleamp(DEFAULT_TREBLEAMP);

  //init pin interrupt
  GPIOIntTypeSet(GPIO_PORTA_BASE, GPIO_PIN_1, GPIO_HIGH_LEVEL);
  GPIOPortIntRegister(GPIO_PORTA_BASE, vs_requesthandler);

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

示例7: GPIOPinTypeGPIOInput

lswitch::lswitch(memory_address_t lswitch_base, memory_address_t lswitch_pin,
                 semaphore *sem, utimer_t timer_id, subtimer_t timer_subtimer,
                 uint32_t switch_interrupt, uint32_t interrupt_mask, bool start) {

    base = lswitch_base;
    pin = lswitch_pin;

    ctlsys::enable_periph(base);
    GPIOPinTypeGPIOInput(base, pin);
    GPIODirModeSet(base, pin, GPIO_DIR_MODE_IN);

    if ((base == GPIO_PORTF_BASE) && (pin & GPIO_PIN_0)) {
        HWREG(base + GPIO_O_LOCK) = GPIO_LOCK_KEY;
        HWREG(base + GPIO_O_CR) = 0x01;
        HWREG(base + GPIO_O_LOCK) = 0;

        GPIOPadConfigSet(base, pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
    }

    /* other solution: timer scoreboard */
    this->tim = timer(timer_id, timer_subtimer, TIMER_CFG_ONE_SHOT, SysCtlClockGet() / 50,
                      ctlsys::timer_timeout_from_subtimer(timer_subtimer));

    GPIOIntTypeSet(base, pin, switch_interrupt);
    IntEnable(interrupt_mask);

    this->sem = sem;
    *(this->sem) = semaphore();

    if (start) {
        this->start();
    }
}
开发者ID:r2labs,项目名称:uncleos,代码行数:33,代码来源:switchpp.cpp

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

示例10: EK_TM4C123GXL_initGPIO

/*
 *  ======== EK_TM4C123GXL_initGPIO ========
 */
void EK_TM4C123GXL_initGPIO(void) {

	GPIOPadConfigSet(GPIO_PORTA_BASE,GPIO_PIN_2,GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPD);
	GPIOPadConfigSet(GPIO_PORTA_BASE,GPIO_PIN_3,GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPD);

	GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_2); /* ENC_A */
	GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_3); /* ENC_B */
	GPIOIntTypeSet(GPIO_PORTA_BASE,GPIO_PIN_2,GPIO_INT_BOTH_EDGES);

	GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_2); /* Load cell clock*/
	GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_3); /* Load cell data*/


	GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0); /* Test Button 1*/
	GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_1); /* Test Button 2*/
	GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_2); /* Test Button 3*/

	/* Setup the LED GPIO pins used */
	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1); /* Test led 2 */
	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); /* Test led 3 */


	/* PF0 requires unlocking before configuration */
	HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
	HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= GPIO_PIN_0;
	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0); /* Test led 1 */

	HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_M;

	/* Once GPIO_init is called, GPIO_config cannot be changed */
	GPIO_init();


}
开发者ID:plurryinc,项目名称:embeded-test,代码行数:37,代码来源:EK_TM4C123GXL.c

示例11: EK_TM4C123GXL_initWiFi

/*
 *  ======== EK_TM4C123GXL_initWiFi ========
 */
void EK_TM4C123GXL_initWiFi(void)
{
	/* Configure EN & CS pins to disable CC3100 */
	GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_4);
	GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_PIN_0);
	GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0);

	/* Configure SSI2 for CC3100 */
	SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
	GPIOPinConfigure(GPIO_PB4_SSI2CLK);
	GPIOPinConfigure(GPIO_PB6_SSI2RX);
	GPIOPinConfigure(GPIO_PB7_SSI2TX);
	GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7);

	/* Configure IRQ pin */
	GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_2);
	GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_2, GPIO_STRENGTH_2MA,
			GPIO_PIN_TYPE_STD_WPD);
	GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_2, GPIO_RISING_EDGE);

	SPI_init();
	EK_TM4C123GXL_initDMA();

	WiFi_init();
}
开发者ID:plurryinc,项目名称:embeded-test,代码行数:28,代码来源:EK_TM4C123GXL.c

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

示例13: setup_buttonInterrupts

void setup_buttonInterrupts(){

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4);
	GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_0);

	GPIOIntEnable(GPIO_PORTF_BASE, (GPIO_INT_PIN_1 | GPIO_INT_PIN_2 | GPIO_INT_PIN_4));
	GPIOIntRegister(GPIO_PORTF_BASE, bHandler);
	GPIOIntTypeSet(GPIO_PORTF_BASE, (GPIO_PIN_1 | GPIO_PIN_2 | GPIO_INT_PIN_4) , GPIO_FALLING_EDGE);

	GPIOIntEnable(GPIO_PORTB_BASE, GPIO_INT_PIN_0);
	GPIOIntRegister(GPIO_PORTB_BASE, brakeHandler);
	GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE);

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

示例14: hw_init

void hw_init(void){
	SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

	f_cpu = SysCtlClockGet();
	SysTickPeriodSet(0xffffffff);
	SysTickEnable();
//	UARTStdioInit();

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
	GPIODirModeSet(SONAR_PORT, TRIG_PIN, GPIO_DIR_MODE_OUT);
	GPIODirModeSet(SONAR_PORT, SERVO_PIN, GPIO_DIR_MODE_OUT);

	GPIOPinTypeGPIOInput(SONAR_PORT, ECHO_PIN);
	GPIOIntTypeSet(SONAR_PORT, ECHO_PIN, GPIO_RISING_EDGE);
	GPIOPinIntEnable(SONAR_PORT,ECHO_PIN);
	IntEnable(INT_GPIOD);

	//Timer configuration
	SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
	TimerConfigure(TIMER0_BASE, TIMER_CFG_A_PERIODIC);
	const long timer_match = (f_cpu/1000000)*10;
	const long timer_out = (f_cpu/1000)*80;
	TimerLoadSet(TIMER0_BASE, TIMER_A, timer_out);
	TimerMatchSet(TIMER0_BASE, TIMER_A, timer_match);
	TimerEnable(TIMER0_BASE, TIMER_A);
	TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
	TimerIntClear(TIMER0_BASE,TIMER_A);
	IntEnable(INT_TIMER0A);

	IntMasterEnable();

}
开发者ID:gluker,项目名称:sonar,代码行数:32,代码来源:main.c

示例15: IRIntHandler

void IRIntHandler(void) {
	uint32_t ulTimerVal;

	ulTimerVal = TimerValueGet(IR_TIMER_BASE, IR_TIMER);  //Read timer value

// Reset the timer
	TimerLoadSet(IR_TIMER_BASE, IR_TIMER, g_ulIRPeriod);
	ir_timeout_flag = 0;

	if (ir_pulse_count == 0) {
// Change the IO pin to trig on RISING, because after this we are
// counting IR detector pulses, starting with RISING edge
		GPIOIntTypeSet(IR_PORT, IR_PIN, GPIO_RISING_EDGE);

// Start the timer
		TimerEnable(IR_TIMER_BASE, IR_TIMER);
	} else {
		TimerEnable(IR_TIMER_BASE, IR_TIMER);
		if (ir_pulse_count < MAX_PULSE_COUNT)
			pulse_buf[ir_pulse_count - 1] = (int) (g_ulIRPeriod - ulTimerVal)
					/ g_ulCountsPerMicrosecond;
	}
	ir_pulse_count++;

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


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