]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - embedded/libs4c/usb/base/usb/usb.h
Embedded code-base updated to actual version from uLan repository.
[lincan.git] / embedded / libs4c / usb / base / usb / usb.h
index 40338a6b68bd572707dbe95852a1b65dbb39731d..4807b5998959bba51dc3450d82a45a3040a69188 100644 (file)
@@ -9,6 +9,7 @@
   #define _USB_MODULE_
 
   #include "usb_spec.h"
   #define _USB_MODULE_
 
   #include "usb_spec.h"
+  #include "usb_devdes.h"
   
 #if defined(SDCC) || defined(__KEIL__) || defined(__C51__)
   /*8051 special handling*/
   
 #if defined(SDCC) || defined(__KEIL__) || defined(__C51__)
   /*8051 special handling*/
     int (*vendor_fnc)( struct usb_device_t *udev) REENTRANT_SIGN;     /* pointer to vendor request processing function */
     int (*class_fnc)( struct usb_device_t *udev) REENTRANT_SIGN;      /* pointer to class request processing function */
 
     int (*vendor_fnc)( struct usb_device_t *udev) REENTRANT_SIGN;     /* pointer to vendor request processing function */
     int (*class_fnc)( struct usb_device_t *udev) REENTRANT_SIGN;      /* pointer to class request processing function */
 
+    const USB_DEVICE_DESCRIPTORS_TABLE *devdes_table;
+
    #ifdef USB_WITH_UDEV_FNC
     int (*init)( struct usb_device_t *udev) REENTRANT_SIGN;              /* function for hw specific part of initialize usb device */
    #ifdef USB_WITH_UDEV_FNC
     int (*init)( struct usb_device_t *udev) REENTRANT_SIGN;              /* function for hw specific part of initialize usb device */
+    int (*set_addr)( struct usb_device_t *udev, unsigned char addr) REENTRANT_SIGN;  /* set device address */
+    int (*set_configuration)( struct usb_device_t *udev, unsigned char iCfg) REENTRANT_SIGN;  /* set device configuration */
     int (*connect)( struct usb_device_t *udev) REENTRANT_SIGN;           /* function for hw specific part of connecting device to usb */
     int (*disconnect)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of disconnecting device to usb */
     void (*ack_setup)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of control response acknowledge */
     void (*ack_control_setup)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of control response acknowledge */
     int (*check_events)( struct usb_device_t *udev) REENTRANT_SIGN;      /* hw specific part of function for checking events */
     int (*connect)( struct usb_device_t *udev) REENTRANT_SIGN;           /* function for hw specific part of connecting device to usb */
     int (*disconnect)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of disconnecting device to usb */
     void (*ack_setup)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of control response acknowledge */
     void (*ack_control_setup)( struct usb_device_t *udev) REENTRANT_SIGN;        /* function for hw specific part of control response acknowledge */
     int (*check_events)( struct usb_device_t *udev) REENTRANT_SIGN;      /* hw specific part of function for checking events */
-    void (*stall)( usb_ep_t *ep) REENTRANT_SIGN;                         /* hw specific function for stall endpoint */
+    void (*stall)( usb_ep_t *ep) REENTRANT_SIGN;                         /* hw specific function to stall endpoint */
+    void (*unstall)( usb_ep_t *ep) REENTRANT_SIGN;                       /* hw specific function to unstall endpoint */
     int (*read_endpoint)( usb_ep_t *ep, void *ptr, int size) REENTRANT_SIGN;
     int (*write_endpoint)( usb_ep_t *ep, const void *ptr, int size) REENTRANT_SIGN;
    #endif /*USB_WITH_UDEV_FNC*/
     int (*read_endpoint)( usb_ep_t *ep, void *ptr, int size) REENTRANT_SIGN;
     int (*write_endpoint)( usb_ep_t *ep, const void *ptr, int size) REENTRANT_SIGN;
    #endif /*USB_WITH_UDEV_FNC*/
   int usb_connect( usb_device_t *udev);
   int usb_disconnect( usb_device_t *udev);
   void usb_stall( usb_ep_t *ep);
   int usb_connect( usb_device_t *udev);
   int usb_disconnect( usb_device_t *udev);
   void usb_stall( usb_ep_t *ep);
-  
+  void usb_unstall( usb_ep_t *ep);
+
   #define usb_stall_ep0( udev) \
     do { \
       usb_stall( &(udev->ep0)); \
   #define usb_stall_ep0( udev) \
     do { \
       usb_stall( &(udev->ep0)); \
   #define usb_udev_is_fnc(_M_udev, _M_fnc) (_M_udev->_M_fnc)
   
   #define usb_udev_init(_M_udev) (_M_udev->init(_M_udev))
   #define usb_udev_is_fnc(_M_udev, _M_fnc) (_M_udev->_M_fnc)
   
   #define usb_udev_init(_M_udev) (_M_udev->init(_M_udev))
+  #define usb_udev_set_addr(_M_udev, _M_addr) (_M_udev->set_addr(_M_udev, _M_addr))
+  #define usb_udev_set_configuration(_M_udev, _M_iCfg) (_M_udev->set_configuration(_M_udev, _M_iCfg))
   #define usb_udev_connect(_M_udev) (_M_udev->connect(_M_udev))
   #define usb_udev_disconnect(_M_udev) (_M_udev->disconnect(_M_udev))
   #define usb_udev_ack_setup(_M_udev) (_M_udev->ack_setup(_M_udev))
   #define usb_udev_connect(_M_udev) (_M_udev->connect(_M_udev))
   #define usb_udev_disconnect(_M_udev) (_M_udev->disconnect(_M_udev))
   #define usb_udev_ack_setup(_M_udev) (_M_udev->ack_setup(_M_udev))
   #define usb_udev_check_events(_M_udev) (_M_udev->check_events(_M_udev))
 
   #define usb_udev_stall(_M_ep) ((_M_ep)->udev->stall(_M_ep))
   #define usb_udev_check_events(_M_udev) (_M_udev->check_events(_M_udev))
 
   #define usb_udev_stall(_M_ep) ((_M_ep)->udev->stall(_M_ep))
+  #define usb_udev_unstall(_M_ep) ((_M_ep)->udev->unstall(_M_ep))
 
   #define usb_udev_read_endpoint(_M_ep, _M_ptr, _M_size) \
        ((_M_ep)->udev->read_endpoint(_M_ep, _M_ptr, _M_size))
 
   #define usb_udev_read_endpoint(_M_ep, _M_ptr, _M_size) \
        ((_M_ep)->udev->read_endpoint(_M_ep, _M_ptr, _M_size))