USBLibAPIGuide  1.00.00.01
Macros | Functions
usbulpi.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "ti/devices/msp432e4/driverlib/driverlib.h"
#include "usbulpi.h"
Include dependency graph for usbulpi.c:

Macros

#define ULPI_FCTL   0x04
 
#define ULPI_FCTL_SET   0x05
 
#define ULPI_FCTL_CLEAR   0x06
 
#define ULPI_ICTL   0x07
 
#define ULPI_ICTL_SET   0x08
 
#define ULPI_ICTL_CLEAR   0x09
 
#define ULPI_OTGCTL   0x0A
 
#define ULPI_OTGCTL_SET   0x0B
 
#define ULPI_OTGCTL_CLEAR   0x0C
 
#define ULPI_FCTL_XCVR_M   0x03
 
#define ULPI_FCTL_XCVR_HS   0x00
 
#define ULPI_FCTL_XCVR_FS   0x01
 
#define ULPI_FCTL_XCVR_LS   0x02
 
#define ULPI_FCTL_XCVR_FSLS   0x03
 
#define ULPI_FCTL_TERMSEL   0x04
 
#define ULPI_FCTL_OPMODE_M   0x18
 
#define ULPI_FCTL_OPMODE_NORM   0x00
 
#define ULPI_FCTL_OPMODE_NODRV   0x08
 
#define ULPI_FCTL_OPMODE_NONRZI   0x10
 
#define ULPI_FCTL_OPMODE_DISAUTO   0x18
 
#define ULPI_FCTL_OPMODE_RESET   0x20
 
#define ULPI_FCTL_OPMODE_SUSPEND   0x40
 
#define ULPI_ICTL_SER6PIN   0x01
 
#define ULPI_ICTL_SER3PIN   0x02
 
#define ULPI_ICTL_AUTORESUME   0x10
 
#define ULPI_ICTL_INDINV   0x20
 
#define ULPI_ICTL_INDPASSTHRU   0x40
 
#define ULPI_ICTL_PROTDIS   0x80
 
#define ULPI_OTGCTL_ID_EN   0x01
 
#define ULPI_OTGCTL_DPPD_EN   0x02
 
#define ULPI_OTGCTL_DMPD_EN   0x04
 
#define ULPI_OTGCTL_DISCHRG_VBUS   0x08
 
#define ULPI_OTGCTL_CHRG_VBUS   0x10
 
#define ULPI_OTGCTL_VBUSINT_EN   0x20
 
#define ULPI_OTGCTL_VBUSEXT_EN   0x40
 
#define ULPI_OTGCTL_VBUSEXT_IND   0x80
 

Functions

void ULPIConfigSet (uint32_t ui32Base, uint32_t ui32Config)
 
void ULPIPowerTransceiver (uint32_t ui32Base, bool bEnable)
 

Macro Definition Documentation

§ ULPI_FCTL

#define ULPI_FCTL   0x04

Referenced by ULPIConfigSet().

§ ULPI_FCTL_SET

#define ULPI_FCTL_SET   0x05

Referenced by ULPIPowerTransceiver().

§ ULPI_FCTL_CLEAR

#define ULPI_FCTL_CLEAR   0x06

Referenced by ULPIPowerTransceiver().

§ ULPI_ICTL

#define ULPI_ICTL   0x07

Referenced by ULPIConfigSet().

§ ULPI_ICTL_SET

#define ULPI_ICTL_SET   0x08

§ ULPI_ICTL_CLEAR

#define ULPI_ICTL_CLEAR   0x09

§ ULPI_OTGCTL

#define ULPI_OTGCTL   0x0A

Referenced by ULPIConfigSet().

§ ULPI_OTGCTL_SET

#define ULPI_OTGCTL_SET   0x0B

§ ULPI_OTGCTL_CLEAR

#define ULPI_OTGCTL_CLEAR   0x0C

§ ULPI_FCTL_XCVR_M

#define ULPI_FCTL_XCVR_M   0x03

Referenced by ULPIConfigSet().

§ ULPI_FCTL_XCVR_HS

#define ULPI_FCTL_XCVR_HS   0x00

§ ULPI_FCTL_XCVR_FS

#define ULPI_FCTL_XCVR_FS   0x01

§ ULPI_FCTL_XCVR_LS

#define ULPI_FCTL_XCVR_LS   0x02

§ ULPI_FCTL_XCVR_FSLS

#define ULPI_FCTL_XCVR_FSLS   0x03

§ ULPI_FCTL_TERMSEL

#define ULPI_FCTL_TERMSEL   0x04

§ ULPI_FCTL_OPMODE_M

#define ULPI_FCTL_OPMODE_M   0x18

§ ULPI_FCTL_OPMODE_NORM

#define ULPI_FCTL_OPMODE_NORM   0x00

§ ULPI_FCTL_OPMODE_NODRV

