📄 usb_hw.h
字号:
Int32U EpCtrlGet_DTOG_TX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlClr_CTR_TX
* Parameters: volatile pInt32U pReg
*
* Return: none
*
* Description: Clear EP CTR_TX bit (IN)
*
*************************************************************************/
void EpCtrlClr_CTR_TX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlGet_CTR_TX
* Parameters: volatile pInt32U pReg
*
* Return: UserFunc_t
*
* Description: Get EP CTR_TX bit (IN)
*
*************************************************************************/
inline
Int32U EpCtrlGet_CTR_TX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlSet_EP_KIND
* Parameters: volatile pInt32U pReg, Int32U Data
*
* Return: none
*
* Description: Set EP KIND bit
*
*************************************************************************/
void EpCtrlSet_EP_KIND (volatile pInt32U pReg, Int32U Data);
/*************************************************************************
* Function Name: EpCtrlGet_EP_KIND
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP KIND bit
*
*************************************************************************/
inline
Int32U EpCtrlGet_EP_KIND(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlSet_EP_TYPE
* Parameters: volatile pInt32U pReg, EpType_t Data
*
* Return: none
*
* Description: Set EP type
*
*************************************************************************/
void EpCtrlSet_EP_TYPE(volatile pInt32U pReg, EpType_t Data);
/*************************************************************************
* Function Name: EpCtrlGet_EP_TYPE
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP type
*
*************************************************************************/
inline
Int32U EpCtrlGet_EP_TYPE(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlGet_SETUP
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP SETUP bit
*
*************************************************************************/
inline
Int32U EpCtrlGet_SETUP(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlSet_STAT_RX
* Parameters: volatile pInt32U pReg, EpState_t Data
*
* Return: none
*
* Description: Set EP STAT_RX (OUT)
*
*************************************************************************/
void EpCtrlSet_STAT_RX (volatile pInt32U pReg, EpState_t Data);
/*************************************************************************
* Function Name: EpCtrlGet_STAT_RX
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP STAT_RX (OUT)
*
*************************************************************************/
inline
Int32U EpCtrlGet_STAT_RX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlSet_DTOG_RX
* Parameters: volatile pInt32U pReg, Int32U Data
*
* Return: none
*
* Description: Set DTOG_RX bit
*
*************************************************************************/
void EpCtrlSet_DTOG_RX(volatile pInt32U pReg, Int32U Data);
/*************************************************************************
* Function Name: EpCtrlToggle_DTOG_RX
* Parameters: volatile Int16U pReg
*
* Return: none
*
* Description: Toggle DTOG_RX bit
*
*************************************************************************/
void EpCtrlToggle_DTOG_RX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlGet_DTOG_RX
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP DTOG_RX bit (OUT)
*
*************************************************************************/
inline
Int32U EpCtrlGet_DTOG_RX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlClr_CTR_RX
* Parameters: volatile pInt32U pReg
*
* Return: none
*
* Description: Clear EP CTR_RX bit (OUT)
*
*************************************************************************/
void EpCtrlClr_CTR_RX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: EpCtrlGet_CTR_RX
* Parameters: volatile pInt32U pReg
*
* Return: Int32U
*
* Description: Get EP CTR_RX bit (OUT)
*
*************************************************************************/
inline
Int32U EpCtrlGet_CTR_RX(volatile pInt32U pReg);
/*************************************************************************
* Function Name: USB_HwInit
* Parameters: none
*
* Return: none
*
* Description: Init USB
*
*************************************************************************/
void USB_HwInit(void);
/*************************************************************************
* Function Name: USB_HwReset
* Parameters: none
*
* Return: none
*
* Description: Reset USB engine
*
*************************************************************************/
void USB_HwReset (void);
/*************************************************************************
* Function Name: USB_RealizeEp
* Parameters: const UsbStandardEpDescriptor_t * pEP_Desc,
* const UsbEP_ExtData_t * pUsbEP_ExtData, Boolean Enable
*
* Return: USB_ErrorCodes_t
*
* Description: Enable or disable an endpoint
*
*************************************************************************/
USB_ErrorCodes_t USB_RealizeEp(const UsbStandardEpDescriptor_t * pEP_Desc,
const UsbEP_ExtData_t * pUsbEP_ExtData,
Boolean Enable);
/*************************************************************************
* Function Name: USB_SetAdd
* Parameters: Int32U DevAdd - device address between 0 - 127
*
* Return: none
*
* Description: Set device address
*
*************************************************************************/
void USB_SetAdd(Int32U DevAdd);
#define USB_SetDefAdd() USB_SetAdd(0)
/*************************************************************************
* Function Name: USB_ConnectRes
* Parameters: Boolean Conn
*
* Return: none
*
* Description: Enable Pull-Up resistor
*
*************************************************************************/
void USB_ConnectRes (Boolean Conn);
/*************************************************************************
* Function Name: USB_Configure
* Parameters: Boolean Configure
*
* Return: none
*
* Description: Configure device
* When Configure != 0 enable all Realize Ep
*
*************************************************************************/
inline
void USB_Configure (Boolean Configure)
{}
#if USB_REMOTE_WAKEUP != 0
/*************************************************************************
* Function Name: USB_WakeUp
* Parameters: none
*
* Return: none
*
* Description: Wake up USB
*
*************************************************************************/
void USB_WakeUp (void);
#endif // USB_REMOTE_WAKEUP != 0
/*************************************************************************
* Function Name: USB_GetDevStatus
* Parameters: USB_DevStatusReqType_t Type
*
* Return: Boolean
*
* Description: Return USB device status
*
*************************************************************************/
Boolean USB_GetDevStatus (USB_DevStatusReqType_t Type);
/*************************************************************************
* Function Name: USB_EpLogToPhysAdd
* Parameters: Int8U EpLogAdd
*
* Return: USB_Endpoint_t
*
* Description: Convert the logical to physical address
*
*************************************************************************/
USB_Endpoint_t USB_EpLogToPhysAdd (Int8U EpLogAdd);
#if USB_SOF_EVENT > 0
/*************************************************************************
* Function Name: USB_GetFrameNumb
* Parameters: none
*
* Return: Int32U
*
* Description: Return current value of SOF number
*
*************************************************************************/
Int32U USB_GetFrameNumb (void);
#endif // USB_SOF_EVENT > 0
/*************************************************************************
* Function Name: USB_StatusPhase
* Parameters: Boolean In
*
* Return: none
*
* Description: Prepare status phase
*
*************************************************************************/
void USB_StatusPhase (Boolean In);
#if USB_HIGH_PRIORITY_EVENT > 0
/*************************************************************************
* Function Name: USB_HIGH_ISR
* Parameters: none
*
* Return: none
*
* Description: High priority USB interrupt subroutine
*
*************************************************************************/
void USB_HIGH_ISR (void);
#endif // USB_HIGH_PRIORITY_EVENT > 0
/*************************************************************************
* Function Name: USB_ISR
* Parameters: none
*
* Return: none
*
* Description: USB interrupt subroutine
*
*************************************************************************/
void USB_ISR (void);
/*************************************************************************
* Function Name: USB_SetStallEP
* Parameters: USB_Endpoint_t EndPoint, Boolean Stall
*
* Return: USB_ErrorCodes_t
*
* Description: The endpoint stall/unstall
*
*************************************************************************/
USB_ErrorCodes_t USB_SetStallEP (USB_Endpoint_t EndPoint, Boolean Stall);
/*************************************************************************
* Function Name: USB_StallCtrlEP
* Parameters: none
*
* Return: none
*
* Description: Stall both direction of the CTRL EP
*
*************************************************************************/
void USB_StallCtrlEP (void);
/*************************************************************************
* Function Name: USB_GetStallEP
* Parameters: USB_Endpoint_t EndPoint, pBoolean pStall
*
* Return: USB_ErrorCodes_t
*
* Description: Get stall state of the endpoint
*
*************************************************************************/
USB_ErrorCodes_t USB_GetStallEP (USB_Endpoint_t EndPoint, pBoolean pStall);
/*************************************************************************
* Function Name: USB_Resume
* Parameters: UsbResumeEvent_t UsbResumeEvent
*
* Return: none
*
* Description: USB Resume implement
*
*************************************************************************/
static
void USB_Resume (UsbResumeEvent_t UsbResumeEvent);
/*************************************************************************
* Function Name: USB_EP_IO
* Parameters: USB_Endpoint_t EndPoint
*
* Return: none
*
* Description: Endpoints IO
*
*************************************************************************/
void USB_EP_IO(USB_Endpoint_t EP);
#endif //__STM32F_USB_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -