M480 BSP V3.05.005
The Board Support Package for M480 Series
Macros | Typedefs | Functions | Variables

Macros

#define HSUSBD_ENABLE_USB()
 
#define HSUSBD_DISABLE_USB()
 
#define HSUSBD_ENABLE_PHY()
 
#define HSUSBD_DISABLE_PHY()
 
#define HSUSBD_SET_SE0()
 
#define HSUSBD_CLR_SE0()
 
#define HSUSBD_SET_ADDR(addr)
 
#define HSUSBD_GET_ADDR()
 
#define HSUSBD_ENABLE_USB_INT(intr)
 
#define HSUSBD_ENABLE_BUS_INT(intr)
 
#define HSUSBD_GET_BUS_INT_FLAG()
 
#define HSUSBD_CLR_BUS_INT_FLAG(flag)
 
#define HSUSBD_ENABLE_CEP_INT(intr)
 
#define HSUSBD_CLR_CEP_INT_FLAG(flag)
 
#define HSUSBD_SET_CEP_STATE(flag)
 
#define HSUSBD_START_CEP_IN(size)
 
#define HSUSBD_SET_MAX_PAYLOAD(ep, size)
 
#define HSUSBD_ENABLE_EP_INT(ep, intr)
 
#define HSUSBD_GET_EP_INT_FLAG(ep)
 
#define HSUSBD_CLR_EP_INT_FLAG(ep, flag)
 
#define HSUSBD_SET_DMA_LEN(len)
 
#define HSUSBD_SET_DMA_ADDR(addr)
 
#define HSUSBD_SET_DMA_READ(epnum)
 
#define HSUSBD_SET_DMA_WRITE(epnum)
 
#define HSUSBD_ENABLE_DMA()
 
#define HSUSBD_IS_ATTACHED()
 

Typedefs

typedef void(* HSUSBD_VENDOR_REQ) (void)
 
typedef void(* HSUSBD_CLASS_REQ) (void)
 
typedef void(* HSUSBD_SET_INTERFACE_REQ) (uint32_t u32AltInterface)
 

Functions

__STATIC_INLINE void HSUSBD_MemCopy (uint8_t u8Dst[], uint8_t u8Src[], uint32_t u32Size)
 HSUSBD_memcpy, Copy bytes hardware limitation. More...
 
__STATIC_INLINE void HSUSBD_ResetDMA (void)
 HSUSBD_ResetDMA. More...
 
__STATIC_INLINE void HSUSBD_SetEpBufAddr (uint32_t u32Ep, uint32_t u32Base, uint32_t u32Len)
 HSUSBD_SetEpBufAddr, Set Endpoint buffer address. More...
 
__STATIC_INLINE void HSUSBD_ConfigEp (uint32_t u32Ep, uint32_t u32EpNum, uint32_t u32EpType, uint32_t u32EpDir)
 HSUSBD_ConfigEp, Config Endpoint. More...
 
__STATIC_INLINE void HSUSBD_SetEpStall (uint32_t u32Ep)
 Set USB endpoint stall state. More...
 
__STATIC_INLINE void HSUSBD_SetStall (uint32_t u32EpNum)
 Set USB endpoint stall state. More...
 
__STATIC_INLINE void HSUSBD_ClearEpStall (uint32_t u32Ep)
 Clear USB endpoint stall state. More...
 
__STATIC_INLINE void HSUSBD_ClearStall (uint32_t u32EpNum)
 Clear USB endpoint stall state. More...
 
__STATIC_INLINE uint32_t HSUSBD_GetEpStall (uint32_t u32Ep)
 Get USB endpoint stall state. More...
 
__STATIC_INLINE uint32_t HSUSBD_GetStall (uint32_t u32EpNum)
 Get USB endpoint stall state. More...
 
void HSUSBD_Open (S_HSUSBD_INFO_T *param, HSUSBD_CLASS_REQ pfnClassReq, HSUSBD_SET_INTERFACE_REQ pfnSetInterface)
 HSUSBD Initial. More...
 
void HSUSBD_Start (void)
 HSUSBD Start. More...
 
void HSUSBD_ProcessSetupPacket (void)
 Process Setup Packet. More...
 
void HSUSBD_StandardRequest (void)
 Process USB standard request. More...
 
void HSUSBD_UpdateDeviceState (void)
 Update Device State. More...
 
void HSUSBD_PrepareCtrlIn (uint8_t pu8Buf[], uint32_t u32Size)
 Prepare Control IN transaction. More...
 
