RetroArch
Classes | Macros | Typedefs | Enumerations | Functions
wiiuse.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  data_req_t
 Data read request structure. More...
 
struct  cmd_blk_t
 
struct  vec2b_t
 Unsigned x,y byte vector. More...
 
struct  vec3b_t
 Unsigned x,y,z byte vector. More...
 
struct  vec3w_t
 
struct  vec3f_t
 Signed x,y,z float struct. More...
 
struct  orient_t
 Orientation struct. More...
 
struct  gforce_t
 Gravity force struct. More...
 
struct  accel_t
 Accelerometer struct. For any device with an accelerometer. More...
 
struct  ir_dot_t
 A single IR source. More...
 
struct  fdot_t
 
struct  sb_t
 
struct  ir_t
 IR struct. Hold all data related to the IR tracking. More...
 
struct  joystick_t
 Joystick calibration structure. More...
 
struct  nunchuk_t
 Nunchuk expansion device. More...
 
struct  classic_ctrl_t
 Classic controller expansion device. More...
 
struct  guitar_hero_3_t
 Guitar Hero 3 expansion device. More...
 
struct  wii_board_t
 Wii Balance Board expansion device. More...
 
struct  motion_plus_t
 
struct  expansion_t
 Generic expansion device plugged into wiimote. More...
 
struct  wiimote_state_t
 Significant data from the previous event. More...
 
struct  wiimote_t
 Wiimote structure. More...
 

Macros

#define WCONST   const
 
#define WIIMOTE_LED_NONE   0x00
 
#define WIIMOTE_LED_1   0x10
 
#define WIIMOTE_LED_2   0x20
 
#define WIIMOTE_LED_3   0x40
 
#define WIIMOTE_LED_4   0x80
 
#define WIIMOTE_BUTTON_TWO   0x0001
 
#define WIIMOTE_BUTTON_ONE   0x0002
 
#define WIIMOTE_BUTTON_B   0x0004
 
#define WIIMOTE_BUTTON_A   0x0008
 
#define WIIMOTE_BUTTON_MINUS   0x0010
 
#define WIIMOTE_BUTTON_ZACCEL_BIT6   0x0020
 
#define WIIMOTE_BUTTON_ZACCEL_BIT7   0x0040
 
#define WIIMOTE_BUTTON_HOME   0x0080
 
#define WIIMOTE_BUTTON_LEFT   0x0100
 
#define WIIMOTE_BUTTON_RIGHT   0x0200
 
#define WIIMOTE_BUTTON_DOWN   0x0400
 
#define WIIMOTE_BUTTON_UP   0x0800
 
#define WIIMOTE_BUTTON_PLUS   0x1000
 
#define WIIMOTE_BUTTON_ZACCEL_BIT4   0x2000
 
#define WIIMOTE_BUTTON_ZACCEL_BIT5   0x4000
 
#define WIIMOTE_BUTTON_UNKNOWN   0x8000
 
#define WIIMOTE_BUTTON_ALL   0x1F9F
 
#define NUNCHUK_BUTTON_Z   0x01
 
#define NUNCHUK_BUTTON_C   0x02
 
#define NUNCHUK_BUTTON_ALL   0x03
 
#define CLASSIC_CTRL_BUTTON_UP   0x0001
 
#define CLASSIC_CTRL_BUTTON_LEFT   0x0002
 
#define CLASSIC_CTRL_BUTTON_ZR   0x0004
 
#define CLASSIC_CTRL_BUTTON_X   0x0008
 
#define CLASSIC_CTRL_BUTTON_A   0x0010
 
#define CLASSIC_CTRL_BUTTON_Y   0x0020
 
#define CLASSIC_CTRL_BUTTON_B   0x0040
 
#define CLASSIC_CTRL_BUTTON_ZL   0x0080
 
#define CLASSIC_CTRL_BUTTON_FULL_R   0x0200
 
#define CLASSIC_CTRL_BUTTON_PLUS   0x0400
 
#define CLASSIC_CTRL_BUTTON_HOME   0x0800
 
#define CLASSIC_CTRL_BUTTON_MINUS   0x1000
 
#define CLASSIC_CTRL_BUTTON_FULL_L   0x2000
 
#define CLASSIC_CTRL_BUTTON_DOWN   0x4000
 
#define CLASSIC_CTRL_BUTTON_RIGHT   0x8000
 
#define CLASSIC_CTRL_BUTTON_ALL   0xFEFF
 
#define GUITAR_HERO_3_BUTTON_STRUM_UP   0x0001
 
#define GUITAR_HERO_3_BUTTON_YELLOW   0x0008
 
#define GUITAR_HERO_3_BUTTON_GREEN   0x0010
 
