VSF Documented
Data Structures | Macros | Typedefs | Enumerations | Functions
usb_host.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "esp_err.h"
#include "FreeRTOS.h"
#include "task.h"
#include "utilities/compiler/compiler.h"
#include "component/usb/common/usb_common.h"

Go to the source code of this file.

Data Structures

struct  VSF_CAL_PACKED
 
struct  usb_host_config_t
 
struct  usb_host_client_event_msg
 
struct  usb_host_client_config_t
 
struct  usb_device_info_t
 
struct  usb_isoc_packet_desc_t
 
struct  usb_transfer_s
 
struct  usb_host_lib_info_t
 

Macros

#define __vsf_espidf_usb_str_desc_t
 
#define USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS   (1 << 0)
 
#define USB_HOST_LIB_EVENT_FLAGS_ALL_FREE   (1 << 1)
 
#define USB_TRANSFER_FLAG_ZERO_PACK   (1 << 0)
 

Typedefs

typedef void * usb_host_client_handle_t
 
typedef void * usb_device_handle_t
 
typedef struct usb_host_client_event_msg usb_host_client_event_msg_t
 
typedef void(* usb_host_client_event_cb_t) (const usb_host_client_event_msg_t *event_msg, void *arg)
 
typedef void(* usb_transfer_cb_t) (struct usb_transfer_s *transfer)
 
typedef struct usb_transfer_s usb_transfer_t
 

Enumerations

enum  usb_host_client_event_t {
  USB_HOST_CLIENT_EVENT_NEW_DEV ,
  USB_HOST_CLIENT_EVENT_DEV_GONE
}
 
enum  usb_transfer_status_t {
  USB_TRANSFER_STATUS_COMPLETED = 0 ,
  USB_TRANSFER_STATUS_ERROR = 1 ,
  USB_TRANSFER_STATUS_TIMED_OUT = 2 ,
  USB_TRANSFER_STATUS_CANCELED = 3 ,
  USB_TRANSFER_STATUS_STALL = 4 ,
  USB_TRANSFER_STATUS_OVERFLOW = 5 ,
  USB_TRANSFER_STATUS_NO_DEVICE = 6 ,
  USB_TRANSFER_STATUS_SKIPPED = 7
}
 
enum  usb_transfer_type_t {
  USB_TRANSFER_TYPE_CTRL = 0 ,
  USB_TRANSFER_TYPE_ISOCHRONOUS = 1 ,
  USB_TRANSFER_TYPE_BULK = 2 ,
  USB_TRANSFER_TYPE_INTR = 3
}
 

Functions

esp_err_t usb_host_install (const usb_host_config_t *config)
 
esp_err_t usb_host_uninstall (void)
 
esp_err_t usb_host_lib_handle_events (TickType_t timeout_ticks, uint32_t *event_flags_ret)
 
esp_err_t usb_host_lib_info (usb_host_lib_info_t *lib_info_ret)
 
esp_err_t usb_host_device_free_all (void)
 
esp_err_t usb_host_client_register (const usb_host_client_config_t *client_config, usb_host_client_handle_t *client_hdl_ret)
 
esp_err_t usb_host_client_deregister (usb_host_client_handle_t client_hdl)
 
esp_err_t usb_host_client_handle_events (usb_host_client_handle_t client_hdl, TickType_t timeout_ticks)
 
esp_err_t usb_host_client_unblock (usb_host_client_handle_t client_hdl)
 
esp_err_t usb_host_device_open (usb_host_client_handle_t client_hdl, uint8_t dev_addr, usb_device_handle_t *dev_hdl_ret)
 
esp_err_t usb_host_device_close (usb_host_client_handle_t client_hdl, usb_device_handle_t dev_hdl)
 
esp_err_t usb_host_device_info (usb_device_handle_t dev_hdl, usb_device_info_t *dev_info)
 
esp_err_t usb_host_get_device_descriptor (usb_device_handle_t dev_hdl, const usb_device_desc_t **dev_desc_ret)
 
