AM261x MCU+ SDK: Miscellaneous API Routines

| AM261x MCU+ SDK 26.00.00 |

Functions
Miscellaneous API Routines
APIs for SOC Specific Device Drivers » APIs for USB » APIs for Synopsys driver

## Introduction

These are miscellaneous routines that don't fit into any of the other categories.

## Functions
dwc_usb3_pcd_ep_t * | dwc_usb3_pcd_get_ep_by_addr (dwc_usb3_pcd_t *pcd, u16 idx)
| This routine gets a pointer to an EP from the wIndex address value of the control request. More...
int | dwc_usb3_pcd_get_frame_number (dwc_usb3_pcd_t *pcd)
| Gets the current USB frame number. More...
int | dwc_usb3_pcd_isoc_ep_hiber_restart (dwc_usb3_pcd_t *pcd, dwc_usb3_pcd_ep_t *ep)
| After hibernation, this function restarts the transfer using the TRB address that was active before hibernation. The address is stored in the hiber_desc_idx field of the dwc_ep structure during the wakeup process. More...
void | dwc_usb3_pcd_stop (dwc_usb3_pcd_t *pcd)
| This routine is called when the Device is disconnected. It stops any active requests and informs the Function Driver of the disconnect. More...
u32 | dwc_usb3_pcd_get_link_state (dwc_usb3_pcd_t *pcd)
| This function retrieves the current link state. More...
void | dwc_usb3_pcd_set_link_state (dwc_usb3_pcd_t *pcd, u32 state)
| This function sets state of USB link. More...
void | dwc_usb3_pcd_remote_wake (dwc_usb3_pcd_t *pcd, int function)
| This function sends a Remote Wakeup to the host. More...
void | dwc_usb3_pcd_do_test_mode (unsigned long data)
| This routine is called when the SET_FEATURE TEST_MODE Setup packet is sent from the host. The Device Control register is written with the Test Mode bits set to the specified Test Mode. This is done as a tasklet so that the "Status" phase of the control transfer completes before transmitting the TEST packets. More...
void | dwc_queueInit (dwc_queue_t *queue)
| This routine initializes the queue. More...
bool | dwc_queuePut (dwc_queue_t *queue, uint32_t data)
| This routine adds an element to the queue. More...
bool | dwc_queueGet (dwc_queue_t *queue, uint32_t *data)
| This routine retrieves an elements from the queue. More...

## Function Documentation

## ◆ dwc_usb3_pcd_get_ep_by_addr()

dwc_usb3_pcd_ep_t* dwc_usb3_pcd_get_ep_by_addr | ( | dwc_usb3_pcd_t * | pcd,
|  | u16 | idx
| ) |  |

This routine gets a pointer to an EP from the wIndex address value of the control request.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.
  idx | The wIndex address value of the control request.

Returns
  Pointer to the EP struct corresponding to the address.

## ◆ dwc_usb3_pcd_get_frame_number()

int dwc_usb3_pcd_get_frame_number | ( | dwc_usb3_pcd_t * | pcd | ) |

Gets the current USB frame number.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.

Returns
  Current USB frame number.

## ◆ dwc_usb3_pcd_isoc_ep_hiber_restart()

int dwc_usb3_pcd_isoc_ep_hiber_restart | ( | dwc_usb3_pcd_t * | pcd,
|  | dwc_usb3_pcd_ep_t * | ep
| ) |  |

After hibernation, this function restarts the transfer using the TRB address that was active before hibernation. The address is stored in the hiber_desc_idx field of the dwc_ep structure during the wakeup process.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.
  ep | The EP to restart the transfer on.

Returns
  1 if a transfer was restarted, 0 if not.

## ◆ dwc_usb3_pcd_stop()

void dwc_usb3_pcd_stop | ( | dwc_usb3_pcd_t * | pcd | ) |

This routine is called when the Device is disconnected. It stops any active requests and informs the Function Driver of the disconnect.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.

## ◆ dwc_usb3_pcd_get_link_state()

u32 dwc_usb3_pcd_get_link_state | ( | dwc_usb3_pcd_t * | pcd | ) |

This function retrieves the current link state.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.

Returns
  The current link state.

## ◆ dwc_usb3_pcd_set_link_state()

void dwc_usb3_pcd_set_link_state | ( | dwc_usb3_pcd_t * | pcd,
|  | u32 | state
| ) |  |

This function sets state of USB link.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.
  state | Link state to set.

## ◆ dwc_usb3_pcd_remote_wake()

void dwc_usb3_pcd_remote_wake | ( | dwc_usb3_pcd_t * | pcd,
|  | int | function
| ) |  |

This function sends a Remote Wakeup to the host.

Parameters

  pcd | Programming view of DWC_usb3 peripheral controller.
  function | Function that caused the remote wakeup.

## ◆ dwc_usb3_pcd_do_test_mode()

void dwc_usb3_pcd_do_test_mode | ( | unsigned long | data | ) |

This routine is called when the SET_FEATURE TEST_MODE Setup packet is sent from the host. The Device Control register is written with the Test Mode bits set to the specified Test Mode. This is done as a tasklet so that the "Status" phase of the control transfer completes before transmitting the TEST packets.

Parameters

  data | Pointer to the programming view of DWC_usb3 peripheral controller.

## ◆ dwc_queueInit()

void dwc_queueInit | ( | dwc_queue_t * | queue | ) |

This routine initializes the queue.

Parameters

  queue | Pointer to the instance of queue

## ◆ dwc_queuePut()

bool dwc_queuePut | ( | dwc_queue_t * | queue,
|  | uint32_t | data
| ) |  |

This routine adds an element to the queue.

Parameters

  queue | Pointer to the instance of queue
  data | Data to be inserted in the queue

Returns
  true if the element was successfully added, false if the queue is full

## ◆ dwc_queueGet()

bool dwc_queueGet | ( | dwc_queue_t * | queue,
|  | uint32_t * | data
| ) |  |

This routine retrieves an elements from the queue.

Parameters

  queue | Pointer to the instance of queue
  data | Pointer to a variable where the data will be stored

Returns
  true if an element was successfully retrieved, false if the queue is empty