C:/Documents and Settings/mschre/Desktop/96330_usb_template_96338us-v11/96330_usb_function_template-v10/96330_usb_template_96338us-v10/src/usb/UsbFunction.h File Reference

#include "base_type.h"
#include "mcu.h"
#include "dbg.h"
#include "UsbFunctionHW.h"
Include dependency graph for UsbFunction.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stc_usb_request
struct  stc_usb_buffer
struct  stc_usb_event
struct  stc_dma_handler
struct  stc_usb_EP

Defines

#define USB_USE_DMA   1
#define USB_BUFFER_FAR   0
#define IS_SET(x, y)   ((x & y) > 0)
#define IS_CLEARED(x, y)   ((x & y) == 0)
#define SET_MASK(x, y)   x |= y
#define CLEAR_MASK(x, y)   x &= ~y
#define EP_CONTROL(x)   *(aEndpoint[x].EPnC)
#define EP_STATUS(x)   *(aEndpoint[x].EPnS)
#define EP_STATUS_IDLE   0
#define EP_STATUS_CONFIGURED   1
#define EP_STATUS_DISABLED   2
#define EP_STATUS_ENABLED   4
#define EP_STATUS_RECEIVING   8
#define EP_STATUS_SENDING   16
#define EP_STATUS_DMA_TRANSFER   32
#define EP_STATUS_DMA_ENABLED   64
#define SET_USB_STATUS_FLAG(x)   u8UsbStatus |= x
#define CLEAR_USB_STATUS_FLAG(x)   u8UsbStatus &= ~x
#define CLEAR_USB_STATUS_FLAGS()   u8UsbStatus = 0
#define pu16EndpointStatusReg_DRQ   (*pu16EndpointStatusReg & 0x0400)
#define SET_pu16EndpointStatusReg_DRQ(x)   *pu16EndpointStatusReg = ((*pu16EndpointStatusReg & 0xFBFF) | x << 10)
#define SET_pu16EndpointStatusReg_BFINI(x)   *pu16EndpointStatusReg = ((*pu16EndpointStatusReg & 0x7FFF) | x << 15)
#define MASK_EPC_PKS   0x007F
#define MASK_EPC_PKS1   0x01FF
#define MASK_EPC_STAL   0x0200
#define MASK_EPC_NULE   0x0400
#define MASK_EPC_DMAE   0x0800
#define MASK_EPC_DIR   0x1000
#define MASK_EPC_TYPE   0x6000
#define MASK_EPC_EPEN   0x8000
#define MASK_EPS_DRQIIE   0x4000
#define MASK_EPS_BFINI   0x8000
#define MASK_EPS_SIZE1   0x01FF
#define MASK_EPS_SIZE   0x007F
#define MASK_EPS_SPK   0x0200
#define MASK_EPS_DRQI   0x0400
#define MASK_EPS_DRQO   0x0400
#define MASK_EPS_DRQ   0x0400
#define MASK_EPS_BUSY   0x0800
#define MASK_EPS_SPKIE   0x2000
#define MASK_EPS_DRQIE   0x4000
#define MASK_EPS_DRQOIE   0x4000
#define MASK_EPS_BFINI   0x8000
#define USBDESCR_DEVICE   1
#define USBDESCR_CONFIG   2
#define USBDESCR_STRING   3
#define USBDESCR_INTERFACE   4
#define USBDESCR_ENDPOINT   5
#define USBATTR_BUSPOWER   0x80
#define USBATTR_SELFPOWER   0xC0
#define USBATTR_REMOTEWAKE   0x20
#define USB_FUNC_INTR_IN   0xF000
#define USB_FUNC_INTR_OUT   0xE000
#define USB_FUNC_BULK_IN   0xD000
#define USB_FUNC_BULK_OUT   0xC000
#define MAX_RECV_BUFFER   512
#define USB_DEVREQ_STDTYPE   0x00
#define USB_DEVREQ_CLSTYPE   0x20
#define USB_DEVREQ_VNDTYPE   0x40
#define USB_DEVREQ_GET_DESC   0x06
#define USB_DEVREQ_SET_DESC   0x07
#define USB_DEVREQ_SET_IDLE   0x0A
#define USB_GET_STATUS   0x00
#define USB_CLEAR_FEATURE   0x01
#define USB_SET_FEATURE   0x03
#define USB_SET_ADDRESS   0x05
#define USB_GET_DESCRIPTOR   0x06
#define USB_SET_DESCRIPTOR   0x07
#define USB_GET_CONFIGURATION   0x08
#define USB_SET_CONFIGURATION   0x09
#define USB_GET_INTERFACE   0x0A
#define USB_SET_INTERFACE   0x0B
#define USB_SYNCH_FRAME   0x0C
#define USB_STATUS_CONNECTED   0x01
#define USB_STATUS_DEVDESC   0x02
#define USB_STATUS_CONFDESC   0x04
#define USB_STATUS_CONFIGURED   0x08
#define USB_REQUEST_TYPE_STANDARD   0
#define USB_REQUEST_TYPE_CLASS   1
#define USB_REQUEST_TYPE_VENDOR   2
#define USB_REQUEST_DEVICE_DESCRIPTOR   0x01
#define USB_REQUEST_CONFIG_DESCRIPTOR   0x02
#define USB_REQUEST_STRING_DESCRIPTOR   0x03
#define USB_REQUEST_INTERF_DESCRIPTOR   0x04
#define USB_REQUEST_ENDPNT_DESCRIPTOR   0x05
#define USB_REQUEST_DEVQUA_DESCRIPTOR   0x06
#define USB_REQUEST_OTHSPE_DESCRIPTOR   0x07
#define USB_REQUEST_IFPOWR_DESCRIPTOR   0x08
#define USB_REQUEST_REPORT_DESCRIPTOR   0x22
#define USB_EVENT_TARGET_GENERAL   0x01
#define USB_EVENT_TARGET_MAINAPP   0x02
#define USB_EVENT_TARGET_VENDOR   0x03
#define USB_EVENT_TARGET_INTERFACE   0x04
#define USB_EVENT_CONNECT   0x01
#define USB_EVENT_DISCONNECT   0x02
#define USB_EVENT_RECEIVE   0x04
#define USB_EVENT_SENT   0x08
#define USB_EVENT_CLASSREQUEST   0x10
#define USB_EVENT_CONFIGURED   0x20
#define USB_EVENT_DECONFIGURED   0x40
#define USB_SENDING_MODE_INTERRUPT   0
#define USB_SENDING_MODE_POLLED   1
#define USB_SENDING_MODE_DMA   2
#define USB_EP0   0x00
#define USB_EP_1   0x01
#define USB_EP_2   0x02
#define USB_EP_3   0x03
#define USB_EP_4   0x04
#define USB_EP_5   0x05
#define sendEP0(x, y)   UsbFunction_SendData(0,x,y,1)
#define sendEP1(x, y)   UsbFunction_SendData(1,x,y,1)
#define sendEP2(x, y)   UsbFunction_SendData(2,x,y,1)
#define sendEP3(x, y)   UsbFunction_SendData(3,x,y,1)
#define sendEP4(x, y)   UsbFunction_SendData(4,x,y,1)
#define sendEP5(x, y)   UsbFunction_SendData(5,x,y,1)
#define DMA_OFFSET_BAPL   0
#define DMA_OFFSET_BAPM   1
#define DMA_OFFSET_BAPH   2
#define DMA_OFFSET_DMACS   3
#define DMA_OFFSET_IOAL   4
#define DMA_OFFSET_IOAH   5
#define DMA_OFFSET_DCTL   6
#define DMA_OFFSET_DCTH   7
#define DMA_DIR_HOST_OUT   0
#define DMA_DIR_HOST_IN   1

Typedefs

typedef uint8_t * puint8_t
typedef uint8_t fnuint8_t
typedef struct stc_usb_request usb_request_t
typedef struct stc_usb_buffer usb_buffer_t
typedef struct stc_usb_event usb_event_t
typedef struct stc_dma_handler dma_handler_t
typedef struct stc_usb_EP usb_EP_t

Functions

void SetupEndpoints ()
void EnableEndpoints (void)
void DisableEndpoints (void)
void ConnectEvent ()
void DisconnectEvent ()
void SetupDma (uint8_t u8EndpointNumber, uint8_t u8InterruptNumber, uint16_t u16DataSize)
void SendReceiveBufferViaDma (uint8_t u8EndpointNumber)
void ReleaseDma (uint8_t u8EndpointNumber)
void UsbFunction_ChangeDmaSettings (uint8_t u8EndpointNumber, volatile uint8_t *DISELn, volatile uint8_t *pu8DmaDescriptor)
void UsbFunction_EnableReceiveDma (uint8_t u8EndpointNumber, uint32_t u32ReceiveSize)
uint8_t UsbFunction_GetStatus ()
uint8_t UsbFunction_GetEndpointStatus (uint8_t u8EndpointNumber)
void UsbFunction_SetEventHandler (uint8_t, uint8_t, uint8_t, uint8_t(*)())
void UsbFunction_SetCustomEndpointBuffer (uint8_t, usb_buffer_t *)
void UsbFunction_EnableSOF (void)
void UsbFunction_DisableSOF (void)
void UsbFunction_SetStartOfFrameHandler (void(*handler)(uint16_t u16FrameNumber))
void UsbFunction_ClearStartOfFrameHandler (void)
void UsbFunction_Initialize ()
boolean_t UsbFunction_Connect (boolean_t bAutoConnect)
boolean_t UsbFunction_Disconnect (boolean_t bForceDisconnect)
void UsbFunction_SendData (uint8_t, puint8_t, uint32_t, uint8_t)
void UsbFunction_SetDataToSendEndpoint0 (uint8_t *, uint32_t)
void UsbFunction_EnableWakeup (boolean_t bEnableDisable)
void UsbFunction_Stall (uint8_t u8EndpointNumber)
void UsbFunction_StallRemove (uint8_t u8EndpointNumber)
void UsbReceiveSetup ()
uint8_t UsbGetDescriptor (usb_request_t *)
uint8_t UsbRequestDecode (puint8_t, uint32_t)
void UsbReceiveDataEndpoint0 ()
uint32_t UsbReceiveData (uint8_t, puint8_t)
uint8_t DummyEventHandler (usb_event_t *)
__interrupt void UsbFunction_EndpointIsr ()
__interrupt void UsbFunction_StatusControlIsr ()
__interrupt void UsbFunction_VbusIsr ()

