Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

VIC Macros

VIC Macros

2004-08-03 by johnthomasedwardtimm

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

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.