#define GUITAR_HERO_3_BUTTON_BLUE   0x0020
 
#define GUITAR_HERO_3_BUTTON_RED   0x0040
 
#define GUITAR_HERO_3_BUTTON_ORANGE   0x0080
 
#define GUITAR_HERO_3_BUTTON_PLUS   0x0400
 
#define GUITAR_HERO_3_BUTTON_MINUS   0x1000
 
#define GUITAR_HERO_3_BUTTON_STRUM_DOWN   0x4000
 
#define GUITAR_HERO_3_BUTTON_ALL   0xFEFF
 
#define GUITAR_HERO_3_TOUCH_AVAILABLE   0x1000
 
#define GUITAR_HERO_3_TOUCH_GREEN   0x1001
 
#define GUITAR_HERO_3_TOUCH_RED   0x1002
 
#define GUITAR_HERO_3_TOUCH_YELLOW   0x1004
 
#define GUITAR_HERO_3_TOUCH_BLUE   0x1008
 
#define GUITAR_HERO_3_TOUCH_ORANGE   0x1010
 
#define WIIUSE_SMOOTHING   0x01
 
#define WIIUSE_CONTINUOUS   0x02
 
#define WIIUSE_ACCEL_THRESH   0x04
 
#define WIIUSE_IR_THRESH   0x08
 
#define WIIUSE_JS_THRESH   0x10
 
#define WIIUSE_INIT_FLAGS   WIIUSE_SMOOTHING
 
#define WIIUSE_ORIENT_PRECISION   100.0f
 
#define EXP_NONE   0
 
#define EXP_NUNCHUK   1
 
#define EXP_CLASSIC   2
 
#define EXP_GUITAR_HERO_3   3
 
#define EXP_WII_BOARD   4
 
#define EXP_MOTION_PLUS   5
 
#define IS_PRESSED(dev, button)   ((dev->btns & button) == button)
 Check if a button is pressed. More...
 
#define IS_HELD(dev, button)   ((dev->btns_held & button) == button)
 Check if a button is being held. More...
 
#define IS_RELEASED(dev, button)   ((dev->btns_released & button) == button)
 Check if a button is released on this event.

This does not mean the button is not pressed, it means
this button was just now released. More...
 
#define IS_JUST_PRESSED(dev, button)   (IS_PRESSED(dev, button) && !IS_HELD(dev, button))
 Check if a button has just been pressed this event. More...
 
#define WIIUSE_GET_IR_SENSITIVITY(dev, lvl)
 Return the IR sensitivity level. More...
 
#define WIIUSE_USING_ACC(wm)   ((wm->state & 0x00100) == 0x00100)
 
#define WIIUSE_USING_EXP(wm)   ((wm->state & 0x00200) == 0x00200)
 
#define WIIUSE_USING_IR(wm)   ((wm->state & 0x00400) == 0x00400)
 
#define WIIUSE_USING_SPEAKER(wm)   ((wm->state & 0x00800) == 0x00800)
 
#define WIIUSE_IS_LED_SET(wm, num)   ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num)
 
#define MAX_PAYLOAD   32
 
#define WIIUSE_EXPORT_DECL
 
#define WIIUSE_IMPORT_DECL
 
#define WIIUSE_EXPORT   WIIUSE_IMPORT_DECL
 

Typedefs

typedef enum ir_position_t ir_position_t
 
typedef unsigned char ubyte
 
typedef char sbyte
 
typedef unsigned short uword
 
typedef short sword
 
typedef unsigned int uint
 
typedef char sint
 
typedef void(* wiiuse_data_cb) (struct wiimote_t *wm, ubyte *data, unsigned short len)
 Callback that handles a read event. More...
 
typedef enum data_req_s data_req_s
 
typedef void(* cmd_blk_cb) (struct wiimote_t *wm, ubyte *data, uword len)
 
typedef enum cmd_blk_s cmd_blk_s
 
typedef struct vec2b_t vec2b_t
 
typedef struct vec3b_t vec3b_t
 
typedef struct vec3w_t vec3w_t
 
typedef struct vec3f_t vec3f_t
 
typedef struct orient_t orient_t
 
typedef struct gforce_t gforce_t
 
typedef struct accel_t accel_t
 
typedef struct ir_dot_t ir_dot_t
 
typedef struct fdot_t fdot_t
 
typedef struct sb_t sb_t
 
typedef enum aspect_t aspect_t
 
typedef struct ir_t ir_t
 
typedef struct joystick_t joystick_t
 
typedef struct nunchuk_t nunchuk_t
 
typedef struct classic_ctrl_t classic_ctrl_t
 
typedef struct guitar_hero_3_t guitar_hero_3_t
 
typedef struct wii_board_t wii_board_t
 
typedef struct motion_plus_t motion_plus_t
 
typedef struct expansion_t expansion_t
 
typedef enum win_bt_stack_t win_bt_stack_t
 
typedef struct wiimote_state_t wiimote_state_t
 
typedef enum WIIUSE_EVENT_TYPE WIIUSE_EVENT_TYPE
 
typedef struct wiimote_t wiimote
 

Enumerations

enum  ir_position_t { WIIUSE_IR_ABOVE, WIIUSE_IR_BELOW }
 
enum  data_req_s { REQ_READY = 0, REQ_SENT, REQ_DONE }
 
enum  cmd_blk_s { CMD_READY = 0, CMD_SENT, CMD_DONE }
 
enum  aspect_t { WIIUSE_ASPECT_4_3, WIIUSE_ASPECT_16_9 }
 Screen aspect ratio. More...
 
enum  win_bt_stack_t { WIIUSE_STACK_UNKNOWN, WIIUSE_STACK_MS, WIIUSE_STACK_BLUESOLEIL }
 
enum  WIIUSE_EVENT_TYPE {
  WIIUSE_NONE = 0, WIIUSE_EVENT, WIIUSE_STATUS, WIIUSE_CONNECT,
  WIIUSE_DISCONNECT, WIIUSE_UNEXPECTED_DISCONNECT, WIIUSE_READ_DATA, WIIUSE_ACK,
  WIIUSE_NUNCHUK_INSERTED, WIIUSE_NUNCHUK_REMOVED, WIIUSE_CLASSIC_CTRL_INSERTED, WIIUSE_CLASSIC_CTRL_REMOVED,
  WIIUSE_GUITAR_HERO_3_CTRL_INSERTED, WIIUSE_GUITAR_HERO_3_CTRL_REMOVED, WIIUSE_WII_BOARD_INSERTED, WIIUSE_WII_BOARD_REMOVED,
  WIIUSE_MOTION_PLUS_ACTIVATED, WIIUSE_MOTION_PLUS_REMOVED
}
 Events that wiiuse can generate from a poll. More...
 

Functions

WIIUSE_EXPORT const char * wiiuse_version ()
 
WIIUSE_EXPORT struct wiimote_t ** wiiuse_init (int wiimotes)
 
WIIUSE_EXPORT void wiiuse_disconnected (struct wiimote_t *wm)
 
WIIUSE_EXPORT void wiiuse_cleanup (struct wiimote_t **wm, int wiimotes)
 
WIIUSE_EXPORT void wiiuse_rumble (struct wiimote_t *wm, int status)
 
WIIUSE_EXPORT void wiiuse_toggle_rumble (struct wiimote_t *wm)
 
WIIUSE_EXPORT void wiiuse_set_leds (struct wiimote_t *wm, int leds, cmd_blk_cb cb)
 Toggle the state of the rumble. More...
 
WIIUSE_EXPORT void wiiuse_motion_sensing (struct wiimote_t *wm, int status)
 Set if the wiimote should report motion sensing. More...
 
WIIUSE_EXPORT int wiiuse_read_data (struct wiimote_t *wm, ubyte *buffer, unsigned int offset, unsigned short len, cmd_blk_cb cb)
 
WIIUSE_EXPORT int wiiuse_write_data (struct wiimote_t *wm, unsigned int addr, ubyte *data, ubyte len, cmd_blk_cb cb)
 
WIIUSE_EXPORT void wiiuse_status (struct wiimote_t *wm, cmd_blk_cb cb)
 
WIIUSE_EXPORT struct wiimote_twiiuse_get_by_id (struct wiimote_t **wm, int wiimotes, int unid)
 
WIIUSE_EXPORT int wiiuse_set_flags (struct wiimote_t *wm, int enable, int disable)
 Set flags for the specified wiimote. More...
 
WIIUSE_EXPORT float wiiuse_set_smooth_alpha (struct wiimote_t *wm, float alpha)
 
WIIUSE_EXPORT void wiiuse_set_bluetooth_stack (struct wiimote_t **wm, int wiimotes, enum win_bt_stack_t type)
 
WIIUSE_EXPORT void wiiuse_resync (struct wiimote_t *wm)
 
WIIUSE_EXPORT void wiiuse_set_timeout (struct wiimote_t **wm, int wiimotes, ubyte normal_timeout, ubyte exp_timeout)
 
WIIUSE_EXPORT int wiiuse_write_streamdata (struct wiimote_t *wm, ubyte *data, ubyte len, cmd_blk_cb cb)
 
WIIUSE_EXPORT int wiiuse_find (struct wiimote_t **wm, int max_wiimotes, int timeout)
 
WIIUSE_EXPORT int wiiuse_connect (struct wiimote_t **wm, int wiimotes)
 
