上一篇硬件连接已完成。GPIO端口已配置。
下面需要配置SPI端口和XINT中断。
DRDY(GPIO5)在ADC转换完成后下降沿触发中断XINT1,进入中断服务程序xint1ISR()
void GPIO_XINTInit(void)
{
//
// Interrupts that are used in this example are re-mapped to ISR functions
// found within this file.
//
Interrupt_register(INT_XINT1, &xint1ISR);
//
// Enable XINT interrupts
//
Interrupt_enable(INT_XINT1);
//
// Each sampling window will be 510 SYSCLKOUT cycles. Note that this
// function actually sets the qualification period for GPIOs 0 through 7
// (if they are using qualification).
//
GPIO_setQualificationPeriod(5, 510);
//
// Select GPIO5 as XINT1
//
GPIO_setInterruptPin(5, GPIO_INT_XINT1);
//
// Configure XINT1 to be a triggered by a falling edge
//
GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_FALLING_EDGE);
//
// Enable XINT1
//
GPIO_enableInterrupt(GPIO_INT_XINT1);
}
<