Main Page | Data Structures | Directories | File List | Data Fields | Globals

usbdrv.h File Reference

#include "system\typedefs.h"
#include "system\usb\usb.h"

Go to the source code of this file.

Defines

#define _PPBM0   0x00
#define _PPBM1   0x01
#define _PPBM2   0x02
#define _LS   0x00
#define _FS   0x04
#define _TRINT   0x00
#define _TREXT   0x08
#define _PUEN   0x10
#define _OEMON   0x40
#define _UTEYE   0x80
#define EP_CTRL   0x06
#define EP_OUT   0x0C
#define EP_IN   0x0A
#define EP_OUT_IN   0x0E
#define HSHK_EN   0x10
#define OUT   0
#define IN   1
#define PIC_EP_NUM_MASK   0b01111000
#define PIC_EP_DIR_MASK   0b00000100
#define EP00_OUT   (0x00<<3)|(OUT<<2)
#define EP00_IN   (0x00<<3)|(IN<<2)
#define EP01_OUT   (0x01<<3)|(OUT<<2)
#define EP01_IN   (0x01<<3)|(IN<<2)
#define EP02_OUT   (0x02<<3)|(OUT<<2)
#define EP02_IN   (0x02<<3)|(IN<<2)
#define EP03_OUT   (0x03<<3)|(OUT<<2)
#define EP03_IN   (0x03<<3)|(IN<<2)
#define EP04_OUT   (0x04<<3)|(OUT<<2)
#define EP04_IN   (0x04<<3)|(IN<<2)
#define EP05_OUT   (0x05<<3)|(OUT<<2)
#define EP05_IN   (0x05<<3)|(IN<<2)
#define EP06_OUT   (0x06<<3)|(OUT<<2)
#define EP06_IN   (0x06<<3)|(IN<<2)
#define EP07_OUT   (0x07<<3)|(OUT<<2)
#define EP07_IN   (0x07<<3)|(IN<<2)
#define EP08_OUT   (0x08<<3)|(OUT<<2)
#define EP08_IN   (0x08<<3)|(IN<<2)
#define EP09_OUT   (0x09<<3)|(OUT<<2)
#define EP09_IN   (0x09<<3)|(IN<<2)
#define EP10_OUT   (0x0A<<3)|(OUT<<2)
#define EP10_IN   (0x0A<<3)|(IN<<2)
#define EP11_OUT   (0x0B<<3)|(OUT<<2)
#define EP11_IN   (0x0B<<3)|(IN<<2)
#define EP12_OUT   (0x0C<<3)|(OUT<<2)
#define EP12_IN   (0x0C<<3)|(IN<<2)
#define EP13_OUT   (0x0D<<3)|(OUT<<2)
#define EP13_IN   (0x0D<<3)|(IN<<2)
#define EP14_OUT   (0x0E<<3)|(OUT<<2)
#define EP14_IN   (0x0E<<3)|(IN<<2)
#define EP15_OUT   (0x0F<<3)|(OUT<<2)
#define EP15_IN   (0x0F<<3)|(IN<<2)
#define mInitializeUSBDriver()
#define mDisableEP1to15()   ClearArray((byte*)&UEP1,15);
#define mUSBBufferReady(buffer_dsc)

Functions

void USBCheckBusStatus (void)
void USBDriverService (void)
void USBRemoteWakeup (void)
void USBSoftDetach (void)
void ClearArray (byte *startAdr, byte count)


Define Documentation

#define _FS   0x04
 

Definition at line 51 of file usbdrv.h.

#define _LS   0x00
 

Definition at line 50 of file usbdrv.h.

#define _OEMON   0x40
 

Definition at line 55 of file usbdrv.h.

#define _PPBM0   0x00
 

D E F I N I T I O N S

Definition at line 47 of file usbdrv.h.

#define _PPBM1   0x01
 

Definition at line 48 of file usbdrv.h.

#define _PPBM2   0x02
 

Definition at line 49 of file usbdrv.h.

#define _PUEN   0x10
 

Definition at line 54 of file usbdrv.h.

#define _TREXT   0x08
 

Definition at line 53 of file usbdrv.h.

#define _TRINT   0x00
 

Definition at line 52 of file usbdrv.h.

#define _UTEYE   0x80
 

Definition at line 56 of file usbdrv.h.

#define EP00_IN   (0x00<<3)|(IN<<2)
 

Definition at line 82 of file usbdrv.h.

Referenced by USBCtrlEPService().

#define EP00_OUT   (0x00<<3)|(OUT<<2)
 

Definition at line 81 of file usbdrv.h.

Referenced by USBCtrlEPService().

#define EP01_IN   (0x01<<3)|(IN<<2)
 

Definition at line 84 of file usbdrv.h.

#define EP01_OUT   (0x01<<3)|(OUT<<2)
 

Definition at line 83 of file usbdrv.h.

#define EP02_IN   (0x02<<3)|(IN<<2)
 

Definition at line 86 of file usbdrv.h.

#define EP02_OUT   (0x02<<3)|(OUT<<2)
 

Definition at line 85 of file usbdrv.h.

#define EP03_IN   (0x03<<3)|(IN<<2)
 

Definition at line 88 of file usbdrv.h.

#define EP03_OUT   (0x03<<3)|(OUT<<2)
 

Definition at line 87 of file usbdrv.h.

#define EP04_IN   (0x04<<3)|(IN<<2)
 

Definition at line 90 of file usbdrv.h.

#define EP04_OUT   (0x04<<3)|(OUT<<2)
 

Definition at line 89 of file usbdrv.h.

#define EP05_IN   (0x05<<3)|(IN<<2)
 

Definition at line 92 of file usbdrv.h.

#define EP05_OUT   (0x05<<3)|(OUT<<2)
 

Definition at line 91 of file usbdrv.h.

#define EP06_IN   (0x06<<3)|(IN<<2)
 

Definition at line 94 of file usbdrv.h.

#define EP06_OUT   (0x06<<3)|(OUT<<2)
 

Definition at line 93 of file usbdrv.h.

#define EP07_IN   (0x07<<3)|(IN<<2)
 

Definition at line 96 of file usbdrv.h.

#define EP07_OUT   (0x07<<3)|(OUT<<2)
 

Definition at line 95 of file usbdrv.h.

#define EP08_IN   (0x08<<3)|(IN<<2)
 

Definition at line 98 of file usbdrv.h.

#define EP08_OUT   (0x08<<3)|(OUT<<2)
 

Definition at line 97 of file usbdrv.h.

#define EP09_IN   (0x09<<3)|(IN<<2)
 

Definition at line 100 of file usbdrv.h.

#define EP09_OUT   (0x09<<3)|(OUT<<2)
 

Definition at line 99 of file usbdrv.h.

#define EP10_IN   (0x0A<<3)|(IN<<2)
 

Definition at line 102 of file usbdrv.h.

#define EP10_OUT   (0x0A<<3)|(OUT<<2)
 

Definition at line 101 of file usbdrv.h.

#define EP11_IN   (0x0B<<3)|(IN<<2)
 

Definition at line 104 of file usbdrv.h.

#define EP11_OUT   (0x0B<<3)|(OUT<<2)
 

Definition at line 103 of file usbdrv.h.

#define EP12_IN   (0x0C<<3)|(IN<<2)
 

Definition at line 106 of file usbdrv.h.

#define EP12_OUT   (0x0C<<3)|(OUT<<2)
 

Definition at line 105 of file usbdrv.h.

#define EP13_IN   (0x0D<<3)|(IN<<2)
 

Definition at line 108 of file usbdrv.h.

#define EP13_OUT   (0x0D<<3)|(OUT<<2)
 

Definition at line 107 of file usbdrv.h.

#define EP14_IN   (0x0E<<3)|(IN<<2)
 

Definition at line 110 of file usbdrv.h.

#define EP14_OUT   (0x0E<<3)|(OUT<<2)
 

Definition at line 109 of file usbdrv.h.

#define EP15_IN   (0x0F<<3)|(IN<<2)
 

Definition at line 112 of file usbdrv.h.

#define EP15_OUT   (0x0F<<3)|(OUT<<2)
 

Definition at line 111 of file usbdrv.h.

#define EP_CTRL   0x06
 

Definition at line 59 of file usbdrv.h.

Referenced by USBProtocolResetHandler().

#define EP_IN   0x0A
 

Definition at line 61 of file usbdrv.h.

#define EP_OUT   0x0C
 

Definition at line 60 of file usbdrv.h.

#define EP_OUT_IN   0x0E
 

Definition at line 62 of file usbdrv.h.

#define HSHK_EN   0x10
 

Definition at line 63 of file usbdrv.h.

Referenced by USBProtocolResetHandler().

#define IN   1
 

Definition at line 76 of file usbdrv.h.

 
#define mDisableEP1to15  )     ClearArray((byte*)&UEP1,15);
 

Definition at line 157 of file usbdrv.h.

Referenced by USBProtocolResetHandler(), and USBStdSetCfgHandler().

 
#define mInitializeUSBDriver  ) 
 

Value:

Definition at line 135 of file usbdrv.h.

Referenced by InitializeSystem().

#define mUSBBufferReady buffer_dsc   ) 
 

Value:

{                                                                           \
    buffer_dsc.Stat._byte &= _DTSMASK;          /* Save only DTS bit */     \
    buffer_dsc.Stat.DTS = !buffer_dsc.Stat.DTS; /* Toggle DTS bit    */     \
    buffer_dsc.Stat._byte |= _USIE|_DTSEN;      /* Turn ownership to SIE */ \
}

Definition at line 188 of file usbdrv.h.

#define OUT   0
 

Definition at line 75 of file usbdrv.h.

#define PIC_EP_DIR_MASK   0b00000100
 

Definition at line 79 of file usbdrv.h.

#define PIC_EP_NUM_MASK   0b01111000
 

Definition at line 78 of file usbdrv.h.


Function Documentation

void ClearArray byte startAdr,
byte  count
 

Definition at line 575 of file usbdrv.c.

Referenced by USBStdSetCfgHandler().

void USBCheckBusStatus void   ) 
 

D E C L A R A T I O N S

Definition at line 76 of file usbdrv.c.

References ATTACHED_STATE, POWERED_STATE, USB_BUS_ATTACHED, usb_bus_sense, usb_device_state, USBModuleDisable(), and USBModuleEnable().

Referenced by USBTasks().

void USBDriverService void   ) 
 

Definition at line 215 of file usbdrv.c.

References DEFAULT_STATE, DETACHED_STATE, usb_device_state, USB_SOF_Handler(), USBCtrlEPService(), USBErrorHandler(), USBProtocolResetHandler(), USBStallHandler(), USBSuspend(), and USBWakeFromSuspend().

Referenced by USBTasks().

void USBRemoteWakeup void   ) 
 

Definition at line 404 of file usbdrv.c.

References _USB_DEVICE_STATUS::RemoteWakeup, usb_stat, and USBWakeFromSuspend().

void USBSoftDetach void   ) 
 

Definition at line 192 of file usbdrv.c.

References USBModuleDisable().


Generated on Wed Jun 8 03:49:40 2005 for cdc by  doxygen 1.4.2