1177 views|1 replies

82

Posts

0

Resources
The OP
 

[Infineon PSOC 62S4 PIONEER KIT Review]——USB [Copy link]

[ Infineon PSOC 62S4 PIONEER KIT Review]——USB

  • Basic Introduction

According to the manual, PSOC 62S4 PIONEER KIT has a USB full-speed device interface; the device can have up to 8 endpoints, one control endpoint, and 7 data endpoints; supports four data transfer protocols: control transfer (Control), interrupt transfer (Interrupt), bulk transfer (Bulk), isochronous transfer (Isochronous); provides a 512-byte SRAM buffer and supports DMA; complies with USB2.0 specifications; supports USB suspend, resume and delete wake-up; supports three logical transmission modes: CUP (non-DMA) mode (mode 1), manual DMA mode (mode 2), automatic DMA mode (mode 3); supports maximum data packet size: 512 bytes (using mode 1 and mode 2), 1023 bytes (using synchronous transmission of mode 3).

  • Main API Introduction

Hardware Abstraction Layer (HAL)

  1. General

1.USB initialization cyhal_usb_dev_init()

  1. USB configuration cyhal_usb_dev_set_configured()

Among them, the cyhal_usb_dev_t structure is

Among them, the cyhal_syspm_callback_data_t structure is

Among them, (1) cyhal_syspm_callback_state_t enumeration is

(2) cyhal_syspm_callback_mode_t is enumerated as

3.USB connects to the host cyhal_usb_dev_connect()

4.USB registration event callback cyhal_usb_dev_register_event_callback()

Among them, the cyhal_usb_dev_event_t enumeration is

  1. Endpoint Management

1. Endpoint addition cyhal_usb_dev_endpoint_add()

Among them, the cyhal_usb_dev_ep_type_t enumeration is

Note: ① When the enable parameter is false, it does not matter what the endpoint type is.

②This function cannot be used to configure endpoint 0 (control endpoint)

2. Register endpoint callback cyhal_usb_dev_register_endpoint_callback()

  1. Endpoint 0 (control endpoint) management
  1. Get the maximum packet size of endpoint 0 cyhal_usb_dev_ep0_get_max_packet()

  1. Read the setup package contents cyhal_usb_dev_ep0_setup_read_result()

Peripheral driver library(PDL)

  1. initialization
  1. USB initialization Cy_USBFS_Dev_Drv_Init()

Among them, the cy_stc_usbfs_dev_drv_config_t structure is

Among them, (1) cy_en_usbfs_dev_drv_ep_management_mode_t enumeration is

(2) The cy_stc_usbfs_dev_drv_dma_config_t structure is

(3) cy_en_usbfs_dev_ep_access_t is enumerated as

  1. USB enable Cy_USBFS_Dev_Drv_Enable()

  1. USB set address Cy_USBFS_Dev_Drv_SetAddress()

  1. USB sets device address Cy_USBFS_Dev_Drv_SetDeviceAddress()

  1. Interrupt
  1. USB interrupt handling Cy_USBFS_Dev_Drv_Interrupt()

Note: This function must be called in the user-defined interrupt service thread.

  1. Set the USB interrupt level Cy_USBFS_Dev_Drv_SetInterruptsLevel()

  1. Enable endpoint 0 interrupt Cy_USBFS_Dev_Drv_EnableEp0Interrupt()

  1. Endpoint 0 settings
  1. Write to endpoint 0 Cy_USBFS_Dev_Drv_Ep0Write()

  1. Terminate endpoint 0Cy_USBFS_Dev_Drv_Ep0Stall()

  1. Read endpoint 0 maximum packet size Cy_USBFS_Dev_Drv_GetEp0MaxPacket()

  1. Data endpoint
  1. Add endpoint Cy_USBFS_Dev_Drv_AddEndpoint()

Among them, the cy_stc_usb_dev_ep_config_t structure is

  1. Get endpoint status Cy_USBFS_Dev_Drv_GetEndpointState()

  1. Endpoint load data Cy_USBFS_Dev_Drv_LoadInEndpoint()

  1. Enable output endpoint Cy_USBFS_Dev_Drv_EnableOutEndpoint()

  1. Read output endpoint data Cy_USBFS_Dev_Drv_ReadOutEndpoint()

  1. Low power consumption
  1. USB enters deep sleep Cy_USBFS_Dev_Drv_Suspend()

Note: When the USB enters deep sleep, the data in its input and output buffers will be lost after being woken up.

  1. USB exits deep sleep Cy_USBFS_Dev_Drv_Resume()

This post is from RF/Wirelessly

Latest reply

When the enable parameter is false, it does not matter what the endpoint type is. It's such a hassle   Details Published on 2023-5-20 11:21
 

1662

Posts

0

Resources
2
 

When the enable parameter is false, it does not matter what the endpoint type is.

It's such a hassle

This post is from RF/Wirelessly
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list