PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
usbdevice.h File Reference
#include "usb.h"
Include dependency graph for usbdevice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stc_usbdevice_class_config
 USB device class configuration. More...
 
struct  stc_usbdevice_intern_data
 USB device class configuration. More...
 
struct  stc_usbdevice_config
 USB device configuration. More...
 
struct  stc_usbdevice_endpoint_config
 USB device endpoint configuration. More...
 
struct  stc_usbdevicen_instance_data
 USB device instance. More...
 

Macros

#define USBDEVICE_MAXCLASSES   5
 
#define UsbDevice_HalEndpointStatus(x)   Usb_HalEndpointStatus(x)
 
#define UsbDevice_HalEndpointIsBusy(x)   Usb_HalEndpointIsBusy(x)
 
#define UsbDevice_HalStallEndpoint(x)   Usb_HalStallEndpoint(x)
 
#define UsbDevice_HalUnstallEndpoint(x)   Usb_HalUnstallEndpoint(x)
 

Typedefs

typedef void(* usbdevice_setuprequest_func_ptr_t )(stc_usbn_t *pstcUsb, stc_usb_request_t *pstcSetup)
 setup request callback handle More...
 
typedef void(* usbdevice_controltranfered_func_ptr_t )(stc_usbn_t *pstcUsb, stc_usbn_endpoint_data_t *pstcEndpoint)
 control data transferred More...
 
typedef void(* usbdevice_initclasses_func_ptr_t )(stc_usbn_t *pstcUsb)
 init class callback More...
 
typedef struct
stc_usbdevice_class_config 
stc_usbdevice_class_config_t
 USB device class configuration. More...
 
typedef struct
stc_usbdevice_intern_data 
stc_usbdevice_intern_data_t
 USB device class configuration. More...
 
typedef struct stc_usbdevice_config stc_usbdevice_config_t
 USB device configuration. More...
 
typedef struct
stc_usbdevice_endpoint_config 
stc_usbdevice_endpoint_config_t
 USB device endpoint configuration. More...
 
typedef struct
stc_usbdevicen_instance_data 
stc_usbdevicen_instance_data_t
 USB device instance. More...
 
typedef enum en_usbsend_mode en_usbsend_mode_t
 USB device sending mode. More...
 

Enumerations

enum  en_usbsend_mode {
  UsbPOLL = 0,
  UsbIRQ = 1,
  UsbDMA = 2
}
 USB device sending mode. More...
 

Functions

en_result_t UsbDevice_ReceiveData (stc_usbn_t *pstcUsb, stc_usbn_endpoint_data_t *pstcEndpoint, uint8_t *pu8Buffer, uint32_t u32DataSize, en_usbsend_mode_t enMode)
 
en_result_t UsbDevice_SendData (stc_usbn_t *pstcUsb, stc_usbn_endpoint_data_t *pstcEndpoint, uint8_t *pu8Buffer, uint32_t u32DataSize, en_usbsend_mode_t enMode)
 
void UsbDevice_SendDataControl (stc_usbn_t *pstcUsb, uint8_t *pu8Buffer, uint32_t u32DataLength)
 
void UsbDevice_ReceiveDataControl (stc_usbn_t *pstcUsb, usbdevice_controltranfered_func_ptr_t pfnCompletionCallback)
 
en_result_t UsbDevice_RegisterVendorClass (stc_usbn_t *pstcUsb, stc_usbdevice_class_config_t *pstcUsbClassConfig, uint8_t **ppu8Buffer, uint8_t *pu8InterfaceLength)
 
en_usb_status_t UsbDevice_GetStatus (stc_usbn_t *pstcUsb)
 
en_usb_endpoint_status_t UsbDevice_HalEndpointStatus (stc_usbn_endpoint_data_t *pstcEpHandle)
 
void UsbDevice_InitCallback (stc_usbn_t *pstcUsb, stc_usb_config_t *pstcUsbConfig)
 
void UsbDevice_Init (stc_usbn_t *pstcUsb, stc_usb_config_t *pstcUsbConfig, stc_usbdevice_config_t *pstcConfig)
 
stc_usbn_endpoint_data_t * UsbDevice_SetupEndpoint (stc_usbn_t *pstcUsb, stc_usbdevice_endpoint_config_t *pstcConfig)
 
void UsbDevice_Usb0ExintCallback (void)
 
void UsbDevice_Usb1ExintCallback (void)
 

Detailed Description

A detailed description is available at USB Device Module description

History:

  • 2012-08-28 2.0 MSc First version (starting at version 2.0).
  • 2012-10-02 2.1 MSc use of external interrupts without L3 implemented
  • 2012-11-13 2.2 MSc Some problems while switching from Host to Device fixed
  • 2013-01-31 2.3 MSc DMA added
  • 2013-05-07 2.4 MSc Bug with sending wrong package sizes solved
  • 2013-05-21 2.5 MSc Some Windows versions request only 4 bytes of string descriptor ->fixed: more than only 4 bytes will be sent
  • 2013-06-04 2.6 MSc FM4 support added
  • 2013-10-17 2.7 MSc Device Configuration change: support for more than one report descriptor
  • 2014-02-28 2.8 MSc Busy wait added to send and receive initiate procedure

Definition in file usbdevice.h.