Hello,
I am maintaining a section of legacy code, which is a DMTimer1_1ms and its overflow interrupt service routine.
NDK 3.61.1.01
SYS/BIOS 6.76.3.01
am335x PDK 1.0.17
The DMTimer1_1ms initialization is as below.
void DMTimer_init() { HW_WR_REG32(CM_WKUP_TIMER1_CLKCTRL, 2); // Enable DMTimer1_1ms HW_WR_REG32(CM_CLKSEL_TIMER1MS_CLK, 0); // Clock source = CLK_M_OSC (25 MHz for A3-P) HW_WR_REG32(DMTIMER1_TIER, 2); // Enable OVF interrupt HW_WR_REG32(DMTIMER1_TPIR, 0); // No TPIR is needed for 24MHz HW_WR_REG32(DMTIMER1_TNIR, 0); // No TNIR is needed for 24MHz HW_WR_REG32(DMTIMER1_TCRR, 0xFFFFA240); // 24M/16K = -1500 HW_WR_REG32(DMTIMER1_TLDR, 0xFFFFA240); // 24M/16K = -1500 Hwi_enableInterrupt(67); // Enable DMTimer_1ms interrupt HW_WR_REG32(DMTIMER1_TCLR, 0x3); // Enable timer and auto-load }
The DMTimer_1ms overflow interrupt is enabled from this initialization.
The interrupt service routine is as below.
void MainLoop_1ms(UArg arg0) { Isr_1ms_Routine_(); HW_WR_REG32(0x44e31018, 2); // Clear OVF interrupt flag return; }
Now the timer works fine, and the interrupt service routine is called and works fine.
My question is that where and how the connection between MainLoop_1ms and the interrupt is.
Because I am going to use another timer to replace this 1ms timer, I know how to set the Int Number but don't how to connect to the function I create for this interrupt.
My previous experience of using 28235 is to map the funtion name to PIE Vector Table. It is like below, RoutineForTimer2 is the name I give for the interrupt service routine. From this mapping, we can know the connection between RoutineForTimer2 and the interrupt generated by timer2.
PieVectTable.TINT2 = (PINT) &RoutineForTimer2;
Come back to AMIC110, I am not able to know where and how this mapping is.
Thank you.
Kind regards,
Sandro