|
wiiuse
|
Classes | |
| struct | read_req_t |
| Data read request structure. More... | |
| struct | ang3s_t |
| Roll/Pitch/Yaw short angles. More... | |
| struct | ang3f_t |
| Roll/Pitch/Yaw float angles. More... | |
| struct | vec2b_t |
| Unsigned x,y byte vector. More... | |
| struct | vec3b_t |
| Unsigned x,y,z byte vector. More... | |
| 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. More... | |
| struct | ir_dot_t |
| A single IR source. More... | |
| struct | ir_t |
| IR struct. 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 | motion_plus_t |
| Motion Plus expansion device. More... | |
| struct | tatacon_t |
| Tatacon expansion device. More... | |
| struct | wii_board_t |
| Wii Balance Board "expansion" device. More... | |
| struct | expansion_t |
| Generic expansion device plugged into wiimote. More... | |
| struct | wiimote_state_t |
| Significant data from the previous event. More... | |
| struct | wiimote_t |
| Main Wiimote device structure. More... | |
| struct | wiimote_callback_data_t |
| Data passed to a callback during wiiuse_update() More... | |
| struct | data_req_t |
| Data write request structure. More... | |
Macros | |
| #define | WIIUSE_SYNC_HANDSHAKE |
| #define | WIIUSE_EXPORT_DECL |
| #define | WIIUSE_IMPORT_DECL |
| #define | WIIUSE_EXPORT WIIUSE_IMPORT_DECL |
| #define | WIIUSE_HAS_OUTPUT_REDIRECTION |
| Define indicating the presence of the feature allowing you to redirect output for one or more logging levels within the library. | |
Typedefs | |
| typedef enum ir_position_t | ir_position_t |
| IR correction types. | |
| typedef unsigned char | byte |
| typedef char | sbyte |
| typedef void(* | wiiuse_read_cb) (struct wiimote_t *wm, byte *data, uint16_t len) |
| Callback that handles a read event. More... | |
| typedef struct ang3s_t | ang3s_t |
| typedef struct ang3f_t | ang3f_t |
| typedef struct vec2b_t | vec2b_t |
| Unsigned x,y byte vector. | |
| typedef struct vec3b_t | vec3b_t |
| Unsigned x,y,z byte vector. | |
| typedef struct vec3f_t | vec3f_t |
| Signed x,y,z float struct. | |
| typedef struct orient_t | orient_t |
| Orientation struct. More... | |
| typedef struct gforce_t | gforce_t |
| Gravity force struct. | |
| typedef struct accel_t | accel_t |
| Accelerometer struct. More... | |
| typedef struct ir_dot_t | ir_dot_t |
| A single IR source. | |
| typedef enum aspect_t | aspect_t |
| Screen aspect ratio. | |
| typedef struct ir_t | ir_t |
| IR struct. More... | |
| typedef struct joystick_t | joystick_t |
| Joystick calibration structure. More... | |
| typedef struct nunchuk_t | nunchuk_t |
| Nunchuk expansion device. | |
| typedef struct classic_ctrl_t | classic_ctrl_t |
| Classic controller expansion device. | |
| typedef struct guitar_hero_3_t | guitar_hero_3_t |
| Guitar Hero 3 expansion device. | |
| typedef struct motion_plus_t | motion_plus_t |
| Motion Plus expansion device. | |
| typedef struct tatacon_t | tatacon_t |
| Tatacon expansion device. | |
| typedef struct wii_board_t | wii_board_t |
| Wii Balance Board "expansion" device. More... | |
| typedef struct expansion_t | expansion_t |
| Generic expansion device plugged into wiimote. | |
| typedef enum win_bt_stack_t | win_bt_stack_t |
| Available bluetooth stacks for Windows. | |
| typedef struct wiimote_state_t | wiimote_state_t |
| Significant data from the previous event. | |
| typedef enum WIIUSE_EVENT_TYPE | WIIUSE_EVENT_TYPE |
| Events that wiiuse can generate from a poll. | |
| typedef enum WIIUSE_WIIMOTE_TYPE | WIIUSE_WIIMOTE_TYPE |
| Type of wiimote peripheral. | |
| typedef struct wiimote_t | wiimote |
| Main Wiimote device structure. More... | |
| typedef struct wiimote_callback_data_t | wiimote_callback_data_t |
| Data passed to a callback during wiiuse_update() | |
| typedef void(* | wiiuse_update_cb) (struct wiimote_callback_data_t *wm) |
| Callback type. | |
| typedef void(* | wiiuse_write_cb) (struct wiimote_t *wm, unsigned char *data, unsigned short len) |
| Callback that handles a write event. More... | |
| typedef enum data_req_s | data_req_s |
| typedef enum wiiuse_loglevel | wiiuse_loglevel |
| Loglevels supported by wiiuse. | |
Enumerations | |
| enum | ir_position_t { WIIUSE_IR_ABOVE, WIIUSE_IR_BELOW } |
| IR correction types. | |
| enum | aspect_t { WIIUSE_ASPECT_4_3, WIIUSE_ASPECT_16_9 } |
| Screen aspect ratio. | |
| enum | win_bt_stack_t { WIIUSE_STACK_UNKNOWN, WIIUSE_STACK_MS, WIIUSE_STACK_BLUESOLEIL } |
| Available bluetooth stacks for Windows. | |
| enum | WIIUSE_EVENT_TYPE { WIIUSE_NONE = 0, WIIUSE_EVENT, WIIUSE_STATUS, WIIUSE_CONNECT, WIIUSE_DISCONNECT, WIIUSE_UNEXPECTED_DISCONNECT, WIIUSE_READ_DATA, WIIUSE_WRITE_DATA, 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_CTRL_INSERTED, WIIUSE_WII_BOARD_CTRL_REMOVED, WIIUSE_MOTION_PLUS_ACTIVATED, WIIUSE_MOTION_PLUS_REMOVED, WIIUSE_TATACON_CTRL_INSERTED, WIIUSE_TATACON_CTRL_REMOVED } |
| Events that wiiuse can generate from a poll. | |
| enum | WIIUSE_WIIMOTE_TYPE { WIIUSE_WIIMOTE_REGULAR = 0, WIIUSE_WIIMOTE_MOTION_PLUS_INSIDE } |
| Type of wiimote peripheral. | |
| enum | data_req_s { REQ_READY = 0, REQ_SENT, REQ_DONE } |
| enum | wiiuse_loglevel { LOGLEVEL_ERROR = 0, LOGLEVEL_WARNING = 1, LOGLEVEL_INFO = 2, LOGLEVEL_DEBUG = 3 } |
| Loglevels supported by wiiuse. | |
Functions | |
| WIIUSE_EXPORT const char * | wiiuse_version () |
| Returns the version of the library. | |
| WIIUSE_EXPORT void | wiiuse_set_output (enum wiiuse_loglevel loglevel, FILE *logtarget) |
| Specify an alternate FILE stream for a log level. More... | |
| WIIUSE_EXPORT struct wiimote_t ** | wiiuse_init (int wiimotes) |
| Initialize an array of wiimote structures. More... | |
| WIIUSE_EXPORT void | wiiuse_disconnected (struct wiimote_t *wm) |
| The wiimote disconnected. More... | |
| WIIUSE_EXPORT void | wiiuse_cleanup (struct wiimote_t **wm, int wiimotes) |
| Clean up wiimote_t array created by wiiuse_init() | |
| WIIUSE_EXPORT void | wiiuse_rumble (struct wiimote_t *wm, int status) |
| Enable or disable the rumble. More... | |
| WIIUSE_EXPORT void | wiiuse_toggle_rumble (struct wiimote_t *wm) |
| Toggle the state of the rumble. More... | |
| WIIUSE_EXPORT void | wiiuse_set_leds (struct wiimote_t *wm, int leds) |
| Set the enabled LEDs. 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, byte *buffer, unsigned int offset, uint16_t len) |
| Read data from the wiimote (event version). More... | |
| WIIUSE_EXPORT int | wiiuse_write_data (struct wiimote_t *wm, unsigned int addr, const byte *data, byte len) |
| Write data to the wiimote. More... | |
| WIIUSE_EXPORT void | wiiuse_status (struct wiimote_t *wm) |
| Request the wiimote controller status. More... | |
| 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. More... | |
| 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) |
| Set the wiimote smoothing alpha value. More... | |
| 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. More... | |
| WIIUSE_EXPORT void | wiiuse_set_orient_threshold (struct wiimote_t *wm, float threshold) |
| Set the orientation event threshold. More... | |
| WIIUSE_EXPORT void | wiiuse_resync (struct wiimote_t *wm) |
| Try to resync with the wiimote by starting a new handshake. More... | |
| 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. More... | |
| WIIUSE_EXPORT void | wiiuse_set_accel_threshold (struct wiimote_t *wm, int threshold) |
| Set the accelerometer event threshold. More... | |
| 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. More... | |
| WIIUSE_EXPORT int | wiiuse_find (struct wiimote_t **wm, int max_wiimotes, int timeout) |
| Find a wiimote or wiimotes. More... | |
| WIIUSE_EXPORT int | wiiuse_connect (struct wiimote_t **wm, int wiimotes) |
| Connect to a wiimote or wiimotes once an address is known. More... | |
| WIIUSE_EXPORT void | wiiuse_disconnect (struct wiimote_t *wm) |
| Disconnect a wiimote. More... | |
| WIIUSE_EXPORT int | wiiuse_poll (struct wiimote_t **wm, int wiimotes) |
| Poll the wiimotes for any events. More... | |
| 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. More... | |
| WIIUSE_EXPORT void | wiiuse_set_ir (struct wiimote_t *wm, int status) |
| Set if the wiimote should track IR targets. More... | |
| 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_nunchuk_orient_threshold (struct wiimote_t *wm, float threshold) |
| Set the orientation event threshold for the nunchuk. More... | |
| WIIUSE_EXPORT void | wiiuse_set_nunchuk_accel_threshold (struct wiimote_t *wm, int threshold) |
| Set the accelerometer event threshold for the nunchuk. More... | |
| WIIUSE_EXPORT void | wiiuse_set_wii_board_calib (struct wiimote_t *wm) |
| Calib wii board. More... | |
| WIIUSE_EXPORT void | wiiuse_set_motion_plus (struct wiimote_t *wm, int status) |
| Enable/disable Motion+ expansion. More... | |
LED bit masks | |
| #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 |
Nunchuk button codes | |
| #define | NUNCHUK_BUTTON_Z 0x01 |
| #define | NUNCHUK_BUTTON_C 0x02 |
| #define | NUNCHUK_BUTTON_ALL 0x03 |
Device Inquiry Macros | |
| #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. 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(wm, lvl) |
| Return the IR sensitivity level. More... | |
| #define | WIIUSE_USING_ACC(wm) ((wm->state & 0x020) == 0x020) |
| #define | WIIUSE_USING_EXP(wm) ((wm->state & 0x040) == 0x040) |
| #define | WIIUSE_USING_IR(wm) ((wm->state & 0x080) == 0x080) |
| #define | WIIUSE_USING_SPEAKER(wm) ((wm->state & 0x100) == 0x100) |
| #define | WIIUSE_IS_LED_SET(wm, num) ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num) |
| #define IS_HELD | ( | dev, | |
| button | |||
| ) | ((dev->btns_held & button) == button) |
Check if a button is being held.
| dev | Pointer to a wiimote_t or expansion structure. |
| button | The button you are interested in. |
| #define IS_JUST_PRESSED | ( | dev, | |
| button | |||
| ) | (IS_PRESSED(dev, button) && !IS_HELD(dev, button)) |
Check if a button has just been pressed this event.
| dev | Pointer to a wiimote_t or expansion structure. |
| button | The button you are interested in. |
| #define IS_PRESSED | ( | dev, | |
| button | |||
| ) | ((dev->btns & button) == button) |
Check if a button is pressed.
| dev | Pointer to a wiimote_t or expansion structure. |
| button | The button you are interested in. |
| #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.
| dev | Pointer to a wiimote_t or expansion structure. |
| button | The button you are interested in. |
| #define WIIUSE_GET_IR_SENSITIVITY | ( | wm, | |
| lvl | |||
| ) |
Return the IR sensitivity level.
| wm | Pointer 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. |
| typedef struct joystick_t joystick_t |
Joystick calibration structure.
The angle ang is relative to the positive y-axis into quadrant I and ranges from 0 to 360 degrees. So if the joystick is held straight upwards then angle is 0 degrees. If it is held to the right it is 90, down is 180, and left is 270.
The magnitude mag is the distance from the center to where the joystick is being held. The magnitude ranges from 0 to 1. If the joystick is only slightly tilted from the center the magnitude will be low, but if it is closer to the outter edge the value will be higher.
Orientation struct.
Yaw, pitch, and roll range from -180 to 180 degrees.
| typedef struct wii_board_t wii_board_t |
Wii Balance Board "expansion" device.
A Balance Board presents itself as a Wiimote with a permanently-attached Balance Board expansion device.
Main Wiimote device structure.
You need one of these to do pretty much anything with this library.
| typedef void(* wiiuse_read_cb) (struct wiimote_t *wm, byte *data, uint16_t len) |
Callback that handles a read event.
| wm | Pointer to a wiimote_t structure. |
| data | Pointer to the filled data block. |
| len | Length in bytes of the data block. |
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().
| typedef void(* wiiuse_write_cb) (struct wiimote_t *wm, unsigned char *data, unsigned short len) |
Callback that handles a write event.
| wm | Pointer to a wiimote_t structure. |
| data | Pointer to the sent data block. |
| len | Length in bytes of the data block. |
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_write_data().
| WIIUSE_EXPORT int wiiuse_connect | ( | struct wiimote_t ** | wm, |
| int | wiimotes | ||
| ) |
Connect to a wiimote or wiimotes once an address is known.
| wm | An array of wiimote_t structures. |
| wiimotes | The number of wiimote structures in wm. |
Connect to a number of wiimotes when the address is already set in the wiimote_t structures. These addresses are normally set by the wiiuse_find() function, but can also be set manually.
This function only delegates to the platform-specific implementation wiiuse_os_connect.
This function is declared in wiiuse.h
| WIIUSE_EXPORT void wiiuse_disconnect | ( | struct wiimote_t * | wm | ) |
Disconnect a wiimote.
| wm | Pointer to a wiimote_t structure. |
Note that this will not free the wiimote structure.
This function only delegates to the platform-specific implementation wiiuse_os_disconnect.
This function is declared in wiiuse.h
| WIIUSE_EXPORT void wiiuse_disconnected | ( | struct wiimote_t * | wm | ) |
The wiimote disconnected.
| wm | Pointer to a wiimote_t structure. |
| WIIUSE_EXPORT int wiiuse_find | ( | struct wiimote_t ** | wm, |
| int | max_wiimotes, | ||
| int | timeout | ||
| ) |
Find a wiimote or wiimotes.
| wm | An array of wiimote_t structures. |
| max_wiimotes | The number of wiimote structures in wm. |
| timeout | The number of seconds before the search times out. |
This function will only look for wiimote devices.
When a device is found the address in the structures will be set.
You can then call wiiuse_connect() to connect to the found
devices.
This function only delegates to the platform-specific implementation wiiuse_os_find.
This function is declared in wiiuse.h
| WIIUSE_EXPORT struct wiimote_t** wiiuse_init | ( | int | wiimotes | ) |
Initialize an array of wiimote structures.
| wiimotes | Number of wiimote_t structures to create. |
The array returned by this function can be passed to various functions, including wiiuse_connect().
| WIIUSE_EXPORT void wiiuse_motion_sensing | ( | struct wiimote_t * | wm, |
| int | status | ||
| ) |
Set if the wiimote should report motion sensing.
| wm | Pointer to a wiimote_t structure. |
| status | 1 to enable, 0 to disable. |
Since reporting motion sensing sends a lot of data, the wiimote saves power by not transmitting it by default.
| WIIUSE_EXPORT int wiiuse_poll | ( | struct wiimote_t ** | wm, |
| int | wiimotes | ||
| ) |
Poll the wiimotes for any events.
| wm | An array of pointers to wiimote_t structures. |
| wiimotes | The number of wiimote_t structures in the wm array. |
It is necessary to poll the wiimote devices for events that occur. If an event occurs on a particular wiimote, the event variable will be set.
| WIIUSE_EXPORT int wiiuse_read_data | ( | struct wiimote_t * | wm, |
| byte * | buffer, | ||
| unsigned int | addr, | ||
| uint16_t | len | ||
| ) |
Read data from the wiimote (event version).
| wm | Pointer to a wiimote_t structure. |
| buffer | An allocated buffer to store the data as it arrives from the wiimote. Must be persistent in memory and large enough to hold the data. |
| addr | The address of wiimote memory to read from. |
| len | The length of the block to be read. |
The library can only handle one data read request at a time because it must keep track of the buffer and other events that are specific to that request. So if a request has already been made, subsequent requests will be added to a pending list and be sent out when the previous finishes.
| WIIUSE_EXPORT void wiiuse_resync | ( | struct wiimote_t * | wm | ) |
Try to resync with the wiimote by starting a new handshake.
| wm | Pointer to a wiimote_t structure. |
| WIIUSE_EXPORT void wiiuse_rumble | ( | struct wiimote_t * | wm, |
| int | status | ||
| ) |
Enable or disable the rumble.
| wm | Pointer to a wiimote_t structure. |
| status | 1 to enable, 0 to disable. |
| WIIUSE_EXPORT void wiiuse_set_accel_threshold | ( | struct wiimote_t * | wm, |
| int | threshold | ||
| ) |
Set the accelerometer event threshold.
| wm | Pointer to a wiimote_t structure. |
| threshold | The decimal place that should be considered a significant change. |
Set the aspect ratio of the TV/monitor.
| wm | Pointer to a wiimote_t structure. |
| aspect | Either WIIUSE_ASPECT_16_9 or WIIUSE_ASPECT_4_3 |
| 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.
| wm | Array of wiimote_t structures. |
| wiimotes | Number of objects in the wm array. |
| type | The type of bluetooth stack to use. |
| WIIUSE_EXPORT int wiiuse_set_flags | ( | struct wiimote_t * | wm, |
| int | enable, | ||
| int | disable | ||
| ) |
| WIIUSE_EXPORT void wiiuse_set_ir | ( | struct wiimote_t * | wm, |
| int | status | ||
| ) |
Set if the wiimote should track IR targets.
| wm | Pointer to a wiimote_t structure. |
| status | 1 to enable, 0 to disable. |
| WIIUSE_EXPORT void wiiuse_set_ir_position | ( | struct wiimote_t * | wm, |
| enum ir_position_t | pos | ||
| ) |
Set the XY position for the IR cursor.
| wm | Pointer to a wiimote_t structure. |
| WIIUSE_EXPORT void wiiuse_set_ir_sensitivity | ( | struct wiimote_t * | wm, |
| int | level | ||
| ) |
Set the IR sensitivity.
| wm | Pointer to a wiimote_t structure. |
| level | 1-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.
| 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.
| wm | Pointer to a wiimote_t structure. |
| status | 1 to enable, 0 to disable. |
| WIIUSE_EXPORT void wiiuse_set_leds | ( | struct wiimote_t * | wm, |
| int | leds | ||
| ) |
Set the enabled LEDs.
| wm | Pointer to a wiimote_t structure. |
| leds | What LEDs to enable. |
leds is a bitwise or of WIIMOTE_LED_1, WIIMOTE_LED_2, WIIMOTE_LED_3, or WIIMOTE_LED_4.
| WIIUSE_EXPORT void wiiuse_set_motion_plus | ( | struct wiimote_t * | wm, |
| int | status | ||
| ) |
Enable/disable Motion+ expansion.
| wm | Pointer to the wiimote with Motion+ |
| status | 0 - off, 1 - on, standalone, 2 - nunchuk pass-through |
| WIIUSE_EXPORT void wiiuse_set_nunchuk_accel_threshold | ( | struct wiimote_t * | wm, |
| int | threshold | ||
| ) |
Set the accelerometer event threshold for the nunchuk.
| wm | Pointer to a wiimote_t structure with a nunchuk attached. |
| threshold | The decimal place that should be considered a significant change. |
See wiiuse_set_orient_threshold() for details.
| WIIUSE_EXPORT void wiiuse_set_nunchuk_orient_threshold | ( | struct wiimote_t * | wm, |
| float | threshold | ||
| ) |
Set the orientation event threshold for the nunchuk.
| wm | Pointer to a wiimote_t structure with a nunchuk attached. |
| threshold | The decimal place that should be considered a significant change. |
See wiiuse_set_orient_threshold() for details.
| WIIUSE_EXPORT void wiiuse_set_orient_threshold | ( | struct wiimote_t * | wm, |
| float | threshold | ||
| ) |
Set the orientation event threshold.
| wm | Pointer to a wiimote_t structure. |
| threshold | The decimal place that should be considered a significant change. |
If threshold is 0.01, and any angle changes by 0.01 then a significant change has occurred and the event callback will be invoked. If threshold is 1 then the angle has to change by a full degree to generate an event.
| WIIUSE_EXPORT void wiiuse_set_output | ( | enum wiiuse_loglevel | loglevel, |
| FILE * | logfile | ||
| ) |
Specify an alternate FILE stream for a log level.
| loglevel | The loglevel, for which the output should be set. |
| logfile | A valid, writeable FILE*, or 0, if output should be disabled. |
The default FILE* for all loglevels is stderr
| WIIUSE_EXPORT float wiiuse_set_smooth_alpha | ( | struct wiimote_t * | wm, |
| float | alpha | ||
| ) |
Set the wiimote smoothing alpha value.
| wm | Pointer to a wiimote_t structure. |
| alpha | The alpha value to set. Between 0 and 1. |
The alpha value is between 0 and 1 and is used in an exponential smoothing algorithm.
Smoothing is only performed if the WIIMOTE_USE_SMOOTHING is set.
| 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.
| wm | Array of wiimote_t structures. |
| wiimotes | Number of objects in the wm array. |
| normal_timeout | The timeout in milliseconds for a normal read. |
| exp_timeout | The timeout in millisecondsd to wait for an expansion handshake. |
| WIIUSE_EXPORT void wiiuse_set_wii_board_calib | ( | struct wiimote_t * | wm | ) |
Calib wii board.
| wm | Pointer to a wiimote_t struct the calib values are used. |
| WIIUSE_EXPORT void wiiuse_status | ( | struct wiimote_t * | wm | ) |
Request the wiimote controller status.
| wm | Pointer to a wiimote_t structure. |
Controller status includes: battery level, LED status, expansions
| WIIUSE_EXPORT void wiiuse_toggle_rumble | ( | struct wiimote_t * | wm | ) |
Toggle the state of the rumble.
| wm | Pointer to a wiimote_t structure. |
| 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.
Alternative to calling wiiuse_poll yourself, and provides the same information struct on all platforms.
| 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.
| wm | Pointer to a wiimote_t structure. |
| enabled | enabled != 0 -> use report 0x32 |
| WIIUSE_EXPORT int wiiuse_write_data | ( | struct wiimote_t * | wm, |
| unsigned int | addr, | ||
| const byte * | data, | ||
| byte | len | ||
| ) |
Write data to the wiimote.
| wm | Pointer to a wiimote_t structure. |
| addr | The address to write to. |
| data | The data to be written to the memory location. |
| len | The length of the block to be written. |
1.8.13