本文整理汇总了C++中GPIOPinIntClear函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIOPinIntClear函数的具体用法?C++ GPIOPinIntClear怎么用?C++ GPIOPinIntClear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GPIOPinIntClear函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
{
}
}
示例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);
}
}
示例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 );
}
示例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;
}
示例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
}
示例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();
}
}
示例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);
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
示例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);
}
示例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;
}
示例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);
}
示例15: GPIOPinIntClear
void GpioIn::enableInterrupts(void)
{
// Clear the interrupt
GPIOPinIntClear(gpio_.port, gpio_.pin);
// Enable the interrupt
GPIOPinIntEnable(gpio_.port, gpio_.pin);
}