void HSUSBD_CtrlIn (void)
 Start Control IN transfer. More...
 
void HSUSBD_CtrlOut (uint8_t pu8Buf[], uint32_t u32Size)
 Start Control OUT transaction. More...
 
void HSUSBD_SwReset (void)
 Clear all software flags. More...
 
void HSUSBD_SetVendorRequest (HSUSBD_VENDOR_REQ pfnVendorReq)
 HSUSBD Set Vendor Request. More...
 
int HSUSBD_GetDescriptor (void)
 Get Descriptor request. More...
 

Variables

uint8_t HSUSBD_CMD_STRUCT::bmRequestType
 
uint8_t HSUSBD_CMD_STRUCT::bRequest
 
uint16_t HSUSBD_CMD_STRUCT::wValue
 
uint16_t HSUSBD_CMD_STRUCT::wIndex
 
uint16_t HSUSBD_CMD_STRUCT::wLength
 
uint8_t * s_hsusbd_info::gu8DevDesc
 
uint8_t * s_hsusbd_info::gu8ConfigDesc
 
uint8_t ** s_hsusbd_info::gu8StringDesc
 
uint8_t * s_hsusbd_info::gu8QualDesc
 
uint8_t * s_hsusbd_info::gu8FullConfigDesc
 
uint8_t * s_hsusbd_info::gu8HSOtherConfigDesc
 
uint8_t * s_hsusbd_info::gu8FSOtherConfigDesc
 
uint8_t ** s_hsusbd_info::gu8HidReportDesc
 
uint32_t * s_hsusbd_info::gu32HidReportSize
 
uint32_t * s_hsusbd_info::gu32ConfigHidDescIdx
 

Detailed Description

HIDDEN_SYMBOLS

Macro Definition Documentation

◆ HSUSBD_CLR_BUS_INT_FLAG

#define HSUSBD_CLR_BUS_INT_FLAG (   flag)

Clear Bus interrupt flag

Definition at line 144 of file hsusbd.h.

◆ HSUSBD_CLR_CEP_INT_FLAG

#define HSUSBD_CLR_CEP_INT_FLAG (   flag)

Clear CEP interrupt flag

Definition at line 146 of file hsusbd.h.

◆ HSUSBD_CLR_EP_INT_FLAG

#define HSUSBD_CLR_EP_INT_FLAG (   ep,
  flag 
)

Clear EPx interrupt flag

Definition at line 152 of file hsusbd.h.

◆ HSUSBD_CLR_SE0

#define HSUSBD_CLR_SE0 ( )

Disable SE0

Definition at line 138 of file hsusbd.h.

◆ HSUSBD_DISABLE_PHY

#define HSUSBD_DISABLE_PHY ( )

Disable PHY

Definition at line 136 of file hsusbd.h.

◆ HSUSBD_DISABLE_USB

#define HSUSBD_DISABLE_USB ( )

Disable USB

Definition at line 134 of file hsusbd.h.

◆ HSUSBD_ENABLE_BUS_INT

#define HSUSBD_ENABLE_BUS_INT (   intr)

Enable BUS Interrupt

Definition at line 142 of file hsusbd.h.

◆ HSUSBD_ENABLE_CEP_INT

#define HSUSBD_ENABLE_CEP_INT (   intr)

Enable CEP Interrupt

Definition at line 145 of file hsusbd.h.

◆ HSUSBD_ENABLE_DMA

#define HSUSBD_ENABLE_DMA ( )

Enable DMA transfer

Definition at line 157 of file hsusbd.h.

◆ HSUSBD_ENABLE_EP_INT

#define HSUSBD_ENABLE_EP_INT (   ep,
  intr 
)

Enable EPx Interrupt

Definition at line 150 of file hsusbd.h.

◆ HSUSBD_ENABLE_PHY

#define HSUSBD_ENABLE_PHY ( )

Enable PHY

Definition at line 135 of file hsusbd.h.

◆ HSUSBD_ENABLE_USB

#define HSUSBD_ENABLE_USB ( )

Enable USB

Definition at line 133 of file hsusbd.h.

◆ HSUSBD_ENABLE_USB_INT

#define HSUSBD_ENABLE_USB_INT (   intr)

Enable USB Interrupt

Definition at line 141 of file hsusbd.h.

◆ HSUSBD_GET_ADDR

#define HSUSBD_GET_ADDR ( )

