Here are some macros to initialize the VIC: #define paste(front, back) front ## back #define VIC_VECT_ADDR(slot, isr) paste(VICVectAddr, slot) = (unsigned long) isr #define VIC_VECT_CNTL(slot, channel) paste(VICVectCntl, slot) = 0x20 | channel #define VIC_INT_ENABLE(channel) VICIntEnable = 0x00000001 << channel // Slot definitions (lower number is higher priority) #define VIC_SLOT_UART0 0 #define VIC_SLOT_UART1 1 // Channel definitions #define VIC_CHANNEL_UART0 6 #define VIC_CHANNEL_UART1 7 Here is an example of how to use the macros: VIC_VECT_ADDR(VIC_SLOT_UART0, Uart0Interrupt); VIC_VECT_CNTL(VIC_SLOT_UART0, VIC_CHANNEL_UART0); VIC_INT_ENABLE(VIC_CHANNEL_UART0); This way you can keep your interrupt priorites in a separate file and change them transparently for different applications. Thanks, JT
Message
VIC Macros
2004-08-03 by johnthomasedwardtimm
Attachments
- No local attachments were found for this message.