WIIUSE_EXPORT void wiiuse_disconnect (struct wiimote_t *wm)
 
WIIUSE_EXPORT int wiiuse_poll (struct wiimote_t **wm, int wiimotes)
 
WIIUSE_EXPORT void wiiuse_set_ir_mode (struct wiimote_t *wm)
 
WIIUSE_EXPORT void wiiuse_set_ir (struct wiimote_t *wm, int status)
 
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. More...
 
WIIUSE_EXPORT void wiiuse_set_ir_position (struct wiimote_t *wm, enum ir_position_t pos)
 Set the XY position for the IR cursor. More...
 
WIIUSE_EXPORT void wiiuse_set_aspect_ratio (struct wiimote_t *wm, enum aspect_t aspect)
 Set the aspect ratio of the TV/monitor. More...
 
WIIUSE_EXPORT void wiiuse_set_ir_sensitivity (struct wiimote_t *wm, int level)
 Set the IR sensitivity. More...
 
WIIUSE_EXPORT void wiiuse_set_motion_plus (struct wiimote_t *wm, int status)
 
WIIUSE_EXPORT void wiiuse_set_speaker (struct wiimote_t *wm, int status)
 

Macro Definition Documentation

◆ CLASSIC_CTRL_BUTTON_A

#define CLASSIC_CTRL_BUTTON_A   0x0010

◆ CLASSIC_CTRL_BUTTON_ALL

#define CLASSIC_CTRL_BUTTON_ALL   0xFEFF

◆ CLASSIC_CTRL_BUTTON_B

#define CLASSIC_CTRL_BUTTON_B   0x0040

◆ CLASSIC_CTRL_BUTTON_DOWN

#define CLASSIC_CTRL_BUTTON_DOWN   0x4000

◆ CLASSIC_CTRL_BUTTON_FULL_L

#define CLASSIC_CTRL_BUTTON_FULL_L   0x2000

◆ CLASSIC_CTRL_BUTTON_FULL_R

#define CLASSIC_CTRL_BUTTON_FULL_R   0x0200

◆ CLASSIC_CTRL_BUTTON_HOME

#define CLASSIC_CTRL_BUTTON_HOME   0x0800

◆ CLASSIC_CTRL_BUTTON_LEFT

#define CLASSIC_CTRL_BUTTON_LEFT   0x0002

◆ CLASSIC_CTRL_BUTTON_MINUS

#define CLASSIC_CTRL_BUTTON_MINUS   0x1000

◆ CLASSIC_CTRL_BUTTON_PLUS

#define CLASSIC_CTRL_BUTTON_PLUS   0x0400

◆ CLASSIC_CTRL_BUTTON_RIGHT

#define CLASSIC_CTRL_BUTTON_RIGHT   0x8000

◆ CLASSIC_CTRL_BUTTON_UP

#define CLASSIC_CTRL_BUTTON_UP   0x0001

◆ CLASSIC_CTRL_BUTTON_X

#define CLASSIC_CTRL_BUTTON_X   0x0008

◆ CLASSIC_CTRL_BUTTON_Y

#define CLASSIC_CTRL_BUTTON_Y   0x0020

◆ CLASSIC_CTRL_BUTTON_ZL

#define CLASSIC_CTRL_BUTTON_ZL   0x0080

◆ CLASSIC_CTRL_BUTTON_ZR

#define CLASSIC_CTRL_BUTTON_ZR   0x0004

◆ EXP_CLASSIC

#define EXP_CLASSIC   2

◆ EXP_GUITAR_HERO_3

#define EXP_GUITAR_HERO_3   3

◆ EXP_MOTION_PLUS

#define EXP_MOTION_PLUS   5

◆ EXP_NONE

#define EXP_NONE   0

◆ EXP_NUNCHUK

#define EXP_NUNCHUK   1

◆ EXP_WII_BOARD

#define EXP_WII_BOARD   4

◆ GUITAR_HERO_3_BUTTON_ALL

#define GUITAR_HERO_3_BUTTON_ALL   0xFEFF

◆ GUITAR_HERO_3_BUTTON_BLUE

#define GUITAR_HERO_3_BUTTON_BLUE   0x0020

◆ GUITAR_HERO_3_BUTTON_GREEN

#define GUITAR_HERO_3_BUTTON_GREEN   0x0010

◆ GUITAR_HERO_3_BUTTON_MINUS

#define GUITAR_HERO_3_BUTTON_MINUS   0x1000

◆ GUITAR_HERO_3_BUTTON_ORANGE

#define GUITAR_HERO_3_BUTTON_ORANGE   0x0080

◆ GUITAR_HERO_3_BUTTON_PLUS

#define GUITAR_HERO_3_BUTTON_PLUS   0x0400

◆ GUITAR_HERO_3_BUTTON_RED

#define GUITAR_HERO_3_BUTTON_RED   0x0040

◆ GUITAR_HERO_3_BUTTON_STRUM_DOWN

#define GUITAR_HERO_3_BUTTON_STRUM_DOWN   0x4000

◆ GUITAR_HERO_3_BUTTON_STRUM_UP

#define GUITAR_HERO_3_BUTTON_STRUM_UP   0x0001

◆ GUITAR_HERO_3_BUTTON_YELLOW

#define GUITAR_HERO_3_BUTTON_YELLOW   0x0008

◆ GUITAR_HERO_3_TOUCH_AVAILABLE

#define GUITAR_HERO_3_TOUCH_AVAILABLE   0x1000

◆ GUITAR_HERO_3_TOUCH_BLUE

#define GUITAR_HERO_3_TOUCH_BLUE   0x1008

◆ GUITAR_HERO_3_TOUCH_GREEN

#define GUITAR_HERO_3_TOUCH_GREEN   0x1001

◆ GUITAR_HERO_3_TOUCH_ORANGE

#define GUITAR_HERO_3_TOUCH_ORANGE   0x1010

◆ GUITAR_HERO_3_TOUCH_RED

#define GUITAR_HERO_3_TOUCH_RED   0x1002

◆ GUITAR_HERO_3_TOUCH_YELLOW

#define GUITAR_HERO_3_TOUCH_YELLOW   0x1004

◆ IS_HELD

#define IS_HELD (   dev,
  button 
)    ((dev->btns_held & button) == button)

Check if a button is being held.

Parameters
devPointer to a wiimote_t or expansion structure.
buttonThe button you are interested in.
Returns
1 if the button is held, 0 if not.

◆ IS_JUST_PRESSED

#define IS_JUST_PRESSED (   dev,
  button 
)    (IS_PRESSED(dev, button) && !IS_HELD(dev, button))

Check if a button has just been pressed this event.

Parameters
devPointer to a wiimote_t or expansion structure.
buttonThe button you are interested in.
Returns
1 if the button is pressed, 0 if not.

◆ IS_PRESSED

#define IS_PRESSED (   dev,
  button 
)    ((dev->btns & button) == button)

Check if a button is pressed.

Parameters
devPointer to a wiimote_t or expansion structure.
buttonThe button you are interested in.
Returns
1 if the button is pressed, 0 if not.

◆ IS_RELEASED

#define IS_RELEASED (   dev,
  button 
)    ((dev->btns_released & button) == button)

Check if a button is released on this event.

This does not mean the button is not pressed, it means
this button was just now released.

Parameters
devPointer to a wiimote_t or expansion structure.
buttonThe button you are interested in.
Returns
1 if the button is released, 0 if not.

◆ MAX_PAYLOAD

#define MAX_PAYLOAD   32

◆ NUNCHUK_BUTTON_ALL

#define NUNCHUK_BUTTON_ALL   0x03

◆ NUNCHUK_BUTTON_C

#define NUNCHUK_BUTTON_C   0x02

◆ NUNCHUK_BUTTON_Z

#define NUNCHUK_BUTTON_Z   0x01

◆ WCONST

#define WCONST   const

◆ WIIMOTE_BUTTON_A

#define WIIMOTE_BUTTON_A   0x0008

◆ WIIMOTE_BUTTON_ALL

#define WIIMOTE_BUTTON_ALL   0x1F9F

◆ WIIMOTE_BUTTON_B

#define WIIMOTE_BUTTON_B   0x0004

◆ WIIMOTE_BUTTON_DOWN

#define WIIMOTE_BUTTON_DOWN   0x0400

◆ WIIMOTE_BUTTON_HOME

#define WIIMOTE_BUTTON_HOME   0x0080

◆ WIIMOTE_BUTTON_LEFT

#define WIIMOTE_BUTTON_LEFT   0x0100

◆ WIIMOTE_BUTTON_MINUS

#define WIIMOTE_BUTTON_MINUS   0x0010

◆ WIIMOTE_BUTTON_ONE

#define WIIMOTE_BUTTON_ONE   0x0002

◆ WIIMOTE_BUTTON_PLUS

#define WIIMOTE_BUTTON_PLUS   0x1000

◆ WIIMOTE_BUTTON_RIGHT

#define WIIMOTE_BUTTON_RIGHT   0x0200

◆ WIIMOTE_BUTTON_TWO

#define WIIMOTE_BUTTON_TWO   0x0001

◆ WIIMOTE_BUTTON_UNKNOWN

#define WIIMOTE_BUTTON_UNKNOWN   0x8000