Get USB address

Definition at line 140 of file hsusbd.h.

◆ HSUSBD_GET_BUS_INT_FLAG

#define HSUSBD_GET_BUS_INT_FLAG ( )

Get Bus interrupt flag

Definition at line 143 of file hsusbd.h.

◆ HSUSBD_GET_EP_INT_FLAG

#define HSUSBD_GET_EP_INT_FLAG (   ep)

Get EPx interrupt flag

Definition at line 151 of file hsusbd.h.

◆ HSUSBD_IS_ATTACHED

#define HSUSBD_IS_ATTACHED ( )

Check cable connect state

Definition at line 158 of file hsusbd.h.

◆ HSUSBD_SET_ADDR

#define HSUSBD_SET_ADDR (   addr)

Set USB address

Definition at line 139 of file hsusbd.h.

◆ HSUSBD_SET_CEP_STATE

#define HSUSBD_SET_CEP_STATE (   flag)

Set CEP state

Definition at line 147 of file hsusbd.h.

◆ HSUSBD_SET_DMA_ADDR

#define HSUSBD_SET_DMA_ADDR (   addr)

Set DMA transfer address

Definition at line 154 of file hsusbd.h.

◆ HSUSBD_SET_DMA_LEN

#define HSUSBD_SET_DMA_LEN (   len)

Set DMA transfer length

Definition at line 153 of file hsusbd.h.

◆ HSUSBD_SET_DMA_READ

#define HSUSBD_SET_DMA_READ (   epnum)

Set DMA transfer type to read

Definition at line 155 of file hsusbd.h.

◆ HSUSBD_SET_DMA_WRITE

#define HSUSBD_SET_DMA_WRITE (   epnum)

Set DMA transfer type to write

Definition at line 156 of file hsusbd.h.

◆ HSUSBD_SET_MAX_PAYLOAD

#define HSUSBD_SET_MAX_PAYLOAD (   ep,
  size 
)

Set EPx Maximum Packet Size

Definition at line 149 of file hsusbd.h.

◆ HSUSBD_SET_SE0

#define HSUSBD_SET_SE0 ( )

Enable SE0, Force USB PHY Transceiver to Drive SE0

Definition at line 137 of file hsusbd.h.

◆ HSUSBD_START_CEP_IN

#define HSUSBD_START_CEP_IN (   size)

Start CEP IN Transfer

Definition at line 148 of file hsusbd.h.

Typedef Documentation

◆ HSUSBD_CLASS_REQ

typedef void(* HSUSBD_CLASS_REQ) (void)

USB Class request callback function

Definition at line 354 of file hsusbd.h.

◆ HSUSBD_SET_INTERFACE_REQ

typedef void(* HSUSBD_SET_INTERFACE_REQ) (uint32_t u32AltInterface)

USB Standard request "Set Interface" callback function

Definition at line 355 of file hsusbd.h.

◆ HSUSBD_VENDOR_REQ

typedef void(* HSUSBD_VENDOR_REQ) (void)

USB Vendor request callback function

Definition at line 353 of file hsusbd.h.

Function Documentation

◆ HSUSBD_ClearEpStall()

__STATIC_INLINE void HSUSBD_ClearEpStall ( uint32_t  u32Ep)

Clear USB endpoint stall state.

Parameters
[in]u32EpThe USB endpoint ID.
Returns
None

Clear USB endpoint stall state for the specified endpoint ID. Endpoint will respond ACK/NAK token.

Definition at line 288 of file hsusbd.h.

◆ HSUSBD_ClearStall()

__STATIC_INLINE void HSUSBD_ClearStall ( uint32_t  u32EpNum)

Clear USB endpoint stall state.

Parameters
[in]u32EpNumUSB endpoint
Returns
None

Clear USB endpoint stall state, endpoint will return ACK/NAK token.

Definition at line 301 of file hsusbd.h.

◆ HSUSBD_ConfigEp()

__STATIC_INLINE void HSUSBD_ConfigEp ( uint32_t  u32Ep,
uint32_t  u32EpNum,
uint32_t  u32EpType,
uint32_t  u32EpDir 
)

HSUSBD_ConfigEp, Config Endpoint.

Parameters
[in]u32EpUSB endpoint
[in]u32EpNumEndpoint number
[in]u32EpTypeEndpoint type
[in]u32EpDirEndpoint direction
Return values
None.

Definition at line 218 of file hsusbd.h.

