PMICSetGainAsync

Syntax

#include <revolution/pmic.h>

// Mic(ADC) Gain
#define PMIC_GAIN_00dB               0x0000
#define PMIC_GAIN_15dB               0x0001
#define PMIC_GAIN_30dB               0x0002
#define PMIC_GAIN_36dB               0x0003

typedef void (*PMICCallback)(PMIC_ERR result, void* arg);

PMIC_ERR PMICSetGainAsync(u16 gain, PMICCallback cb, void* arg);

Arguments

gain Gain of the Wii Speak.
cb Callback function that will send notification of the execution results of this function.
arg Passed as the second argument of the callback function above.

Return Values

Returns one of the following.

PMIC_ERR_OK The function has been called normally.
PMIC_ERR_INVALID_ARGUMENTS The correct argument was not passed.
PMIC_ERR_INVALID_STATE The Wii Speak is not open.
PMIC_ERR_BUSY Cannot register the command. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

Description

Asynchronously sets the gain of the Wii Speak.

The gain is specified in the gain argument. You can set a gain of +0 dB, +15 dB, +30 dB, or +36 dB. Specify PMIC_GAIN_00dB for a gain of +0 dB, PMIC_GAIN_15dB for a gain of +15 dB, PMIC_GAIN_30dB for a gain of +30 dB, or PMIC_GAIN_36dB for a gain of +36 dB. The Wii Speak default gain setting is +36 dB.

This function can be called when the Wii Speak is in the STOP state.

One of the following is passed to result, the callback function's first argument.

PMIC_ERR_OK The gain has been set successfully.
PMIC_ERR_NO_DEVICE The Wii Speak has been unplugged.
PMIC_ERR_INVALID_STATE The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)
PMIC_ERR_USB_ERROR An error occurred in USB communications. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

See Also

Revision History

2008/10/24 Added Description.
2008/10/23 Revised Description.
2008/06/09 Initial version.


CONFIDENTIAL