Hi,
I am working on the MMWCAS-DSP-EVM board, object-detection usecase.
I want to use GPIO6_14 as an input sinchronization clock. From the schematics, I saw that this GPIO is connected to a TP and I checked that in the code is it not used for anything else, which means that I can use it, am I right?
I want to use it in interrupt mode, and I want the ISR to run on the DSP.
Below is my code. Is that correct ? I am not sure about the line "BspOsal_irqXbarConnect(CSL_XBAR_INST_DSP2_IRQ_32,CSL_XBAR_GPIO6_IRQ_1);" . Can interrupt_num be any number ?
Where can I find some documentation ?
UInt32 interrupt_num = 32;
UInt32 gpio_base_address = SOC_GPIO6_BASE;
UInt32 gpio_pin = 14;
void gpioIsr(void *arg)
{
// Disable interrupt
GPIOPinIntDisable(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
GPIOPinIntClear(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
Vps_printf(" Interrupt received\n");
// Enable interrupt
GPIOPinIntEnable(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
}
and then, inside AlgorithmFxn_RadarDspCascadeMimoCreate
{
BspOsal_irqXbarConnect(CSL_XBAR_INST_DSP1_IRQ_32, CSL_XBAR_GPIO6_IRQ_1);
BspOsal_registerIntr(interrupt_num, (IntrFuncPtr)gpioIsr,(void *) 0);
//Reset GPIO
GPIOModuleReset(gpio_base_address);
//Enable GPIO
GPIOModuleEnable(gpio_base_address);
// Set interrupt type
GPIOIntTypeSet(gpio_base_address, gpio_pin, GPIO_INT_TYPE_RISE_EDGE);
// Set pin direction as input
GPIODirModeSet(gpio_base_address, gpio_pin, GPIO_DIR_INPUT);
//Clear interrupt
GPIOPinIntDisable(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
GPIOPinIntClear(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
//Enable interrupt
GPIOPinIntEnable(gpio_base_address, GPIO_INT_LINE_1, gpio_pin);
}
Regards,
Sara Salvador