#define ULPI_FCTL_OPMODE_NODRV   0x08

§ ULPI_FCTL_OPMODE_NONRZI

#define ULPI_FCTL_OPMODE_NONRZI   0x10

§ ULPI_FCTL_OPMODE_DISAUTO

#define ULPI_FCTL_OPMODE_DISAUTO   0x18

§ ULPI_FCTL_OPMODE_RESET

#define ULPI_FCTL_OPMODE_RESET   0x20

§ ULPI_FCTL_OPMODE_SUSPEND

#define ULPI_FCTL_OPMODE_SUSPEND   0x40

Referenced by ULPIPowerTransceiver().

§ ULPI_ICTL_SER6PIN

#define ULPI_ICTL_SER6PIN   0x01

§ ULPI_ICTL_SER3PIN

#define ULPI_ICTL_SER3PIN   0x02

§ ULPI_ICTL_AUTORESUME

#define ULPI_ICTL_AUTORESUME   0x10

Referenced by ULPIConfigSet().

§ ULPI_ICTL_INDINV

#define ULPI_ICTL_INDINV   0x20

Referenced by ULPIConfigSet().

§ ULPI_ICTL_INDPASSTHRU

#define ULPI_ICTL_INDPASSTHRU   0x40

Referenced by ULPIConfigSet().

§ ULPI_ICTL_PROTDIS

#define ULPI_ICTL_PROTDIS   0x80

§ ULPI_OTGCTL_ID_EN

#define ULPI_OTGCTL_ID_EN   0x01

§ ULPI_OTGCTL_DPPD_EN

#define ULPI_OTGCTL_DPPD_EN   0x02

§ ULPI_OTGCTL_DMPD_EN

#define ULPI_OTGCTL_DMPD_EN   0x04

§ ULPI_OTGCTL_DISCHRG_VBUS

#define ULPI_OTGCTL_DISCHRG_VBUS   0x08

§ ULPI_OTGCTL_CHRG_VBUS

#define ULPI_OTGCTL_CHRG_VBUS   0x10

§ ULPI_OTGCTL_VBUSINT_EN

#define ULPI_OTGCTL_VBUSINT_EN   0x20

Referenced by ULPIConfigSet().

§ ULPI_OTGCTL_VBUSEXT_EN

#define ULPI_OTGCTL_VBUSEXT_EN   0x40

Referenced by ULPIConfigSet().

§ ULPI_OTGCTL_VBUSEXT_IND

#define ULPI_OTGCTL_VBUSEXT_IND   0x80

Referenced by ULPIConfigSet().

Function Documentation

§ ULPIConfigSet()

void ULPIConfigSet ( uint32_t  ui32Base,
uint32_t  ui32Config 
)

Sets the configuration of an external USB Phy.

Parameters
ui32Basespecifies the USB module base address.
ui32Configspecifies the configuration options for the external Phy.

This function sets the configuration options for an externally connected USB Phy that is connected using the ULPI interface. The ui32Config parameter holds all of the configuration options defined by the UPLI_CFG_ values. The values are grouped as follows:

Connection speed, using one of the following:

  • UPLI_CFG_HS enables high speed operation.
  • UPLI_CFG_FS enables full speed operation.
  • UPLI_CFG_HS enables low speed operation.

Any of the following can be included:

  • UPLI_CFG_AUTORESUME enable automatic transmission of resume signaling from the Phy.
  • UPLI_CFG_INVVBUSIND inverts the external VBUS indicator if it is selected.
  • UPLI_CFG_PASSTHRUIND passes the external VBUS indicator through without using the Phy's VBUS comparator.
  • ULPI_CFG_EXTVBUSDRV enables an external VBUS drive source.
  • ULPI_CFG_EXTVBUSIND enables an external signal for VBUS valid.
Returns
None.

References ULPI_FCTL, ULPI_FCTL_XCVR_M, ULPI_ICTL, ULPI_ICTL_AUTORESUME, ULPI_ICTL_INDINV, ULPI_ICTL_INDPASSTHRU, ULPI_OTGCTL, ULPI_OTGCTL_VBUSEXT_EN, ULPI_OTGCTL_VBUSEXT_IND, and ULPI_OTGCTL_VBUSINT_EN.

§ ULPIPowerTransceiver()

void ULPIPowerTransceiver ( uint32_t  ui32Base,
bool  bEnable 
)

Enables or disables power to the external USB Phy.

Parameters
ui32Basespecifies the USB module base address.
bEnablespecifies if the Phy is fully powered or in suspend mode.

This function sets the current power configuration for the external ULPI connected Phy. When bEnable is true the Phy is fully powered and when false the USB Phy is in suspend mode.

Returns
None.

References ULPI_FCTL_CLEAR, ULPI_FCTL_OPMODE_SUSPEND, and ULPI_FCTL_SET.

© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale