X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/f8d7cde0d035f087f39c8076061bd8ef608e14f4..b2be2bbd665328f4ec3dc14d7d84fdbac4c58e11:/embedded/libs4c/usb/base/usb/usb.h diff --git a/embedded/libs4c/usb/base/usb/usb.h b/embedded/libs4c/usb/base/usb/usb.h index 40338a6..4807b59 100644 --- a/embedded/libs4c/usb/base/usb/usb.h +++ b/embedded/libs4c/usb/base/usb/usb.h @@ -9,6 +9,7 @@ #define _USB_MODULE_ #include "usb_spec.h" + #include "usb_devdes.h" #if defined(SDCC) || defined(__KEIL__) || defined(__C51__) /*8051 special handling*/ @@ -86,14 +87,19 @@ 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 */ + 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 */ - 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*/ @@ -131,7 +137,8 @@ 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)); \ @@ -157,6 +164,8 @@ #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)) @@ -164,6 +173,7 @@ #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))