libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Functions | Variables
interface.h File Reference

USB-as-device interface. More...

#include <libtransistor/types.h>
#include <libtransistor/ipc.h>
#include <libtransistor/ipc/usb/ds/endpoint.h>
Include dependency graph for interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usb_ds_interface_t
 

Macros

#define USB_DS_INTERFACE_NUMBER_AUTO   0x4
 

Functions

result_t usb_ds_interface_get_endpoint (usb_ds_interface_t *intf, usb_endpoint_descriptor_t *descriptor, usb_ds_endpoint_t *endpoint)
 Create a new endpoint on the given interface. More...
 
result_t usb_ds_interface_enable (usb_ds_interface_t *intf)
 Enables the given interface for use.
 
result_t usb_ds_interface_disable (usb_ds_interface_t *intf)
 Disables the given interface so it can no longer be used.
 
result_t usb_ds_close_interface (usb_ds_interface_t *intf)
 Close and destroy the given interface.
 
result_t usb_ds_ctrl_in_post_buffer_async (usb_ds_interface_t *intf, void *buffer, size_t size, uint32_t *urb_id)
 Submits a buffer for transfer over the control input endpoint.
 
result_t usb_ds_ctrl_out_post_buffer_async (usb_ds_interface_t *intf, void *buffer, size_t size, uint32_t *urb_id)
 Submits a buffer for transfer over the control output endpoint.
 
result_t usb_ds_get_ctrl_in_completion_event (usb_ds_interface_t *intf, revent_h *event)
 Gets an event that is signalled when a transaction completes on the control input endpoint.
 
result_t usb_ds_get_ctrl_in_report_data (usb_ds_interface_t *intf, usb_ds_report_t *report)
 Gets report data for the control input endpoint.
 
result_t usb_ds_get_ctrl_out_completion_event (usb_ds_interface_t *intf, revent_h *event)
 Gets an event that is signalled when a transaction completes on the control output endpoint.
 
result_t usb_ds_get_ctrl_out_report_data (usb_ds_interface_t *intf, usb_ds_report_t *report)
 Gets report data for the control output endpoint.
 
result_t usb_ds_stall_ctrl (usb_ds_interface_t *intf)
 Stalls control endpoints.
 

Variables

usb_interface_descriptor_t usb_default_interface_descriptor
 

Detailed Description

USB-as-device interface.

Function Documentation

result_t usb_ds_interface_get_endpoint ( usb_ds_interface_t intf,
usb_endpoint_descriptor_t *  descriptor,
usb_ds_endpoint_t endpoint 
)

Create a new endpoint on the given interface.

Parameters
intfInterface to create endpoint on
descriptorEndpoint descriptor
endpointOutput for newly created endpoint