EasyManua.ls Logo

Cypress EZ-USB FX3 - Host Negotiation Protocol

Cypress EZ-USB FX3
660 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 118
Universal Serial Bus (USB)
CyU3PBusyWait (100);
/* Reset and enable the PHY. */
UIB->phy_clk_and_test = (CY_U3P_UIB_DATABUS16_8 | CY_U3P_UIB_VLOAD |
CY_U3P_UIB_RESET | CY_U3P_UIB_EN_SWITCH);
CyU3PBusyWait (10);
UIB->phy_clk_and_test &= ~CY_U3P_UIB_RESET;
UIB->phy_clk_and_test |= CY_U3P_UIB_SUSPEND_N;
CyU3PBusyWait (100);
/* Switch EPM clock to 120MHz. */
GCTL->uib_core_clk &= ~CY_U3P_GCTL_UIBCLK_EPMCLK_SRC_MASK;
CyU3PBusyWait (10);
UIB->otg_ctrl &= ~CY_U3P_UIB_DEV_ENABLE;
}
}
CyU3PReturnStatus_t
CyU3POtgSrpStart (uint32_t repeatInterval)
{
if (!glIsOtgEnable)
{
return CY_U3P_ERROR_NOT_STARTED;
}
if ((repeatInterval > CY_U3P_OTG_SRP_MAX_REPEAT_INTERVAL) ||
(repeatInterval == 0))
{
return CY_U3P_ERROR_BAD_ARGUMENT;
}
/* Check if device mode is enabled. */
if ((!CyU3POtgIsDeviceMode ()) || (CyU3PUsbIsStarted ()) || (CyU3PUsbHostIsStarted ()))
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
/* Check if there is any valid session. */
if (GCTL->iopower & glUibDeviceInfo.vbusDetectMode)
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
CyU3POtgSetupPhy ();
/* Update the required timer period value. */
glOtgTimerPeriod = (uint32_t)(repeatInterval * 32);
/* Initialize the OTG timer with the corresponding repeat period. */
UIB->otg_timer = glOtgTimerPeriod;
return CY_U3P_SUCCESS;
}
6.10.2.3 Host Negotiation Protocol
An OTG A-device acts as the host initially in a USB session. To allow a peripheral to assume the role of a host, the initial host
must first configure the peripheral to enable HNP support through USB commands (SetFeature(b_hnp_enable)). To start the

Table of Contents

Related product manuals