InterruptMask library allows masking/unmasking GPIO interrupts (attached to either the rise or falling edges). It also allows clearing pending interrupts which may come handy before unmasking them.
Diff: InterruptMask.cpp
- Revision:
- 4:a34eddd0a2be
- Parent:
- 3:7b8a744ac27a
--- a/InterruptMask.cpp Tue Feb 18 15:44:49 2014 +0000 +++ b/InterruptMask.cpp Wed Feb 19 04:35:24 2014 +0000 @@ -1,3 +1,12 @@ +//***************************************************************************// +/* InterruptMask Library */ +/* Napoleon Leoni, February 18,2014*/ +/* This class enables masking a GPIO interrupt from a specific MBED pin */ +// Note to get the actual pin number in the LPC of an mbed pin in P0 +// simply do pN-P0_0, for example p12-P0_0=17, that is pin 12 in the mbed +// corresponds to Port[0].17 or bit 17 of port 0. +//***************************************************************************// +// Example Code is in the header file: InterruptMask.h // #include "InterruptMask.h" //default constructor required, should not be use will yield error @@ -42,7 +51,7 @@ case p28: case p29: case p30: - //These pins are in Port 0 of the LPC1768, so the proper register is selected below + //These pins are in Port 2 of the LPC1768, so the proper register is selected below IOIntEnF = &(LPC_GPIOINT->IO2IntEnF); IOIntEnR = &(LPC_GPIOINT->IO2IntEnR); IOIntClr = &(LPC_GPIOINT->IO2IntClr);