ECE 330 Homework 9 Fall 2010 Due: 10/25/2010

advertisement
ECE 330
Due: 10/25/2010
Homework 9
Fall 2010
1. Create functions that satisfy the implied functionality of
the following C language prototypes. You may code the functions
in any language that you wish.
a. void bsu_irq_enable_all (unsigned int status);
The bsu_irq_enable_all() function enables all interrupts
that were previously disabled by bsu_irq_disable_all(). The
input argument, status, is the value returned by a previous
call to bsu_irq_disable_all()
b. unsigned int bsu_irq_disable_all (void);
The bsu_irq_disable_all() function disables all interrupts.
Return: Pass the return value as the input argument to a
subsequent call to bsu_irq_enable_all().
c. void bsu_irq_enable (unsigned int irqnbr);
The bsu_irq_enable() function enables a single interrupt.
d. void bsu_irq_disable (unsigned int irqnbr);
The bsu_irq_disable() function disables a single interrupt.
e. void bsu_irq_register (int irqnbr, void (*handler)(void));
The bsu_irq_register() function registers an ISR. If the
function is successful, the requested interrupt is enabled
upon return. The input argument, id is the interrupt to
enable, isr is the function that is called when the
interrupt is active, context and id are the two input
arguments to isr.
For this function you can use the following array for the
function pointers.
void * IRQ_TABLE[32];
Provide test code with snapshots at specific points that
exercises the functionality of each of the functions. Using the
test code in the debugger capture snap shots of the appropriate
registers that verify that the functions are performing
properly.
For function e, verify that it enables the irq and that the
function address is correct and placed into the proper location
in the array.
Rev. 1
Page 1 of 1
Download