71 #ifndef WIIUSE_H_INCLUDED 72 #define WIIUSE_H_INCLUDED 74 #define WIIUSE_MAJOR 0 75 #define WIIUSE_MINOR 16 76 #define WIIUSE_MICRO 0 78 #define WIIUSE_VERSION_TRANSFORM(MAJ, MIN, MICRO) (MAJ * 1000000 + MIN * 1000 + MICRO) 79 #define WIIUSE_HAS_VERSION(MAJ, MIN, MICRO) \ 80 (WIIUSE_VERSION_TRANSFORM(MAJ, MIN, MICRO) \ 81 <= WIIUSE_VERSION_TRANSFORM(WIIUSE_MAJOR, WIIUSE_MINOR, WIIUSE_MICRO)) 83 #ifndef WIIUSE_PLATFORM 85 #define WIIUSE_PLATFORM 87 #elif defined(__linux) 88 #define WIIUSE_PLATFORM 90 #elif defined(__APPLE__) 91 #define WIIUSE_PLATFORM 94 #error "Platform not yet supported!" 100 #ifndef WIN32_LEAN_AND_MEAN 101 #define WIN32_LEAN_AND_MEAN 1 104 #define _WIN32_WINNT 0x0A00 110 #include <bluetooth/bluetooth.h> 112 #ifdef WIIUSE_BT_EMBEDDED 113 #include <bt-embedded/l2cap.h> 116 #if defined(_MSC_VER) && _MSC_VER < 1700 121 #include "wiiuse_msvcstdint.h" 133 #define WIIMOTE_STATE_DEV_FOUND 0x0001 134 #define WIIMOTE_STATE_HANDSHAKE 0x0002 135 #define WIIMOTE_STATE_HANDSHAKE_COMPLETE 0x0004 136 #define WIIMOTE_STATE_CONNECTED 0x0008 137 #define WIIMOTE_STATE_RUMBLE 0x0010 138 #define WIIMOTE_STATE_ACC 0x0020 139 #define WIIMOTE_STATE_EXP 0x0040 140 #define WIIMOTE_STATE_IR 0x0080 141 #define WIIMOTE_STATE_SPEAKER 0x0100 142 #define WIIMOTE_STATE_IR_SENS_LVL1 0x0200 143 #define WIIMOTE_STATE_IR_SENS_LVL2 0x0400 144 #define WIIMOTE_STATE_IR_SENS_LVL3 0x0800 145 #define WIIMOTE_STATE_IR_SENS_LVL4 0x1000 146 #define WIIMOTE_STATE_IR_SENS_LVL5 0x2000 147 #define WIIMOTE_STATE_EXP_HANDSHAKE 0x10000 148 #define WIIMOTE_STATE_EXP_EXTERN 0x20000 149 #define WIIMOTE_STATE_EXP_FAILED 0x40000 150 #define WIIMOTE_STATE_MPLUS_PRESENT 0x80000 152 #define WIIMOTE_ID(wm) (wm->unid) 154 #define WIIMOTE_IS_SET(wm, s) ((wm->state & (s)) == (s)) 155 #define WIIMOTE_IS_CONNECTED(wm) (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_CONNECTED)) 160 #define WIIMOTE_LED_NONE 0x00 161 #define WIIMOTE_LED_1 0x10 162 #define WIIMOTE_LED_2 0x20 163 #define WIIMOTE_LED_3 0x40 164 #define WIIMOTE_LED_4 0x80 169 #define WIIMOTE_BUTTON_TWO 0x0001 170 #define WIIMOTE_BUTTON_ONE 0x0002 171 #define WIIMOTE_BUTTON_B 0x0004 172 #define WIIMOTE_BUTTON_A 0x0008 173 #define WIIMOTE_BUTTON_MINUS 0x0010 174 #define WIIMOTE_BUTTON_YACCEL_LSB 0x0020 175 #define WIIMOTE_BUTTON_ZACCEL_LSB 0x0040 176 #define WIIMOTE_BUTTON_HOME 0x0080 177 #define WIIMOTE_BUTTON_LEFT 0x0100 178 #define WIIMOTE_BUTTON_RIGHT 0x0200 179 #define WIIMOTE_BUTTON_DOWN 0x0400 180 #define WIIMOTE_BUTTON_UP 0x0800 181 #define WIIMOTE_BUTTON_PLUS 0x1000 182 #define WIIMOTE_BUTTON_XACCEL_LSB0 0x2000 183 #define WIIMOTE_BUTTON_XACCEL_LSB1 0x4000 184 #define WIIMOTE_BUTTON_UNKNOWN 0x8000 185 #define WIIMOTE_BUTTON_ALL 0x1F9F 190 #define NUNCHUK_BUTTON_Z 0x01 191 #define NUNCHUK_BUTTON_C 0x02 192 #define NUNCHUK_BUTTON_ALL 0x03 197 #define CLASSIC_CTRL_BUTTON_UP 0x0001 198 #define CLASSIC_CTRL_BUTTON_LEFT 0x0002 199 #define CLASSIC_CTRL_BUTTON_ZR 0x0004 200 #define CLASSIC_CTRL_BUTTON_X 0x0008 201 #define CLASSIC_CTRL_BUTTON_A 0x0010 202 #define CLASSIC_CTRL_BUTTON_Y 0x0020 203 #define CLASSIC_CTRL_BUTTON_B 0x0040 204 #define CLASSIC_CTRL_BUTTON_ZL 0x0080 205 #define CLASSIC_CTRL_BUTTON_FULL_R 0x0200 206 #define CLASSIC_CTRL_BUTTON_PLUS 0x0400 207 #define CLASSIC_CTRL_BUTTON_HOME 0x0800 208 #define CLASSIC_CTRL_BUTTON_MINUS 0x1000 209 #define CLASSIC_CTRL_BUTTON_FULL_L 0x2000 210 #define CLASSIC_CTRL_BUTTON_DOWN 0x4000 211 #define CLASSIC_CTRL_BUTTON_RIGHT 0x8000 212 #define CLASSIC_CTRL_BUTTON_ALL 0xFEFF 217 #define GUITAR_HERO_3_BUTTON_STRUM_UP 0x0001 218 #define GUITAR_HERO_3_BUTTON_YELLOW 0x0008 219 #define GUITAR_HERO_3_BUTTON_GREEN 0x0010 220 #define GUITAR_HERO_3_BUTTON_BLUE 0x0020 221 #define GUITAR_HERO_3_BUTTON_RED 0x0040 222 #define GUITAR_HERO_3_BUTTON_ORANGE 0x0080 223 #define GUITAR_HERO_3_BUTTON_PLUS 0x0400 224 #define GUITAR_HERO_3_BUTTON_MINUS 0x1000 225 #define GUITAR_HERO_3_BUTTON_STRUM_DOWN 0x4000 226 #define GUITAR_HERO_3_BUTTON_ALL 0xFEFF 231 #define TATACON_BUTTON_CENTER_LEFT 0x40 232 #define TATACON_BUTTON_CENTER_RIGHT 0x10 233 #define TATACON_BUTTON_RIM_LEFT 0x20 234 #define TATACON_BUTTON_RIM_RIGHT 0x08 235 #define TATACON_BUTTON_ALL 0x78 240 #define WIIUSE_SMOOTHING 0x01 241 #define WIIUSE_CONTINUOUS 0x02 242 #define WIIUSE_ORIENT_THRESH 0x04 243 #define WIIUSE_INIT_FLAGS (WIIUSE_SMOOTHING | WIIUSE_ORIENT_THRESH) 245 #define WIIUSE_ORIENT_PRECISION 100.0f 251 #define EXP_NUNCHUK 1 252 #define EXP_CLASSIC 2 253 #define EXP_GUITAR_HERO_3 3 254 #define EXP_WII_BOARD 4 255 #define EXP_MOTION_PLUS 5 256 #define EXP_MOTION_PLUS_NUNCHUK 6 257 #define EXP_MOTION_PLUS_CLASSIC 7 258 #define EXP_TATACON 8 272 #define IS_PRESSED(dev, button) ((dev->btns & button) == button) 280 #define IS_HELD(dev, button) ((dev->btns_held & button) == button) 291 #define IS_RELEASED(dev, button) ((dev->btns_released & button) == button) 299 #define IS_JUST_PRESSED(dev, button) (IS_PRESSED(dev, button) && !IS_HELD(dev, button)) 307 #define WIIUSE_GET_IR_SENSITIVITY(wm, lvl) \ 310 if ((wm->state & 0x0200) == 0x0200) \ 312 else if ((wm->state & 0x0400) == 0x0400) \ 314 else if ((wm->state & 0x0800) == 0x0800) \ 316 else if ((wm->state & 0x1000) == 0x1000) \ 318 else if ((wm->state & 0x2000) == 0x2000) \ 324 #define WIIUSE_USING_ACC(wm) ((wm->state & 0x020) == 0x020) 325 #define WIIUSE_USING_EXP(wm) ((wm->state & 0x040) == 0x040) 326 #define WIIUSE_USING_IR(wm) ((wm->state & 0x080) == 0x080) 327 #define WIIUSE_USING_SPEAKER(wm) ((wm->state & 0x100) == 0x100) 329 #define WIIUSE_IS_LED_SET(wm, num) ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num) 337 #define WIIMOTE_DEFAULT_TIMEOUT 10 338 #define WIIMOTE_EXP_TIMEOUT 10 341 #define WIIUSE_SYNC_HANDSHAKE 343 typedef unsigned char byte;
389 int16_t roll, pitch, yaw;
398 float roll, pitch, yaw;
532 unsigned int vres[2];
688 uint8_t update_calib;
689 uint8_t use_alternate_report;
729 float exp_r_shoulder;
730 float exp_l_shoulder;
763 WIIUSE_UNEXPECTED_DISCONNECT,
766 WIIUSE_NUNCHUK_INSERTED,
767 WIIUSE_NUNCHUK_REMOVED,
768 WIIUSE_CLASSIC_CTRL_INSERTED,
769 WIIUSE_CLASSIC_CTRL_REMOVED,
770 WIIUSE_GUITAR_HERO_3_CTRL_INSERTED,
771 WIIUSE_GUITAR_HERO_3_CTRL_REMOVED,
772 WIIUSE_WII_BOARD_CTRL_INSERTED,
773 WIIUSE_WII_BOARD_CTRL_REMOVED,
774 WIIUSE_MOTION_PLUS_ACTIVATED,
775 WIIUSE_MOTION_PLUS_REMOVED,
776 WIIUSE_TATACON_CTRL_INSERTED,
777 WIIUSE_TATACON_CTRL_REMOVED
784 WIIUSE_WIIMOTE_REGULAR = 0,
785 WIIUSE_WIIMOTE_MOTION_PLUS_INSIDE,
807 #ifdef WIIUSE_BT_EMBEDDED 811 BteL2cap *ctrl_channel;
812 BteL2cap *intr_channel;
813 BteBuffer *incoming_queue;
821 OVERLAPPED hid_overlap;
842 #ifndef WIIUSE_SYNC_HANDSHAKE 843 byte handshake_state;
868 byte motion_plus_id[6];
883 uint16_t buttons_held;
884 uint16_t buttons_released;
908 typedef enum data_req_s { REQ_READY = 0, REQ_SENT, REQ_DONE } data_req_s;
931 LOGLEVEL_WARNING = 1,
944 #define WIIUSE_EXPORT_DECL 945 #define WIIUSE_IMPORT_DECL 947 #define WIIUSE_EXPORT_DECL __declspec(dllexport) 948 #define WIIUSE_IMPORT_DECL __declspec(dllimport) 951 #define WIIUSE_EXPORT_DECL 952 #define WIIUSE_IMPORT_DECL 955 #ifdef WIIUSE_COMPILE_LIB 956 #define WIIUSE_EXPORT WIIUSE_EXPORT_DECL 958 #define WIIUSE_EXPORT WIIUSE_IMPORT_DECL 971 #define WIIUSE_HAS_OUTPUT_REDIRECTION int x
calculated X coordinate
Definition: wiiuse.h:539
WIIUSE_EXPORT void wiiuse_status(struct wiimote_t *wm)
Request the wiimote controller status.
Definition: wiiuse.c:536
Nunchuk expansion device.
Definition: wiiuse.h:575
WIIUSE_EXPORT int wiiuse_update(struct wiimote_t **wm, int wiimotes, wiiuse_update_cb callback)
Poll Wiimotes, and call the provided callback with information on each Wiimote that had an event...
Definition: events.c:77
uint16_t btns_held
what buttons are being held down
Definition: wiiuse.h:859
Significant data from the previous event.
Definition: wiiuse.h:719
struct wii_board_t wii_board_t
Wii Balance Board "expansion" device.
float x
horizontal position of the joystick (range [-1, 1]
Definition: wiiuse.h:568
float orient_threshold
threshold for orient to generate an event
Definition: wiiuse.h:586
float pitch
pitch, this may be smoothed if enabled
Definition: wiiuse.h:459
uint32_t addr
the offset that the read started at
Definition: wiiuse.h:374
WIIUSE_EXPORT void wiiuse_set_aspect_ratio(struct wiimote_t *wm, enum aspect_t aspect)
Set the aspect ratio of the TV/monitor.
Definition: ir.c:298
struct ir_t ir_t
IR struct.
WIIUSE_EXPORT void wiiuse_set_ir_vres(struct wiimote_t *wm, unsigned int x, unsigned int y)
Set the virtual screen resolution for IR tracking.
Definition: ir.c:233
byte visible
if the IR source is visible
Definition: wiiuse.h:502
Main Wiimote device structure.
Definition: wiiuse.h:793
struct motion_plus_t motion_plus_t
Motion Plus expansion device.
struct data_req_t * data_req
list of data read requests
Definition: wiiuse.h:846
int32_t accel_threshold
threshold for accel to generate an event
Definition: wiiuse.h:863
Accelerometer struct.
Definition: wiiuse.h:477
WIIUSE_EVENT_TYPE
Events that wiiuse can generate from a poll.
Definition: wiiuse.h:757
A single IR source.
Definition: wiiuse.h:500
int type
type of expansion attached
Definition: wiiuse.h:697
WIIUSE_EXPORT void wiiuse_set_leds(struct wiimote_t *wm, int leds)
Set the enabled LEDs.
Definition: wiiuse.c:267
float st_roll
last smoothed roll value
Definition: wiiuse.h:492
wiiuse_read_cb cb
read data callback
Definition: wiiuse.h:371
int16_t btns_held
what buttons are being held down
Definition: wiiuse.h:600
float st_alpha
alpha value for smoothing [0-1]
Definition: wiiuse.h:494
wiiuse_write_cb cb
read data callback
Definition: wiiuse.h:921
Roll/Pitch/Yaw short angles.
Definition: wiiuse.h:387
struct nunchuk_t * nc
pointers to nunchuk & classic in pass-through-mode
Definition: wiiuse.h:639
float roll
roll, this may be smoothed if enabled
Definition: wiiuse.h:458
byte order
increasing order by x-axis value
Definition: wiiuse.h:510
struct expansion_t expansion_t
Generic expansion device plugged into wiimote.
WIIUSE_EXPORT void wiiuse_motion_sensing(struct wiimote_t *wm, int status)
Set if the wiimote should report motion sensing.
Definition: wiiuse.c:300
struct read_req_t * next
next read request in the queue
Definition: wiiuse.h:379
struct nunchuk_t nunchuk_t
Nunchuk expansion device.
byte num_dots
number of dots at this time
Definition: wiiuse.h:526
uint16_t size
the length of the data read
Definition: wiiuse.h:375
int16_t btns
what buttons have just been pressed
Definition: wiiuse.h:615
float distance
pixel distance between first 2 dots
Definition: wiiuse.h:542
WIIUSE_EXPORT void wiiuse_cleanup(struct wiimote_t **wm, int wiimotes)
Clean up wiimote_t array created by wiiuse_init()
Definition: wiiuse.c:73
int accel_threshold
threshold for accel to generate an event
Definition: wiiuse.h:587
struct gforce_t gforce_t
Gravity force struct.
WIIUSE_EXPORT void wiiuse_wiiboard_use_alternate_report(struct wiimote_t *wm, int enabled)
Switch the Balance Board to use report 0x34 instead of 0x32.
Definition: wiiuse.c:913
struct wiimote_callback_data_t wiimote_callback_data_t
Data passed to a callback during wiiuse_update()
Motion Plus expansion device.
Definition: wiiuse.h:627
void(* wiiuse_update_cb)(struct wiimote_callback_data_t *wm)
Callback type.
Definition: wiiuse.h:891
int y
calculated Y coordinate
Definition: wiiuse.h:540
uint16_t btns
what buttons have just been pressed
Definition: wiiuse.h:858
float whammy_bar
whammy bar (range 0-1)
Definition: wiiuse.h:619
uint16_t btns_released
what buttons were just released this
Definition: wiiuse.h:860
float st_pitch
last smoothed roll pitch
Definition: wiiuse.h:493
int16_t ry
raw Y coordinate (0-767)
Definition: wiiuse.h:508
data_req_s state
set to 1 if not using callback and needs to be cleaned up
Definition: wiiuse.h:920
int * flags
options flag (points to wiimote_t.flags)
Definition: wiiuse.h:580
ir_position_t
IR correction types.
Definition: wiiuse.h:262
struct read_req_t * read_req
list of data read requests
Definition: wiiuse.h:848
struct guitar_hero_3_t guitar_hero_3_t
Guitar Hero 3 expansion device.
int state
keeps track of the IR state
Definition: wiiuse.h:534
Unsigned x,y byte vector.
Definition: wiiuse.h:404
int16_t btns_released
what buttons were just released this
Definition: wiiuse.h:601
WIIUSE_EXPORT struct wiimote_t * wiiuse_get_by_id(struct wiimote_t **wm, int wiimotes, int unid)
Find a wiimote_t structure by its unique identifier.
Definition: wiiuse.c:559
struct classic_ctrl_t classic_ctrl_t
Classic controller expansion device.
Unsigned x,y,z 16-bit vector.
Definition: wiiuse.h:446
Classic controller expansion device.
Definition: wiiuse.h:597
Tatacon expansion device.
Definition: wiiuse.h:646
Gravity force struct.
Definition: wiiuse.h:469
WIIUSE_EXPORT void wiiuse_set_timeout(struct wiimote_t **wm, int wiimotes, byte normal_timeout, byte exp_timeout)
Set the normal and expansion handshake timeouts.
Definition: wiiuse.c:949
WIIUSE_EXPORT struct wiimote_t ** wiiuse_init(int wiimotes)
Initialize an array of wiimote structures.
Definition: wiiuse.c:108
wiiuse_loglevel
Loglevels supported by wiiuse.
Definition: wiiuse.h:929
WIIUSE_EXPORT float wiiuse_set_smooth_alpha(struct wiimote_t *wm, float alpha)
Set the wiimote smoothing alpha value.
Definition: wiiuse.c:825
byte * buf
buffer where read data is written
Definition: wiiuse.h:373
byte dirty
set to 1 if not using callback and needs to be cleaned up
Definition: wiiuse.h:377
void(* wiiuse_read_cb)(struct wiimote_t *wm, byte *data, uint16_t len)
Callback that handles a read event.
Definition: wiiuse.h:364
WIIUSE_EXPORT void wiiuse_disconnected(struct wiimote_t *wm)
The wiimote disconnected.
Definition: wiiuse.c:179
struct vec3f_t vec3f_t
Signed x,y,z float struct.
struct orient_t orient_t
Orientation struct.
WIIUSE_WIIMOTE_TYPE
Type of wiimote peripheral.
Definition: wiiuse.h:783
int16_t rx
raw X coordinate (0-1023)
Definition: wiiuse.h:507
struct vec2b_t vec2b_t
Unsigned x,y byte vector.
WIIUSE_EXPORT void wiiuse_set_ir_sensitivity(struct wiimote_t *wm, int level)
Set the IR sensitivity.
Definition: ir.c:330
WIIUSE_EXPORT void wiiuse_rumble(struct wiimote_t *wm, int status)
Enable or disable the rumble.
Definition: wiiuse.c:211
float a_roll
absolute roll, unsmoothed
Definition: wiiuse.h:462
Guitar Hero 3 expansion device.
Definition: wiiuse.h:613
byte acc_mode
Fast/slow rotation mode for roll, pitch and yaw (0 if rotating fast, 1 if slow or still) ...
Definition: wiiuse.h:635
int8_t btns
what buttons have just been pressed
Definition: wiiuse.h:648
Data passed to a callback during wiiuse_update()
Definition: wiiuse.h:873
IR struct.
Definition: wiiuse.h:523
struct ir_dot_t ir_dot_t
A single IR source.
Orientation struct.
Definition: wiiuse.h:456
byte btns_released
what buttons were just released this
Definition: wiiuse.h:584
WIIUSE_EXPORT int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
Find a wiimote or wiimotes.
Definition: io.c:66
struct wiimote_state_t wiimote_state_t
Significant data from the previous event.
int16_t btns_released
what buttons were just released this
Definition: wiiuse.h:617
WIIUSE_EXPORT int wiiuse_read_data(struct wiimote_t *wm, byte *buffer, unsigned int offset, uint16_t len)
Read data from the wiimote (event version).
Definition: wiiuse.c:480
byte ext
is there a device on the pass-through port?
Definition: wiiuse.h:629
WIIUSE_EXPORT void wiiuse_set_nunchuk_orient_threshold(struct wiimote_t *wm, float threshold)
Set the orientation event threshold for the nunchuk.
Definition: nunchuk.c:202
WIIUSE_EXPORT void wiiuse_set_orient_threshold(struct wiimote_t *wm, float threshold)
Set the orientation event threshold.
Definition: wiiuse.c:881
WIIUSE_EXPORT void wiiuse_set_ir_position(struct wiimote_t *wm, enum ir_position_t pos)
Set the XY position for the IR cursor.
Definition: ir.c:249
int unid
user specified id
Definition: wiiuse.h:795
void(* wiiuse_write_cb)(struct wiimote_t *wm, unsigned char *data, unsigned short len)
Callback that handles a write event.
Definition: wiiuse.h:906
unsigned int x
interpolated X coordinate
Definition: wiiuse.h:504
Data read request structure.
Definition: wiiuse.h:369
byte btns_held
what buttons are being held down
Definition: wiiuse.h:583
float battery_level
battery level
Definition: wiiuse.h:838
int ax
absolute X coordinate
Definition: wiiuse.h:536
float mag
magnitude of the joystick (range 0-1)
Definition: wiiuse.h:567
struct tatacon_t tatacon_t
Tatacon expansion device.
Generic expansion device plugged into wiimote.
Definition: wiiuse.h:695
byte leds
currently lit leds
Definition: wiiuse.h:837
int raw_gyro_threshold
threshold for gyroscopes to generate an event
Definition: wiiuse.h:637
WIIUSE_EXPORT void wiiuse_set_motion_plus(struct wiimote_t *wm, int status)
Enable/disable Motion+ expansion.
Definition: motion_plus.c:177
struct vec3b_t vec3b_t
Unsigned x,y,z byte vector.
WIIUSE_EXPORT void wiiuse_disconnect(struct wiimote_t *wm)
Disconnect a wiimote.
Definition: io.c:109
Roll/Pitch/Yaw float angles.
Definition: wiiuse.h:396
WIIUSE_EXPORT void wiiuse_set_wii_board_calib(struct wiimote_t *wm)
Calib wii board.
Definition: wiiboard.c:168
WIIUSE_EXPORT void wiiuse_set_accel_threshold(struct wiimote_t *wm, int threshold)
Set the accelerometer event threshold.
Definition: wiiuse.c:897
float y
vertical position of the joystick (range [-1, 1]
Definition: wiiuse.h:569
int state
various state flags
Definition: wiiuse.h:836
int flags
options flag
Definition: wiiuse.h:840
int16_t btns_held
what buttons are being held down
Definition: wiiuse.h:616
float a_pitch
absolute pitch, unsmoothed
Definition: wiiuse.h:463
Data write request structure.
Definition: wiiuse.h:914
byte size
size of the IR dot (0-15)
Definition: wiiuse.h:512
WIIUSE_EXPORT int wiiuse_set_flags(struct wiimote_t *wm, int enable, int disable)
Set flags for the specified wiimote.
Definition: wiiuse.c:795
Wii Balance Board "expansion" device.
Definition: wiiuse.h:657
float l_shoulder
left shoulder button (range 0-1)
Definition: wiiuse.h:604
struct vec3w_t vec3w_t
Unsigned x,y,z 16-bit vector.
Unsigned x,y,z byte vector.
Definition: wiiuse.h:412
WIIUSE_EXPORT void wiiuse_set_output(enum wiiuse_loglevel loglevel, FILE *logtarget)
Specify an alternate FILE stream for a log level.
Definition: wiiuse.c:68
int16_t btns
what buttons have just been pressed
Definition: wiiuse.h:599
WIIUSE_EXPORT void wiiuse_set_bluetooth_stack(struct wiimote_t **wm, int wiimotes, enum win_bt_stack_t type)
Set the bluetooth stack type to use.
Definition: wiiuse.c:854
unsigned int y
interpolated Y coordinate
Definition: wiiuse.h:505
WIIUSE_EXPORT int wiiuse_write_data(struct wiimote_t *wm, unsigned int addr, const byte *data, byte len)
Write data to the wiimote.
Definition: wiiuse.c:590
struct wiimote_t wiimote
Main Wiimote device structure.
WIIUSE_EVENT_TYPE event
type of event that occurred
Definition: wiiuse.h:867
float ang
angle the joystick is being held
Definition: wiiuse.h:566
WIIUSE_EXPORT const char * wiiuse_version()
Returns the version of the library.
Definition: wiiuse.c:52
WIIUSE_EXPORT int wiiuse_poll(struct wiimote_t **wm, int wiimotes)
Poll the wiimotes for any events.
Definition: events.c:75
WIIUSE_EXPORT void wiiuse_set_ir(struct wiimote_t *wm, int status)
Set if the wiimote should track IR targets.
Definition: ir.c:87
WIIUSE_EXPORT void wiiuse_toggle_rumble(struct wiimote_t *wm)
Toggle the state of the rumble.
Definition: wiiuse.c:249
int ay
absolute Y coordinate
Definition: wiiuse.h:537
aspect_t
Screen aspect ratio.
Definition: wiiuse.h:518
Signed x,y,z float struct.
Definition: wiiuse.h:420
FILE * logtarget[]
Output FILE stream for each wiiuse_loglevel.
Definition: wiiuse.c:57
float r_shoulder
right shoulder button (range 0-1)
Definition: wiiuse.h:603
struct accel_t accel_t
Accelerometer struct.
WIIUSE_EXPORT int wiiuse_connect(struct wiimote_t **wm, int wiimotes)
Connect to a wiimote or wiimotes once an address is known.
Definition: io.c:92
win_bt_stack_t
Available bluetooth stacks for Windows.
Definition: wiiuse.h:714
struct joystick_t joystick_t
Joystick calibration structure.
WIIUSE_EXPORT void wiiuse_resync(struct wiimote_t *wm)
Try to resync with the wiimote by starting a new handshake.
Definition: wiiuse.c:928
uint16_t wait
num bytes still needed to finish read
Definition: wiiuse.h:376
Joystick calibration structure.
Definition: wiiuse.h:560
float z
calculated distance
Definition: wiiuse.h:543
byte btns
what buttons have just been pressed
Definition: wiiuse.h:582
byte expansion_state
the state of the expansion handshake
Definition: wiiuse.h:845
WIIUSE_EXPORT void wiiuse_set_nunchuk_accel_threshold(struct wiimote_t *wm, int threshold)
Set the accelerometer event threshold for the nunchuk.
Definition: nunchuk.c:220
float orient_threshold
threshold for orient to generate an event
Definition: wiiuse.h:862