esp_err_t usb_host_get_active_config_descriptor (usb_device_handle_t dev_hdl, const usb_config_desc_t **config_desc_ret)
 
void usb_print_device_descriptor (const usb_device_desc_t *dev_desc)
 
void usb_print_config_descriptor (const usb_config_desc_t *config_desc, const usb_interface_desc_t *ifc_desc)
 
void usb_print_string_descriptor (const usb_str_desc_t *str_desc)
 
esp_err_t usb_host_transfer_alloc (size_t data_buffer_size, int num_isoc_packets, usb_transfer_t **transfer_ret)
 
esp_err_t usb_host_transfer_free (usb_transfer_t *transfer)
 
esp_err_t usb_host_transfer_submit (usb_transfer_t *transfer)
 
esp_err_t usb_host_transfer_submit_control (usb_host_client_handle_t client_hdl, usb_device_handle_t dev_hdl, const usb_setup_packet_t *setup_packet, usb_transfer_t *transfer)
 
esp_err_t usb_host_interface_claim (usb_host_client_handle_t client_hdl, usb_device_handle_t dev_hdl, uint8_t bInterfaceNumber, uint8_t bAlternateSetting)
 
esp_err_t usb_host_interface_release (usb_host_client_handle_t client_hdl, usb_device_handle_t dev_hdl, uint8_t bInterfaceNumber)
 
esp_err_t usb_host_endpoint_halt (usb_device_handle_t dev_hdl, uint8_t bEndpointAddress)
 
esp_err_t usb_host_endpoint_flush (usb_device_handle_t dev_hdl, uint8_t bEndpointAddress)
 

Macro Definition Documentation

◆ __vsf_espidf_usb_str_desc_t

#define __vsf_espidf_usb_str_desc_t

◆ USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS

#define USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS   (1 << 0)

◆ USB_HOST_LIB_EVENT_FLAGS_ALL_FREE

#define USB_HOST_LIB_EVENT_FLAGS_ALL_FREE   (1 << 1)

◆ USB_TRANSFER_FLAG_ZERO_PACK

#define USB_TRANSFER_FLAG_ZERO_PACK   (1 << 0)

Typedef Documentation

◆ usb_host_client_handle_t

typedef void* usb_host_client_handle_t

◆ usb_device_handle_t

typedef void* usb_device_handle_t

◆ usb_host_client_event_msg_t

◆ usb_host_client_event_cb_t

typedef void(* usb_host_client_event_cb_t) (const usb_host_client_event_msg_t *event_msg, void *arg)

◆ usb_transfer_cb_t

typedef void(* usb_transfer_cb_t) (struct usb_transfer_s *transfer)

◆ usb_transfer_t

Enumeration Type Documentation

◆ usb_host_client_event_t

Enumerator
USB_HOST_CLIENT_EVENT_NEW_DEV 
USB_HOST_CLIENT_EVENT_DEV_GONE 

◆ usb_transfer_status_t

Enumerator
USB_TRANSFER_STATUS_COMPLETED 
USB_TRANSFER_STATUS_ERROR 
USB_TRANSFER_STATUS_TIMED_OUT 
USB_TRANSFER_STATUS_CANCELED 
USB_TRANSFER_STATUS_STALL 
USB_TRANSFER_STATUS_OVERFLOW 
USB_TRANSFER_STATUS_NO_DEVICE 
USB_TRANSFER_STATUS_SKIPPED 

◆ usb_transfer_type_t

Enumerator
USB_TRANSFER_TYPE_CTRL 
USB_TRANSFER_TYPE_ISOCHRONOUS 
USB_TRANSFER_TYPE_BULK 
USB_TRANSFER_TYPE_INTR 

Function Documentation

◆ usb_host_install()

esp_err_t usb_host_install ( const usb_host_config_t config)

◆ usb_host_uninstall()

esp_err_t usb_host_uninstall ( void  )

◆ usb_host_lib_handle_events()

