include/eputils.h File Reference

#include "fx2types.h"

Go to the source code of this file.

Defines

#define RESETFIFO(ep)
#define RESETFIFOS()

Functions

void readep0 (BYTE *dst, WORD len)


Detailed Description

Functions and macros for working with endpoints.

Definition in file eputils.h.


Define Documentation

#define RESETFIFO ( ep   ) 

Value:

{FIFORESET=0x80; SYNCDELAY();\
                       FIFORESET=ep; SYNCDELAY();\
                       FIFORESET=0x00; SYNCDELAY();}
NOTE you can't use these unless you define SYNCDELAY as a macro or function. The reason is that SYNCDELAY needs to be longer or shorter depending on your IFCONFIG settings. See delay.h

Example:

  #define SYNCDELAY() SYNCDELAY4 // SYNCDELAY4 from delay.h
RESETFIFO should not use 0x80|epnum for IN endpoints Only use 0x02, 0x04, 0x06, 0x06 for ep value

Definition at line 45 of file eputils.h.

 
#define RESETFIFOS (  ) 

Value:

{FIFORESET=0x80; SYNCDELAY();\
                     FIFORESET=0x02; SYNCDELAY();\
                     FIFORESET=0x04; SYNCDELAY();\
                     FIFORESET=0x06; SYNCDELAY();\
                     FIFORESET=0x08; SYNCDELAY();\
                     FIFORESET=0x00; SYNCDELAY();}
Quickly reset all endpoint FIFOS.

Definition at line 51 of file eputils.h.


Function Documentation

void readep0 ( BYTE dst,
WORD  len 
)

Continually read available bytes from endpoint0 into dst, wait until more bytes are available, and loop until len bytes have been read.


Generated on Wed Feb 4 12:27:36 2009 for Fx2lib by  doxygen 1.5.7.1