Synergy Software Package User's Manual

RTOS-integrated USBX adaptation framework for Synergy. Implements USB HOST and DEVICE low level device drivers. More...

Data Structures

struct  UX_DCD_SYNERGY_ED
 
struct  UX_DCD_SYNERGY_TRANSFER
 
struct  UX_DCD_SYNERGY_PAYLOAD_TRANSFER
 
struct  UX_DCD_SYNERGY
 
struct  UX_HCD_SYNERGY_TRANSFER
 
struct  UX_HCD_SYNERGY
 
struct  UX_HCD_SYNERGY_PAYLOAD_TRANSFER
 
struct  UX_HCD_SYNERGY_FIFO
 
struct  UX_SYNERGY_ED
 
struct  UX_SYNERGY_TD
 
struct  UX_SYNERGY_ISO_TD
 

Macros

#define UX_DCD_SYNERGY_SLAVE_CONTROLLER   (0x80U)
 
#define UX_SYNERGY_DCD_SYSCFG   (0x00UL)
 
#define UX_SYNERGY_DCD_BUSWAIT_CALC_FREQ_PCLK_CYC   (17142857U)
 
#define UX_SYNERGY_DCD_MAIN_OSC_24MHz   (24000000U)
 
#define UX_SYNERGY_DCD_SYSCFG_SCKE   (1U<<10)
 
#define UX_SYNERGY_DCD_DCP   (0)
 
#define UX_SYNERGY_DCD_PIPESEL_NO_PIPE   (0x000FU)
 
#define UX_SYNERGY_DCD_PIPE0_SIZE   (256U)
 
#define UX_SYNERGY_DCD_COMMAND_STATUS_RESET   (0)
 
#define UX_SYNERGY_DCD_FIFO_WRITING   (2U)
 
#define UX_SYNERGY_DCD_FIFO_READING   (2U)
 
#define UX_SYNERGY_DCD_ED_BRDY   (0x00000001U)
 
#define UX_SYNERGY_DCD_PHYSLEW_SLEW_SLEWR00   (1U<<0)
 
#define UX_DCD_SYNERGY_ED_STATUS_UNUSED   (0U)
 
#define UX_DCD_SYNERGY_ED_STATE_IDLE   (0U)
 
#define UX_SYNERGY_CONTROLLER   (0)
 
#define UX_SYNERGY_HC_SYSCFG   (0x00UL)
 
#define UX_SYNERGY_HC_BUSWAIT_CALC_FREQ_PCLK_CYC   (17142857U)
 
#define UX_SYNERGY_HC_MAIN_OSC_24MHz   (24000000U)
 
#define UX_SYNERGY_HC_SYSCFG_SCKE   (1U<<10)
 
#define UX_SYNERGY_HC_DCP   (0)
 
#define UX_SYNERGY_HC_PIPESEL_NO_PIPE   0x000f
 
#define UX_SYNERGY_HC_PIPE0_SIZE   (256)
 
#define UX_SYNERGY_HC_AVAILABLE_BANDWIDTH   (2304UL)
 
#define UX_SYNERGY_HC_COMMAND_STATUS_RESET   (0)
 
#define UX_SYNERGY_HC_FIFO_WRITING   (2)
 
#define UX_SYNERGY_HC_FIFO_READING   (2)
 
#define UX_SYNERGY_HC_ED_BRDY   (0x00000001U)
 
#define UX_SYNERGY_HC_PHYSLEW_SLEW_SLEWR00   (1U<<0)
 
#define UX_SYNERGY_HC_PORT_ENABLED   (1)
 
#define UX_SYNERGY_ED_STATIC   (0x80000000)
 
#define UX_SYNERGY_TD_SETUP_PHASE   (0x00010000)
 

Functions

void usbhs_usb_int_resume_isr (void)
 This function calls the host interrupt handler or the device interrupt handler.
 
void usbfs_int_isr (void)
 All the USBFS interrupts are handled by this ISR.
 
void usbfs_resume_isr (void)
 VBINT (VBUS interrupt), RESM (Resume interrupt), OVRCR (Over current input), BCHG (Change interrupt), and PDDETINT0 (Bus change interrupt) fire this ISR. This is only used for canceling following standby modes. More...
 
VOID ux_dcd_synergy_buffer_empty_interrupt (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, ULONG flag)
 This function processes the BEMP interrupt for the specific endpoint. More...
 
VOID ux_dcd_synergy_buffer_notready_interrupt (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, ULONG flag)
 This function processes the NRDY(Not Ready) interrupt for the specific endpoint. More...
 
UINT ux_dcd_synergy_buffer_read (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function reads from a specified pipe into a buffer. More...
 
VOID ux_dcd_synergy_buffer_ready_interrupt (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, ULONG flag)
 This function enable or disable the BRDY(Ready) interrupt for the pipe. More...
 
UINT ux_dcd_synergy_buffer_write (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function writes a data from input buffer to the specified PIPE. More...
 
VOID ux_dcd_synergy_current_endpoint_change (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, ULONG direction)
 This function configures the FIFO as per the request specified in endpoint descriptor. More...
 
ULONG ux_dcd_synergy_data_buffer_size (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function returns the size of the data buffer and selects the specified pipe. More...
 
UINT ux_dcd_synergy_endpoint_create (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_ENDPOINT *endpoint)
 This function creates a physical endpoint. More...
 
UINT ux_dcd_synergy_endpoint_destroy (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_ENDPOINT *endpoint)
 This function will destroy a physical endpoint. More...
 
VOID ux_dcd_synergy_endpoint_nak_set (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function sets a NAK(Not Acknowledged) to an endpoint. More...
 
UINT ux_dcd_synergy_endpoint_reset (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_ENDPOINT *endpoint)
 This function will reset a physical endpoint. More...
 
UINT ux_dcd_synergy_remote_wakeup (UX_DCD_SYNERGY *dcd_synergy, ULONG *parameter)
 This function is called when the device wants to wake up the host. More...
 
UINT ux_dcd_synergy_endpoint_stall (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_ENDPOINT *endpoint)
 This function will stall a physical endpoint. More...
 
UINT ux_dcd_synergy_endpoint_status (UX_DCD_SYNERGY *dcd_synergy, ULONG endpoint_index)
 This function will retrieve the status of the endpoint. More...
 
ULONG ux_dcd_synergy_fifo_port_change (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, ULONG direction)
 This function configures the FIFO port. More...
 
UINT ux_dcd_synergy_fifoc_read (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function reads from the hardware FIFO C and stores in the destination buffer. More...
 
UINT ux_dcd_synergy_fifo_read (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function reads from the hardware FIFO D0 or D1 and stores in the destination buffer. More...
 
UINT ux_dcd_synergy_fifo_read_dma (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, UINT dma_bytes_to_transfer)
 This function reads the data from HW D0/ D1 FIFO using DMA. More...
 
UINT ux_dcd_synergy_fifoc_write (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function writes a data from a buffer into USB FIFO using CPU. More...
 
VOID ux_dcd_synergy_fifo_write_software_copy (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_PAYLOAD_TRANSFER *p_payload, VOID *p_fifo, ULONG fifo_sel)
 USBX DCD FIFO write by software copy. Call a subroutine for selected USB controller hardware. More...
 
VOID ux_dcd_synergy_fifo_write_last_bytes (UX_DCD_SYNERGY_PAYLOAD_TRANSFER *p_payload, VOID *p_fifo, ULONG usb_base)
 USBX DCD FIFO write - Copy last bytes to FIFO by software if the rest bytes are less than FIFO access width. More...
 
UINT ux_dcd_synergy_fifod_write (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed)
 This function writes a buffer to FIFOD0 or FIFOD1. More...
 
UINT ux_dcd_synergy_fifod_write_dma (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_ED *ed, UINT dma_bytes_to_transfer)
 This function writes a buffer to FIFOD0 or FIFOD1 using DMA. More...
 
VOID ux_dcd_synergy_write_dma_configure (UX_DCD_SYNERGY *dcd_synergy, UX_DCD_SYNERGY_PAYLOAD_TRANSFER *p_payload, ULONG fifo_sel, ULONG endpoint_size)
 USBX DCD DMA write setup function. Call a subroutine for selected USB controller hardware. More...
 
VOID ux_dcd_synergy_fifo_dma_start_write (UX_DCD_SYNERGY *dcd_synergy, UCHAR *p_payload_buffer, VOID *p_fifo_add, VOID *p_fifo_ctrl, VOID *p_fifo_sel)
 USBX DCD DMA FIFO write - DMA start function. More...
 
UINT ux_dcd_synergy_frame_number_get (UX_DCD_SYNERGY *dcd_synergy, ULONG *frame_number)
 This function will return the frame number currently used by the controller. This function is mostly used for isochronous purposes. More...
 
UINT ux_dcd_synergy_function (UX_SLAVE_DCD *dcd, UINT function, VOID *parameter)
 This function act as interface between upper layer USBX device stack and synergy controller. More...
 
UINT ux_dcd_synergy_initialize (ULONG dcd_io)
 This function initializes the USB slave controller for Renesas Synergy MCUs. More...
 
UINT ux_dcd_synergy_initialize_transfer_support (ULONG dcd_io, UX_DCD_SYNERGY_TRANSFER *p_transfer_instance)
 The function initializes the USB slave controller of the Renesas Synergy MCUs with associated DMA transfer modules. More...
 
UINT ux_dcd_synergy_initialize_complete (VOID)
 This function completes the initialization of the USB slave controller for the Renesas Synergy MCUs. More...
 
VOID ux_dcd_synergy_interrupt_handler (VOID)
 This function is the interrupt handler for the synergy controller. More...
 
VOID ux_dcd_synergy_register_clear (UX_DCD_SYNERGY *dcd_synergy, ULONG synergy_register, USHORT value)
 This function clears a bit in a register of the synergy. More...
 
VOID ux_dcd_synergy_usb_status_register_clear (UX_DCD_SYNERGY *dcd_synergy, ULONG synergy_register, USHORT value)
 This function clears a bit in a status register of the synergy.To clear the status bits, need to write 0 only to the bits to be cleared. Write 1 to the other bits. More...
 
ULONG ux_dcd_synergy_register_read (UX_DCD_SYNERGY *dcd_synergy, ULONG synergy_register)
 This function reads a synergy USB register. More...
 
VOID ux_dcd_synergy_register_set (UX_DCD_SYNERGY *dcd_synergy, ULONG synergy_register, USHORT value)
 This function set a bit in synergy USB register. More...
 
VOID ux_dcd_synergy_register_write (UX_DCD_SYNERGY *dcd_synergy, ULONG synergy_register, USHORT value)
 This function writes a bit in synergy USB register. More...
 
UINT ux_dcd_synergy_transfer_abort (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_TRANSFER *transfer_request)
 This function will terminate the transfer. More...
 
UINT ux_dcd_synergy_transfer_callback (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_TRANSFER *transfer_request, ULONG interrupt_status, ULONG ctsq_mask)
 This function is invoked under ISR when an event happens on a specific endpoint. More...
 
UINT ux_dcd_synergy_transfer_request (UX_DCD_SYNERGY *dcd_synergy, UX_SLAVE_TRANSFER *transfer_request)
 This function will initiate a transfer to a specific endpoint. If the endpoint is IN, the endpoint register will be set to accept the request. If the endpoint is IN, the endpoint FIFO will be filled with the buffer and the endpoint register set. More...
 
void ux_dcd_synergy_disconnect (void)
 USBX DCD disconnect the USB controller communication from the host.
 
UINT ux_dcd_synergy_uninitialize (ULONG dcd_io)
 USBX DCD un-initialization the USB controller. More...
 
UINT ux_dcd_synergy_uninitialize_transfer_support (ULONG dcd_io)
 The function un-initializes the USB slave controller of the Renesas Synergy MCUs with associated DMA transfer modules. More...
 
VOID ux_hcd_synergy_asynch_queue_process (UX_HCD_SYNERGY *hcd_synergy)
 This function process the asynchronous transactions. The function will identify the USB interrupts occurred associated with an endpoint and will process the interrupts. More...
 
VOID ux_hcd_synergy_asynch_queue_process_bemp (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the BEMP(Buffer Empty) interrupt that occurred on a specific ED. More...
 
VOID ux_hcd_synergy_asynch_queue_process_brdy (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the BRDY(Buffer Ready)interrupt that occurred on a specific ED. More...
 
VOID ux_hcd_synergy_asynch_queue_process_nrdy (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the NRDY(Not Ready) Interrupt that occurred on a specific ED. More...
 
VOID ux_hcd_synergy_asynch_queue_process_sign (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the Setup transaction Error Interrupt. More...
 
VOID ux_hcd_synergy_asynch_schedule (UX_HCD_SYNERGY *hcd_synergy)
 This function schedules new transfers from the control or bulk lists. More...
 
UINT ux_hcd_synergy_asynchronous_endpoint_create (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will create an asynchronous endpoint. The control and bulk endpoints fall into this category. More...
 
UINT ux_hcd_synergy_asynchronous_endpoint_destroy (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will destroy an asynchronous endpoint. The control and bulk endpoints fall into this category. More...
 
VOID ux_hcd_synergy_buffer_empty_interrupt (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed, ULONG flag)
 This function enable or disable the BEMP(Buffer Empty) interrupt for the pipe. More...
 
VOID ux_hcd_synergy_buffer_notready_interrupt (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed, ULONG flag)
 This function enable or disable the NRDY(Not Ready) interrupt for the pipe. More...
 
UINT ux_hcd_synergy_buffer_read (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function reads from a specified pipe into a buffer. More...
 
VOID ux_hcd_synergy_buffer_ready_interrupt (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed, ULONG flag)
 This function enable or disable the BRDY(Ready) interrupt for the pipe. More...
 
UINT ux_hcd_synergy_buffer_write (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function writes data to the selected FIFO of the endpoint. More...
 
UINT ux_hcd_synergy_bulk_endpoint_create (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will create a bulk endpoint. More...
 
UINT ux_hcd_synergy_bulk_int_td_add (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function adds a transfer descriptor to an Bulk or INT ED. More...
 
UINT ux_hcd_synergy_control_endpoint_create (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will create a control endpoint. More...
 
UINT ux_hcd_synergy_control_td_add (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function adds a transfer descriptor to an ED. More...
 
UINT ux_hcd_synergy_controller_disable (UX_HCD_SYNERGY *hcd_synergy)
 This function will disable the Synergy controller. The controller will release all its resources (memory, IO ...). After this, the controller will not send SOF any longer. All transactions should have been completed, all classes should have been closed. More...
 
VOID ux_hcd_synergy_current_endpoint_change (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed, ULONG direction)
 This function change the endpoint in the FIFO. More...
 
ULONG ux_hcd_synergy_data_buffer_size (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function returns the size of the buffer data. More...
 
UX_SYNERGY_EDux_hcd_synergy_ed_obtain (UX_HCD_SYNERGY *hcd_synergy)
 This function obtains a free ED from the ED list. More...
 
VOID ux_hcd_synergy_ed_td_clean (UX_SYNERGY_ED *ed)
 This function process cleans the ED of all tds except the last dummy TD. More...
 
VOID ux_hcd_synergy_endpoint_nak_set (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function sets a NAK(Not Acknowledged) to an endpoint. More...
 
UINT ux_hcd_synergy_endpoint_reset (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will reset an endpoint. More...
 
UINT ux_hcd_synergy_entry (UX_HCD *hcd, UINT function, VOID *parameter)
 This function is the entry function to the USB driver from the USB stack. More...
 
ULONG ux_hcd_synergy_fifo_port_change (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed, ULONG direction)
 This function change the port of the FIFO. More...
 
UINT ux_hcd_synergy_fifo_read (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function read data from the FIFO configured for the PIPE(FIFO C, D0 or D1). More...
 
UINT ux_hcd_synergy_fifoc_write (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function writes a buffer to FIFOC. More...
 
VOID ux_hcd_synergy_fifo_write_software_copy (UX_HCD_SYNERGY *hcd_synergy, ULONG payload_length, UCHAR *payload_buffer, VOID *fifo_addr, ULONG fifo_sel)
 USBX HCD CPU FIFO write by software copy. Call a suitable subroutine for selected USB controller hardware. More...
 
VOID ux_hcd_synergy_fifo_write_software_copy_remaining_bytes (UX_HCD_SYNERGY *hcd_synergy, ULONG payload_length, UCHAR *payload_buffer, VOID *fifo_addr)
 USBX HCD CPU FIFO write - Copy remaining bytes to FIFO by software if the rest bytes are less than FIFO access width. More...
 
UINT ux_hcd_synergy_fifod_write (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function writes a buffer data to FIFOD0 or FIFOD1. More...
 
UINT ux_hcd_synergy_frame_number_get (UX_HCD_SYNERGY *hcd_synergy, ULONG *frame_number)
 This function will return the frame number currently used by the controller. This function is mostly used for isochronous purposes and for timing. More...
 
VOID ux_hcd_synergy_frame_number_set (UX_HCD_SYNERGY *hcd_synergy, ULONG frame_number)
 This function will set the current frame number to the one specified. This function is mostly used for isochronous purpos.es. More...
 
UINT ux_hcd_synergy_initialize (UX_HCD *hcd)
 This function initializes the Synergy controller. More...
 
UINT ux_hcd_synergy_initialize_transfer_support (UX_HCD *hcd, const UX_HCD_SYNERGY_TRANSFER *p_transfer_instance)
 USBX HCD Transfer Support with DMA support. More...
 
UINT ux_hcd_synergy_interrupt_endpoint_create (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will create an interrupt endpoint. The interrupt endpoint has an interval of operation from 1 to 255. The Synergy has no hardware scheduler but we still build an interrupt tree similar to the OHCI controller. More...
 
VOID ux_hcd_synergy_interrupt_handler (UINT hcd_index)
 This function is the interrupt handler for the Synergy USB HS controller. Normally an interrupt occurs from the controller when there is either a EOF signal and there has been transfers within the frame or when there is a change on one of the downstream ports. More...
 
VOID ux_hcd_synergy_iso_queue_process (UX_HCD_SYNERGY *hcd_synergy)
 This function process the isochronous transactions that happened in the last frame. More...
 
VOID ux_hcd_synergy_iso_queue_process_bemp (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the BEMP(Buffer Empty) Interrupt that occurred on a specific ED used for Isochronous transfer. More...
 
VOID ux_hcd_synergy_iso_queue_process_brdy (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the BRDY(Buffer Ready)interrupt that occurred on a specific ED used for isochronous transfer. More...
 
VOID ux_hcd_synergy_iso_queue_process_nrdy (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function process the NRDY(Not Ready) Interrupt that occurred on a specific ED used for Isochronous transfer. More...
 
VOID ux_hcd_synergy_iso_schedule (UX_HCD_SYNERGY *hcd_synergy)
 This function schedules new transfers from isochronous list. More...
 
UINT ux_hcd_synergy_iso_td_add (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function adds a transfer descriptor to an Isochronous Endpoint Descriptor. More...
 
UINT ux_hcd_synergy_isochronous_endpoint_create (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function creates an isochronous endpoint. More...
 
UX_SYNERGY_ISO_TDux_hcd_synergy_isochronous_td_obtain (UX_HCD_SYNERGY *hcd_synergy)
 This function obtains a free TD from the isochronous TD list. More...
 
UX_SYNERGY_EDux_hcd_synergy_least_traffic_list_get (UX_HCD_SYNERGY *hcd_synergy)
 This function return a pointer to the first ED in the periodic tree that has the least traffic registered. More...
 
UINT ux_hcd_synergy_periodic_endpoint_destroy (UX_HCD_SYNERGY *hcd_synergy, UX_ENDPOINT *endpoint)
 This function will destroy an isochronous endpoint. More...
 
VOID ux_hcd_synergy_periodic_schedule (UX_HCD_SYNERGY *hcd_synergy)
 This function schedules new transfers from the periodic interrupt list. More...
 
UINT ux_hcd_synergy_periodic_tree_create (UX_HCD_SYNERGY *hcd_synergy)
 This function creates the periodic static tree for the interrupt and isochronous eds. More...
 
UINT ux_hcd_synergy_port_disable (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will disable a specific port attached to the root HUB. More...
 
UINT ux_hcd_synergy_port_enable (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will enable a specific port attached to the root HUB. More...
 
UINT ux_hcd_synergy_port_reset (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will reset a specific port attached to the root HUB. More...
 
UINT ux_hcd_synergy_port_resume (UX_HCD_SYNERGY *hcd_synergy, UINT port_index)
 This function will resume a specific port attached to the root HUB. Present, this function is not supported for resume port. More...
 
ULONG ux_hcd_synergy_port_status_get (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will return the status for each port attached to the root HUB. More...
 
UINT ux_hcd_synergy_port_suspend (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will suspend a specific port attached to the root HUB. Present, this function is does not supported. More...
 
UINT ux_hcd_synergy_power_down_port (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will power down a specific port attached to the root HUB. Present, this function is does not supported. More...
 
UINT ux_hcd_synergy_power_on_port (UX_HCD_SYNERGY *hcd_synergy, ULONG port_index)
 This function will power a specific port attached to the root HUB. Present, this function is does not supported. More...
 
VOID ux_hcd_synergy_power_root_hubs (UX_HCD_SYNERGY *hcd_synergy)
 This function will power the root HUB. Present, this function is does not supported. More...
 
VOID ux_hcd_synergy_register_clear (UX_HCD_SYNERGY *hcd_synergy, ULONG synergy_register, USHORT value)
 This function clears flags in a synergy USB register. More...
 
VOID ux_hcd_synergy_register_status_clear (UX_HCD_SYNERGY *hcd_synergy, ULONG synergy_register, USHORT value)
 This function clears a bit in a status register of the synergy controller.To clear the status bits, need to write 0 only to the bits to be cleared. Write 1 to the other bits. More...
 
ULONG ux_hcd_synergy_register_read (UX_HCD_SYNERGY *hcd_synergy, ULONG synergy_register)
 This function reads a data from synergy USB register. More...
 
VOID ux_hcd_synergy_register_set (UX_HCD_SYNERGY *hcd_synergy, ULONG synergy_register, USHORT value)
 This function sets flags in a synergy USB register. More...
 
VOID ux_hcd_synergy_register_write (UX_HCD_SYNERGY *hcd_synergy, ULONG synergy_register, USHORT value)
 This function writes a data to a Synergy USB register. More...
 
UX_SYNERGY_TDux_hcd_synergy_regular_td_obtain (UX_HCD_SYNERGY *hcd_synergy)
 This function obtains a free TD from the regular TD list. More...
 
UINT ux_hcd_synergy_request_bulk_transfer (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function performs a bulk transfer request. A bulk transfer can be larger than the size of the Synergy buffer so it may be required to chain multiple tds to accommodate this transfer request. A bulk transfer is non blocking, so we return before the transfer request is completed. More...
 
UINT ux_hcd_synergy_request_control_transfer (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function performs a control transfer from a transfer request. The USB control transfer is in 3 phases (setup, data, status). This function will chain all phases of the control sequence before setting the Synergy endpoint as a candidate for transfer. More...
 
UINT ux_hcd_synergy_request_interrupt_transfer (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function performs an interrupt transfer request. An interrupt transfer can only be as large as the MaxpacketField in the endpoint descriptor. This was verified at the USB layer and does not need to be reverified here. More...
 
UINT ux_hcd_synergy_request_isochronous_transfer (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function performs an isochronous transfer request. More...
 
UINT ux_hcd_synergy_request_transfer (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function is the handler for all the transactions on the USB. The transfer request passed as parameter contains the endpoint and the device descriptors in addition to the type of transaction de be executed. This function routes the transfer request to according to the type of transfer to be executed. More...
 
UINT ux_hcd_synergy_td_add (UX_HCD_SYNERGY *hcd_synergy, UX_SYNERGY_ED *ed)
 This function add new TD for control, Bulk or Interrupt endpoint. More...
 
UINT ux_hcd_synergy_transfer_abort (UX_HCD_SYNERGY *hcd_synergy, UX_TRANSFER *transfer_request)
 This function will abort transactions attached to a transfer request. More...
 
UINT ux_hcd_synergy_disable (ULONG ux_hcd_io)
 This function disables the Synergy HOST controller. More...
 
UINT ux_hcd_synergy_uninitialize (ULONG ux_hcd_io)
 This function un-initializes the Synergy HOST controller. More...
 
UINT ux_hcd_synergy_uninitialize_transfer_support (UX_HCD_SYNERGY *hcd_synergy)
 This function un-initializes the transfer module associated with the USBX HOST controller. More...
 

Detailed Description

RTOS-integrated USBX adaptation framework for Synergy. Implements USB HOST and DEVICE low level device drivers.

USBX Component SYNERGY Controller Driver

Macro Definition Documentation

◆ UX_DCD_SYNERGY_ED_STATE_IDLE

#define UX_DCD_SYNERGY_ED_STATE_IDLE   (0U)

Define USB SYNERGY physical endpoint state machine definition.

◆ UX_DCD_SYNERGY_ED_STATUS_UNUSED

#define UX_DCD_SYNERGY_ED_STATUS_UNUSED   (0U)

Define USB SYNERGY physical endpoint status definition.

◆ UX_DCD_SYNERGY_SLAVE_CONTROLLER

#define UX_DCD_SYNERGY_SLAVE_CONTROLLER   (0x80U)

Define SYNERGY generic equivalences.

◆ UX_SYNERGY_CONTROLLER

#define UX_SYNERGY_CONTROLLER   (0)

Define Synergy generic definitions.

◆ UX_SYNERGY_DCD_BUSWAIT_CALC_FREQ_PCLK_CYC

#define UX_SYNERGY_DCD_BUSWAIT_CALC_FREQ_PCLK_CYC   (17142857U)

Register access wait cycles for USBHS controller. 7cycles at Peripheral clock 120MHz

◆ UX_SYNERGY_DCD_COMMAND_STATUS_RESET

#define UX_SYNERGY_DCD_COMMAND_STATUS_RESET   (0)

Define synergy initialization values.

◆ UX_SYNERGY_DCD_DCP

#define UX_SYNERGY_DCD_DCP   (0)

Define synergy command/status bitmaps.

◆ UX_SYNERGY_DCD_ED_BRDY

#define UX_SYNERGY_DCD_ED_BRDY   (0x00000001U)

Define synergy physical endpoint definitions.

◆ UX_SYNERGY_DCD_FIFO_READING

#define UX_SYNERGY_DCD_FIFO_READING   (2U)

Define synergy FIFO read completion code.

◆ UX_SYNERGY_DCD_FIFO_WRITING

#define UX_SYNERGY_DCD_FIFO_WRITING   (2U)

Define synergy FIFO write completion code.

◆ UX_SYNERGY_DCD_MAIN_OSC_24MHz

#define UX_SYNERGY_DCD_MAIN_OSC_24MHz   (24000000U)

Supported USBMCLK frequency for S7G2 and S5D9.

◆ UX_SYNERGY_DCD_PHYSLEW_SLEW_SLEWR00

#define UX_SYNERGY_DCD_PHYSLEW_SLEW_SLEWR00   (1U<<0)

PHY Cross Point Adjustment, note that Hardware Manual to be updated(0xE->0x5)

◆ UX_SYNERGY_DCD_PIPE0_SIZE

#define UX_SYNERGY_DCD_PIPE0_SIZE   (256U)

Define synergy fifo definition.

◆ UX_SYNERGY_DCD_PIPESEL_NO_PIPE

#define UX_SYNERGY_DCD_PIPESEL_NO_PIPE   (0x000FU)

Define synergy PIPE selection definitions.

◆ UX_SYNERGY_DCD_SYSCFG

#define UX_SYNERGY_DCD_SYSCFG   (0x00UL)

Define SYNERGY HCOR register mapping.

◆ UX_SYNERGY_DCD_SYSCFG_SCKE

#define UX_SYNERGY_DCD_SYSCFG_SCKE   (1U<<10)

Define SYNERGY control register values.

◆ UX_SYNERGY_ED_STATIC

#define UX_SYNERGY_ED_STATIC   (0x80000000)

Define Synergy ED bitmap.

◆ UX_SYNERGY_HC_AVAILABLE_BANDWIDTH

#define UX_SYNERGY_HC_AVAILABLE_BANDWIDTH   (2304UL)

Define Synergy static definition. This macro is used for checking the available bandwidth for periodic transfers(Isochronous and Interrupt) Maximum bandwidth is calculated as {2048byes(2x ISO PIPEs) + 256bytes(4x INT PIPEs)} for high-speed operation.

◆ UX_SYNERGY_HC_BUSWAIT_CALC_FREQ_PCLK_CYC

#define UX_SYNERGY_HC_BUSWAIT_CALC_FREQ_PCLK_CYC   (17142857U)

Register access wait cycles for USBHS controller. 7cycles at Peripheral clock 120MHz

◆ UX_SYNERGY_HC_COMMAND_STATUS_RESET

#define UX_SYNERGY_HC_COMMAND_STATUS_RESET   (0)

Define Synergy initialization values.

◆ UX_SYNERGY_HC_DCP

#define UX_SYNERGY_HC_DCP   (0)

Define Synergy HCOR command/status bitmaps.

◆ UX_SYNERGY_HC_ED_BRDY

#define UX_SYNERGY_HC_ED_BRDY   (0x00000001U)

Define Synergy physical endpoint definitions.

◆ UX_SYNERGY_HC_FIFO_READING

#define UX_SYNERGY_HC_FIFO_READING   (2)

Define Synergy FIFO read completion code.

◆ UX_SYNERGY_HC_FIFO_WRITING

#define UX_SYNERGY_HC_FIFO_WRITING   (2)

Define Synergy FIFO write completion code.

◆ UX_SYNERGY_HC_MAIN_OSC_24MHz

#define UX_SYNERGY_HC_MAIN_OSC_24MHz   (24000000U)

Supported USBMCLK frequency for S7G2 and S5D9.

◆ UX_SYNERGY_HC_PHYSLEW_SLEW_SLEWR00

#define UX_SYNERGY_HC_PHYSLEW_SLEW_SLEWR00   (1U<<0)

PHY Cross Point Adjustment, note that Hardware Manual to be updated(0xE->0x5)

◆ UX_SYNERGY_HC_PIPE0_SIZE

#define UX_SYNERGY_HC_PIPE0_SIZE   (256)

Define Synergy fifo definition.

◆ UX_SYNERGY_HC_PIPESEL_NO_PIPE

#define UX_SYNERGY_HC_PIPESEL_NO_PIPE   0x000f

Define Synergy PIPE selection definitions.

◆ UX_SYNERGY_HC_PORT_ENABLED

#define UX_SYNERGY_HC_PORT_ENABLED   (1)

Define Synergy Root hub states.

◆ UX_SYNERGY_HC_SYSCFG

#define UX_SYNERGY_HC_SYSCFG   (0x00UL)

Protection against no definition of Synergy controller.

◆ UX_SYNERGY_HC_SYSCFG_SCKE

#define UX_SYNERGY_HC_SYSCFG_SCKE   (1U<<10)

Define Synergy control register values.

◆ UX_SYNERGY_TD_SETUP_PHASE

#define UX_SYNERGY_TD_SETUP_PHASE   (0x00010000)

Define Synergy TD bitmap.

Function Documentation

◆ usbfs_resume_isr()

void usbfs_resume_isr ( void  )

VBINT (VBUS interrupt), RESM (Resume interrupt), OVRCR (Over current input), BCHG (Change interrupt), and PDDETINT0 (Bus change interrupt) fire this ISR. This is only used for canceling following standby modes.

  • Canceling the software standby mode
  • Canceling deep standby mode

◆ ux_dcd_synergy_buffer_empty_interrupt()

VOID ux_dcd_synergy_buffer_empty_interrupt ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
ULONG  flag 
)

This function processes the BEMP interrupt for the specific endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to physical Endpoint(ED) control block
[in]flagFlag to enable or disable the buffer empty interrupt.

◆ ux_dcd_synergy_buffer_notready_interrupt()

VOID ux_dcd_synergy_buffer_notready_interrupt ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
ULONG  flag 
)

This function processes the NRDY(Not Ready) interrupt for the specific endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to physical Endpoint(ED) control block
[in]flagFlag for DCD synergy enable or disable.

◆ ux_dcd_synergy_buffer_read()

UINT ux_dcd_synergy_buffer_read ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function reads from a specified pipe into a buffer.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
Return values
UX_SUCCESSRead a data from buffer successfully.
UX_ERRORUnable to read a data from buffer.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_dcd_synergy_buffer_ready_interrupt()

VOID ux_dcd_synergy_buffer_ready_interrupt ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
ULONG  flag 
)

This function enable or disable the BRDY(Ready) interrupt for the pipe.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
[in]flagCheck whether DCD synergy is enable or disable.

◆ ux_dcd_synergy_buffer_write()

UINT ux_dcd_synergy_buffer_write ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function writes a data from input buffer to the specified PIPE.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
Return values
UX_SUCCESSWrite a data to FIFO(D0, D1 and C) successfully.
UX_ERRORUnable to write a data to FIFO(D0, D1 and C).
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_dcd_synergy_current_endpoint_change()

VOID ux_dcd_synergy_current_endpoint_change ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
ULONG  direction 
)

This function configures the FIFO as per the request specified in endpoint descriptor.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
[in]directionEndpoint direction

◆ ux_dcd_synergy_data_buffer_size()

ULONG ux_dcd_synergy_data_buffer_size ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function returns the size of the data buffer and selects the specified pipe.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
Return values
buffer_sizeMaximum packet size.

◆ ux_dcd_synergy_endpoint_create()

UINT ux_dcd_synergy_endpoint_create ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_ENDPOINT *  endpoint 
)

This function creates a physical endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]endpointPointer to a Device Controller Endpoint structure.
Return values
UX_SUCCESSEndpoint is created successfully.
UX_ERRORBuffer is not free or endpoint creation is unsuccessful.
UX_NO_ED_AVAILABLEEndpoint is already in use.

◆ ux_dcd_synergy_endpoint_destroy()

UINT ux_dcd_synergy_endpoint_destroy ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_ENDPOINT *  endpoint 
)

This function will destroy a physical endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]endpointPointer to a Device Controller Endpoint structure.
Return values
UX_SUCCESSEndpoint is destroyed successfully.

◆ ux_dcd_synergy_endpoint_nak_set()

VOID ux_dcd_synergy_endpoint_nak_set ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function sets a NAK(Not Acknowledged) to an endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block

◆ ux_dcd_synergy_endpoint_reset()

UINT ux_dcd_synergy_endpoint_reset ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_ENDPOINT *  endpoint 
)

This function will reset a physical endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]endpointPointer to a Device Controller Endpoint structure.
Return values
UX_SUCCESSEndpoint is reset successfully.
UX_NO_ED_AVAILABLEDevice Controller Endpoint structure pointer is NULL

Abort the transfer request on this endpoint.

◆ ux_dcd_synergy_endpoint_stall()

UINT ux_dcd_synergy_endpoint_stall ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_ENDPOINT *  endpoint 
)

This function will stall a physical endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]endpointPointer to a Device Controller Endpoint structure.
Return values
UX_SUCCESSEndpoint is stalled successfully.
UX_NO_ED_AVAILABLEDevice Controller Endpoint control pointer is Null.

◆ ux_dcd_synergy_endpoint_status()

UINT ux_dcd_synergy_endpoint_status ( UX_DCD_SYNERGY dcd_synergy,
ULONG  endpoint_index 
)

This function will retrieve the status of the endpoint.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]endpoint_indexEndpoint number who's status is to be known.
Return values
UX_ERROREndpoint already in use.
UX_FALSEEndpoint is stalled.
UX_TRUEEndpoint is not stalled.

◆ ux_dcd_synergy_fifo_dma_start_write()

VOID ux_dcd_synergy_fifo_dma_start_write ( UX_DCD_SYNERGY dcd_synergy,
UCHAR *  p_payload_buffer,
VOID *  p_fifo_add,
VOID *  p_fifo_ctrl,
VOID *  p_fifo_sel 
)

USBX DCD DMA FIFO write - DMA start function.

Parameters
[in]dcd_synergyPointer to the DCD control block
[in,out]p_payload_bufferPointer to a payload buffer
[in]p_fifo_addFIFO register address
[in]p_fifo_ctrlFIFO port control register address
[in]p_fifo_selFIFO port selection register address

◆ ux_dcd_synergy_fifo_port_change()

ULONG ux_dcd_synergy_fifo_port_change ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
ULONG  direction 
)

This function configures the FIFO port.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]edPointer to a physical Endpoint(ED) control block
[in]directionDirection to switch
Return values
UX_ERRORUnable to change fifo port.
Returns
synergy_register Current endpoint index(pipe)

◆ ux_dcd_synergy_fifo_read()

UINT ux_dcd_synergy_fifo_read ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function reads from the hardware FIFO D0 or D1 and stores in the destination buffer.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_READ_OVERFIFO read overflow.
UX_SYNERGY_DCD_FIFO_READ_SHORTShort packet is received.
UX_SYNERGY_DCD_FIFO_READINGContinue reading FIFO.

◆ ux_dcd_synergy_fifo_read_dma()

UINT ux_dcd_synergy_fifo_read_dma ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
UINT  dma_bytes_to_transfer 
)

This function reads the data from HW D0/ D1 FIFO using DMA.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
[in,out]dma_bytes_to_transfer: No of bytes to be transferred using DMA
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_READ_OVERFIFO read overflow.
UX_SYNERGY_DCD_FIFO_READ_SHORTShort packet is received.
UX_SYNERGY_DCD_FIFO_READINGContinue reading FIFO.

◆ ux_dcd_synergy_fifo_write_last_bytes()

VOID ux_dcd_synergy_fifo_write_last_bytes ( UX_DCD_SYNERGY_PAYLOAD_TRANSFER p_payload,
VOID *  p_fifo,
ULONG  usb_base 
)

USBX DCD FIFO write - Copy last bytes to FIFO by software if the rest bytes are less than FIFO access width.

Parameters
[in,out]p_payloadPointer to a payload transfer structure
[in]p_fifoFIFO register address
[in]usb_baseUSB controller hardware base address

◆ ux_dcd_synergy_fifo_write_software_copy()

VOID ux_dcd_synergy_fifo_write_software_copy ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_PAYLOAD_TRANSFER p_payload,
VOID *  p_fifo,
ULONG  fifo_sel 
)

USBX DCD FIFO write by software copy. Call a subroutine for selected USB controller hardware.

Parameters
[in]dcd_synergyPointer to the DCD control block
[in,out]p_payloadPointer to a payload transfer structure
[in]p_fifoFIFO register address
[in]fifo_selFIFO select register

◆ ux_dcd_synergy_fifoc_read()

UINT ux_dcd_synergy_fifoc_read ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function reads from the hardware FIFO C and stores in the destination buffer.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_READ_OVERFIFO read overflow.
UX_SYNERGY_DCD_FIFO_READ_SHORTShort packet is received.
UX_SYNERGY_DCD_FIFO_READINGContinue reading FIFO.

◆ ux_dcd_synergy_fifoc_write()

UINT ux_dcd_synergy_fifoc_write ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function writes a data from a buffer into USB FIFO using CPU.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_WRITE_ENDStatus for fifo write ends.
UX_SYNERGY_DCD_FIFO_WRITINGStatus for fifo multiple writes.

◆ ux_dcd_synergy_fifod_write()

UINT ux_dcd_synergy_fifod_write ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed 
)

This function writes a buffer to FIFOD0 or FIFOD1.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_WRITE_ENDWrite ends of FIFO.
UX_SYNERGY_DCD_FIFO_WRITINGContinue multiple write to FIFO.

◆ ux_dcd_synergy_fifod_write_dma()

UINT ux_dcd_synergy_fifod_write_dma ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_ED ed,
UINT  dma_bytes_to_transfer 
)

This function writes a buffer to FIFOD0 or FIFOD1 using DMA.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]ed: Pointer to a physical Endpoint(ED) control block
[in,out]dma_bytes_to_transfer: No of bytes to be transferred using DMA
Return values
UX_ERRORFIFO is not accessible.
UX_SYNERGY_DCD_FIFO_WRITE_ENDWrite ends of FIFO.
UX_SYNERGY_DCD_FIFO_WRITINGContinue multiple write to FIFO.
UX_SYNERGY_DCD_FIFO_WRITE_ERRORReturn error if timeout occurs or endpoint reset occurs.

Setup DMA transfer.

Start DMA transfer by software control.

Wait till DMA transfer is done.

Return error, if semaphore timeouts or endpoint reset occurs.

Wait for certain time - if the buffer is not ready return error

Clear the DELSR.n.IR flag by starting the dummy DMA transfer.

◆ ux_dcd_synergy_frame_number_get()

UINT ux_dcd_synergy_frame_number_get ( UX_DCD_SYNERGY dcd_synergy,
ULONG *  frame_number 
)

This function will return the frame number currently used by the controller. This function is mostly used for isochronous purposes.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]frame_number: Pointer to a frame number in use
Return values
UX_SUCCESSIn use frame number is returned successfully.

◆ ux_dcd_synergy_function()

UINT ux_dcd_synergy_function ( UX_SLAVE_DCD *  dcd,
UINT  function,
VOID *  parameter 
)

This function act as interface between upper layer USBX device stack and synergy controller.

Parameters
[in,out]dcd: Pointer to a USBX control block.
[in,out]function: Function requested to be despatched.
[in,out]parameter: Pointer to requested function parameters.
Return values
UX_CONTROLLER_UNKNOWNDesired controller is not specified.
UX_FUNCTION_NOT_SUPPORTEDDCD function is not supported by the controller.
UX_SUCCESSDCD function despatched successfully.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_dcd_synergy_initialize()

UINT ux_dcd_synergy_initialize ( ULONG  dcd_io)

This function initializes the USB slave controller for Renesas Synergy MCUs.

Parameters
[in,out]dcd_ioAddress of DCD
Returns
See Common Error Codes for other possible return codes or causes.
              This function calls:
              * ux_dcd_synergy_initialize_common()

◆ ux_dcd_synergy_initialize_complete()

UINT ux_dcd_synergy_initialize_complete ( VOID  )

This function completes the initialization of the USB slave controller for the Renesas Synergy MCUs.

Return values
UX_SUCCESSUSB slave is initialized successfully.

◆ ux_dcd_synergy_initialize_transfer_support()

UINT ux_dcd_synergy_initialize_transfer_support ( ULONG  dcd_io,
UX_DCD_SYNERGY_TRANSFER p_transfer_instance 
)

The function initializes the USB slave controller of the Renesas Synergy MCUs with associated DMA transfer modules.

Parameters
[in]dcd_ioAddress of the USB controller.
[in]p_transfer_instancePointer to Synergy Transfer module instances.
Return values
UX_SUCCESSCompleted the USB controller initialization successfully.
UX_CONTROLLER_INIT_FAILEDFailed to initialize the USB controller.
UX_MEMORY_INSUFFICIENTMemory was not allocated properly for the Synergy DCD instance.

Get the pointer to the Synergy DCD instance.

To begin, initialize D0 and D1 FIFO as free.

Initialize Transfer instances.

Setup the Transfer module for transmission.

DTC is not supported in S1 series - so no need of activation source

Clear the DMA transfer end callback flag.

Open Transfer module for transmission.

Setup the Transfer module for reception.

Note address mode in rx is reverst of tx: Destination (which is ram) is incremented and source (which is FIFO_1 buffer)

DTC is not supported in S1 series - so no need of activation source

Clear the DMA transfer end callback flag.

Open Transfer module for reception.

Return successful completion.

◆ ux_dcd_synergy_interrupt_handler()

VOID ux_dcd_synergy_interrupt_handler ( VOID  )

This function is the interrupt handler for the synergy controller.

The controller will trigger an interrupt when something happens on an endpoint whose mask has been set in the interrupt enable register.

Get the pointer to the DCD.

Get the pointer to the synergy DCD.

Get the pointer to the device.

Read the interrupt status register from the controller.

Check if we have an RESUME.

Check the source of the interrupt. Is it VBUS transition?

Check the source of the interrupt. Is it Device State transition (DVST) ?

We enter this state when there is a Bus Reset.

If the device is marked as configured, the device is reset.

Decide what speed is used by the host, read DVSTCTR and isolate speed.

Check if we have a BEMP interrupt.

Check if we have a BRDY interrupt.

Check if we have a NRDY interrupt.

Check if we have a SETUP transaction phase.

◆ ux_dcd_synergy_register_clear()

VOID ux_dcd_synergy_register_clear ( UX_DCD_SYNERGY dcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function clears a bit in a register of the synergy.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to clear
[in,out]value: Value to clear

◆ ux_dcd_synergy_register_read()

ULONG ux_dcd_synergy_register_read ( UX_DCD_SYNERGY dcd_synergy,
ULONG  synergy_register 
)

This function reads a synergy USB register.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to read
Return values
dcd_regValue read from USB register.

◆ ux_dcd_synergy_register_set()

VOID ux_dcd_synergy_register_set ( UX_DCD_SYNERGY dcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function set a bit in synergy USB register.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to set
[in,out]value: Value to set

◆ ux_dcd_synergy_register_write()

VOID ux_dcd_synergy_register_write ( UX_DCD_SYNERGY dcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function writes a bit in synergy USB register.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to write
[in,out]value: Value to write

◆ ux_dcd_synergy_remote_wakeup()

UINT ux_dcd_synergy_remote_wakeup ( UX_DCD_SYNERGY dcd_synergy,
ULONG *  parameter 
)

This function is called when the device wants to wake up the host.

Parameters
[in]dcd_synergyPointer to a DCD control block
[in]parameterPointer to a remote wakeup parameter.
Return values
UX_SUCCESSRemote wakeup signaled to the USB HOST successfully.
UX_ERRORRemote wakeup signal failed from DEVICE to the USB HOST.

◆ ux_dcd_synergy_transfer_abort()

UINT ux_dcd_synergy_transfer_abort ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_TRANSFER *  transfer_request 
)

This function will terminate the transfer.

Parameters
[in]dcd_synergy: Pointer to a DCD control block
[in]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSTransfer Abort is initiated successfully.

Set the ACLRM bit to 1 and then to 0 for clearing FIFO buffers.

Clear the FIFO buffer memory.

◆ ux_dcd_synergy_transfer_callback()

UINT ux_dcd_synergy_transfer_callback ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_TRANSFER *  transfer_request,
ULONG  interrupt_status,
ULONG  ctsq_mask 
)

This function is invoked under ISR when an event happens on a specific endpoint.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]transfer_request: Pointer to USBX Device Transfer Request structure
[in,out]interrupt_status: Check if we have SETUP condition or BRDY or BEMP interrupt.
[in,out]ctsq_mask: Mask to isolate the CTSQ field.
Return values
UX_SUCCESSFunction is invoked under ISR successfully.

◆ ux_dcd_synergy_transfer_request()

UINT ux_dcd_synergy_transfer_request ( UX_DCD_SYNERGY dcd_synergy,
UX_SLAVE_TRANSFER *  transfer_request 
)

This function will initiate a transfer to a specific endpoint. If the endpoint is IN, the endpoint register will be set to accept the request. If the endpoint is IN, the endpoint FIFO will be filled with the buffer and the endpoint register set.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSTransfer to a specific endpoint is initiated successfully.
ux_slave_transfer_request_completion_codePointer to structure UX_SLAVE_TRANSFER(transfer request completion code).
UX_TRANSFER_ERRORTransfer is completed with error.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

Set the ACLRM bit to 1 and then to 0 for clearing FIFO buffers.

Clear the D1 FIFO buffer memory.

Clear the CFIFO buffer memory.

Clean the pending semaphore due to timeout on this transfer request.

Check the completion code, and if it is not successful abort this transfer and return the error to the caller

Check the completion code, and if it is not successful abort this transfer and return the error to the caller

◆ ux_dcd_synergy_uninitialize()

UINT ux_dcd_synergy_uninitialize ( ULONG  dcd_io)

USBX DCD un-initialization the USB controller.

Parameters
[in]dcd_ioAddress of the USB controller.
Return values
UX_SUCCESSCompleted the USB controller Un-initialization successfully.
UX_DCD_SYNERGY_UNINIT_FAILEDFailed to Un-initialize the USB controller.

Disable interrupt requests

uninitialize and disable DMA support

Stop the clock to the USB module. The SCKE clearing is required for USBFS controller but not for USBHS

Reset USB Module.

Clear the Pending IRQ in NVIC

Disable the IRQ in NVIC

Stop the module usage

Free up resource.

◆ ux_dcd_synergy_uninitialize_transfer_support()

UINT ux_dcd_synergy_uninitialize_transfer_support ( ULONG  dcd_io)

The function un-initializes the USB slave controller of the Renesas Synergy MCUs with associated DMA transfer modules.

Parameters
[in]dcd_ioAddress of the USB controller.
Return values
UX_SUCCESSCompleted the USB controller Un-initialization successfully.
UX_DCD_SYNERGY_UNINIT_FAILEDFailed to Un-initialize the USB controller.

◆ ux_dcd_synergy_usb_status_register_clear()

VOID ux_dcd_synergy_usb_status_register_clear ( UX_DCD_SYNERGY dcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function clears a bit in a status register of the synergy.To clear the status bits, need to write 0 only to the bits to be cleared. Write 1 to the other bits.

Parameters
[in,out]dcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to clear
[in,out]value: Value to clear

◆ ux_dcd_synergy_write_dma_configure()

VOID ux_dcd_synergy_write_dma_configure ( UX_DCD_SYNERGY dcd_synergy,
UX_DCD_SYNERGY_PAYLOAD_TRANSFER p_payload,
ULONG  fifo_sel,
ULONG  endpoint_size 
)

USBX DCD DMA write setup function. Call a subroutine for selected USB controller hardware.

Parameters
[in]dcd_synergyPointer to the DCD control block
[in,out]p_payloadPointer to a payload transfer structure
[in]fifo_selFIFO select register
[in]endpoint_sizeEndpoint size

◆ ux_hcd_synergy_asynch_queue_process()

VOID ux_hcd_synergy_asynch_queue_process ( UX_HCD_SYNERGY hcd_synergy)

This function process the asynchronous transactions. The function will identify the USB interrupts occurred associated with an endpoint and will process the interrupts.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_asynch_queue_process_bemp()

VOID ux_hcd_synergy_asynch_queue_process_bemp ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the BEMP(Buffer Empty) interrupt that occurred on a specific ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_asynch_queue_process_brdy()

VOID ux_hcd_synergy_asynch_queue_process_brdy ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the BRDY(Buffer Ready)interrupt that occurred on a specific ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_asynch_queue_process_nrdy()

VOID ux_hcd_synergy_asynch_queue_process_nrdy ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the NRDY(Not Ready) Interrupt that occurred on a specific ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
  • UX_TRANSFER::ux_transfer_request_completion_function

◆ ux_hcd_synergy_asynch_queue_process_sign()

VOID ux_hcd_synergy_asynch_queue_process_sign ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the Setup transaction Error Interrupt.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_asynch_schedule()

VOID ux_hcd_synergy_asynch_schedule ( UX_HCD_SYNERGY hcd_synergy)

This function schedules new transfers from the control or bulk lists.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_asynchronous_endpoint_create()

UINT ux_hcd_synergy_asynchronous_endpoint_create ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will create an asynchronous endpoint. The control and bulk endpoints fall into this category.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to endpoint
Return values
UX_NO_ED_AVAILABLEED for new endpoint not available.
UX_NO_TD_AVAILABLEDummy TD not available for terminating the ED transfer chain.
UX_SUCCESSAsynchronous endpoint created successfully.

◆ ux_hcd_synergy_asynchronous_endpoint_destroy()

UINT ux_hcd_synergy_asynchronous_endpoint_destroy ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will destroy an asynchronous endpoint. The control and bulk endpoints fall into this category.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to endpoint
Return values
UX_ENDPOINT_HANDLE_UNKNOWNPhysical endpoint has not been initialized properly.
UX_SUCCESSAsynchronous endpoint destroyed successfully.

◆ ux_hcd_synergy_buffer_empty_interrupt()

VOID ux_hcd_synergy_buffer_empty_interrupt ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed,
ULONG  flag 
)

This function enable or disable the BEMP(Buffer Empty) interrupt for the pipe.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to physical Endpoint(ED) control block
[in]flag: Check whether DCD synergy is enable or disable.

Reset the BEMPE, NRDYE, BRDYE bits.

◆ ux_hcd_synergy_buffer_notready_interrupt()

VOID ux_hcd_synergy_buffer_notready_interrupt ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed,
ULONG  flag 
)

This function enable or disable the NRDY(Not Ready) interrupt for the pipe.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to physical Endpoint(ED) control block
[in]flag: Check whether DCD synergy is enable or disable.

◆ ux_hcd_synergy_buffer_read()

UINT ux_hcd_synergy_buffer_read ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function reads from a specified pipe into a buffer.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to a physical Endpoint(ED) control block
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_hcd_synergy_buffer_ready_interrupt()

VOID ux_hcd_synergy_buffer_ready_interrupt ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed,
ULONG  flag 
)

This function enable or disable the BRDY(Ready) interrupt for the pipe.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to physical Endpoint(ED) control block
[in]flag: Check whether DCD synergy is enable or disable.

◆ ux_hcd_synergy_buffer_write()

UINT ux_hcd_synergy_buffer_write ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function writes data to the selected FIFO of the endpoint.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to a physical Endpoint(ED) control block
Return values
UX_SUCCESSBuffer written to the specified PIPE successfully.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_hcd_synergy_bulk_endpoint_create()

UINT ux_hcd_synergy_bulk_endpoint_create ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will create a bulk endpoint.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to a USBX Endpoint Container structure
Return values
UX_ERRORPIPE is not available for bulk endpoint creation .
UX_SUCCESSBulk endpoints created successfully.
UX_NO_ED_AVAILABLEED for bulk endpoint is not available.
UX_NO_TD_AVAILABLEDummy TD for terminating the ED transfer chain is not available.

Limit the max packet size to the size the HW supports.

◆ ux_hcd_synergy_bulk_int_td_add()

UINT ux_hcd_synergy_bulk_int_td_add ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function adds a transfer descriptor to an Bulk or INT ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to a Synergy ED structure
Return values
UX_SUCCESSTransfer descriptor added successfully.

Clear the BRDY and BEMP status for this pipe.

◆ ux_hcd_synergy_control_endpoint_create()

UINT ux_hcd_synergy_control_endpoint_create ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will create a control endpoint.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to an Endpoint control block
Return values
UX_SUCCESSControl endpoint created successfully.
UX_NO_ED_AVAILABLEFailed to obtain an ED for control endpoint.
UX_NO_TD_AVAILABLEFailed to obtain a TD for control endpoint.

◆ ux_hcd_synergy_control_td_add()

UINT ux_hcd_synergy_control_td_add ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function adds a transfer descriptor to an ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to Synergy ED structure
Return values
UX_SUCCESSTransfer descriptor added to an ED successfully.

Get transmit descriptors.

Set TD into response pending state.

Check data, status for setup phase.

We are processing a SETUP phase. Set the device address register if different.

And store it. Note that the device address is not an index.

DEVADDm.USBSPD[1:0] is set by the Software after the speed of the device is obtained and reset after connecting/disconnecting the device every time. To set the TRNENSEL bit, when LS device is connected to FS Hub, we are indirectly examining the speed of the device by examining DEVADDm.USBSPD[1:0].

Check if the speed of the connected HUB is FS

Clear the address field first.

Store the new address but leave the MPS field intact.

Set the buffer address to be accessed.

Copy the payload of the control transfer into each register : Request.

Copy the payload of the control transfer into each register : Value.

Copy the payload of the control transfer into each register : Index.

Copy the payload of the control transfer into each register : Length.

Start transmission.

We are processing data/status stage of control transfer. Check direction now.

This is an IN. Reset the PID mask register.

Set PIPE0 FIFO in in status.

Set DATA0-DATA1 toggle.

We are doing a read. Reset the Direction bit in the DCPCFG register.

Clear the FIFO buffer memory.

Enable the Buffer empty interrupt.

Enable the Ready interrupt.

Start transmission - set PID to NAK then set PID to BUF.

Must be an OUT now.

Clear the FIFO buffer memory.

Set PID to NAK.

Set DATA0-DATA1 toggle.

Write the buffer to the pipe.

Check status.

Return successful completion.

◆ ux_hcd_synergy_controller_disable()

UINT ux_hcd_synergy_controller_disable ( UX_HCD_SYNERGY hcd_synergy)

This function will disable the Synergy controller. The controller will release all its resources (memory, IO ...). After this, the controller will not send SOF any longer. All transactions should have been completed, all classes should have been closed.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
UX_SUCCESSSynergy controller disabled successfully.

◆ ux_hcd_synergy_current_endpoint_change()

VOID ux_hcd_synergy_current_endpoint_change ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed,
ULONG  direction 
)

This function change the endpoint in the FIFO.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure
[in]direction: Direction to transfer

◆ ux_hcd_synergy_data_buffer_size()

ULONG ux_hcd_synergy_data_buffer_size ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function returns the size of the buffer data.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure
Return values
buffer_sizebuffer size

◆ ux_hcd_synergy_disable()

UINT ux_hcd_synergy_disable ( ULONG  ux_hcd_io)

This function disables the Synergy HOST controller.

Parameters
[in]ux_hcd_io: HCD controller base address
Return values
UX_SUCCESSHCD controller disabled successfully.
UX_SYNERGY_UNINIT_FAILEDHCD controller un-initialization failed.

◆ ux_hcd_synergy_ed_obtain()

UX_SYNERGY_ED* ux_hcd_synergy_ed_obtain ( UX_HCD_SYNERGY hcd_synergy)

This function obtains a free ED from the ED list.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
UX_NULLNo available ED in the ED list.
Returns
ed Endpoint descriptor pointer address.

◆ ux_hcd_synergy_ed_td_clean()

VOID ux_hcd_synergy_ed_td_clean ( UX_SYNERGY_ED ed)

This function process cleans the ED of all tds except the last dummy TD.

Parameters
[in,out]ed: Pointer to Synergy ED structure

◆ ux_hcd_synergy_endpoint_nak_set()

VOID ux_hcd_synergy_endpoint_nak_set ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function sets a NAK(Not Acknowledged) to an endpoint.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure

◆ ux_hcd_synergy_endpoint_reset()

UINT ux_hcd_synergy_endpoint_reset ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will reset an endpoint.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to an Endpoint control block
Return values
UX_SUCCESSEndpoint reset successfully.

◆ ux_hcd_synergy_entry()

UINT ux_hcd_synergy_entry ( UX_HCD *  hcd,
UINT  function,
VOID *  parameter 
)

This function is the entry function to the USB driver from the USB stack.

Parameters
[in]hcd: Pointer to USBX Host Controller structure.
[in]function: Function for driver to perform
[in]parameter: Pointer to function parameter(s)
Return values
UX_SUCCESSHCD function is dispatched successfully.
UX_CONTROLLER_UNKNOWNSynergy controller is not known.
UX_FUNCTION_NOT_SUPPORTEDFunction not supported.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_hcd_synergy_fifo_port_change()

ULONG ux_hcd_synergy_fifo_port_change ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed,
ULONG  direction 
)

This function change the port of the FIFO.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure
[in]direction: Direction to transfer
Return values
synergy_registerContent of FIFO control register.
UX_ERRORPort not changed successfully or unable to access FIFO.

◆ ux_hcd_synergy_fifo_read()

UINT ux_hcd_synergy_fifo_read ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function read data from the FIFO configured for the PIPE(FIFO C, D0 or D1).

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure
Return values
UX_ERRORUnable to access FIFO successfully.
UX_SYNERGY_HC_FIFO_READ_OVERStatus set to read overflow.
UX_SYNERGY_HC_FIFO_READ_SHORTShort packet to read.
UX_SYNERGY_HC_FIFO_READINGContinue reading buffer.

◆ ux_hcd_synergy_fifo_write_software_copy()

VOID ux_hcd_synergy_fifo_write_software_copy ( UX_HCD_SYNERGY hcd_synergy,
ULONG  payload_length,
UCHAR *  payload_buffer,
VOID *  fifo_addr,
ULONG  fifo_sel 
)

USBX HCD CPU FIFO write by software copy. Call a suitable subroutine for selected USB controller hardware.

Parameters
[in]hcd_synergyPointer to the HCD control block
[in]payload_lengthPayload length
[in]payload_bufferPayload buffer address
[in]fifo_addrFIFO register address
[in]fifo_selFIFO select register

◆ ux_hcd_synergy_fifo_write_software_copy_remaining_bytes()

VOID ux_hcd_synergy_fifo_write_software_copy_remaining_bytes ( UX_HCD_SYNERGY hcd_synergy,
ULONG  payload_length,
UCHAR *  payload_buffer,
VOID *  fifo_addr 
)

USBX HCD CPU FIFO write - Copy remaining bytes to FIFO by software if the rest bytes are less than FIFO access width.

Parameters
[in]hcd_synergyPointer to the HCD control block
[in,out]payload_lengthPayload length
[in,out]payload_bufferPayload buffer address
[in,out]fifo_addrFIFO register address

◆ ux_hcd_synergy_fifoc_write()

UINT ux_hcd_synergy_fifoc_write ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function writes a buffer to FIFOC.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to Synergy ED structure
Return values
UX_ERRORUnable to access FIFO successfully.
UX_SYNERGY_HC_FIFO_WRITE_ENDWriting at ends.
UX_SYNERGY_HC_FIFO_WRITE_SHORTWriting short data.
UX_SYNERGY_HC_FIFO_WRITINGDoing multiple writes.

◆ ux_hcd_synergy_fifod_write()

UINT ux_hcd_synergy_fifod_write ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function writes a buffer data to FIFOD0 or FIFOD1.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to Synergy ED structure
Return values
UX_ERRORUnable to access FIFO successfully.
UX_SYNERGY_HC_FIFO_WRITE_ENDWriting at ends.
UX_SYNERGY_HC_FIFO_WRITE_SHORTWriting short data.
UX_SYNERGY_HC_FIFO_WRITINGDoing multiple writes.

◆ ux_hcd_synergy_frame_number_get()

UINT ux_hcd_synergy_frame_number_get ( UX_HCD_SYNERGY hcd_synergy,
ULONG *  frame_number 
)

This function will return the frame number currently used by the controller. This function is mostly used for isochronous purposes and for timing.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]frame_number: Frame number to set
Return values
UX_SUCCESSFrame number returned successfully.

◆ ux_hcd_synergy_frame_number_set()

VOID ux_hcd_synergy_frame_number_set ( UX_HCD_SYNERGY hcd_synergy,
ULONG  frame_number 
)

This function will set the current frame number to the one specified. This function is mostly used for isochronous purpos.es.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]frame_number: Frame number to set

◆ ux_hcd_synergy_initialize()

UINT ux_hcd_synergy_initialize ( UX_HCD *  hcd)

This function initializes the Synergy controller.

Parameters
[in,out]hcd: Pointer to USBX host controller structure.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:
  • ux_hcd_synergy_initialize_common()

◆ ux_hcd_synergy_initialize_transfer_support()

UINT ux_hcd_synergy_initialize_transfer_support ( UX_HCD *  hcd,
const UX_HCD_SYNERGY_TRANSFER p_transfer_instance 
)

USBX HCD Transfer Support with DMA support.

Parameters
[in,out]hcdPointer to the USBX HCD control block.
[in]p_transfer_instancePointer to Transfer module instances.
Return values
UX_SUCCESSInitialize hcd transfer support successfully.
UX_CONTROLLER_INIT_FAILEDFailed in Transfer module setup, or Unsupported USB controller was specified.
UX_SEMAPHORE_ERRORFailed in creating a semaphore used for DMA transfer.
UX_MEMORY_INSUFFICIENTFailed in allocation memory.

◆ ux_hcd_synergy_interrupt_endpoint_create()

UINT ux_hcd_synergy_interrupt_endpoint_create ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will create an interrupt endpoint. The interrupt endpoint has an interval of operation from 1 to 255. The Synergy has no hardware scheduler but we still build an interrupt tree similar to the OHCI controller.

This routine will match the best interval for the Synergy hardware. It will also determine the best node to hook the endpoint based on the load that already exists on the horizontal ED chain.

The tricky part is to understand how the interrupt matrix is constructed. We have used eds with the skip bit on to build a frame of anchor eds. Each ED creates a node for an appropriate combination of interval frequency in the list.

After obtaining a pointer to the list with the lowest traffic, we traverse the list from the highest interval until we reach the interval required. At that node, we anchor our real ED to the node and link the ED that was attached to the node to our ED.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to an Endpoint control block
Return values
UX_SUCCESSInterrupt endpoint created successfully.
UX_ERRORAvailable pipe is not found for interrupt endpoint.
UX_NO_ED_AVAILABLEFailed to obtain an ED for new endpoint.
UX_NO_TD_AVAILABLEFailed to obtain a TD for terminating the ED transfer chain.

◆ ux_hcd_synergy_interrupt_handler()

VOID ux_hcd_synergy_interrupt_handler ( UINT  hcd_index)

This function is the interrupt handler for the Synergy USB HS controller. Normally an interrupt occurs from the controller when there is either a EOF signal and there has been transfers within the frame or when there is a change on one of the downstream ports.

All we need to do in the ISR is scan the controllers to find out which one has issued a IRQ. If there is work to do for this controller we need to wake up the corresponding thread to take care of the job.

Parameters
[in]hcd_index: HCD number

Check if the controller is operational, if not, skip it.

Examine the source of interrupts. Check for SOF signal.

Check for Over Current condition.

Check if we have a BEMP interrupt.

Do we have a BRDY interrupt ?

Do we have a NRDY interrupt ?

Check for attach signal.

Is it a detach signal ?

Check for BCHG signal.

Is it a EOFERR signal.

Did we get a SACK interrupt ?

Did we get a SIGN interrupt ?

◆ ux_hcd_synergy_iso_queue_process()

VOID ux_hcd_synergy_iso_queue_process ( UX_HCD_SYNERGY hcd_synergy)

This function process the isochronous transactions that happened in the last frame.

Parameters
[in]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_iso_queue_process_bemp()

VOID ux_hcd_synergy_iso_queue_process_bemp ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the BEMP(Buffer Empty) Interrupt that occurred on a specific ED used for Isochronous transfer.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_iso_queue_process_brdy()

VOID ux_hcd_synergy_iso_queue_process_brdy ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the BRDY(Buffer Ready)interrupt that occurred on a specific ED used for isochronous transfer.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_iso_queue_process_nrdy()

VOID ux_hcd_synergy_iso_queue_process_nrdy ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function process the NRDY(Not Ready) Interrupt that occurred on a specific ED used for Isochronous transfer.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block

◆ ux_hcd_synergy_iso_schedule()

VOID ux_hcd_synergy_iso_schedule ( UX_HCD_SYNERGY hcd_synergy)

This function schedules new transfers from isochronous list.

Parameters
[in]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_iso_td_add()

UINT ux_hcd_synergy_iso_td_add ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function adds a transfer descriptor to an Isochronous Endpoint Descriptor.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]ed: Pointer to an Endpoint control block
Return values
UX_SUCCESSA transfer descriptor was added to an Isochronous Endpoint Descriptor successfully.
OthersSee Common Error Codes for other possible return codes or causes. This function calls : ux_hcd_synergy_buffer_write()

◆ ux_hcd_synergy_isochronous_endpoint_create()

UINT ux_hcd_synergy_isochronous_endpoint_create ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function creates an isochronous endpoint.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to an Endpoint control block
Return values
UX_SUCCESSIsochronous endpoint is created successfully.
UX_NO_ED_AVAILABLEFailed to obtain an ED terminating the ED transfer chain.
UX_NO_TD_AVAILABLEFailed to obtain a TD for new endpoint.

◆ ux_hcd_synergy_isochronous_td_obtain()

UX_SYNERGY_ISO_TD* ux_hcd_synergy_isochronous_td_obtain ( UX_HCD_SYNERGY hcd_synergy)

This function obtains a free TD from the isochronous TD list.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
tdPointer to Synergy ISO Trasfer Descriptor.
UX_NULLTD not available in the TD list.

◆ ux_hcd_synergy_least_traffic_list_get()

UX_SYNERGY_ED* ux_hcd_synergy_least_traffic_list_get ( UX_HCD_SYNERGY hcd_synergy)

This function return a pointer to the first ED in the periodic tree that has the least traffic registered.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
min_bandwidth_edEnd descriptor interrupt Number(ed)

◆ ux_hcd_synergy_periodic_endpoint_destroy()

UINT ux_hcd_synergy_periodic_endpoint_destroy ( UX_HCD_SYNERGY hcd_synergy,
UX_ENDPOINT *  endpoint 
)

This function will destroy an isochronous endpoint.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]endpoint: Pointer to an Endpoint control block
Return values
UX_SUCCESSIsochronous endpoint is destroyed successfully.
UX_ENDPOINT_HANDLE_UNKNOWNPhysical endpoint has not been initialized properly.

◆ ux_hcd_synergy_periodic_schedule()

VOID ux_hcd_synergy_periodic_schedule ( UX_HCD_SYNERGY hcd_synergy)

This function schedules new transfers from the periodic interrupt list.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_periodic_tree_create()

UINT ux_hcd_synergy_periodic_tree_create ( UX_HCD_SYNERGY hcd_synergy)

This function creates the periodic static tree for the interrupt and isochronous eds.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
UX_SUCCESSPeriodic tree created successfully.
UX_NO_ED_AVAILABLEFailed to obtain an ED.

◆ ux_hcd_synergy_port_disable()

UINT ux_hcd_synergy_port_disable ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will disable a specific port attached to the root HUB.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_SUCCESSPort disabled successfully.
UX_PORT_INDEX_UNKNOWNInvalid port .

◆ ux_hcd_synergy_port_enable()

UINT ux_hcd_synergy_port_enable ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will enable a specific port attached to the root HUB.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_SUCCESSPort enabled successfully.
UX_PORT_INDEX_UNKNOWNInvalid port.
UX_NO_DEVICE_CONNECTEDDevice not connected properly.

◆ ux_hcd_synergy_port_reset()

UINT ux_hcd_synergy_port_reset ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will reset a specific port attached to the root HUB.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_SUCCESSPort reset successfully.
UX_PORT_INDEX_UNKNOWNInvalid port.
UX_NO_DEVICE_CONNECTEDDevice not connected properly.

◆ ux_hcd_synergy_port_resume()

UINT ux_hcd_synergy_port_resume ( UX_HCD_SYNERGY hcd_synergy,
UINT  port_index 
)

This function will resume a specific port attached to the root HUB. Present, this function is not supported for resume port.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_FUNCTION_NOT_SUPPORTEDUnsupported function.

◆ ux_hcd_synergy_port_status_get()

ULONG ux_hcd_synergy_port_status_get ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will return the status for each port attached to the root HUB.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_PORT_INDEX_UNKNOWNInvalid port.
port_statusSynergy Port status

Check to see if this port is valid on this controller.

The port is valid, build the status mask for this port. This function returns a controller agnostic bit field.

Provides a delay of 100 ms to stabilize while initial power up

Find the number of enumeration events occurred on another HOST.

Wait for the semaphore to be put by the root hub or a regular hub.

◆ ux_hcd_synergy_port_suspend()

UINT ux_hcd_synergy_port_suspend ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will suspend a specific port attached to the root HUB. Present, this function is does not supported.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_FUNCTION_NOT_SUPPORTEDUnsupported function.

◆ ux_hcd_synergy_power_down_port()

UINT ux_hcd_synergy_power_down_port ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will power down a specific port attached to the root HUB. Present, this function is does not supported.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_FUNCTION_NOT_SUPPORTEDUnsupported function.

◆ ux_hcd_synergy_power_on_port()

UINT ux_hcd_synergy_power_on_port ( UX_HCD_SYNERGY hcd_synergy,
ULONG  port_index 
)

This function will power a specific port attached to the root HUB. Present, this function is does not supported.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]port_index: Port Index
Return values
UX_FUNCTION_NOT_SUPPORTEDUnsupported function.

◆ ux_hcd_synergy_power_root_hubs()

VOID ux_hcd_synergy_power_root_hubs ( UX_HCD_SYNERGY hcd_synergy)

This function will power the root HUB. Present, this function is does not supported.

Parameters
[in]hcd_synergy: Pointer to a HCD control block

◆ ux_hcd_synergy_register_clear()

VOID ux_hcd_synergy_register_clear ( UX_HCD_SYNERGY hcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function clears flags in a synergy USB register.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]synergy_register: Register to write
[in]value: Value to clear

◆ ux_hcd_synergy_register_read()

ULONG ux_hcd_synergy_register_read ( UX_HCD_SYNERGY hcd_synergy,
ULONG  synergy_register 
)

This function reads a data from synergy USB register.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]synergy_register: Register to read
Return values
hcd_regValue read from the specified register(ULONG value).

◆ ux_hcd_synergy_register_set()

VOID ux_hcd_synergy_register_set ( UX_HCD_SYNERGY hcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function sets flags in a synergy USB register.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]synergy_register: Register to read
[in]value: Value to be set

◆ ux_hcd_synergy_register_status_clear()

VOID ux_hcd_synergy_register_status_clear ( UX_HCD_SYNERGY hcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function clears a bit in a status register of the synergy controller.To clear the status bits, need to write 0 only to the bits to be cleared. Write 1 to the other bits.

Parameters
[in,out]hcd_synergy: Pointer to a DCD control block
[in,out]synergy_register: Register to clear
[in,out]value: Value to clear

◆ ux_hcd_synergy_register_write()

VOID ux_hcd_synergy_register_write ( UX_HCD_SYNERGY hcd_synergy,
ULONG  synergy_register,
USHORT  value 
)

This function writes a data to a Synergy USB register.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in]synergy_register: Register to write
[in]value: Value to write

◆ ux_hcd_synergy_regular_td_obtain()

UX_SYNERGY_TD* ux_hcd_synergy_regular_td_obtain ( UX_HCD_SYNERGY hcd_synergy)

This function obtains a free TD from the regular TD list.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
Return values
tdA pointer to Synergy TD.
UX_NULLNull pointer.

◆ ux_hcd_synergy_request_bulk_transfer()

UINT ux_hcd_synergy_request_bulk_transfer ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function performs a bulk transfer request. A bulk transfer can be larger than the size of the Synergy buffer so it may be required to chain multiple tds to accommodate this transfer request. A bulk transfer is non blocking, so we return before the transfer request is completed.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSBulk transfer happened successfully.
UX_NO_TD_AVAILABLEUnavailable New TD.

Perform bulk transfer. If transfer request payload length is zero, transfer it once.

◆ ux_hcd_synergy_request_control_transfer()

UINT ux_hcd_synergy_request_control_transfer ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function performs a control transfer from a transfer request. The USB control transfer is in 3 phases (setup, data, status). This function will chain all phases of the control sequence before setting the Synergy endpoint as a candidate for transfer.

Parameters
[in,out]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_MEMORY_INSUFFICIENTInsufficient memory to build the SETUP request.
UX_NO_TD_AVAILABLEUnavailable New TD.
ux_transfer_request_completion_codePointer to USBX transfer request structure(request completion code).

◆ ux_hcd_synergy_request_interrupt_transfer()

UINT ux_hcd_synergy_request_interrupt_transfer ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function performs an interrupt transfer request. An interrupt transfer can only be as large as the MaxpacketField in the endpoint descriptor. This was verified at the USB layer and does not need to be reverified here.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSInterrupt transfer request processed successfully.
UX_NO_TD_AVAILABLEUnavailable new TD.

◆ ux_hcd_synergy_request_isochronous_transfer()

UINT ux_hcd_synergy_request_isochronous_transfer ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function performs an isochronous transfer request.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSIsochronous transfer request processed successfully.
UX_NO_TD_AVAILABLEUnavailable new TD.

◆ ux_hcd_synergy_request_transfer()

UINT ux_hcd_synergy_request_transfer ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function is the handler for all the transactions on the USB. The transfer request passed as parameter contains the endpoint and the device descriptors in addition to the type of transaction de be executed. This function routes the transfer request to according to the type of transfer to be executed.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_ERRORError while Isolating the endpoint type and routing the transfer request.
UX_NO_DEVICE_CONNECTEDNo device attached.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

◆ ux_hcd_synergy_td_add()

UINT ux_hcd_synergy_td_add ( UX_HCD_SYNERGY hcd_synergy,
UX_SYNERGY_ED ed 
)

This function add new TD for control, Bulk or Interrupt endpoint.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in]ed: Pointer to Synergy ED structure
Return values
UX_SUCCESSTransfer done successfully.

◆ ux_hcd_synergy_transfer_abort()

UINT ux_hcd_synergy_transfer_abort ( UX_HCD_SYNERGY hcd_synergy,
UX_TRANSFER *  transfer_request 
)

This function will abort transactions attached to a transfer request.

Parameters
[in]hcd_synergy: Pointer to a HCD control block
[in,out]transfer_request: Pointer to transfer request
Return values
UX_SUCCESSTransactions attached to transfer request are aborted successfully.
UX_ENDPOINT_HANDLE_UNKNOWNEndpoint is not initialized properly.

◆ ux_hcd_synergy_uninitialize()

UINT ux_hcd_synergy_uninitialize ( ULONG  ux_hcd_io)

This function un-initializes the Synergy HOST controller.

Parameters
[in]ux_hcd_io: HCD controller base address
Return values
UX_SUCCESSCompleted the USB controller Un-initialization successfully.
UX_SYNERGY_UNINIT_FAILEDHCD controller un-initialization failed.
Returns
See Common Error Codes for other possible return codes or causes. This function calls:

Reset the BEMPE, NRDYE, BRDYE, SOFE bits.

Clear the INTENB1 bits.

Reset the BRDY, NRDY, BEMPE for all pipes.

Clear USB interrupt status0 register.

Clear USB interrupt status1 register.

Clear all the physical endpoint.

Disable pull-up/pull-down of the D+/D- line.

Disable USB clock operation.

uninitialize and disable DMA support

Stop the module usage

◆ ux_hcd_synergy_uninitialize_transfer_support()

UINT ux_hcd_synergy_uninitialize_transfer_support ( UX_HCD_SYNERGY hcd_synergy)

This function un-initializes the transfer module associated with the USBX HOST controller.

Parameters
[in]hcd_synergy: HCD synergy controller instance.
Return values
UX_SUCCESSCompleted the transfer Un-initialization successfully.
UX_SYNERGY_UNINIT_FAILEDFailed to Un-initialize the USB controller.