Utility to print interrupt handlers

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
User avatar
Panu
VLSI Staff
Posts: 2510
Joined: Tue 2010-06-22 13:43

Utility to print interrupt handlers

Post by Panu » Mon 2018-05-28 15:16

Here's a small utility to print addresses of interrupt handlers.
VS1010>interrupts
Interrupts:
DAC 0x20:0x923b, pri 2 -> 0x923b
SP1 0x24:0x8d1b, pri 1 -> 0x8d1b
RX0 0x2d:0x9b94, pri 1 -> 0x9b94
TI2 0x30:0x80e9, pri 1 -> 0x80e9
RX2 0x31:0x9bf8, pri 2 -> 0x9bf8
Here's the code:

Code: Select all

void PrintInterrupts() {
	const char *intName[] = {
		"DAC","USB","XPR","SP0","SP1","NMI","MMS","GP0",
		"GP1","GP2","FCC","I2S","TX0","RX0","TI0","TI1",
		"TI2","RX2","TX2","SRC","DAO","RTC","SRX","STX",
		"POS","PWR","PWM","SAR","na1","na2","na3","na4"
	};
	
	u_int32 h, l;
	u_int16 i;
		
	printf("Interrupts:\n");
	h = ((u_int32)PERIP(INT_ENABLE1_HP) << 16) | PERIP(INT_ENABLE0_HP);
	l = ((u_int32)PERIP(INT_ENABLE1_LP) << 16) | PERIP(INT_ENABLE0_LP);
	for (i=0; i<32; i++) {
		int pri = ((u_int16)l&1) | (((u_int16)h&1)<<1);
		l >>= 1;
		h >>= 1;
		if (pri) {
			u_int16 addr = (u_int16)(ReadIMem((void *)(0x20+i))>>6L);
			printf("%s 0x%02x:0x%04x, pri %d",intName[i],0x20+i,addr,pri);
			printf(" -> %p\n",(void*)((ReadFromProgramRam(0x20+i)>>6L)&0xffff));
		}
	}
}
Attachments
arch-interrupts-2018-05-28-16-14-v1.zip
Source code and executable, VSIDE Solution
(12.41 KiB) Downloaded 4 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Post Reply