RetroArch
Classes | Typedefs | Functions | Variables
device_ds4.c File Reference
#include "hid_device_driver.h"
Include dependency graph for device_ds4.c:

Classes

struct  ds4_instance
 

Typedefs

typedef struct ds4_instance ds4_instance_t
 

Functions

static voidds4_init (void *handle)
 
static void ds4_free (void *data)
 
static void ds4_handle_packet (void *data, uint8_t *buffer, size_t size)
 
static bool ds4_detect (uint16_t vendor_id, uint16_t product_id)
 
static voidds4_pad_init (void *data, uint32_t slot, hid_driver_t *driver)
 
static void ds4_pad_deinit (void *data)
 
static void ds4_get_buttons (void *data, input_bits_t *state)
 
static void ds4_packet_handler (void *data, uint8_t *packet, uint16_t size)
 
static void ds4_set_rumble (void *data, enum retro_rumble_effect effect, uint16_t strength)
 
static int16_t ds4_get_axis (void *data, unsigned axis)
 
static const char * ds4_get_name (void *data)
 
static bool ds4_button (void *data, uint16_t joykey)
 

Variables

pad_connection_interface_t ds4_pad_connection
 
hid_device_t ds4_hid_device
 

Typedef Documentation

◆ ds4_instance_t

typedef struct ds4_instance ds4_instance_t

Function Documentation

◆ ds4_button()

static bool ds4_button ( void data,
uint16_t  joykey 
)
static

◆ ds4_detect()

static bool ds4_detect ( uint16_t  vendor_id,
uint16_t  product_id 
)
static

◆ ds4_free()

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

◆ ds4_get_axis()

static int16_t ds4_get_axis ( void data,
unsigned  axis 
)
static

◆ ds4_get_buttons()

static void ds4_get_buttons ( void data,
input_bits_t state 
)
static

◆ ds4_get_name()

static const char* ds4_get_name ( void data)
static

◆ ds4_handle_packet()

static void ds4_handle_packet ( void data,
uint8_t buffer,
size_t  size 
)
static

◆ ds4_init()

static void* ds4_init ( void handle)
static

I'm leaving this code in here for posterity, and because maybe it can be used on other platforms. But using the DS4 on the Wii U directly is impossible because it doesn't generate a HID event. Which makes me think it's not a HID device at all–at least, not over USB.

I imagine it might be useful in Bluetooth mode, though.

Here is the call graph for this function:

◆ ds4_packet_handler()

static void ds4_packet_handler ( void data,
uint8_t packet,
uint16_t  size 
)
static
Here is the call graph for this function:

◆ ds4_pad_deinit()

static void ds4_pad_deinit ( void data)
static

◆ ds4_pad_init()

static void* ds4_pad_init ( void data,
uint32_t  slot,
hid_driver_t driver 
)
static

◆ ds4_set_rumble()

static void ds4_set_rumble ( void data,
enum retro_rumble_effect  effect,
uint16_t  strength 
)
static

Variable Documentation

◆ ds4_hid_device

hid_device_t ds4_hid_device
Initial value:
= {
"Sony DualShock 4"
}
static void ds4_handle_packet(void *data, uint8_t *buffer, size_t size)
Definition: device_ds4.c:72
static void ds4_free(void *data)
Definition: device_ds4.c:62
static void * ds4_init(void *handle)
Definition: device_ds4.c:38
static bool ds4_detect(uint16_t vendor_id, uint16_t product_id)
Definition: device_ds4.c:80

◆ ds4_pad_connection

pad_connection_interface_t ds4_pad_connection
Initial value:
= {
}
static bool ds4_button(void *data, uint16_t joykey)
Definition: device_ds4.c:140
static void * ds4_pad_init(void *data, uint32_t slot, hid_driver_t *driver)
Definition: device_ds4.c:93
static void ds4_packet_handler(void *data, uint8_t *packet, uint16_t size)
Definition: device_ds4.c:117
static const char * ds4_get_name(void *data)
Definition: device_ds4.c:135
static void ds4_pad_deinit(void *data)
Definition: device_ds4.c:104
static void ds4_get_buttons(void *data, input_bits_t *state)
Definition: device_ds4.c:108
static int16_t ds4_get_axis(void *data, unsigned axis)
Definition: device_ds4.c:130
static void ds4_set_rumble(void *data, enum retro_rumble_effect effect, uint16_t strength)
Definition: device_ds4.c:126