Detailed Description

History:

Definition in file UsbFunction.h.


Define Documentation

#define CLEAR_MASK ( x,
y   )     x &= ~y

Definition at line 66 of file UsbFunction.h.

#define CLEAR_USB_STATUS_FLAG ( x   )     u8UsbStatus &= ~x

Definition at line 80 of file UsbFunction.h.

 
#define CLEAR_USB_STATUS_FLAGS (  )     u8UsbStatus = 0

Definition at line 81 of file UsbFunction.h.

#define DMA_DIR_HOST_IN   1

Definition at line 208 of file UsbFunction.h.

#define DMA_DIR_HOST_OUT   0

Definition at line 207 of file UsbFunction.h.

#define DMA_OFFSET_BAPH   2

Definition at line 201 of file UsbFunction.h.

#define DMA_OFFSET_BAPL   0

Definition at line 199 of file UsbFunction.h.

#define DMA_OFFSET_BAPM   1

Definition at line 200 of file UsbFunction.h.

#define DMA_OFFSET_DCTH   7

Definition at line 206 of file UsbFunction.h.

#define DMA_OFFSET_DCTL   6

Definition at line 205 of file UsbFunction.h.

#define DMA_OFFSET_DMACS   3

Definition at line 202 of file UsbFunction.h.

#define DMA_OFFSET_IOAH   5

