RetroArch
|
#include "hid_device_driver.h"
Classes | |
struct | null_instance |
Typedefs | |
typedef struct null_instance | null_instance_t |
Functions | |
static void * | null_init (void *handle) |
static void | null_free (void *data) |
static void | null_handle_packet (void *data, uint8_t *buffer, size_t size) |
static bool | null_detect (uint16_t vendor_id, uint16_t product_id) |
static void * | null_pad_init (void *data, uint32_t slot, hid_driver_t *driver) |
static void | null_pad_deinit (void *data) |
static void | null_get_buttons (void *data, input_bits_t *state) |
static void | null_packet_handler (void *data, uint8_t *packet, uint16_t size) |
static void | null_set_rumble (void *data, enum retro_rumble_effect effect, uint16_t strength) |
static int16_t | null_get_axis (void *data, unsigned axis) |
static const char * | null_get_name (void *data) |
static bool | null_button (void *data, uint16_t joykey) |
Variables | |
pad_connection_interface_t | null_pad_connection |
hid_device_t | null_hid_device |
typedef struct null_instance null_instance_t |
Return true if the passed in VID and PID are supported by the driver.
Read analog sticks. If the pad doesn't have any analog axis, just return 0 here.
The return value must conform to the following characteristics:
|
static |
Translate the button data from the pad into the input_bits_t format that RetroArch can use.
The name the pad will show up as in the UI, also used to auto-assign buttons in input/input_autodetect_builtin.c
Handle a single packet from the device. For most pads you'd just forward it onto the pad driver (see below). A more complicated example is in the Wii U GC adapter driver.
Use the HID_ macros (see input/include/hid_driver.h) to send data packets to the device. When this method returns, the device needs to be in a state where we can read data packets from the device. So, if there's any activation packets (see the ds3 and Wii U GameCube adapter drivers for examples), send them here.
While you can allocate the retro pad here, it isn't mandatory (see the Wii U GC adapter).
If initialization fails, return NULL.
Handle a single packet for the pad.
If you allocate any memory in null_pad_init() above, de-allocate it here.
|
static |
This is called via hid_pad_register(). In the common case where the device only controls one pad, you can simply return the data parameter. But if you need to track multiple pads attached to the same HID device (see: Wii U GC adapter), you can allocate that memory here.
|
static |
If the pad doesn't support rumble, then this can just be a no-op.
hid_device_t null_hid_device |
Assign function pointers to the driver structure.
pad_connection_interface_t null_pad_connection |
Fill in the joypad interface