◆ WIIMOTE_BUTTON_UP

#define WIIMOTE_BUTTON_UP   0x0800

◆ WIIMOTE_BUTTON_ZACCEL_BIT4

#define WIIMOTE_BUTTON_ZACCEL_BIT4   0x2000

◆ WIIMOTE_BUTTON_ZACCEL_BIT5

#define WIIMOTE_BUTTON_ZACCEL_BIT5   0x4000

◆ WIIMOTE_BUTTON_ZACCEL_BIT6

#define WIIMOTE_BUTTON_ZACCEL_BIT6   0x0020

◆ WIIMOTE_BUTTON_ZACCEL_BIT7

#define WIIMOTE_BUTTON_ZACCEL_BIT7   0x0040

◆ WIIMOTE_LED_1

#define WIIMOTE_LED_1   0x10

◆ WIIMOTE_LED_2

#define WIIMOTE_LED_2   0x20

◆ WIIMOTE_LED_3

#define WIIMOTE_LED_3   0x40

◆ WIIMOTE_LED_4

#define WIIMOTE_LED_4   0x80

◆ WIIMOTE_LED_NONE

#define WIIMOTE_LED_NONE   0x00

◆ WIIUSE_ACCEL_THRESH

#define WIIUSE_ACCEL_THRESH   0x04

◆ WIIUSE_CONTINUOUS

#define WIIUSE_CONTINUOUS   0x02

◆ WIIUSE_EXPORT

#define WIIUSE_EXPORT   WIIUSE_IMPORT_DECL

◆ WIIUSE_EXPORT_DECL

#define WIIUSE_EXPORT_DECL

◆ WIIUSE_GET_IR_SENSITIVITY

#define WIIUSE_GET_IR_SENSITIVITY (   dev,
  lvl 
)
Value:
do { \
if ((wm->state & 0x01000) == 0x01000) *lvl = 1; \
else if ((wm->state & 0x02000) == 0x02000) *lvl = 2; \
else if ((wm->state & 0x04000) == 0x04000) *lvl = 3; \
else if ((wm->state & 0x08000) == 0x08000) *lvl = 4; \
else if ((wm->state & 0x10000) == 0x10000) *lvl = 5; \
else *lvl = 0; \
} while (0)

Return the IR sensitivity level.

Parameters
wmPointer to a wiimote_t structure.
lvl[out] Pointer to an int that will hold the level setting. If no level is set 'lvl' will be set to 0.

◆ WIIUSE_IMPORT_DECL

#define WIIUSE_IMPORT_DECL

◆ WIIUSE_INIT_FLAGS

#define WIIUSE_INIT_FLAGS   WIIUSE_SMOOTHING

◆ WIIUSE_IR_THRESH

#define WIIUSE_IR_THRESH   0x08

◆ WIIUSE_IS_LED_SET

#define WIIUSE_IS_LED_SET (   wm,
  num 
)    ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num)

◆ WIIUSE_JS_THRESH

#define WIIUSE_JS_THRESH   0x10

◆ WIIUSE_ORIENT_PRECISION

#define WIIUSE_ORIENT_PRECISION   100.0f

◆ WIIUSE_SMOOTHING

#define WIIUSE_SMOOTHING   0x01

◆ WIIUSE_USING_ACC

#define WIIUSE_USING_ACC (   wm)    ((wm->state & 0x00100) == 0x00100)

◆ WIIUSE_USING_EXP

#define WIIUSE_USING_EXP (   wm)    ((wm->state & 0x00200) == 0x00200)

◆ WIIUSE_USING_IR

#define WIIUSE_USING_IR (   wm)    ((wm->state & 0x00400) == 0x00400)

◆ WIIUSE_USING_SPEAKER

#define WIIUSE_USING_SPEAKER (   wm)    ((wm->state & 0x00800) == 0x00800)

Typedef Documentation

◆ accel_t

typedef struct accel_t accel_t

◆ aspect_t

typedef enum aspect_t aspect_t

◆ classic_ctrl_t

◆ cmd_blk_cb

typedef void(* cmd_blk_cb) (struct wiimote_t *wm, ubyte *data, uword len)

◆ cmd_blk_s

typedef enum cmd_blk_s cmd_blk_s

◆ data_req_s

typedef enum data_req_s data_req_s

◆ expansion_t

typedef struct expansion_t expansion_t

◆ fdot_t

typedef struct fdot_t fdot_t

◆ gforce_t

typedef struct gforce_t gforce_t

◆ guitar_hero_3_t

◆ ir_dot_t

typedef struct ir_dot_t ir_dot_t

◆ ir_position_t

◆ ir_t

typedef struct ir_t ir_t

◆ joystick_t