Definition at line 204 of file UsbFunction.h.

#define DMA_OFFSET_IOAL   4

Definition at line 203 of file UsbFunction.h.

#define EP_CONTROL ( x   )     *(aEndpoint[x].EPnC)

Definition at line 67 of file UsbFunction.h.

#define EP_STATUS ( x   )     *(aEndpoint[x].EPnS)

Definition at line 68 of file UsbFunction.h.

#define EP_STATUS_CONFIGURED   1

Definition at line 71 of file UsbFunction.h.

#define EP_STATUS_DISABLED   2

Definition at line 72 of file UsbFunction.h.

#define EP_STATUS_DMA_ENABLED   64

Definition at line 77 of file UsbFunction.h.

#define EP_STATUS_DMA_TRANSFER   32

Definition at line 76 of file UsbFunction.h.

#define EP_STATUS_ENABLED   4

Definition at line 73 of file UsbFunction.h.

#define EP_STATUS_IDLE   0

Definition at line 70 of file UsbFunction.h.

#define EP_STATUS_RECEIVING   8

Definition at line 74 of file UsbFunction.h.

#define EP_STATUS_SENDING   16

Definition at line 75 of file UsbFunction.h.

#define IS_CLEARED ( x,
y   )     ((x & y) == 0)

Definition at line 64 of file UsbFunction.h.

#define IS_SET ( x,
y   )     ((x & y) > 0)

Definition at line 63 of file UsbFunction.h.

#define MASK_EPC_DIR   0x1000

Definition at line 91 of file UsbFunction.h.

#define MASK_EPC_DMAE   0x0800

Definition at line 90 of file UsbFunction.h.

#define MASK_EPC_EPEN   0x8000

Definition at line 93 of file UsbFunction.h.

#define MASK_EPC_NULE   0x0400

Definition at line 89 of file UsbFunction.h.

#define MASK_EPC_PKS   0x007F

Definition at line 86 of file UsbFunction.h.

#define MASK_EPC_PKS1   0x01FF

Definition at line 87 of file UsbFunction.h.

#define MASK_EPC_STAL   0x0200

Definition at line 88 of file UsbFunction.h.

#define MASK_EPC_TYPE   0x6000

Definition at line 92 of file UsbFunction.h.

#define MASK_EPS_BFINI   0x8000

Definition at line 107 of file UsbFunction.h.

#define MASK_EPS_BFINI   0x8000

Definition at line 107 of file UsbFunction.h.

#define MASK_EPS_BUSY   0x0800

Definition at line 103 of file UsbFunction.h.

#define MASK_EPS_DRQ   0x0400

Definition at line 102 of file UsbFunction.h.

#define MASK_EPS_DRQI   0x0400

Definition at line 100 of file UsbFunction.h.

#define MASK_EPS_DRQIE   0x4000

Definition at line 105 of file UsbFunction.h.

#define MASK_EPS_DRQIIE   0x4000

Definition at line 95 of file UsbFunction.h.

#define MASK_EPS_DRQO   0x0400

Definition at line 101 of file UsbFunction.h.

#define MASK_EPS_DRQOIE   0x4000

Definition at line 106 of file UsbFunction.h.

#define MASK_EPS_SIZE   0x007F

Definition at line 98 of file UsbFunction.h.

#define MASK_EPS_SIZE1   0x01FF

Definition at line 97 of file UsbFunction.h.

#define MASK_EPS_SPK   0x0200

Definition at line 99 of file UsbFunction.h.

#define MASK_EPS_SPKIE   0x2000

Definition at line 104 of file UsbFunction.h.

