Nut/OS  5.0.5
API Reference
otgd_fs_dev.h File Reference
Include dependency graph for otgd_fs_dev.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define OTG_DEV_EP_TYPE_CONTROL   0
#define OTG_DEV_EP_TYPE_ISOC   1
#define OTG_DEV_EP_TYPE_BULK   2
#define OTG_DEV_EP_TYPE_INT   3
#define EP0_OUT   0x00
#define EP0_IN   0x80
#define EP1_OUT   0x01
#define EP1_IN   0x81
#define EP2_OUT   0x02
#define EP2_IN   0x82
#define EP3_OUT   0x03
#define EP3_IN   0x83
#define ENDP0   ((uint8_t)0)
#define ENDP1   ((uint8_t)1)
#define ENDP2   ((uint8_t)2)
#define ENDP3   ((uint8_t)3)
#define ENDP4   ((uint8_t)4)
#define ENDP5   ((uint8_t)5)
#define ENDP6   ((uint8_t)6)
#define ENDP7   ((uint8_t)7)
#define EP_TX_DIS   DEV_EP_TX_DIS)
#define EP_TX_STALL   DEV_EP_TX_STALL
#define EP_TX_NAK   DEV_EP_TX_NAK
#define EP_TX_VALID   DEV_EP_TX_VALID
#define EP_RX_DIS   DEV_EP_RX_DIS
#define EP_RX_STALL   DEV_EP_RX_STALL
#define EP_RX_NAK   DEV_EP_RX_NAK
#define EP_RX_VALID   DEV_EP_RX_VALID
#define _GetEPTxStatus(bEpNum)   ((uint16_t)OTG_DEV_GetEPTxStatus(bEpNum))
#define _GetEPRxStatus(bEpNum)   ((uint16_t)OTG_DEV_GetEPRxStatus(bEpNum))
#define _SetEPTxStatus(bEpNum, wState)   (OTG_DEV_SetEPTxStatus(bEpNum, wState))
#define _SetEPRxStatus(bEpNum, wState)   (OTG_DEV_SetEPRxStatus(bEpNum, wState))
#define _SetEPTxValid(bEpNum)   (OTG_DEV_SetEPTxStatus(bEpNum, EP_TX_VALID))
#define _SetEPRxValid(bEpNum)   (OTG_DEV_SetEPRxStatus(bEpNum, EP_RX_VALID))
#define _GetTxStallStatus(bEpNum)   (OTG_DEV_GetEPTxStatus(bEpNum) == EP_TX_STALL)
#define _GetRxStallStatus(bEpNum)   (OTG_DEV_GetEPRxStatus(bEpNum) == EP_RX_STALL)
#define OTGD_FS_DEVICE_RESET   Device_Property.Reset()

Functions

void OTG_DEV_Init (void)
void OTG_DEV_EP_Init (uint8_t bEpAdd, uint8_t bEpType, uint16_t wEpMaxPackSize)
void OTG_DEV_SetEPRxStatus (uint8_t bEpnum, uint32_t status)
void OTG_DEV_SetEPTxStatus (uint8_t bEpnum, uint32_t status)
uint32_t OTG_DEV_GetEPRxStatus (uint8_t bEpnum)
uint32_t OTG_DEV_GetEPTxStatus (uint8_t bEpnum)
void USB_DevDisconnect (void)
void USB_DevConnect (void)
void SetEPTxStatus (uint8_t bEpNum, uint16_t wState)
void SetEPRxStatus (uint8_t bEpNum, uint16_t wState)
uint16_t GetEPTxStatus (uint8_t bEpNum)
uint16_t GetEPRxStatus (uint8_t bEpNum)
void SetEPTxValid (uint8_t bEpNum)
void SetEPRxValid (uint8_t bEpNum)
uint16_t GetTxStallStatus (uint8_t bEpNum)
uint16_t GetRxStallStatus (uint8_t bEpNum)
void SetEPTxCount (uint8_t bEpNum, uint16_t wCount)
void SetEPRxCount (uint8_t bEpNum, uint16_t wCount)
uint16_t ToWord (uint8_t, uint8_t)
uint16_t ByteSwap (uint16_t)

Define Documentation

#define OTG_DEV_EP_TYPE_CONTROL   0
#define OTG_DEV_EP_TYPE_ISOC   1
#define OTG_DEV_EP_TYPE_BULK   2

Referenced by Virtual_Com_Port_Reset().

#define OTG_DEV_EP_TYPE_INT   3
#define EP0_OUT   0x00
#define EP0_IN   0x80
#define EP1_OUT   0x01
#define EP1_IN   0x81

Referenced by Virtual_Com_Port_Reset().

