/*
 Common definitions and functions for the FX2 firmware
 
 Copyright (c) 2008 Dimtel, Inc., All Rights Reserved

 $Id: common.h,v 1.1 2012/11/11 01:24:32 dim Exp $
 $Date: 2012/11/11 01:24:32 $
 $Author: dim $
 $Revision: 1.1 $
 $Log: common.h,v $
 Revision 1.1  2012/11/11 01:24:32  dim
 Moved from BxB, adapted to compile for both LLRF4 and IGP12

 Revision 1.1  2011/12/27 19:31:45  dim
 Updated to remove deprecated constructs (at, sfr, xdata, sbit)

 Revision 1.1.1.1  2009/06/02 20:25:58  dim
 Initial import

*/

#ifndef _COMMON_H_
#define _COMMON_H_

#include "../include/data_types.h"

#define	NOP	__asm nop; __endasm
#define SYNCDELAY NOP; NOP; NOP

/* Define __XPAGE, so that initialization code works right */
__sfr __at (0x92) _XPAGE;

void basic_init(void);
void fpga_reset(void);
void renumerate(void);
void reset_toggle(uchar ep);
void delay(ushort ms);
__xdata char *write_short(__xdata char *ptr, ushort value);
void poll_ep0(void);

#endif /* _COMMON_H_ */