#define MAX_RECV_BUFFER   512

Definition at line 124 of file UsbFunction.h.

#define pu16EndpointStatusReg_DRQ   (*pu16EndpointStatusReg & 0x0400)

Definition at line 82 of file UsbFunction.h.

#define sendEP0 ( x,
y   )     UsbFunction_SendData(0,x,y,1)

Definition at line 191 of file UsbFunction.h.

#define sendEP1 ( x,
y   )     UsbFunction_SendData(1,x,y,1)

Definition at line 192 of file UsbFunction.h.

#define sendEP2 ( x,
y   )     UsbFunction_SendData(2,x,y,1)

Definition at line 193 of file UsbFunction.h.

#define sendEP3 ( x,
y   )     UsbFunction_SendData(3,x,y,1)

Definition at line 194 of file UsbFunction.h.

#define sendEP4 ( x,
y   )     UsbFunction_SendData(4,x,y,1)

Definition at line 195 of file UsbFunction.h.

#define sendEP5 ( x,
y   )     UsbFunction_SendData(5,x,y,1)

Definition at line 196 of file UsbFunction.h.

#define SET_MASK ( x,
y   )     x |= y

Definition at line 65 of file UsbFunction.h.

#define SET_pu16EndpointStatusReg_BFINI ( x   )     *pu16EndpointStatusReg = ((*pu16EndpointStatusReg & 0x7FFF) | x << 15)

Definition at line 84 of file UsbFunction.h.

#define SET_pu16EndpointStatusReg_DRQ ( x   )     *pu16EndpointStatusReg = ((*pu16EndpointStatusReg & 0xFBFF) | x << 10)

Definition at line 83 of file UsbFunction.h.

#define SET_USB_STATUS_FLAG ( x   )     u8UsbStatus |= x

Definition at line 79 of file UsbFunction.h.

#define USB_BUFFER_FAR   0

Definition at line 60 of file UsbFunction.h.

#define USB_CLEAR_FEATURE   0x01

Definition at line 135 of file UsbFunction.h.

#define USB_DEVREQ_CLSTYPE   0x20

Definition at line 127 of file UsbFunction.h.

#define USB_DEVREQ_GET_DESC   0x06

Definition at line 130 of file UsbFunction.h.

#define USB_DEVREQ_SET_DESC   0x07

Definition at line 131 of file UsbFunction.h.

#define USB_DEVREQ_SET_IDLE   0x0A

Definition at line 132 of file UsbFunction.h.

#define USB_DEVREQ_STDTYPE   0x00

Definition at line 126 of file UsbFunction.h.

#define USB_DEVREQ_VNDTYPE   0x40

Definition at line 128 of file UsbFunction.h.

#define USB_EP0   0x00

Definition at line 184 of file UsbFunction.h.

#define USB_EP_1   0x01

Definition at line 185 of file UsbFunction.h.

#define USB_EP_2   0x02

Definition at line 186 of file UsbFunction.h.

#define USB_EP_3   0x03

Definition at line 187 of file UsbFunction.h.

#define USB_EP_4   0x04

Definition at line 188 of file UsbFunction.h.

#define USB_EP_5   0x05

Definition at line 189 of file UsbFunction.h.

#define USB_EVENT_CLASSREQUEST   0x10

Definition at line 176 of file UsbFunction.h.

#define USB_EVENT_CONFIGURED   0x20

Definition at line 177 of file UsbFunction.h.

#define USB_EVENT_CONNECT   0x01

Definition at line 172 of file UsbFunction.h.

#define USB_EVENT_DECONFIGURED   0x40

Definition at line 178 of file UsbFunction.h.

#define USB_EVENT_DISCONNECT   0x02

Definition at line 173 of file UsbFunction.h.

#define USB_EVENT_RECEIVE   0x04

Definition at line 174 of file UsbFunction.h.

#define USB_EVENT_SENT   0x08

Definition at line 175 of file UsbFunction.h.

