sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
usbdrv.c File Reference
#include "usbdrv.h"
#include "oddebug.h"

Macros

#define USB_FLG_MSGPTR_IS_ROM   (1<<6)
 
#define USB_FLG_USE_USER_RW   (1<<7)
 
#define USB_CFG_DESCR_PROPS_STRING_0   sizeof(usbDescriptorString0)
 
#define USB_CFG_DESCR_PROPS_DEVICE   sizeof(usbDescriptorDevice)
 
#define USB_CFG_DESCR_PROPS_CONFIGURATION   sizeof(usbDescriptorConfiguration)
 
#define SWITCH_START(cmd)   {uchar _cmd = cmd; if(0){
 
#define SWITCH_CASE(value)   }else if(_cmd == (value)){
 
#define SWITCH_CASE2(v1, v2)   }else if(_cmd == (v1) || _cmd == (v2)){
 
#define SWITCH_CASE3(v1, v2, v3)   }else if(_cmd == (v1) || _cmd == (v2) || (_cmd == v3)){
 
#define SWITCH_DEFAULT   }else{
 
#define SWITCH_END   }}
 
#define USB_RX_USER_HOOK(data, len)
 
#define USB_SET_ADDRESS_HOOK()
 
#define GET_DESCRIPTOR(cfgProp, staticName)
 

Functions

USB_PUBLIC void usbPoll (void)
 
USB_PUBLIC void usbInit (void)
 

Variables

uchar usbRxBuf [2 *USB_BUFSIZE]
 
uchar usbInputBufOffset
 
uchar usbDeviceAddr
 
uchar usbNewDeviceAddr
 
uchar usbConfiguration
 
volatile schar usbRxLen
 
uchar usbCurrentTok
 
uchar usbRxToken
 
volatile uchar usbTxLen = USBPID_NAK
 
uchar usbTxBuf [USB_BUFSIZE]
 
usbMsgPtr_t usbMsgPtr
 
PROGMEM const char usbDescriptorString0 []
 
PROGMEM const char usbDescriptorDevice []
 
PROGMEM const char usbDescriptorConfiguration []
 

Macro Definition Documentation

#define GET_DESCRIPTOR (   cfgProp,
  staticName 
)
Value:
if(cfgProp){ \
if((cfgProp) & USB_PROP_IS_RAM) \
flags = 0; \
if((cfgProp) & USB_PROP_IS_DYNAMIC){ \
len = usbFunctionDescriptor(rq); \
}else{ \
len = USB_PROP_LENGTH(cfgProp); \
usbMsgPtr = (usbMsgPtr_t)(staticName); \
} \
}
#define USB_PROP_IS_DYNAMIC
Definition: usbdrv.h:403
#define usbMsgPtr_t
Definition: usbconfig-prototype.h:359
if(CHK_INT_EN())
Definition: onewire.c:414
#define USB_PROP_LENGTH(len)
Definition: usbdrv.h:414
USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq)
#define USB_PROP_IS_RAM
Definition: usbdrv.h:409
usbMsgPtr_t usbMsgPtr
Definition: usbdrv.c:46
#define SWITCH_CASE (   value)    }else if(_cmd == (value)){
#define SWITCH_CASE2 (   v1,
  v2 
)    }else if(_cmd == (v1) || _cmd == (v2)){
#define SWITCH_CASE3 (   v1,
  v2,
  v3 
)    }else if(_cmd == (v1) || _cmd == (v2) || (_cmd == v3)){
#define SWITCH_DEFAULT   }else{
#define SWITCH_END   }}
#define SWITCH_START (   cmd)    {uchar _cmd = cmd; if(0){
#define USB_CFG_DESCR_PROPS_CONFIGURATION   sizeof(usbDescriptorConfiguration)
#define USB_CFG_DESCR_PROPS_DEVICE   sizeof(usbDescriptorDevice)
#define USB_CFG_DESCR_PROPS_STRING_0   sizeof(usbDescriptorString0)
#define USB_FLG_MSGPTR_IS_ROM   (1<<6)
#define USB_FLG_USE_USER_RW   (1<<7)
#define USB_RX_USER_HOOK (   data,
  len 
)
#define USB_SET_ADDRESS_HOOK ( )

Function Documentation

USB_PUBLIC void usbInit ( void  )
USB_PUBLIC void usbPoll ( void  )

Variable Documentation

uchar usbConfiguration
uchar usbCurrentTok
PROGMEM const char usbDescriptorConfiguration[]
PROGMEM const char usbDescriptorDevice[]
Initial value:
= {
18,
0x10, 0x01,
0,
8,
1,
}
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
Definition: usbconfig.h:358
#define USBDESCR_DEVICE
Definition: usbdrv.h:722
#define USB_CFG_VENDOR_ID
Definition: usbconfig.h:224
#define USB_CFG_DESCR_PROPS_STRING_VENDOR
Definition: usbconfig.h:356
#define USB_CFG_DEVICE_SUBCLASS
Definition: usbconfig.h:273
#define USB_CFG_DEVICE_VERSION
Definition: usbconfig.h:244
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT
Definition: usbconfig.h:357
#define USB_CFG_DEVICE_ID
Definition: usbconfig.h:233
#define USB_CFG_DEVICE_CLASS
Definition: usbconfig.h:272
PROGMEM const char usbDescriptorString0[]
Initial value:
= {
4,
3,
0x09, 0x04,
}
uchar usbDeviceAddr
uchar usbInputBufOffset
usbMsgPtr_t usbMsgPtr
uchar usbNewDeviceAddr
uchar usbRxBuf[2 *USB_BUFSIZE]
volatile schar usbRxLen
uchar usbRxToken
uchar usbTxBuf[USB_BUFSIZE]
volatile uchar usbTxLen = USBPID_NAK