#include <cafe/pads/kpad/kpad.h>

void KPADEnableMpls( s32 chan, u8 mode );


chan One of the WPAD_CHANn values.

Return Values



Calling this function issues a request that the Wii MotionPlus operate in the operational mode specified by mode. The library attempts to issue an operational-mode-change request if the Wii MotionPlus operational mode differs from the mode specified when data was received from the Wii remote. If issuing the request fails, the system tries again the next time data is received.

To prevent Wii MotionPlus from interfering with Wii remote audio or with non-MPLS controllers like the URCC, only enable Wii MotionPlus if the controller supports Wii MotionPlus. A good way to do this is to set a WPADIsMplsAttached callback function from within the connection callback, and let your mplsAttachedCallback function catch the result. When your mplsAttachedCallback is called, and if Wii MotionPlus is attached, then enable Wii MotionPlus at that time.

The only case where you will need to disable Wii MotionPlus is if the MPLS extension is removed from a connected Wii remote. Detect this case by registering a KPADSetControlMplsCallback function. If the controlMplsCallback function is called with a reason of FAIL, then Wii MotionPlus is not working with the current controller, and KPADDisableMpls should be called.

Also, adding an Wii MotionPlus extension to a connected Wii remote is not detected, either as change in the device type, via a connection callback, or via an extension callback. (It is detected correctly if the extension is present at the time of connection.) If your application requires Wii MotionPlus and the controller does not have the extension, you should periodically poll the state using the WPADIsMplsAttached function and callback. After the Wii MotionPlus extension is attached, KPADEnableMpls can be called.

For a design reference, see the KPAD demo urcc_mpls.

From the viewpoint of battery consumption, it is prohibited to turn on MotionPlus functionality in applications that do not use it.
Overlay applications should not call this function since it might reset the calibration status that games are using.

Do Not Call From

Background Do not call this function from the background.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Multiple Cores Do not call this function from more than one Core.

See Also


Revision History

2013/05/08 Automated cleanup pass.
2013/02/19 Updated description, adding ref to KPADSetControlMplsCallback and WPADIsMplsAttached.
2012/12/14 Added an instruction when using devices without mpls.
2012/06/28 Removed deprecated WPADControlMpls function.
2010/06/23 Added text about the state where audio output commands cannot be sent to the Wii remote speaker.
2008/12/04 Deleted a description of the KPADSetConfig function.
2008/12/04 Added WPAD_MPLS_CL as a selection for mode.
2008/07/22 Initial version.