/** @file het.h
*   @brief HET Driver Definition File
*   @date 11.August.2009
*   @version 1.00.000
*   
*   (c) Texas Instruments 2009, All rights reserved.
*/

#ifndef __HET_H__
#define __HET_H__

#include "sys_common.h"

typedef enum 
{
	ON = 0,	
	OFF
}Switch_type;

/** @struct hetBase
*   @brief HET Base Register Definition
*
*   This structure is used to access the HET module registers.
*/
typedef volatile struct hetBase
{
  uint32 GCR;	/* global control register */
  uint32 PFR;	/* prescale factor register */
  uint32 ADDR;	/* current address register */
  uint32 OFF1;	/* offset level 1 register */
  uint32 OFF2;	/* offset level 2 register */
  uint32 EXC1;    /* exceptions interrupt control register 1 */
  uint32 EXC2;    /* exceptions interrupt control register 2 */
  uint32 INTPRI;	/* interrupt priority register */
  uint32 INTFLAG;	/* interrupt flag register */
  uint32 fill1;   /* reserved */
 
  uint32 HETAND;
  uint32 HRSHARE;	/* HR share control register */
  uint32 XORSHARE;   /* XOR SHARE */
  uint32 CCDIR;	/* capture-compare direction register */
  uint32 CCDIN;	/* capture-compare input data register */
  uint32 CCDWR;	/* capture-compare write */
  uint32 CCDSET;	/* capture-compare set */
  uint32 CCDCLR;	/* capture-compare clear */
  uint32 HETPDR;  /* open drain */
  uint32 HETPULDIS; /* pull disable*/
  uint32 HETPSL;  /* pull select*/ 
  uint32 HETSRS;  /* Slew Rate*/
  uint32 reserved1;
  uint32 reserved2;
 
  uint32 HETLPBSEL; /* loopback pair */
  uint32 HETLPBDIR; /* loopback mode direction */	
  uint32 HETPCR;   /* HET Parity Control Register */
  uint32 HETPIEN;  /* HET Interrupt Enable Register */
  uint32 HETPIFLG; /* HET Interrupt Flag Register */
  uint32 HETPAR;   /* HET Parity Address Register */
} hetBASE_t;

/** @def hetREG
*   @brief HET Register Frame Pointer
*
*   This pointer is used by the HET driver to access the het module registers.
*/
#define hetREG   ((hetBASE_t *)0xFFF7B800U)

#define hetMEM   0xFF460000U

/* HET Interface Functions */

void HET_Parity(void);
void HET_Err_Pin_Ctrl(Switch_type Control);

#endif
