/** 
 *   @file  Interrupt.h
 *
 *   @brief  
 *      Header file with data structure and API declarations for Interrupt Configuration.
 * 
 *  \par
 *  ============================================================================
 *  @n   (C) Copyright 2010, Texas Instruments, Inc.
 *  @n   Use of this software is controlled by the terms and conditions found 
 *  @n   in the license agreement under which this software has been supplied.
 *  ===========================================================================
 *  \par
 */
#ifndef _INTERRUPT_H
#define _INTERRUPT_H

/* RTS include */
#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C"
{
#endif

#define CPINTC0_MAX_SYSTEM_INT_NUM   (208)
#define CPINTC1_MAX_SYSTEM_INT_NUM   (160)
#define CPINTC2_MAX_SYSTEM_INT_NUM   (64)
#define CPINTC0_MAX_CHANNEL_NUM      (159)
#define CPINTC1_MAX_CHANNEL_NUM      (59)
#define CPINTC2_MAX_CHANNEL_NUM      (42)

#define MAX_SYSTEM_CPINTC_EVENT       (1)
#define MAX_SYSTEM_VECTOR             (1) 

#define MAX_CORE_VECTOR               (12)
#define MAX_CORE_NUM                  (4)


typedef struct
{
	uint32_t inst;    // 0: CPINTC0, 1: CPINTC1, 2: CPINTC2
	uint32_t event;   // system events ID
	uint32_t channel; // channel
}cpintcCfg;

typedef struct
{ 
	uint32_t core;        // CoreID
	uint32_t event;       // INTC event
	CSL_IntcVectId vect;  // Core interrupt vector
	CSL_IntcEventHandler isr;
}interruptCfg;

void CSL_CPINTC_generateSysInterrupt();
int32_t intcInit();
int32_t initCPINTC();
int32_t registerInterrupt ();

#ifdef __cplusplus
}
#endif
						
#endif  /* __INTERRUPT_H__ */

