hi, sorry for my posts, i'm trying to configure an ssi transmission by pressing a button, how can i do for handle an interrupt on PB5?a part of the code i wrote is the following:
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_5); //pulsante
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_5, GPIO_RISING_EDGE);
GPIOPinIntEnable(GPIO_PORTB_BASE, GPIO_PIN_5);
IntEnable(GPIO_PORTB_BASE);
IntMasterEnable();
SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3,
SSI_MODE_MASTER, 5000, 16);
SSIEnable(SSI0_BASE);
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_7);
GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, GPIO_PIN_2);
while(1)
{
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_7);
GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, GPIO_PIN_2);
{ int i; //int j;
if (GPIOPinRead(GPIO_PORTB_BASE, GPIO_PIN_5)) {
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, 0);
for (i = 0; i < 200000; i++) {
}
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_7);
SSIDataPut(SSI0_BASE, 0x0002);
while(SSIBusy(SSI0_BASE)){}
}
}
}
}
void Miointerrupt(void)
{ int i;
if (GPIOPinRead(GPIO_PORTB_BASE, GPIO_PIN_5)) {
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, 0);
for (i = 0; i < 20000; i++) {
}
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_PIN_7);
SSIDataPut(SSI0_BASE, 0xf0f0);
while(SSIBusy(SSI0_BASE)){}
GPIOPinIntClear(GPIO_PORTB_BASE, GPIO_PIN_5);
}
}
i don't understand how handle interrupts....
thanks!