/*******************************************************************************
 * (c) Copyright 2015 Microsemi Corporation.  All rights reserved.
 *
 *
 *
 * SVN $Revision: $
 * SVN $Date: $
 */

#ifndef CFM_ISR_H_
#define CFM_ISR_H_

#include <api_oam_sdk/common/types/inc/mr_api_types.h>
#include "egl_types.h"

/*
 * @brief Initialise the CFM interrupt handler task
 *
 * This function will launch a dedicated task for processing CFM interrupt
 * events. The ISR routine will inform this thread of a CFM event using a
 * semaphore. The task will remain asleep until an event occurs.
 * This function must only be called once at system startup.
 */
void initCfmInterruptHandler(void);

/* @brief Must be called by the ISR used to handle CFM interrupts
 *
 * This function should be called by the ISR used to handle the
 * CFM interrupts. (In the current HW there in just one ISR for MetRoam
 * which shares CFM interrupts and Captured packet interrupts)
 * It is used in conjunction with initCfmInterruptHandler to
 * handle CFM interrupt events
 */
void cfmISRCallback(uint32_t maskBits,uint32_t interruptBits);

int convertEventTlvToIsrRpt(uint8_t* arrayPtr,isrRpt_t* isrRpt, uint16_t arrayLen);

/* @brief This should be called when shutting down the application
 *
 */
void cfm_isr_shutdown(void);
#endif /* CFM_ISR_H_ */
