#define FBASE	48000
#define OSR	4
#define FS	((float)FBASE/(float)OSR)
#define FSPACE	1000
#define FMARK	1850
#define DR	45

#define BAUD_LIST {30,45,50,75,100,150,200,300,600,1200,0}

enum {RTTY,CW,HDLC};

typedef struct {
        int phs;      	/* bit phase / sample (2_PI = 65536) */
        int nbit;       /* Number of data bits (5,7,8) */
        int nstop;	/* Number of stop bits 1,2 (serial.c)  */
	int nstop05;	/* 0.5 extra STOP bits */
        int parity;	/* Paridad bit: 0=nada 1=Even 2=Odd */
        float spacef;	/* Space Frequency */
        float markf;	/* Mark Frequency */
        int dr;		/* Data Rate */
        int mode;       /* 0=RTTY 1=CW */
        float cwt;      /* CW dot time */
        int cwatim;     /* CW Auto timming enable */
} fsk_data;

extern fsk_data *fskdp;

#ifdef ENX11
#define NDBUF 0x4000

typedef struct {
	int mode;		/* Display mode */
	int inp;		/* Input buffer pointer */
	int outp;		/* Output buffer pointer */
	float in[NDBUF];	/* Buffers */
	float out[NDBUF];
} disp_data;

extern disp_data *disdp;
#endif

/*----------- audio.c ----------*/

void init_audio();
float get_audio_sample();

/*----------- dsp.c ------------*/

void set_filters(float f0, float f1, float dr);
float demodulator();

/*----------- serie.c --------*/

int serie();

/*----------- dpll.c ---------*/

int get_bit_raw();
extern unsigned short bit_phase;

/*---------- baudot.c ----------*/

int baudot(unsigned char data);

/*---------- FORMS ------------*/

void form_main();

/*---------- GRAPH ------------*/

void graph_main();
extern int redisp;

/*---------- MORSE ------------*/

void morsedec();

/*---------- HDLC -------------*/

int hdlc(char *buf,int len);
int check_crc_ccitt(const unsigned char *buf, int cnt);
void dump_addr(unsigned char *buf);
void hdump(unsigned char *buf,int n);