typedef struct joystick_t joystick_t

◆ motion_plus_t

typedef struct motion_plus_t motion_plus_t

◆ nunchuk_t

typedef struct nunchuk_t nunchuk_t

◆ orient_t

typedef struct orient_t orient_t

◆ sb_t

typedef struct sb_t sb_t

◆ sbyte

typedef char sbyte

◆ sint

typedef char sint

◆ sword

typedef short sword

◆ ubyte

typedef unsigned char ubyte

◆ uint

typedef unsigned int uint

◆ uword

typedef unsigned short uword

◆ vec2b_t

typedef struct vec2b_t vec2b_t

◆ vec3b_t

typedef struct vec3b_t vec3b_t

◆ vec3f_t

typedef struct vec3f_t vec3f_t

◆ vec3w_t

typedef struct vec3w_t vec3w_t

◆ wii_board_t

typedef struct wii_board_t wii_board_t

◆ wiimote

typedef struct wiimote_t wiimote

◆ wiimote_state_t

◆ wiiuse_data_cb

typedef void(* wiiuse_data_cb) (struct wiimote_t *wm, ubyte *data, unsigned short len)

Callback that handles a read event.

Parameters
wmPointer to a wiimote_t structure.
dataPointer to the filled data block.
lenLength in bytes of the data block.
See also
wiiuse_init()

A registered function of this type is called automatically by the wiiuse library when the wiimote has returned the full data requested by a previous call to wiiuse_read_data().

◆ WIIUSE_EVENT_TYPE

◆ win_bt_stack_t

Enumeration Type Documentation

◆ aspect_t

enum aspect_t

Screen aspect ratio.

Enumerator
WIIUSE_ASPECT_4_3 
WIIUSE_ASPECT_16_9 

◆ cmd_blk_s

enum cmd_blk_s
Enumerator
CMD_READY 
CMD_SENT 
CMD_DONE 

◆ data_req_s

enum data_req_s
Enumerator
REQ_READY 
REQ_SENT 
REQ_DONE 

◆ ir_position_t

Enumerator
WIIUSE_IR_ABOVE 
WIIUSE_IR_BELOW 

◆ WIIUSE_EVENT_TYPE

Events that wiiuse can generate from a poll.

Enumerator
WIIUSE_NONE 
WIIUSE_EVENT 
WIIUSE_STATUS 
WIIUSE_CONNECT 
WIIUSE_DISCONNECT 
WIIUSE_UNEXPECTED_DISCONNECT 
WIIUSE_READ_DATA 
WIIUSE_ACK 
WIIUSE_NUNCHUK_INSERTED 
WIIUSE_NUNCHUK_REMOVED 
WIIUSE_CLASSIC_CTRL_INSERTED 
WIIUSE_CLASSIC_CTRL_REMOVED 
WIIUSE_GUITAR_HERO_3_CTRL_INSERTED 
WIIUSE_GUITAR_HERO_3_CTRL_REMOVED 
WIIUSE_WII_BOARD_INSERTED 
WIIUSE_WII_BOARD_REMOVED 
WIIUSE_MOTION_PLUS_ACTIVATED 
WIIUSE_MOTION_PLUS_REMOVED 

◆ win_bt_stack_t

Enumerator
WIIUSE_STACK_UNKNOWN 
WIIUSE_STACK_MS 
WIIUSE_STACK_BLUESOLEIL 

Function Documentation

◆ wiiuse_cleanup()

WIIUSE_EXPORT void wiiuse_cleanup ( struct wiimote_t **  wm,
int  wiimotes 
)

◆ wiiuse_connect()

WIIUSE_EXPORT int wiiuse_connect ( struct wiimote_t **  wm,
int  wiimotes 
)

◆ wiiuse_disconnect()

WIIUSE_EXPORT void wiiuse_disconnect ( struct wiimote_t wm)
Here is the caller graph for this function:

◆ wiiuse_disconnected()

WIIUSE_EXPORT void wiiuse_disconnected ( struct wiimote_t wm)

◆ wiiuse_find()

WIIUSE_EXPORT int wiiuse_find ( struct wiimote_t **  wm,
int  max_wiimotes,
int  timeout 
)

◆ wiiuse_get_by_id()

WIIUSE_EXPORT struct wiimote_t* wiiuse_get_by_id ( struct wiimote_t **  wm,
int  wiimotes,
int  unid 
)

◆ wiiuse_init()

WIIUSE_EXPORT struct wiimote_t** wiiuse_init ( int  wiimotes)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_motion_sensing()

WIIUSE_EXPORT void wiiuse_motion_sensing ( struct wiimote_t wm,
int  status 
)

Set if the wiimote should report motion sensing.