esp_err_t usb_host_lib_handle_events ( TickType_t  timeout_ticks,
uint32_t event_flags_ret 
)

◆ usb_host_lib_info()

esp_err_t usb_host_lib_info ( usb_host_lib_info_t lib_info_ret)

◆ usb_host_device_free_all()

esp_err_t usb_host_device_free_all ( void  )

◆ usb_host_client_register()

esp_err_t usb_host_client_register ( const usb_host_client_config_t client_config,
usb_host_client_handle_t client_hdl_ret 
)

◆ usb_host_client_deregister()

esp_err_t usb_host_client_deregister ( usb_host_client_handle_t  client_hdl)

◆ usb_host_client_handle_events()

esp_err_t usb_host_client_handle_events ( usb_host_client_handle_t  client_hdl,
TickType_t  timeout_ticks 
)

◆ usb_host_client_unblock()

esp_err_t usb_host_client_unblock ( usb_host_client_handle_t  client_hdl)

◆ usb_host_device_open()

esp_err_t usb_host_device_open ( usb_host_client_handle_t  client_hdl,
uint8_t  dev_addr,
usb_device_handle_t dev_hdl_ret 
)

◆ usb_host_device_close()

esp_err_t usb_host_device_close ( usb_host_client_handle_t  client_hdl,
usb_device_handle_t  dev_hdl 
)

◆ usb_host_device_info()

esp_err_t usb_host_device_info ( usb_device_handle_t  dev_hdl,
usb_device_info_t dev_info 
)

◆ usb_host_get_device_descriptor()

esp_err_t usb_host_get_device_descriptor ( usb_device_handle_t  dev_hdl,
const usb_device_desc_t **  dev_desc_ret 
)

◆ usb_host_get_active_config_descriptor()

esp_err_t usb_host_get_active_config_descriptor ( usb_device_handle_t  dev_hdl,
const usb_config_desc_t **  config_desc_ret 
)

◆ usb_print_device_descriptor()

void usb_print_device_descriptor ( const usb_device_desc_t dev_desc)

◆ usb_print_config_descriptor()

void usb_print_config_descriptor ( const usb_config_desc_t config_desc,
const usb_interface_desc_t ifc_desc 
)

◆ usb_print_string_descriptor()

void usb_print_string_descriptor ( const usb_str_desc_t *  str_desc)

◆ usb_host_transfer_alloc()

esp_err_t usb_host_transfer_alloc ( size_t  data_buffer_size,
int  num_isoc_packets,
usb_transfer_t **  transfer_ret 
)

◆ usb_host_transfer_free()

esp_err_t usb_host_transfer_free ( usb_transfer_t transfer)

◆ usb_host_transfer_submit()

esp_err_t usb_host_transfer_submit ( usb_transfer_t transfer)

◆ usb_host_transfer_submit_control()

esp_err_t usb_host_transfer_submit_control ( usb_host_client_handle_t  client_hdl,
usb_device_handle_t  dev_hdl,
const usb_setup_packet_t *  setup_packet,
usb_transfer_t transfer 
)

◆ usb_host_interface_claim()

esp_err_t usb_host_interface_claim ( usb_host_client_handle_t  client_hdl,
usb_device_handle_t  dev_hdl,
uint8_t  bInterfaceNumber,
uint8_t  bAlternateSetting 
)

◆ usb_host_interface_release()

esp_err_t usb_host_interface_release ( usb_host_client_handle_t  client_hdl,
usb_device_handle_t  dev_hdl,
uint8_t  bInterfaceNumber 
)

◆ usb_host_endpoint_halt()

esp_err_t usb_host_endpoint_halt ( usb_device_handle_t  dev_hdl,
uint8_t  bEndpointAddress 
)

◆ usb_host_endpoint_flush()

esp_err_t usb_host_endpoint_flush ( usb_device_handle_t  dev_hdl,
uint8_t  bEndpointAddress 
)
Generated from commit: vsfteam/vsf@699cdec