Hi TI Team,
We interfacing a 4x4 keypad with TMDSEVM6678LE, We want to do interrupt-based keypress scanning. That's why, We follow the CLS API, In this code We want to generate the interrupt while columns are being pressed (as per this C0, C1, C2, and C3). It's the correct code or setup for the interrupt generation on the GPIO(pind). And How to use Interrupt Vector IDs which are mentioned in <ti/csl/soc/c6678/src/cslr_device.h> and <ti/csl/src/intc/csl_intc.h>.
We share the code, Please review it and give us any suggestions.
Warmest regards,
Krishn Singh Chauhan
CSL_IntcContext context; CSL_IntcGlobalEnableState state; CSL_IntcEventHandlerRecord EventRecord[10]; CSL_IntcParam vectId; CSL_GpioHandle hGpio; CSL_Status intStat; CSL_IntcObj intcObj20; CSL_IntcHandle hIntc20; CSL_IntcDropStatus drop; CSL_IntcContext Intcontext; Uint32 intrStat; //for the Column 0, GPIO interrupt 15 void C0_init_interrupt_controllers(){ CSL_IntcGlobalEnableState state; Intcontext.numEvtEntries = 10; Intcontext.eventhandlerRecord = EventRecord; CSL_intcInit(&Intcontext); /* Enable NMIs */ CSL_intcGlobalNmiEnable(); /* Enable Global Interrupts */ CSL_intcGlobalEnable(&state); /* Initialize the chip level CIC CSL handle. */ // Opening a handle for the Event 20 at vector id 4 vectId = CSL_INTC_VECTID_4; hIntc20 = CSL_intcOpen (&intcObj20, CSL_GEM_GPINT15, &vectId , NULL); if (hIntc20 == 0) { printf("Cannot initialize CPINTC\n"); return; } } //for the Column 1, GPIO interrupt 14 void C1_init_interrupt_controllers(){ CSL_IntcGlobalEnableState state; Intcontext.numEvtEntries = 10; Intcontext.eventhandlerRecord = EventRecord; CSL_intcInit(&Intcontext); /* Enable NMIs */ CSL_intcGlobalNmiEnable(); /* Enable Global Interrupts */ CSL_intcGlobalEnable(&state); /* Initialize the chip level CIC CSL handle. */ // Opening a handle for the Event 20 at vector id 4 vectId = CSL_INTC_VECTID_4; hIntc20 = CSL_intcOpen (&intcObj20, CSL_GEM_GPINT14, &vectId , NULL); if (hIntc20 == 0) { printf("Cannot initialize CPINTC\n"); return; } } //for the Column 2, GPIO interrupt 11 void C2_init_interrupt_controllers(){ CSL_IntcGlobalEnableState state; Intcontext.numEvtEntries = 10; Intcontext.eventhandlerRecord = EventRecord; CSL_intcInit(&Intcontext); /* Enable NMIs */ CSL_intcGlobalNmiEnable(); /* Enable Global Interrupts */ CSL_intcGlobalEnable(&state); /* Initialize the chip level CIC CSL handle. */ // Opening a handle for the Event 20 at vector id 4 vectId = CSL_INTC_VECTID_4; hIntc20 = CSL_intcOpen (&intcObj20, CSL_GEM_GPINT11, &vectId , NULL); if (hIntc20 == 0) { printf("Cannot initialize CPINTC\n"); return; } } //for the Column 3, GPIO interrupt 13 void C3_init_interrupt_controllers(){ CSL_IntcGlobalEnableState state; Intcontext.numEvtEntries = 10; Intcontext.eventhandlerRecord = EventRecord; CSL_intcInit(&Intcontext); /* Enable NMIs */ CSL_intcGlobalNmiEnable(); /* Enable Global Interrupts */ CSL_intcGlobalEnable(&state); /* Initialize the chip level CIC CSL handle. */ // Opening a handle for the Event 20 at vector id 4 vectId = CSL_INTC_VECTID_4; hIntc20 = CSL_intcOpen (&intcObj20, CSL_GEM_GPINT13, &vectId , NULL); if (hIntc20 == 0) { printf("Cannot initialize CPINTC\n"); return; } }