RetroArch
Classes | Macros | Functions | Variables
connect_ps2adapter.c File Reference
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <boolean.h>
#include "joypad_connection.h"
#include "../input_defines.h"
Include dependency graph for connect_ps2adapter.c:

Classes

struct  hidpad_ps2adapter_data
 

Macros

#define PS2_H_GET(a)   (a & 0x0F) /*HAT MASK = 0x0F */
 
#define PS2_H_LEFT(a)   (a == 0x05) || (a == 0x06) || (a == 0x07)
 
#define PS2_H_RIGHT(a)   (a == 0x01) || (a == 0x02) || (a == 0x03)
 
#define PS2_H_UP(a)   (a == 0x07) || (a == 0x00) || (a == 0x01)
 
#define PS2_H_DOWN(a)   (a == 0x03) || (a == 0x04) || (a == 0x05)
 

Functions

static voidhidpad_ps2adapter_init (void *data, uint32_t slot, hid_driver_t *driver)
 
static void hidpad_ps2adapter_deinit (void *data)
 
static void hidpad_ps2adapter_get_buttons (void *data, input_bits_t *state)
 
static int16_t hidpad_ps2adapter_get_axis (void *data, unsigned axis)
 
static void hidpad_ps2adapter_packet_handler (void *data, uint8_t *packet, uint16_t size)
 
static void hidpad_ps2adapter_set_rumble (void *data, enum retro_rumble_effect effect, uint16_t strength)
 
const char * hidpad_ps2adapter_get_name (void *data)
 

Variables

pad_connection_interface_t pad_connection_ps2adapter
 

Macro Definition Documentation

◆ PS2_H_DOWN

#define PS2_H_DOWN (   a)    (a == 0x03) || (a == 0x04) || (a == 0x05)

◆ PS2_H_GET

#define PS2_H_GET (   a)    (a & 0x0F) /*HAT MASK = 0x0F */

◆ PS2_H_LEFT

#define PS2_H_LEFT (   a)    (a == 0x05) || (a == 0x06) || (a == 0x07)

◆ PS2_H_RIGHT

#define PS2_H_RIGHT (   a)    (a == 0x01) || (a == 0x02) || (a == 0x03)

◆ PS2_H_UP

#define PS2_H_UP (   a)    (a == 0x07) || (a == 0x00) || (a == 0x01)

Function Documentation

◆ hidpad_ps2adapter_deinit()

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

◆ hidpad_ps2adapter_get_axis()

static int16_t hidpad_ps2adapter_get_axis ( void data,
unsigned  axis 
)
static

◆ hidpad_ps2adapter_get_buttons()

static void hidpad_ps2adapter_get_buttons ( void data,
input_bits_t state 
)
static

◆ hidpad_ps2adapter_get_name()

const char* hidpad_ps2adapter_get_name ( void data)
Here is the call graph for this function:

◆ hidpad_ps2adapter_init()

static void* hidpad_ps2adapter_init ( void data,
uint32_t  slot,
hid_driver_t driver 
)
static
Here is the call graph for this function:

◆ hidpad_ps2adapter_packet_handler()

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

◆ hidpad_ps2adapter_set_rumble()

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

Variable Documentation

◆ pad_connection_ps2adapter

pad_connection_interface_t pad_connection_ps2adapter
Initial value:
= {
}
static void * hidpad_ps2adapter_init(void *data, uint32_t slot, hid_driver_t *driver)
Definition: connect_ps2adapter.c:33
const char * hidpad_ps2adapter_get_name(void *data)
Definition: connect_ps2adapter.c:168
static void hidpad_ps2adapter_packet_handler(void *data, uint8_t *packet, uint16_t size)
Definition: connect_ps2adapter.c:110
static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis)
Definition: connect_ps2adapter.c:75
static void hidpad_ps2adapter_get_buttons(void *data, input_bits_t *state)
Definition: connect_ps2adapter.c:62
static void hidpad_ps2adapter_deinit(void *data)
Definition: connect_ps2adapter.c:54
static void hidpad_ps2adapter_set_rumble(void *data, enum retro_rumble_effect effect, uint16_t strength)
Definition: connect_ps2adapter.c:160