The dspic-utility.h header file defines a number of macros for manipulating the interrupt priority level (IPL) of the microcontroller, and for using the DISI instruction.
To use these macros, you can use the -I compiler option to add the dsPIC Helper Library source directory to the compiler command line, and then include the header file like so:
#include <dspic-utility.h>
This macro raises the IPL to 7, disabling all maskable interrupts. The previous IPL is saved in a global variable for use by STI().
This macro restores the IPL to the value saved by the CLI() macro.
This macro raises the IPL to 7, disabling all maskable interrupts. Unlike CLI(), the current IPL value is not saved.
This macro emits the DISI instruction with the given count. This disables interrupts for n + 1 cycles.
This macro emits the DISI instruction to disable interrupts for the maximum number of cycles. This macro can be used with DISI_CLEAR() to disable interrupts for a reasonably short, but unknown number of instructions.
This macro clears the DISICNT register to re-enable interrupts after a call to DISI_MAX() or DISI_SET().