◆ HSUSBD_CtrlIn()

void HSUSBD_CtrlIn ( void  )

Start Control IN transfer.

Parameters
[in]None
Returns
None

This function is used to start Control IN

Definition at line 634 of file hsusbd.c.

◆ HSUSBD_CtrlOut()

void HSUSBD_CtrlOut ( uint8_t  pu8Buf[],
uint32_t  u32Size 
)

Start Control OUT transaction.

Parameters
[in]pu8BufControl OUT data pointer
[in]u32SizeOUT transfer size
Returns
None

This function is used to start Control OUT transfer

Definition at line 676 of file hsusbd.c.

◆ HSUSBD_GetDescriptor()

int HSUSBD_GetDescriptor ( void  )

Get Descriptor request.

Parameters
[in]None
Returns
None

This function is used to process GetDescriptor request.

Definition at line 170 of file hsusbd.c.

◆ HSUSBD_GetEpStall()

__STATIC_INLINE uint32_t HSUSBD_GetEpStall ( uint32_t  u32Ep)

Get USB endpoint stall state.

Parameters
[in]u32EpThe USB endpoint ID.
Return values
0USB endpoint is not stalled.
OthersUSB endpoint is stalled.

Get USB endpoint stall state of the specified endpoint ID.

Definition at line 321 of file hsusbd.h.

◆ HSUSBD_GetStall()

__STATIC_INLINE uint32_t HSUSBD_GetStall ( uint32_t  u32EpNum)

Get USB endpoint stall state.

Parameters
[in]u32EpNumUSB endpoint
Return values
0USB endpoint is not stalled.
non-0USB endpoint is stalled.

Get USB endpoint stall state.

Definition at line 335 of file hsusbd.h.

◆ HSUSBD_MemCopy()

__STATIC_INLINE void HSUSBD_MemCopy ( uint8_t  u8Dst[],
uint8_t  u8Src[],
uint32_t  u32Size 
)

HSUSBD_memcpy, Copy bytes hardware limitation.

Parameters
[in]u8DstDestination pointer.
[in]u8SrcSource pointer.
[in]u32SizeCopy size.
Return values
None.

Definition at line 167 of file hsusbd.h.

◆ HSUSBD_Open()

void HSUSBD_Open ( S_HSUSBD_INFO_T param,
HSUSBD_CLASS_REQ  pfnClassReq,
HSUSBD_SET_INTERFACE_REQ  pfnSetInterface 
)

HSUSBD Initial.

HIDDEN_SYMBOLS

Parameters
[in]paramDescriptor
[in]pfnClassReqClass Request Callback Function
[in]pfnSetInterfaceSetInterface Request Callback Function
Returns
None

This function is used to initial HSUSBD.

Definition at line 70 of file hsusbd.c.

◆ HSUSBD_PrepareCtrlIn()

void HSUSBD_PrepareCtrlIn ( uint8_t  pu8Buf[],
uint32_t  u32Size 
)

Prepare Control IN transaction.

Parameters
[in]pu8BufControl IN data pointer
[in]u32SizeIN transfer size
Returns
None

This function is used to prepare Control IN transfer

Definition at line 617 of file hsusbd.c.

◆ HSUSBD_ProcessSetupPacket()

void HSUSBD_ProcessSetupPacket ( void  )

Process Setup Packet.

Parameters
[in]None
Returns
None

This function is used to process Setup packet.

Definition at line 119 of file hsusbd.c.

◆ HSUSBD_ResetDMA()

__STATIC_INLINE void HSUSBD_ResetDMA ( void  )

HSUSBD_ResetDMA.

Parameters
None
Return values
None.

Definition at line 183 of file hsusbd.h.

◆ HSUSBD_SetEpBufAddr()

__STATIC_INLINE void HSUSBD_SetEpBufAddr ( uint32_t  u32Ep,
uint32_t  u32Base,
uint32_t  u32Len 
)

HSUSBD_SetEpBufAddr, Set Endpoint buffer address.

Parameters
[in]u32EpEndpoint Number
[in]u32BaseBuffer Start Address
[in]u32LenBuffer length
Return values
None.

Definition at line 196 of file hsusbd.h.

◆ HSUSBD_SetEpStall()

__STATIC_INLINE void HSUSBD_SetEpStall ( uint32_t  u32Ep)

Set USB endpoint stall state.

Parameters
[in]u32EpThe USB endpoint ID.
Returns
None

