#include <cafe/uac.h>

int UACOpen(usb_mic_handle_t h_mic, mem_res_t* p_mem_res, usb_mic_ringbuffer_t* prb);


h_mic Instance handle returned via usb_event_data_t data structure through the event handler of type usb_event_handler_t that is provided as an argument to UACInit and will contain a valid instance handle when the UAC device is attached.
p_mem_res A pointer to a structure of type mem_res_t. Deprecated. The number of resources returned by UACOpenQuery is always zero.
prb A pointer to a ringbuffer structure of type usb_mic_ringbuffer_t. The minimal alignment of the memory buffer is 4 bytes. This memory may be used for DMA by the AX subsystem if the input device is monophonic.

Return Values

A value of zero indicates success and any other value the type of error that was encountered.


Calling this function will prepare the UAC stack and put it into a state of readiness. This function will only succeed if sufficient memory resources and ring buffer are provided. All resources referenced in calling UACOpen must remain allocated and accessible to the UAC stack until UACClose or UACUninit is called. Only the memory referenced in the ring buffer is shared between the UAC stack and the hierarchically higher level process. All other memory resources are for the exclusive use of the USB UAC stack.

The streaming of PCM data does not start until UACINStart is called to receive an input stream, or UACOUTStart is called to send an output stream.

This function can be called from the event handler that was provided with UACInit.

This function is affected by foreground/background switching. Upon releasing foreground, an application is required to call UACINStop, and/or UACOUTStop, UACClose, and UACUninit to fully shut down the UAC driver stack. When foreground status is reacquired, an application needs to go through the sequence of UACInit and device discovery again.

This function requires several milliseconds to complete, although much of that time is spent waiting on synchronization objects. It is not recommended to call this function from a timing sensitive thread.

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.

See Also

Error Codes

Revision History

2013/05/29 Initial version.