EE445M RTOS
Taken at the University of Texas Spring 2015
Usb_lpm

Functions

void USBHostLPMSend (uint32_t ui32Base, uint32_t ui32Address, uint32_t ui32Endpoint)
 
void USBHostLPMConfig (uint32_t ui32Base, uint32_t ui32ResumeTime, uint32_t ui32Config)
 
void USBHostLPMResume (uint32_t ui32Base)
 
void USBDevLPMRemoteWake (uint32_t ui32Base)
 
void USBDevLPMConfig (uint32_t ui32Base, uint32_t ui32Config)
 
void USBDevLPMEnable (uint32_t ui32Base)
 
void USBDevLPMDisable (uint32_t ui32Base)
 
uint32_t USBLPMLinkStateGet (uint32_t ui32Base)
 
uint32_t USBLPMEndpointGet (uint32_t ui32Base)
 
bool USBLPMRemoteWakeEnabled (uint32_t ui32Base)
 
uint32_t USBLPMIntStatus (uint32_t ui32Base)
 
void USBLPMIntEnable (uint32_t ui32Base, uint32_t ui32Ints)
 
void USBLPMIntDisable (uint32_t ui32Base, uint32_t ui32Ints)
 

Detailed Description

Function Documentation

void USBDevLPMConfig ( uint32_t  ui32Base,
uint32_t  ui32Config 
)

Configures the USB device mode response to LPM requests.

Parameters
ui32Basespecifies the USB module base address.
ui32Configis the combination of configuration options for LPM transactions in device mode.

This function sets the global configuration options for LPM transactions in device mode and must be called before ever calling USBDevLPMEnable() to set the configuration for LPM transactions. The configuration options in device mode are specified in the ui32Config parameter and include one of the following:

  • USB_DEV_LPM_NONE disables the USB controller from responding to LPM transactions.
  • USB_DEV_LPM_EN enables the USB controller to respond to LPM and extended transactions.
  • USB_DEV_LPM_EXTONLY enables the USB controller to respond to extended transactions, but not LPM transactions.

The ui32Config option can also optionally include the USB_DEV_LPM_NAK value to cause the USB controller to NAK all transactions other than an LPM transaction once the USB controller is in LPM suspend mode. If this value is not included in the ui32Config parameter, the USB controller does not respond in suspend mode.

The USB controller does not enter LPM suspend mode until the application calls the USBDevLPMEnable() function.

Example: Enable LPM transactions and NAK while in LPM suspend mode.

//! //
//! // Enable LPM transactions and NAK while in LPM suspend mode.
//! //
//! USBDevLPMConfig(USB0_BASE, USB_DEV_LPM_NAK | USB_DEV_LPM_EN);
//! 
\note This function must only be called in device mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5429 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, and USB_O_LPMCNTRL.

5430 {
5431  ASSERT(ui32Base == USB0_BASE);
5432 
5433  //
5434  // Set the device LPM configuration.
5435  //
5436  HWREGB(ui32Base + USB_O_LPMCNTRL) = ui32Config;
5437 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
void USBDevLPMDisable ( uint32_t  ui32Base)

Disables the USB controller from responding to LPM suspend requests.

Parameters
ui32Basespecifies the USB module base address.

This function disables the USB controller from responding to LPM transactions. When the device enters LPM L1 mode, the USB controller automatically disables responding to further LPM transactions.

Note
If LPM transactions were enabled before calling this function, then an LPM request can still occur before this function returns. As a result, the application must continue to handle LPM requests until this function returns.

Example: Disable LPM suspend mode.

//!     //
//!     // Disable LPM suspend mode.
//!     //
//!     USBDevLPMDisable(USB0_BASE);
//! 
\note This function must only be called in device mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5517 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, USB_LPMCNTRL_TXLPM, and USB_O_LPMCNTRL.

5518 {
5519  ASSERT(ui32Base == USB0_BASE);
5520 
5521  //
5522  // Disable auto entering L1 mode on LPM transactions.
5523  //
5524  HWREGB(ui32Base + USB_O_LPMCNTRL) &= ~USB_LPMCNTRL_TXLPM;
5525 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define USB_LPMCNTRL_TXLPM
Definition: hw_usb.h:2805
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
void USBDevLPMEnable ( uint32_t  ui32Base)

Enables the USB controller to respond to LPM suspend requests.

Parameters
ui32Basespecifies the USB module base address.

This function is used to automatically respond to an LPM sleep request from the USB host controller. If there is no data pending in any transmit FIFOs, then the USB controller acknowledges the packet and enters the LPM L1 state and generates the USB_INTLPM_ACK interrupt. If the USB controller has pending transmit data in at least one FIFO, then the USB controller responds with NYET and signals the USB_INTLPM_INCOMPLETE or USB_INTLPM_NYET depending on if data is pending in receive or transmit FIFOs. A call to USBDevLPMEnable() is required after every LPM resume event to re-enable LPM mode.

Example: Enable LPM suspend mode.

//!     //
//!     // Enable LPM suspend mode.
//!     //
//!     USBDevLPMEnable(USB0_BASE);
//! 
\note This function must only be called in device mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5473 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, USB_LPMCNTRL_EN_LPMEXT, USB_LPMCNTRL_TXLPM, and USB_O_LPMCNTRL.

5474 {
5475  ASSERT(ui32Base == USB0_BASE);
5476 
5477  //
5478  // Enable L1 mode on the next LPM transaction.
5479  //
5480  HWREGB(ui32Base + USB_O_LPMCNTRL) |=
5482 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define USB_LPMCNTRL_TXLPM
Definition: hw_usb.h:2805
#define USB_LPMCNTRL_EN_LPMEXT
Definition: hw_usb.h:2799
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
void USBDevLPMRemoteWake ( uint32_t  ui32Base)

Initiates remote wake signaling to request the device to leave LPM suspend mode.

Parameters
ui32Basespecifies the USB module base address.

This function initiates remote wake signaling to request that the host wake a device that has entered an LPM-triggered low power mode.

Example: Initiate remote wake signaling.

//! //
//! // Initiate remote wake signaling.
//! //
//! USBDevLPMRemoteWake(USB0_BASE);
//! 
\note This function must only be called in device mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5371 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, USB_LPMCNTRL_RES, and USB_O_LPMCNTRL.

5372 {
5373  ASSERT(ui32Base == USB0_BASE);
5374 
5375  //
5376  // Send remote wake signaling.
5377  //
5378  HWREGB(ui32Base + USB_O_LPMCNTRL) |= USB_LPMCNTRL_RES;
5379 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define USB_LPMCNTRL_RES
Definition: hw_usb.h:2804
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
void USBHostLPMConfig ( uint32_t  ui32Base,
uint32_t  ui32ResumeTime,
uint32_t  ui32Config 
)

Sets the global configuration for all LPM requests.

Parameters
ui32Basespecifies the USB module base address.
ui32ResumeTimespecifies the resume signaling duration in 75us increments.
ui32Configspecifies the combination of configuration options for LPM transactions.

This function sets the global configuration options for LPM transactions and must be called at least once before ever calling USBHostLPMSend(). The ui32ResumeTime specifies the length of time that the host drives resume signaling on the bus in microseconds. The valid values for ui32ResumeTime are from 50us to 1175us in 75us increments. The remaining configuration is specified by the ui32Config parameter and includes the following options:

  • USB_HOST_LPM_RMTWAKE allows the device to signal a remote wake from the LPM state.
  • USB_HOST_LPM_L1 is the LPM mode to enter and must always be included in the configuration.

Example: Set the LPM configuration to allow remote wake with a resume duration of 500us.

//! //
//! // Set the LPM configuration to allow remote wake with a resume
//! // duration of 500us.
//! //
//! USBHostLPMConfig(USB0_BASE, 500, USB_HOST_LPM_RMTWAKE | USB_HOST_LPM_L1);
//! 
\note This function must only be called in host mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5290 of file usb.c.

References ASSERT, HWREGH, USB0_BASE, USB_LPMATTR_HIRD_S, and USB_O_LPMATTR.

5292 {
5293  ASSERT(ui32Base == USB0_BASE);
5294  ASSERT(ui32ResumeTime <= 1175);
5295  ASSERT(ui32ResumeTime >= 50);
5296 
5297  //
5298  // Set the Host Initiated Resume Duration, Remote wake and Suspend mode.
5299  //
5300  HWREGH(ui32Base + USB_O_LPMATTR) =
5301  ui32Config | ((ui32ResumeTime - 50) / 75) << USB_LPMATTR_HIRD_S;
5302 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_LPMATTR_HIRD_S
Definition: hw_usb.h:2780
#define HWREGH(x)
Definition: hw_types.h:50
#define USB_O_LPMATTR
Definition: hw_usb.h:371
#define USB0_BASE
Definition: hw_memmap.h:99
void USBHostLPMResume ( uint32_t  ui32Base)

Initiates resume signaling to wake a device from LPM suspend mode.

Parameters
ui32Basespecifies the USB module base address.

In host mode, this function initiates resume signaling to wake a device that has entered an LPM-triggered low power mode. This LPM-triggered low power mode is entered when the USBHostLPMSend() is called to put a specific device into a low power state.

Example: Initiate resume signaling.

//! //
//! // Initiate resume signaling.
//! //
//! USBHostLPMResume(USB0_BASE);
//! 
\note This function must only be called in host mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5333 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, USB_LPMCNTRL_RES, and USB_O_LPMCNTRL.

5334 {
5335  ASSERT(ui32Base == USB0_BASE);
5336 
5337  //
5338  // Send Resume signaling.
5339  //
5340  HWREGB(ui32Base + USB_O_LPMCNTRL) |= USB_LPMCNTRL_RES;
5341 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define USB_LPMCNTRL_RES
Definition: hw_usb.h:2804
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
void USBHostLPMSend ( uint32_t  ui32Base,
uint32_t  ui32Address,
uint32_t  ui32Endpoint 
)

Sends an LPM request to a device at a specified address and endpoint number.

Parameters
ui32Basespecifies the USB module base address.
ui32Addressis the target device address for the LPM request.
ui32Endpointis the target endpoint for the LPM request.

This function sends an LPM request to a connected device in host mode. The ui32Address parameter specifies the device address and has a range of values from 1 to 127. The ui32Endpoint parameter specifies the endpoint on the device to which to send the LPM request and must be one of the USB_EP_* values. The function returns before the LPM request is sent, requiring the caller to poll the USBLPMIntStatus() function or wait for an interrupt to signal completion of the LPM transaction. This function must only be called after the USBHostLPMConfig() has configured the LPM transaction settings.

Example: Send an LPM request to the device at address 1 on endpoint 0.

//! //
//! // Send an LPM request to the device at address 1 on endpoint 0.
//! //
//! USBHostLPMSend(USB0_BASE, 1, USB_EP_0);
//! 
\note This function must only be called in host mode. The USB LPM feature
is not available on all Tiva devices. Please consult the data sheet for
the Tiva device that you are using to determine if this feature is
available.

\return None.  

Definition at line 5224 of file usb.c.

References ASSERT, HWREGB, HWREGH, USB0_BASE, USB_LPMATTR_ENDPT_M, USB_LPMATTR_ENDPT_S, USB_LPMCNTRL_TXLPM, USB_O_LPMATTR, USB_O_LPMCNTRL, USB_O_LPMFADDR, and USBEPToIndex.

5225 {
5226  uint32_t ui32Reg;
5227 
5228  ASSERT(ui32Base == USB0_BASE);
5229  ASSERT(ui32Address < 127);
5230 
5231  //
5232  // Set the address and endpoint.
5233  //
5234  HWREGB(ui32Base + USB_O_LPMFADDR) = ui32Address;
5235 
5236  ui32Reg = HWREGH(ui32Base + USB_O_LPMATTR) & ~USB_LPMATTR_ENDPT_M;
5237  ui32Reg |= (USBEPToIndex(ui32Endpoint) << USB_LPMATTR_ENDPT_S);
5238 
5239  HWREGH(ui32Base + USB_O_LPMATTR) = ui32Reg;
5240 
5241  //
5242  // Send the LPM transaction.
5243  //
5244  HWREGB(ui32Base + USB_O_LPMCNTRL) |= USB_LPMCNTRL_TXLPM;
5245 }
#define USB_LPMATTR_ENDPT_M
Definition: hw_usb.h:2774
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMCNTRL
Definition: hw_usb.h:372
#define HWREGH(x)
Definition: hw_types.h:50
#define USB_O_LPMFADDR
Definition: hw_usb.h:375
#define USB_LPMATTR_ENDPT_S
Definition: hw_usb.h:2779
#define USB_LPMCNTRL_TXLPM
Definition: hw_usb.h:2805
#define USB_O_LPMATTR
Definition: hw_usb.h:371
#define USBEPToIndex(x)
Definition: usb.h:364
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
uint32_t USBLPMEndpointGet ( uint32_t  ui32Base)

Returns the current LPM endpoint value.

Parameters
ui32Basespecifies the USB module base address.

This function returns the current LPM endpoint value. The meaning of the value depends on the mode of operation of the USB controller. When in device mode, the value returned is the endpoint that received the last LPM transaction. When in host mode this is the endpoint that was last sent an LPM transaction, or the endpoint that is configured to be sent when the LPM transaction is triggered. The value returned is in the USB_EP_[0-7] value and a direct endpoint index.

Example: Get the endpoint for the last LPM transaction.

//! uint32_t ui32Endpoint;
//!
//! //
//! // Get the endpoint number that received the LPM request.
//! //
//! ui32LinkState = USBLPMEndpointGet(USB0_BASE);
//!
//! 
\note The USB LPM feature is not available on all Tiva devices. Please
consult the data sheet for the Tiva device that you are using to determine
if this feature is available.

\return The last endpoint to receive an LPM request in device mode or the
endpoint that the host sends an LPM request as one of the \b USB_EP_[0-7]
values.  

Definition at line 5618 of file usb.c.

References ASSERT, HWREGH, IndexToUSBEP, USB0_BASE, USB_LPMATTR_ENDPT_M, USB_LPMATTR_ENDPT_S, and USB_O_LPMATTR.

5619 {
5620  uint32_t ui32Endpoint;
5621 
5622  ASSERT(ui32Base == USB0_BASE);
5623 
5624  ui32Endpoint = (HWREGH(ui32Base + USB_O_LPMATTR) & USB_LPMATTR_ENDPT_M) >>
5626 
5627  return(IndexToUSBEP(ui32Endpoint));
5628 }
#define USB_LPMATTR_ENDPT_M
Definition: hw_usb.h:2774
#define IndexToUSBEP(x)
Definition: usb.h:363
#define ASSERT(expr)
Definition: debug.h:67
#define HWREGH(x)
Definition: hw_types.h:50
#define USB_LPMATTR_ENDPT_S
Definition: hw_usb.h:2779
#define USB_O_LPMATTR
Definition: hw_usb.h:371
#define USB0_BASE
Definition: hw_memmap.h:99
void USBLPMIntDisable ( uint32_t  ui32Base,
uint32_t  ui32Ints 
)

Disables LPM interrupts.

Parameters
ui32Basespecifies the USB module base address.
ui32Intsspecifies which LPM interrupts to disable.

This function disables the LPM interrupts specified in the ui32Ints parameter, preventing them from triggering a USB interrupt.

The valid interrupt status bits when the USB controller is acting as a host are the following:

  • USB_INTLPM_ERROR a bus error occurred in the transmission of an LPM transaction.
  • USB_INTLPM_RESUME the USB controller has resumed from LPM low power state.
  • USB_INTLPM_INCOMPLETE the LPM transaction failed because a timeout occurred or there were bit errors in the response for three attempts.
  • USB_INTLPM_ACK the device has acknowledged an LPM transaction.
  • USB_INTLPM_NYET the device has responded with a NYET to an LPM transaction.
  • USB_INTLPM_STALL the device has stalled an LPM transaction.

The valid interrupt status bits when the USB controller is acting as a device are the following:

  • USB_INTLPM_ERROR an LPM transaction was received that has an unsupported link state field. The transaction was stalled, but the requested link state can still be read using the USBLPMLinkStateGet() function.
  • USB_INTLPM_RESUME the USB controller has resumed from the LPM low power state.
  • USB_INTLPM_INCOMPLETE the USB controller responded to an LPM transaction with a NYET because data was still in the transmit FIFOs.
  • USB_INTLPM_ACK the USB controller acknowledged an LPM transaction and is now in the LPM suspend mode.
  • USB_INTLPM_NYET the USB controller responded to an LPM transaction with a NYET because LPM transactions are not yet enabled by a call to USBDevLPMEnable().
  • USB_INTLPM_STALL the USB controller has stalled an incoming LPM transaction.

Example: Disable all LPM interrupt sources.

//! //
//! // Disable all LPM interrupt sources.
//! //
//! USBLPMIntDisable(USB0_BASE, USB_INTLPM_ERROR | USB_INTLPM_RESUME |
//!                             USB_INTLPM_INCOMPLETE | USB_INTLPM_ACK |
//!                             USB_INTLPM_NYET | USB_INTLPM_STALL);
//! 
\note The USB LPM feature is not available on all Tiva devices.
Please consult the data sheet for the Tiva device that you
are using to determine if this feature is available.

\return None.  

Definition at line 5894 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, and USB_O_LPMIM.

5895 {
5896  ASSERT(ui32Base == USB0_BASE);
5897 
5898  //
5899  // Disable the requested interrupts.
5900  //
5901  HWREGB(ui32Base + USB_O_LPMIM) &= ~ui32Ints;
5902 }
#define ASSERT(expr)
Definition: debug.h:67
#define HWREGB(x)
Definition: hw_types.h:52
#define USB_O_LPMIM
Definition: hw_usb.h:373
#define USB0_BASE
Definition: hw_memmap.h:99
void USBLPMIntEnable ( uint32_t  ui32Base,
uint32_t  ui32Ints 
)

Enables LPM interrupts.

Parameters
ui32Basespecifies the USB module base address.
ui32Intsspecifies which LPM interrupts to enable.

This function enables a set of LPM interrupts so that they can trigger a USB interrupt. The ui32Ints parameter specifies which of the USB_INTLPM_* to enable.

The valid interrupt status bits when the USB controller is acting as a host are the following:

  • USB_INTLPM_ERROR a bus error occurred in the transmission of an LPM transaction.
  • USB_INTLPM_RESUME the USB controller has resumed from LPM low power state.
  • USB_INTLPM_INCOMPLETE the LPM transaction failed because a timeout occurred or there were bit errors in the response for three attempts.
  • USB_INTLPM_ACK the device has acknowledged an LPM transaction.
  • USB_INTLPM_NYET the device has responded with a NYET to an LPM transaction.
  • USB_INTLPM_STALL the device has stalled an LPM transaction.

The valid interrupt status bits when the USB controller is acting as a device are the following:

  • USB_INTLPM_ERROR an LPM transaction was received that has an unsupported link state field. The transaction was stalled, but the requested link state can still be read using the USBLPMLinkStateGet() function.
  • USB_INTLPM_RESUME the USB controller has resumed from the LPM low power state.
  • USB_INTLPM_INCOMPLETE the USB controller responded to an LPM transaction with a NYET because data was still in the transmit FIFOs.
  • USB_INTLPM_ACK the USB controller acknowledged an LPM transaction and is now in the LPM suspend mode.
  • USB_INTLPM_NYET the USB controller responded to an LPM transaction with a NYET because LPM transactions are not yet enabled by a call to USBDevLPMEnable().
  • USB_INTLPM_STALL the USB controller has stalled an incoming LPM transaction.

Example: Enable all LPM interrupt sources.

//! //
//! // Enable all LPM interrupt sources.
//! //
//! USBLPMIntEnable(USB0_BASE, USB_INTLPM_ERROR | USB_INTLPM_RESUME |
//!                            USB_INTLPM_INCOMPLETE | USB_INTLPM_ACK |
//!                            USB_INTLPM_NYET | USB_INTLPM_STALL);
//! 
\note The USB LPM feature is not available on all Tiva devices.
Please consult the data sheet for the Tiva device that you
are using to determine if this feature is available.

\return None.  

Definition at line 5822 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, and USB_O_LPMIM.

5823 {
5824  ASSERT(ui32Base == USB0_BASE);
5825 
5826  //
5827  // Enable the requested interrupts.
5828  //
5829  HWREGB(ui32Base + USB_O_LPMIM) |= ui32Ints;
5830 }
#define ASSERT(expr)
Definition: debug.h:67
#define HWREGB(x)
Definition: hw_types.h:52
#define USB_O_LPMIM
Definition: hw_usb.h:373
#define USB0_BASE
Definition: hw_memmap.h:99
uint32_t USBLPMIntStatus ( uint32_t  ui32Base)

Returns the current LPM interrupt status.

Parameters
ui32Basespecifies the USB module base address.

This function returns the current LPM interrupt status for the USB controller.

The valid interrupt status bits when the USB controller is acting as a host are the following:

  • USB_INTLPM_ERROR a bus error occurred in the transmission of an LPM transaction.
  • USB_INTLPM_RESUME the USB controller has resumed from the LPM low power state.
  • USB_INTLPM_INCOMPLETE the LPM transaction failed because a timeout occurred or there were bit errors in the response for three attempts.
  • USB_INTLPM_ACK the device has acknowledged an LPM transaction.
  • USB_INTLPM_NYET the device has responded with a NYET to an LPM transaction.
  • USB_INTLPM_STALL the device has stalled an LPM transaction.

The valid interrupt status bits when the USB controller is acting as a device are the following:

  • USB_INTLPM_ERROR an LPM transaction was received that has an unsupported link state field. The transaction was stalled, but the requested link state can still be read using the USBLPMLinkStateGet() function.
  • USB_INTLPM_RESUME the USB controller has resumed from the LPM low power state.
  • USB_INTLPM_INCOMPLETE the USB controller responded to an LPM transaction with a NYET because data was still in the transmit FIFOs.
  • USB_INTLPM_ACK the USB controller acknowledged an LPM transaction and is now in the LPM suspend mode.
  • USB_INTLPM_NYET the USB controller responded to an LPM transaction with a NYET because LPM transactions are not yet enabled by a call to USBDevLPMEnable().
  • USB_INTLPM_STALL the USB controller has stalled an incoming LPM transaction.
Note
This call clears the source of all LPM status interrupts, so the caller must take care to save the value returned because a subsequent call to USBLPMIntStatus() does not return the previous value.

Example: Get the current LPM interrupt status.

//! uint32_t ui32LPMIntStatus;
//!
//! //
//! // Get the current LPM interrupt status.
//! //
//! ui32LPMIntStatus = USBLPMIntStatus(USB0_BASE);
//!
//! //
//! // Check if an LPM transaction was acknowledged.
//! //
//! if(ui32LPMIntStatus & USB_INTLPM_ACK)
//! {
//!     //
//!     // Handle entering LPM suspend mode.
//!     //
//!     ...
//! }
//! 
\note The USB LPM feature is not available on all Tiva devices.
Please consult the data sheet for the Tiva device that you
are using to determine if this feature is available.

\return The current LPM interrupt status.  

Definition at line 5749 of file usb.c.

References ASSERT, HWREGB, USB0_BASE, and USB_O_LPMRIS.

5750 {
5751  ASSERT(ui32Base == USB0_BASE);
5752 
5753  //
5754  // Return the current raw interrupt status.
5755  //
5756  return(HWREGB(ui32Base + USB_O_LPMRIS));
5757 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_O_LPMRIS
Definition: hw_usb.h:374
#define HWREGB(x)
Definition: hw_types.h:52
#define USB0_BASE
Definition: hw_memmap.h:99
uint32_t USBLPMLinkStateGet ( uint32_t  ui32Base)

Returns the current link state setting.

Parameters
ui32Basespecifies the USB module base address.

This function returns the current link state setting for the USB controller. When the controller is operating as a host, this link state is sent with an LPM request. When the controller is acting as a device, this link state was received by the last LPM transaction whether it was acknowledged or stalled because the requested LPM mode is not supported.

Example: Get the link state for the last LPM transaction.

//! uint32_t ui32LinkState;
//!
//! //
//! // Get the endpoint number that received the LPM request.
//! //
//! ui32LinkState = USBLPMLinkStateGet(USB0_BASE);
//!
//! //
//! // Check if this was a supported link state.
//! //
//! if(ui32LinkState == USB_HOST_LPM_L1)
//! {
//!     //
//!     // Handle the supported L1 link state.
//!     //
//! }
//! else
//! {
//!     //
//!     // Handle the unsupported link state.
//!     //
//! }
//! 
\note The USB LPM feature is not available on all Tiva devices.
Please consult the data sheet for the Tiva device that you
are using to determine if this feature is available.

\return The current LPM link state.  

Definition at line 5575 of file usb.c.

References ASSERT, HWREGH, USB0_BASE, USB_LPMATTR_LS_M, and USB_O_LPMATTR.

5576 {
5577  ASSERT(ui32Base == USB0_BASE);
5578 
5579  return(HWREGH(ui32Base + USB_O_LPMATTR) & USB_LPMATTR_LS_M);
5580 }
#define USB_LPMATTR_LS_M
Definition: hw_usb.h:2777
#define ASSERT(expr)
Definition: debug.h:67
#define HWREGH(x)
Definition: hw_types.h:50
#define USB_O_LPMATTR
Definition: hw_usb.h:371
#define USB0_BASE
Definition: hw_memmap.h:99
bool USBLPMRemoteWakeEnabled ( uint32_t  ui32Base)

Returns if remote wake is currently enabled.

Parameters
ui32Basespecifies the USB module base address.

This function returns the current state of the remote wake setting for host or device mode operation. If the controller is acting as a host this returns the current setting that is sent to devices when LPM requests are sent to a device. If the controller is in device mode, this function returns the state of the last LPM request sent from the host and indicates if the host enabled remote wakeup.

Example: Issue remote wake if remote wake is enabled.

//!
//! if(USBLPMRemoteWakeEnabled(USB0_BASE))
//! {
//!     USBDevLPMRemoteWake(USB0_BASE);
//! }
//!
//! 
\note The USB LPM feature is not available on all Tiva devices.
Please consult the data sheet for the Tiva device that you
are using to determine if this feature is available.

\return The \b true if remote wake is enabled or \b false if it is not.  

Definition at line 5662 of file usb.c.

References ASSERT, HWREGH, USB0_BASE, USB_LPMATTR_RMTWAK, and USB_O_LPMATTR.

5663 {
5664  ASSERT(ui32Base == USB0_BASE);
5665 
5666  if(HWREGH(ui32Base + USB_O_LPMATTR) & USB_LPMATTR_RMTWAK)
5667  {
5668  return(true);
5669  }
5670  return(false);
5671 }
#define ASSERT(expr)
Definition: debug.h:67
#define USB_LPMATTR_RMTWAK
Definition: hw_usb.h:2775
#define HWREGH(x)
Definition: hw_types.h:50
#define USB_O_LPMATTR
Definition: hw_usb.h:371
#define USB0_BASE
Definition: hw_memmap.h:99