#define USB_EVENT_TARGET_GENERAL   0x01

Definition at line 167 of file UsbFunction.h.

#define USB_EVENT_TARGET_INTERFACE   0x04

Definition at line 170 of file UsbFunction.h.

#define USB_EVENT_TARGET_MAINAPP   0x02

Definition at line 168 of file UsbFunction.h.

#define USB_EVENT_TARGET_VENDOR   0x03

Definition at line 169 of file UsbFunction.h.

#define USB_FUNC_BULK_IN   0xD000

Definition at line 121 of file UsbFunction.h.

#define USB_FUNC_BULK_OUT   0xC000

Definition at line 122 of file UsbFunction.h.

#define USB_FUNC_INTR_IN   0xF000

Definition at line 119 of file UsbFunction.h.

#define USB_FUNC_INTR_OUT   0xE000

Definition at line 120 of file UsbFunction.h.

#define USB_GET_CONFIGURATION   0x08

Definition at line 140 of file UsbFunction.h.

#define USB_GET_DESCRIPTOR   0x06

Definition at line 138 of file UsbFunction.h.

#define USB_GET_INTERFACE   0x0A

Definition at line 142 of file UsbFunction.h.

#define USB_GET_STATUS   0x00

Definition at line 134 of file UsbFunction.h.

#define USB_REQUEST_CONFIG_DESCRIPTOR   0x02

Definition at line 158 of file UsbFunction.h.

#define USB_REQUEST_DEVICE_DESCRIPTOR   0x01

Definition at line 157 of file UsbFunction.h.

#define USB_REQUEST_DEVQUA_DESCRIPTOR   0x06

Definition at line 162 of file UsbFunction.h.

#define USB_REQUEST_ENDPNT_DESCRIPTOR   0x05

Definition at line 161 of file UsbFunction.h.

#define USB_REQUEST_IFPOWR_DESCRIPTOR   0x08

Definition at line 164 of file UsbFunction.h.

#define USB_REQUEST_INTERF_DESCRIPTOR   0x04

Definition at line 160 of file UsbFunction.h.

#define USB_REQUEST_OTHSPE_DESCRIPTOR   0x07

Definition at line 163 of file UsbFunction.h.

#define USB_REQUEST_REPORT_DESCRIPTOR   0x22

Definition at line 165 of file UsbFunction.h.

#define USB_REQUEST_STRING_DESCRIPTOR   0x03

Definition at line 159 of file UsbFunction.h.

#define USB_REQUEST_TYPE_CLASS   1

Definition at line 154 of file UsbFunction.h.

#define USB_REQUEST_TYPE_STANDARD   0

Definition at line 153 of file UsbFunction.h.

#define USB_REQUEST_TYPE_VENDOR   2

Definition at line 155 of file UsbFunction.h.

#define USB_SENDING_MODE_DMA   2

Definition at line 182 of file UsbFunction.h.

#define USB_SENDING_MODE_INTERRUPT   0

Definition at line 180 of file UsbFunction.h.

#define USB_SENDING_MODE_POLLED   1

Definition at line 181 of file UsbFunction.h.

#define USB_SET_ADDRESS   0x05

Definition at line 137 of file UsbFunction.h.

#define USB_SET_CONFIGURATION   0x09

Definition at line 141 of file UsbFunction.h.

#define USB_SET_DESCRIPTOR   0x07

Definition at line 139 of file UsbFunction.h.

#define USB_SET_FEATURE   0x03

Definition at line 136 of file UsbFunction.h.

#define USB_SET_INTERFACE   0x0B

Definition at line 143 of file UsbFunction.h.

#define USB_STATUS_CONFDESC   0x04

Definition at line 149 of file UsbFunction.h.

#define USB_STATUS_CONFIGURED   0x08

Definition at line 150 of file UsbFunction.h.

#define USB_STATUS_CONNECTED   0x01

Definition at line 147 of file UsbFunction.h.

#define USB_STATUS_DEVDESC   0x02

Definition at line 148 of file UsbFunction.h.

#define USB_SYNCH_FRAME   0x0C

Definition at line 144 of file UsbFunction.h.

#define USB_USE_DMA   1

Definition at line 59 of file UsbFunction.h.

#define USBATTR_BUSPOWER   0x80

Definition at line 115 of file UsbFunction.h.

#define USBATTR_REMOTEWAKE   0x20

Definition at line 117 of file UsbFunction.h.

#define USBATTR_SELFPOWER   0xC0

Definition at line 116 of file UsbFunction.h.

#define USBDESCR_CONFIG   2

Definition at line 110 of file UsbFunction.h.

#define USBDESCR_DEVICE   1

Definition at line 109 of file UsbFunction.h.

#define USBDESCR_ENDPOINT   5

Definition at line 113 of file UsbFunction.h.

#define USBDESCR_INTERFACE   4

Definition at line 112 of file UsbFunction.h.

#define USBDESCR_STRING   3

Definition at line 111 of file UsbFunction.h.


Typedef Documentation

typedef uint8_t fnuint8_t

Definition at line 219 of file UsbFunction.h.

typedef uint8_t* puint8_t

Definition at line 218 of file UsbFunction.h.

typedef struct stc_usb_buffer usb_buffer_t
typedef struct stc_usb_EP usb_EP_t
typedef struct stc_usb_event usb_event_t

Function Documentation

void ConnectEvent (  ) 

Here is the caller graph for this function:

void DisableEndpoints ( void   ) 

Here is the caller graph for this function:

void DisconnectEvent (  ) 

Here is the caller graph for this function:

uint8_t DummyEventHandler ( usb_event_t *   ) 
void EnableEndpoints ( void   ) 

Here is the caller graph for this function:

void ReleaseDma ( uint8_t  u8EndpointNumber  ) 
void SendReceiveBufferViaDma ( uint8_t  u8EndpointNumber  ) 

Here is the caller graph for this function:

void SetupDma ( uint8_t  u8EndpointNumber,
uint8_t  u8InterruptNumber,
uint16_t  u16DataSize 
)
void SetupEndpoints (  ) 
void UsbFunction_ChangeDmaSettings ( uint8_t  u8EndpointNumber,
volatile uint8_t *  DISELn,
volatile uint8_t *  pu8DmaDescriptor 
)
void UsbFunction_ClearStartOfFrameHandler ( void   ) 

Clear a Start of Frame handler

Returns:
none

Definition at line 595 of file UsbFunction.c.

boolean_t UsbFunction_Connect ( boolean_t  bAutoConnect  ) 

Connect USB function (only used if auto connect is disabled)

Parameters:
bAutoConnect can be used to auto connect/disconnect (standard)
Returns:
returns TRUE if connect was successful started

Definition at line 949 of file UsbFunction.c.

Here is the call graph for this function:

void UsbFunction_DisableSOF ( void   ) 

Disables Start of Frame Interrupt

Returns:
none

Definition at line 568 of file UsbFunction.c.

boolean_t UsbFunction_Disconnect ( boolean_t  bForceDisconnect  ) 

Disconnect USB function

Parameters:
bForceDisconnect can be used to force disconnect
Returns:
returns TRUE if connect was successful started

Definition at line 975 of file UsbFunction.c.

Here is the call graph for this function:

void UsbFunction_EnableReceiveDma ( uint8_t  u8EndpointNumber,
uint32_t  u32ReceiveSize 
)
void UsbFunction_EnableSOF ( void   ) 

Enables Start of Frame Interrupt

Returns:
none

Definition at line 555 of file UsbFunction.c.

void UsbFunction_EnableWakeup ( boolean_t  bEnableDisable  ) 

send wakeup to computer

Parameters:
bEnableDisable TRUE to enable, FALSE to disable
Returns:
none

Definition at line 1213 of file UsbFunction.c.

__interrupt void UsbFunction_EndpointIsr ( void   ) 

Interrupt Routine (USB-Function Endpoint1-5 Interrupt)

Example Vectors.c

Definition at line 1728 of file UsbFunction.c.

uint8_t UsbFunction_GetEndpointStatus ( uint8_t  u8EndpointNumber  ) 

Get the current endpoint status

Parameters:
u8Endpoint Endpoint Number (0..5)
Returns:
returns the current endpoint status

Definition at line 460 of file UsbFunction.c.

uint8_t UsbFunction_GetStatus ( void   ) 

Get the current USB status

Returns:
returns the current USB status

Definition at line 448 of file UsbFunction.c.

Here is the caller graph for this function:

void UsbFunction_Initialize (  ) 
void UsbFunction_SendData ( uint8_t  u8EndpointNumber,
puint8_t  buffer,
uint32_t  buffersize,
uint8_t  u8PollingMode 
)

Procedure to send buffer with Endpoint 0..5

Parameters:
u8EndpointNumber Endpoint number (0..5)
buffer pointer of buffer to send
buffersize size of buffer to send
Returns:
none

Definition at line 1004 of file UsbFunction.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void UsbFunction_SetCustomEndpointBuffer ( uint8_t  u8Endpoint,
usb_buffer_t *  pstcEndpointBuffer 
)

Set a custom endpoint buffer

Parameters:
u8Endpoint Endpoint number
pstcEndpointBuffer pointer to buffer struct
Returns:
none

Example:

Definition at line 612 of file UsbFunction.c.

Here is the caller graph for this function:

void UsbFunction_SetDataToSendEndpoint0 ( uint8_t *  buffer,
uint32_t  size 
)

only for Endpoint 0, used in data stage to send replies for requests

Parameters:
buffer pointer of buffer to send
buffersize size of buffer to send
Returns:
none

Definition at line 1181 of file UsbFunction.c.

void UsbFunction_SetEventHandler ( uint8_t  ,
uint8_t  ,
uint8_t  ,
uint8_t(*)()   
)
void UsbFunction_SetStartOfFrameHandler ( void(*)(uint16_t u16FrameNumber)  handler  ) 

Set a Start of Frame handler

Parameters:
handler Start Of Framehandler, type: handler(uint16_t u16FrameNumber);
Returns:
none

Definition at line 582 of file UsbFunction.c.

void UsbFunction_Stall ( uint8_t  u8EndpointNumber  ) 

Routine to stall endpoint 0

Returns:
none

Definition at line 1199 of file UsbFunction.c.

void UsbFunction_StallRemove ( uint8_t  u8EndpointNumber  ) 

Routine to unstall endpoint 0

Returns:
none

Definition at line 1230 of file UsbFunction.c.

Here is the caller graph for this function:

__interrupt void UsbFunction_StatusControlIsr ( void   ) 

Interrupt Routine (USB-Function Status & Control Interrupt)

Note:
Used for control interrupts and endpoint 0 data receive / sent interrupts

Example Vectors.c

Definition at line 1839 of file UsbFunction.c.

__interrupt void UsbFunction_VbusIsr ( void   ) 

Interrupt Routine (USB-Function VBUS Interrupt)

Example Vectors.c

Definition at line 1920 of file UsbFunction.c.

uint8_t UsbGetDescriptor ( usb_request_t *   ) 
uint32_t UsbReceiveData ( uint8_t  ,
puint8_t   
)

Here is the caller graph for this function:

void UsbReceiveDataEndpoint0 (  ) 

Here is the caller graph for this function:

void UsbReceiveSetup (  ) 

Here is the caller graph for this function:

uint8_t UsbRequestDecode ( puint8_t  ,
uint32_t   
)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Wed Mar 31 11:15:11 2010 for UsbFunction by  doxygen 1.6.1