Parameters
wmPointer to a wiimote_t structure.
status1 to enable, 0 to disable.

Since reporting motion sensing sends a lot of data, the wiimote saves power by not transmitting it by default.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_poll()

WIIUSE_EXPORT int wiiuse_poll ( struct wiimote_t **  wm,
int  wiimotes 
)

◆ wiiuse_read_data()

WIIUSE_EXPORT int wiiuse_read_data ( struct wiimote_t wm,
ubyte buffer,
unsigned int  offset,
unsigned short  len,
cmd_blk_cb  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_resync()

WIIUSE_EXPORT void wiiuse_resync ( struct wiimote_t wm)

◆ wiiuse_rumble()

WIIUSE_EXPORT void wiiuse_rumble ( struct wiimote_t wm,
int  status 
)

◆ wiiuse_set_aspect_ratio()

WIIUSE_EXPORT void wiiuse_set_aspect_ratio ( struct wiimote_t wm,
enum aspect_t  aspect 
)

Set the aspect ratio of the TV/monitor.

Parameters
wmPointer to a wiimote_t structure.
aspectEither WIIUSE_ASPECT_16_9 or WIIUSE_ASPECT_4_3
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_bluetooth_stack()

WIIUSE_EXPORT void wiiuse_set_bluetooth_stack ( struct wiimote_t **  wm,
int  wiimotes,
enum win_bt_stack_t  type 
)

◆ wiiuse_set_flags()

WIIUSE_EXPORT int wiiuse_set_flags ( struct wiimote_t wm,
int  enable,
int  disable 
)

Set flags for the specified wiimote.

Parameters
wmPointer to a wiimote_t structure.
enableFlags to enable.
disableFlags to disable.
Returns
The flags set after 'enable' and 'disable' have been applied.

The values 'enable' and 'disable' may be any flags OR'ed together. Flags are defined in wiiuse.h.

Here is the caller graph for this function:

◆ wiiuse_set_ir()

WIIUSE_EXPORT void wiiuse_set_ir ( struct wiimote_t wm,
int  status 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_ir_mode()

WIIUSE_EXPORT void wiiuse_set_ir_mode ( struct wiimote_t wm)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_ir_position()

WIIUSE_EXPORT void wiiuse_set_ir_position ( struct wiimote_t wm,
enum ir_position_t  pos 
)

Set the XY position for the IR cursor.

Parameters
wmPointer to a wiimote_t structure.
Here is the caller graph for this function:

◆ wiiuse_set_ir_sensitivity()

WIIUSE_EXPORT void wiiuse_set_ir_sensitivity ( struct wiimote_t wm,
int  level 
)

Set the IR sensitivity.

Parameters
wmPointer to a wiimote_t structure.
level1-5, same as Wii system sensitivity setting.

If the level is < 1, then level will be set to 1. If the level is > 5, then level will be set to 5.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_ir_vres()

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.

Parameters
wmPointer to a wiimote_t structure.
status1 to enable, 0 to disable.
Here is the caller graph for this function:

◆ wiiuse_set_leds()

WIIUSE_EXPORT void wiiuse_set_leds ( struct wiimote_t wm,
int  leds,
cmd_blk_cb  cb 
)

Toggle the state of the rumble.

Parameters
wmPointer to a wiimote_t structure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_motion_plus()

WIIUSE_EXPORT void wiiuse_set_motion_plus ( struct wiimote_t wm,
int  status 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_smooth_alpha()

WIIUSE_EXPORT float wiiuse_set_smooth_alpha ( struct wiimote_t wm,
float  alpha 
)

◆ wiiuse_set_speaker()

WIIUSE_EXPORT void wiiuse_set_speaker ( struct wiimote_t wm,
int  status 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_set_timeout()

WIIUSE_EXPORT void wiiuse_set_timeout ( struct wiimote_t **  wm,
int  wiimotes,
ubyte  normal_timeout,
ubyte  exp_timeout 
)

◆ wiiuse_status()

WIIUSE_EXPORT void wiiuse_status ( struct wiimote_t wm,
cmd_blk_cb  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_toggle_rumble()

WIIUSE_EXPORT void wiiuse_toggle_rumble ( struct wiimote_t wm)

◆ wiiuse_version()

WIIUSE_EXPORT const char* wiiuse_version ( )

◆ wiiuse_write_data()

WIIUSE_EXPORT int wiiuse_write_data ( struct wiimote_t wm,
unsigned int  addr,
ubyte data,
ubyte  len,
cmd_blk_cb  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wiiuse_write_streamdata()

WIIUSE_EXPORT int wiiuse_write_streamdata ( struct wiimote_t wm,
ubyte data,
ubyte  len,
cmd_blk_cb  cb 
)
Here is the call graph for this function: