2018-06-13 13:11:00 +02:00
|
|
|
#pragma once
|
|
|
|
#include <wut.h>
|
2018-06-17 20:18:51 +02:00
|
|
|
#include <padscore/wpad.h>
|
2018-06-13 13:11:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \defgroup padscore_kpad KPAD
|
|
|
|
* \ingroup padscore
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-06-17 20:18:51 +02:00
|
|
|
typedef WPADVec2D KPADVec2D;
|
|
|
|
|
2018-06-17 19:13:21 +02:00
|
|
|
typedef struct _KPADStatus
|
2018-06-17 20:18:51 +02:00
|
|
|
{
|
|
|
|
//! Indicates what KPADButtons are held down
|
|
|
|
uint32_t hold;
|
|
|
|
|
|
|
|
//! Indicates what KPADButtons have been pressed since last sample
|
|
|
|
uint32_t trigger;
|
|
|
|
|
|
|
|
//! Indicates what KPADButtons have been released since last sample
|
|
|
|
uint32_t release;
|
|
|
|
|
2018-06-17 19:13:21 +02:00
|
|
|
uint32_t unused_1[5];
|
2018-06-17 20:18:51 +02:00
|
|
|
KPADVec2D pos;
|
2018-06-17 19:13:21 +02:00
|
|
|
uint32_t unused_2[3];
|
2018-06-17 20:18:51 +02:00
|
|
|
KPADVec2D angle;
|
2018-06-17 19:13:21 +02:00
|
|
|
uint32_t unused_3[8];
|
|
|
|
uint8_t device_type;
|
|
|
|
uint8_t wpad_error;
|
|
|
|
uint8_t pos_valid;
|
|
|
|
uint8_t format;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2018-06-17 20:18:51 +02:00
|
|
|
KPADVec2D stick;
|
2018-06-17 19:13:21 +02:00
|
|
|
} nunchuck;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint32_t btns_h;
|
|
|
|
uint32_t btns_d;
|
|
|
|
uint32_t btns_r;
|
2018-06-17 20:18:51 +02:00
|
|
|
KPADVec2D leftStick;
|
|
|
|
KPADVec2D rightStick;
|
|
|
|
float leftTrigger;
|
|
|
|
float rightTrigger;
|
2018-06-17 19:13:21 +02:00
|
|
|
} classic;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint32_t hold;
|
|
|
|
uint32_t trigger;
|
|
|
|
uint32_t release;
|
2018-06-17 20:18:51 +02:00
|
|
|
KPADVec2D leftStick;
|
|
|
|
KPADVec2D rightStick;
|
2018-06-17 19:13:21 +02:00
|
|
|
int32_t charging;
|
|
|
|
int32_t wired;
|
|
|
|
} pro;
|
|
|
|
|
|
|
|
uint32_t unused_6[20];
|
|
|
|
};
|
|
|
|
uint32_t unused_7[16];
|
|
|
|
} KPADStatus;
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
KPADInit (void);
|
|
|
|
|
|
|
|
int32_t
|
|
|
|
KPADRead(int32_t chan,
|
|
|
|
void * data,
|
|
|
|
uint32_t size);
|
|
|
|
|
|
|
|
int32_t
|
|
|
|
KPADReadEx(int32_t chan,
|
|
|
|
KPADStatus * data,
|
|
|
|
uint32_t size,
|
|
|
|
int32_t *error);
|
2018-06-13 13:11:00 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** @} */
|