PMICOpen

Syntax

#include <revolution/pmic.h>

PMIC_ERR PMICOpen(void);

Arguments

None.

Return Values

Returns one of the following.

PMIC_ERR_OK The Wii Speak has been opened successfully.
PMIC_ERR_NO_DEVICE The Wii Speak has been unplugged.
PMIC_ERR_INVALID_STATE Either the PMIC library is not initialized, or the Wii Speak cable is not inserted in the USB port.
PMIC_ERR_BUSY The state is in transition. Call the function again.
PMIC_ERR_USB_ERROR An error occurred in USB communications. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

Description

Opens the Wii Speak synchronously.

If the Wii Speak is successfully opened, its microphone transitions to the stopped state. You can set operating parameters, start the microphone, and perform various other operations on the Wii Speak while the microphone is stopped.

The library prepares to recognize the Wii Speak by calling the PMICProbe function first after calling the PMICInit function. Therefore, after calling the PMICInit function, always call the PMICProbe function once before calling this function.

Also, even if the Wii Speak is connected, if you call this function before the library recognizes the Wii Speak and PMIC_ERR_OK is returned for the PMICProbe function, this function returns PMIC_ERR_INVALID_STATE (in rare cases, PMIC_ERR_BUSY). In such cases, call this function after waiting a while until the PMIC_ERR_OK value is returned for the PMICProbe function.

This function cannot be called in an interrupt handler or alarm callback.

After the Wii Speak is opened, the error notification callback registered by the PMICRegisterErrorCallback function is enabled.

Note: Do not quit an application while the Wii Speak is still open. Always call the PMICCloseAsync or PMICClose function to close the Wii Speak before exiting an application.

See Also

PMICInit
PMICProbe
PMICRegisterErrorCallback
PMICCloseAsync
PMICClose

Revision History

2009/06/17 Revised description related to calling the PMICProbe function.
2009/06/01 Added description related to calling PMICProbe.
2008/12/22 Changed the error codes.
2008/11/04 Added Description.
2008/10/24 Revised Description.
2008/10/23 Revised Return Values.
2008/10/22 Added note.
2008/09/25 Added Return Values.
2008/03/04 Changed the function reference format.
2008/01/25 Initial version.


CONFIDENTIAL