#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <incap.h>

#ifdef _ICAP3
/********************************************************************
*    Function Name:  ConfigIntCapture3                              *
*    Description:    Set the Enable Interrupts and Interrupt        *
*                    Priorites  to the Interrupt Control and        *
*                    Interrupt Priority Register respectively       *
*    Parameters:     unsigned int config                            *
*                    config[0:2]  -> priority setting               *
*                    config[3]    -> Interrupt Enable/Disable       *
*                    config[4:15] -> unsused                        *
*    Return Value:   None                                           *
********************************************************************/

void ConfigIntCapture3(unsigned int config)
{
    IFS2bits.IC3IF = 0;                   /* Clear IF bit */
    IPC9bits.IC3IP = (config &0x0007);    /* assigning Interrupt Priority 
                                             to IPC Register              */
    IEC2bits.IC3IE = (config &0x0008) >> 3;/* assiging Interrupt Enable/
                                              Disable to IEC Register    */
}

#else
#warning "Does not build on this target"
#endif
