/***************************************************************************/
/*                                                                         */
/*     dsk_lib.h                                                           */
/*                                                                         */
/*     Basic library functions for the DSK                                 */
/*                                                                         */
/***************************************************************************/
/***************************************************************************/ 
#ifndef _DSK_LIB_H_  
#define _DSK_LIB_H_
/****************************************************************************/ 
/*  Include Header File  */
/* Chip definition, change this accordingly */
#define CHIP_6713 1

#include "mmaccfg.h"
#include "global_def.h"

#include <std.h>
#include <log.h>
/*
 *  The POST uses the Chip Support Library for basic definitions as well as
 *  McBSP manipulation.  Programs that use the CSL must include the
 *  appropriate header files.
 */
#include <csl.h> /* CSL library   */
#include <csl_mcbsp.h>/* MCBSP_SUPPORT */
#include <csl_timer.h>
#include <csl_edma.h>/* EDMA_SUPPORT  */
#include <csl_irq.h>     /* IRQ_SUPPORT   */

// add dsk6713bsl.lib from C:\ti13\c6000\dsk6713\lib
#include <dsk6713.h>
//#include <dsk6713_aic23.h>
#include <dsk6713_dip.h>
#include <dsk6713_flash.h>
#include <dsk6713_led.h>


// LED on the connector 
#define DC_LED_Y  0x01
#define DC_LED_R  0x02

#define DC_LED_Yx  0xFE
#define DC_LED_Rx  0xFD

void DC_LED_toggle(Uint32 ledNum);
void DC_LED_on(Uint32 ledNum);
void DC_LED_off(Uint32 LED_Num);


// Timers
#define TIMER_Run(x)		*(unsigned volatile int *)(x) = 0x03C3
#define TIMER_Stop(x)		*(unsigned volatile int *)(x) &= 0xff3f
#define TIMER_StopFast(x)	*(unsigned volatile int *)(x) = 0x0303

// Interrupts
#define INT_POLARITY		0x019c0008
#define	INT_EXT4			0x0010
#define	INT_TIMER0			0x4000



void start_DSK();


#endif