#define EP2_OUT   0x02
#define EP2_IN   0x82
#define EP3_OUT   0x03
#define EP3_IN   0x83
#define ENDP1   ((uint8_t)1)
#define ENDP2   ((uint8_t)2)
#define ENDP3   ((uint8_t)3)
#define ENDP4   ((uint8_t)4)
#define ENDP5   ((uint8_t)5)
#define ENDP6   ((uint8_t)6)
#define ENDP7   ((uint8_t)7)
#define EP_TX_DIS   DEV_EP_TX_DIS)
#define EP_TX_STALL   DEV_EP_TX_STALL
#define EP_TX_NAK   DEV_EP_TX_NAK
#define EP_TX_VALID   DEV_EP_TX_VALID
#define EP_RX_DIS   DEV_EP_RX_DIS
#define EP_RX_STALL   DEV_EP_RX_STALL
#define EP_RX_NAK   DEV_EP_RX_NAK
#define EP_RX_VALID   DEV_EP_RX_VALID
#define _GetEPTxStatus (   bEpNum)    ((uint16_t)OTG_DEV_GetEPTxStatus(bEpNum))
#define _GetEPRxStatus (   bEpNum)    ((uint16_t)OTG_DEV_GetEPRxStatus(bEpNum))
#define _SetEPTxStatus (   bEpNum,
  wState 
)    (OTG_DEV_SetEPTxStatus(bEpNum, wState))
#define _SetEPRxStatus (   bEpNum,
  wState 
)    (OTG_DEV_SetEPRxStatus(bEpNum, wState))
#define _SetEPTxValid (   bEpNum)    (OTG_DEV_SetEPTxStatus(bEpNum, EP_TX_VALID))
#define _SetEPRxValid (   bEpNum)    (OTG_DEV_SetEPRxStatus(bEpNum, EP_RX_VALID))
#define _GetTxStallStatus (   bEpNum)    (OTG_DEV_GetEPTxStatus(bEpNum) == EP_TX_STALL)
#define _GetRxStallStatus (   bEpNum)    (OTG_DEV_GetEPRxStatus(bEpNum) == EP_RX_STALL)
#define OTGD_FS_DEVICE_RESET   Device_Property.Reset()

Function Documentation

void OTG_DEV_EP_Init ( uint8_t  bEpAdd,
uint8_t  bEpType,
uint16_t  wEpMaxPackSize 
)

References usb_ep_descriptor::bEndpointAddress, usb_ep_descriptor::bmAttributes, DEV_EP_TX_NAK, USB_OTG_ep::even_odd_frame, OTG_DEV_SetEPTxStatus(), OTGD_FS_EPStartXfer(), OTGD_FS_PCD_EP_Flush(), OTGD_FS_PCD_EP_Open(), OTGD_FS_PCD_GetInEP(), OTGD_FS_PCD_GetOutEP(), and usb_ep_descriptor::wMaxPacketSize.

Referenced by Virtual_Com_Port_Reset().

Here is the call graph for this function:

void OTG_DEV_SetEPRxStatus ( uint8_t  bEpnum,
uint32_t  status 
)

References OTGD_FS_Dev_SetEPStatus(), and OTGD_FS_PCD_GetOutEP().

Referenced by OTGD_FS_Handle_InEP_ISR().

Here is the call graph for this function:

void OTG_DEV_SetEPTxStatus ( uint8_t  bEpnum,
uint32_t  status 
)

References DEV_EP_TX_STALL, USB_OTG_ep::is_in, OTGD_FS_Dev_SetEPStatus(), and OTGD_FS_PCD_GetInEP().

Referenced by OTG_DEV_EP_Init(), OTGD_FS_Handle_InEP_ISR(), and OTGD_FS_Handle_OutEP_ISR().

Here is the call graph for this function:

uint32_t OTG_DEV_GetEPRxStatus ( uint8_t  bEpnum)

References OTGD_FS_Dev_GetEPStatus(), and OTGD_FS_PCD_GetOutEP().

Here is the call graph for this function:

uint32_t OTG_DEV_GetEPTxStatus ( uint8_t  bEpnum)

References OTGD_FS_Dev_GetEPStatus(), and OTGD_FS_PCD_GetInEP().

Referenced by OTGD_FS_Handle_InEP_ISR().

Here is the call graph for this function:

void USB_DevDisconnect ( void  )

References OTGD_FS_PCD_DevDisconnect().

Referenced by USB_Cable_Config().

Here is the call graph for this function:

void USB_DevConnect ( void  )

References OTGD_FS_PCD_DevConnect().

Referenced by USB_Cable_Config().

Here is the call graph for this function:

void SetEPTxStatus ( uint8_t  bEpNum,
uint16_t  wState 
)

References _SetEPTxStatus.

Referenced by Standard_ClearFeature().

void SetEPRxStatus ( uint8_t  bEpNum,
uint16_t  wState 
)

References _SetEPRxStatus.

uint16_t GetEPTxStatus ( uint8_t  bEpNum)

References _GetEPTxStatus.

uint16_t GetEPRxStatus ( uint8_t  bEpNum)

References _GetEPRxStatus.

void SetEPTxValid ( uint8_t  bEpNum)

References _SetEPTxStatus, and EP_TX_VALID.

void SetEPRxValid ( uint8_t  bEpNum)

References _SetEPRxStatus, and EP_RX_VALID.

uint16_t GetTxStallStatus ( uint8_t  bEpNum)

References _GetTxStallStatus.

uint16_t GetRxStallStatus ( uint8_t  bEpNum)

References _GetRxStallStatus.

void SetEPTxCount ( uint8_t  bEpNum,
uint16_t  wCount 
)
void SetEPRxCount ( uint8_t  bEpNum,
uint16_t  wCount 
)
uint16_t ToWord ( uint8_t  ,
uint8_t   
)
uint16_t ByteSwap ( uint16_t  )

Referenced by Setup0_Process().