Subversion Repositories zxusbnet

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1.  
  2. ///////////////////////////hal.h//////////////////////////
  3.  
  4. #define SL811H_ADDR     0x80ab//        0x08000
  5. #define SL811H_DATA     0x7fab//        0x08001
  6.  
  7.  
  8. void USBReset(void);
  9. int sl811_init_my(void);
  10. extern unsigned char SL811Read(unsigned char a);
  11. void SL811Write(unsigned char a, unsigned char d);
  12. extern void SL811BufRead(unsigned char addr, unsigned char *s, unsigned char c);
  13. void SL811BufWrite(unsigned char addr, unsigned char *s, unsigned char c);
  14. unsigned short WordSwap(unsigned short input);
  15. unsigned long SwapINT32(unsigned long dData);
  16.  
  17. unsigned int LSwapINT16(unsigned short dData1,unsigned short dData2);
  18. unsigned long LSwapINT32(unsigned long dData1,unsigned long dData2,unsigned long dData3,unsigned long dData4);
  19. unsigned long SwapINT32(unsigned long dData);
  20.  
  21.  
  22. #define TRUE            1
  23. #define FALSE           0
  24.  
  25. #define xdata
  26. #define bdata
  27. #define idata
  28. #define EZUSB_Delay DelayMs
  29. //#define UARTBUF_LENGTH  16384//520//
  30. #define BUFFER_LENGTH   1024//520 //
  31. #define MAX_READ_LENGTH 16384//1024//
  32. #define MAX_WRITE_LENGTH 2048//1024//
  33. // Disable all interrupts
  34. #define DISABLE_INTERRUPTS              EA = 0
  35. // Enable all interrupts
  36. #define ENABLE_INTERRUPTS               EA = 1
  37.  
  38. typedef unsigned char       INT8;
  39. typedef unsigned short      INT16;
  40. typedef unsigned long       INT32;
  41.  
  42. typedef union __FLAGS
  43. {
  44.         struct _FLAGS
  45.         {
  46.                 unsigned char   SLAVE_IS_ATTACHED       ;
  47.                 unsigned char   SLAVE_REMOVED           ;
  48.                 unsigned char   SLAVE_FOUND             ;       // Slave USB device found
  49.                 unsigned char   SLAVE_ENUMERATED        ;       // slave USB device enumeration done
  50.                 unsigned char   SLAVE_ONLINE            ;
  51.                 unsigned char   TIMEOUT_ERR             ;                               // timeout error during data endpoint transfer
  52.                 unsigned char   DATA_STOP               ;                                       // device unplugged during data transfer
  53.                 unsigned char   bData1                  ;
  54.                 unsigned char   bUartInDone             ;                
  55.                 unsigned char   bMassDevice             ;
  56.                 unsigned char   FULL_SPEED              ;
  57.                 unsigned char   BULK_OUT_DONE           ;
  58.                 unsigned char   DATA_INPROCESS          ;
  59.         } bits;
  60.          
  61. } FLAGS;
  62.