Set USB endpoint stall state for the specified endpoint ID. Endpoint will respond STALL token automatically.

Definition at line 242 of file hsusbd.h.

◆ HSUSBD_SetStall()

__STATIC_INLINE void HSUSBD_SetStall ( uint32_t  u32EpNum)

Set USB endpoint stall state.

Parameters
[in]u32EpNumUSB endpoint
Returns
None

Set USB endpoint stall state, endpoint will return STALL token.

Definition at line 262 of file hsusbd.h.

◆ HSUSBD_SetVendorRequest()

void HSUSBD_SetVendorRequest ( HSUSBD_VENDOR_REQ  pfnVendorReq)

HSUSBD Set Vendor Request.

Parameters
[in]pfnVendorReqVendor Request Callback Function
Returns
None

This function is used to set HSUSBD vendor request callback function

Definition at line 723 of file hsusbd.c.

◆ HSUSBD_StandardRequest()

void HSUSBD_StandardRequest ( void  )

Process USB standard request.

Parameters
[in]None
Returns
None

This function is used to process USB Standard Request.

Definition at line 332 of file hsusbd.c.

◆ HSUSBD_Start()

void HSUSBD_Start ( void  )

HSUSBD Start.

Parameters
[in]None
Returns
None

This function is used to start transfer

Definition at line 104 of file hsusbd.c.

◆ HSUSBD_SwReset()

void HSUSBD_SwReset ( void  )

Clear all software flags.

Parameters
[in]None
Returns
None

This function is used to clear all software control flag

Definition at line 702 of file hsusbd.c.

◆ HSUSBD_UpdateDeviceState()

void HSUSBD_UpdateDeviceState ( void  )

Update Device State.

Parameters
[in]None
Returns
None

This function is used to update Device state when Setup packet complete HIDDEN_SYMBOLS

Definition at line 524 of file hsusbd.c.

Variable Documentation

◆ bmRequestType

uint8_t HSUSBD_CMD_STRUCT::bmRequestType

Definition at line 88 of file hsusbd.h.

◆ bRequest

uint8_t HSUSBD_CMD_STRUCT::bRequest

Definition at line 89 of file hsusbd.h.

◆ gu32ConfigHidDescIdx

uint32_t* s_hsusbd_info::gu32ConfigHidDescIdx

Pointer for HID Descriptor start index

Definition at line 110 of file hsusbd.h.

◆ gu32HidReportSize

uint32_t* s_hsusbd_info::gu32HidReportSize

Pointer for HID Report descriptor Size

Definition at line 109 of file hsusbd.h.

◆ gu8ConfigDesc

uint8_t* s_hsusbd_info::gu8ConfigDesc

Config descriptor

Definition at line 102 of file hsusbd.h.

◆ gu8DevDesc

uint8_t* s_hsusbd_info::gu8DevDesc

Device descriptor

Definition at line 101 of file hsusbd.h.

◆ gu8FSOtherConfigDesc

uint8_t* s_hsusbd_info::gu8FSOtherConfigDesc

Other Speed Config descriptor

Definition at line 107 of file hsusbd.h.

◆ gu8FullConfigDesc

uint8_t* s_hsusbd_info::gu8FullConfigDesc

Full Speed Config descriptor

Definition at line 105 of file hsusbd.h.

◆ gu8HidReportDesc

uint8_t** s_hsusbd_info::gu8HidReportDesc

Pointer for HID Report descriptor

Definition at line 108 of file hsusbd.h.

◆ gu8HSOtherConfigDesc

uint8_t* s_hsusbd_info::gu8HSOtherConfigDesc

Other Speed Config descriptor

Definition at line 106 of file hsusbd.h.

◆ gu8QualDesc

uint8_t* s_hsusbd_info::gu8QualDesc

Qualifier descriptor

Definition at line 104 of file hsusbd.h.

◆ gu8StringDesc

uint8_t** s_hsusbd_info::gu8StringDesc

Pointer for USB String Descriptor pointers

Definition at line 103 of file hsusbd.h.

◆ wIndex

uint16_t HSUSBD_CMD_STRUCT::wIndex

Definition at line 91 of file hsusbd.h.

◆ wLength

uint16_t HSUSBD_CMD_STRUCT::wLength

Definition at line 92 of file hsusbd.h.

◆ wValue

uint16_t HSUSBD_CMD_STRUCT::wValue

Definition at line 90 of file hsusbd.h.