RetroArch
Classes | Macros | Typedefs | Functions | Variables
libusb_hid.c File Reference
#include <stdlib.h>
#include <string.h>
#include <libusb-1.0/libusb.h>
#include <rthreads/rthreads.h>
#include <compat/strl.h>
#include <queues/fifo_queue.h>
#include <string/stdstring.h>
#include "../connect/joypad_connection.h"
#include "../input_defines.h"
#include "../../tasks/tasks_internal.h"
#include "../input_driver.h"
#include "../../verbosity.h"
Include dependency graph for libusb_hid.c:

Classes

struct  libusb_hid
 
struct  libusb_adapter
 

Macros

#define LIBUSB_CAP_HAS_HOTPLUG   0x0001
 

Typedefs

typedef struct libusb_hid libusb_hid_t
 

Functions

static void adapter_thread (void *data)
 
static void libusb_hid_device_send_control (void *data, uint8_t *data_buf, size_t size)
 
static void libusb_hid_device_add_autodetect (unsigned idx, const char *device_name, const char *driver_name, uint16_t dev_vid, uint16_t dev_pid)
 
static void libusb_get_description (struct libusb_device *device, struct libusb_adapter *adapter)
 
static int add_adapter (void *data, struct libusb_device *dev)
 
static int remove_adapter (void *data, struct libusb_device *dev)
 
static int libusb_hid_hotplug_callback (struct libusb_context *ctx, struct libusb_device *dev, libusb_hotplug_event event, void *user_data)
 
static bool libusb_hid_joypad_query (void *data, unsigned pad)
 
static const char * libusb_hid_joypad_name (void *data, unsigned pad)
 
static void libusb_hid_joypad_get_buttons (void *data, unsigned port, input_bits_t *state)
 
static bool libusb_hid_joypad_button (void *data, unsigned port, uint16_t joykey)
 
static bool libusb_hid_joypad_rumble (void *data, unsigned pad, enum retro_rumble_effect effect, uint16_t strength)
 
static int16_t libusb_hid_joypad_axis (void *data, unsigned port, uint32_t joyaxis)
 
static void libusb_hid_free (const void *data)
 
static void poll_thread (void *data)
 
static voidlibusb_hid_init (void)
 
static void libusb_hid_poll (void *data)
 

Variables

static struct libusb_adapter adapters
 
hid_driver_t libusb_hid
 

Macro Definition Documentation

◆ LIBUSB_CAP_HAS_HOTPLUG

#define LIBUSB_CAP_HAS_HOTPLUG   0x0001

Typedef Documentation

◆ libusb_hid_t

typedef struct libusb_hid libusb_hid_t

Function Documentation

◆ adapter_thread()

static void adapter_thread ( void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_adapter()

static int add_adapter ( void data,
struct libusb_device *  dev 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_get_description()

static void libusb_get_description ( struct libusb_device *  device,
struct libusb_adapter adapter 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_hid_device_add_autodetect()

static void libusb_hid_device_add_autodetect ( unsigned  idx,
const char *  device_name,
const char *  driver_name,
uint16_t  dev_vid,
uint16_t  dev_pid 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_hid_device_send_control()

static void libusb_hid_device_send_control ( void data,
uint8_t data_buf,
size_t  size 
)
static
Here is the call graph for this function:

◆ libusb_hid_free()

static void libusb_hid_free ( const void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_hid_hotplug_callback()

static int libusb_hid_hotplug_callback ( struct libusb_context *  ctx,
struct libusb_device *  dev,
libusb_hotplug_event  event,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_hid_init()

static void* libusb_hid_init ( void  )
static
Here is the call graph for this function:

◆ libusb_hid_joypad_axis()

static int16_t libusb_hid_joypad_axis ( void data,
unsigned  port,
uint32_t  joyaxis 
)
static
Here is the call graph for this function:

◆ libusb_hid_joypad_button()

static bool libusb_hid_joypad_button ( void data,
unsigned  port,
uint16_t  joykey 
)
static
Here is the call graph for this function:

◆ libusb_hid_joypad_get_buttons()

static void libusb_hid_joypad_get_buttons ( void data,
unsigned  port,
input_bits_t state 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ libusb_hid_joypad_name()

static const char* libusb_hid_joypad_name ( void data,
unsigned  pad 
)
static

◆ libusb_hid_joypad_query()

static bool libusb_hid_joypad_query ( void data,
unsigned  pad 
)
static

◆ libusb_hid_joypad_rumble()

static bool libusb_hid_joypad_rumble ( void data,
unsigned  pad,
enum retro_rumble_effect  effect,
uint16_t  strength 
)
static
Here is the call graph for this function:

◆ libusb_hid_poll()

static void libusb_hid_poll ( void data)
static
Here is the call graph for this function:

◆ poll_thread()

static void poll_thread ( void data)
static
Here is the caller graph for this function:

◆ remove_adapter()

static int remove_adapter ( void data,
struct libusb_device *  dev 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ adapters

struct libusb_adapter adapters
static

◆ libusb_hid

Initial value:
= {
"libusb",
}
static void libusb_hid_poll(void *data)
Definition: libusb_hid.c:643
static const char * libusb_hid_joypad_name(void *data, unsigned pad)
Definition: libusb_hid.c:437
static bool libusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey)
Definition: libusb_hid.c:459
static void libusb_hid_joypad_get_buttons(void *data, unsigned port, input_bits_t *state)
Definition: libusb_hid.c:446
static int16_t libusb_hid_joypad_axis(void *data, unsigned port, uint32_t joyaxis)
Definition: libusb_hid.c:484
static void libusb_hid_device_send_control(void *data, uint8_t *data_buf, size_t size)
Definition: libusb_hid.c:125
static void * libusb_hid_init(void)
Definition: libusb_hid.c:550
static void libusb_hid_free(const void *data)
Definition: libusb_hid.c:513
static bool libusb_hid_joypad_rumble(void *data, unsigned pad, enum retro_rumble_effect effect, uint16_t strength)
Definition: libusb_hid.c:475
static bool libusb_hid_joypad_query(void *data, unsigned pad)
Definition: libusb_hid.c:432