![]() |
NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
|
Functions | |
void | UAC_Init (void) |
Initialize this USB Audio Class driver. More... | |
UAC_DEV_T * | UAC_GetDeviceList (void) |
Get a list of currently connected USB Audio Class devices. More... | |
int32_t | UAC_GetChannelNumber (UAC_DEV_T *audev, uint8_t target) |
Obtain Audio Class device's channel number. More... | |
int32_t | UAC_GetBitResolution (UAC_DEV_T *audev, uint8_t target, uint8_t *byte_cnt) |
Obtain Audio Class device subframe bit resolution.. More... | |
int32_t | UAC_GetSamplingRate (UAC_DEV_T *audev, uint8_t target, uint32_t *srate_list, int max_cnt, uint8_t *type) |
Get a list of sampling rate frequences supported by the UAC device. More... | |
int32_t | UAC_MuteControl (UAC_DEV_T *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *mute) |
Control Audio Class device mute on/off. More... | |
int32_t | UAC_VolumeControl (UAC_DEV_T *audev, uint8_t target, uint8_t req, uint16_t chn, uint16_t *volume) |
Audio Class device volume control. More... | |
int32_t | UAC_AutoGainControl (UAC_DEV_T *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *mute) |
Audio Class device automatic gain control. More... | |
int32_t | UAC_SamplingRateControl (UAC_DEV_T *audev, uint8_t target, uint8_t req, uint32_t *srate) |
Set sampling rate frequency. More... | |
int32_t | UAC_InstallIsoInCbFun (UAC_DEV_T *audev, uint8_t *au_in_buff, int bufsiz, UAC_CB_FUNC *func) |
Install isochronous-in (microphone) callback function. Received audio data from UAC device will be delivered to user application by this callback function. More... | |
int32_t | UAC_StartIsoInPipe (UAC_DEV_T *audev) |
Start to receive audio data from UAC device via isochronous in pipe. More... | |
int32_t | UAC_StopIsoInPipe (UAC_DEV_T *audev) |
Stop UAC device audio in data stream. More... | |
int32_t | UAC_InstallIsoOutCbFun (UAC_DEV_T *audev, UAC_CB_FUNC *func) |
Install isochronous-out (speaker) callback function. The UAC driver will call the callback function to request one audio out packet from user application. UAC driver will then send this packet to UAC device via isochronous out pipe. More... | |
int32_t | UAC_StartIsoOutPipe (UAC_DEV_T *audev) |
Start to send audio data to UAC device via isochronous out pipe. More... | |
int32_t | UAC_StopIsoOutPipe (UAC_DEV_T *audev) |
Stop UAC device audio out data stream. More... | |
Variables | |
USB_DEV_T * | uac_dev_t::udev |
int | uac_dev_t::ctrl_ifnum |
int | uac_dev_t::au_in_ifnum |
int | uac_dev_t::au_out_ifnum |
void * | uac_dev_t::priv |
struct uac_dev_t * | uac_dev_t::next |
EP_INFO_T * | uac_dev_t::ep_au_in |
EP_INFO_T * | uac_dev_t::ep_au_out |
URB_T * | uac_dev_t::urbin [ISO_IN_URB_CNT] |
URB_T * | uac_dev_t::urbout [ISO_OUT_URB_CNT] |
uint8_t | uac_dev_t::iso_inbuf [ISO_IN_URB_CNT][AU_IN_MAX_PKTSZ *ISO_FRAME_COUNT] |
uint8_t | uac_dev_t::iso_outbuf [ISO_OUT_URB_CNT][AU_OUT_MAX_PKTSZ *ISO_FRAME_COUNT] |
uint8_t | uac_dev_t::in_streaming |
uint8_t | uac_dev_t::out_streaming |
UAC_CB_FUNC * | uac_dev_t::au_in_func |
UAC_CB_FUNC * | uac_dev_t::au_out_func |
uint8_t * | uac_dev_t::au_in_buff |
int | uac_dev_t::au_in_bufsz |
int | uac_dev_t::au_in_bufidx |
Audio Class device structure
int32_t UAC_AutoGainControl | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint8_t | req, | ||
uint16_t | chn, | ||
uint8_t * | mute | ||
) |
Audio Class device automatic gain control.
[in] | audev | UAC device |
[in] | target | Select the control target. |
[in] | req | Control request. This UAC driver supports the following request: |
[in] | chn | The requested channel. It can be one of the followings: |
[in] | mute | One byte data. If the channel's automaic gain control is on, then the value is 1. Otherwise, it's 0. |
0 | Success |
UAC_RET_DEV_NOT_SUPPORTED | This UAC device does not support this function. |
Otheriwse | Error occurred |
Definition at line 435 of file uac_core.c.
int32_t UAC_GetBitResolution | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint8_t * | byte_cnt | ||
) |
Obtain Audio Class device subframe bit resolution..
[in] | audev | UAC device |
[in] | target | Select the control target. |
[out] | byte_cnt | The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4. |
< | 0 Failed. UAC device may not present or function not supported. |
Otherwise | The number of effectively used bits from the available bits in an audio subframe. |
Definition at line 79 of file uac_core.c.
int32_t UAC_GetChannelNumber | ( | UAC_DEV_T * | audev, |
uint8_t | target | ||
) |
Obtain Audio Class device's channel number.
[in] | audev | UAC device |
[in] | target | Select the control target. |
< | 0 Failed. UAC device may not present or function not supported. |
Otheriwse | The channle number. |
Definition at line 46 of file uac_core.c.
UAC_DEV_T * UAC_GetDeviceList | ( | void | ) |
Get a list of currently connected USB Audio Class devices.
NULL | There's no UAC devices found. |
Otherwise | A list of connected UAC devices. |
The Audio Class devices are chained by the "next" member of UAC_DEV_T.
Definition at line 277 of file uac_driver.c.
HIDDEN_SYMBOLS int32_t UAC_GetSamplingRate | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint32_t * | srate_list, | ||
int | max_cnt, | ||
uint8_t * | type | ||
) |
Get a list of sampling rate frequences supported by the UAC device.
[in] | audev | UAC device |
[in] | target | Select the control target. |
[out] | srate_list | A word array provided by user application to hold the sampling rate list. |
[in] | max_cnt | Available number of entries of srate_list[]. Must be > 2. |
[out] | type | Indicates how the sampling frequency can be programmed. 0: Continuous sampling frequency. srate_list[0] is the lower bound in Hz of the sampling frequency and srate_list[1] is the upper bound. 1~255: The number of discrete sampling frequencies supported. They are listed in srate_list[]. |
0 | Success |
Otherwise | Failed |
Definition at line 130 of file uac_core.c.
HIDDEN_SYMBOLS void UAC_Init | ( | void | ) |
Initialize this USB Audio Class driver.
Definition at line 261 of file uac_driver.c.
HIDDEN_SYMBOLS int32_t UAC_InstallIsoInCbFun | ( | UAC_DEV_T * | audev, |
uint8_t * | au_in_buff, | ||
int | bufsiz, | ||
UAC_CB_FUNC * | func | ||
) |
Install isochronous-in (microphone) callback function. Received audio data from UAC device will be delivered to user application by this callback function.
[in] | audev | Audio Class device |
[in] | au_in_buff | Audio stream input buffer. User application prepares and announces this buffer. UAC driver will directly move received audio data into it. Once UAC driver moves audio data into au_in_buff, it will call the callback to notify user. |
[in] | bufsiz | Size of au_in_buff. |
[in] | func | The audio in callback function. |
0 | Success |
Otherwise | Failed |
Definition at line 559 of file uac_core.c.
HIDDEN_SYMBOLS int32_t UAC_InstallIsoOutCbFun | ( | UAC_DEV_T * | audev, |
UAC_CB_FUNC * | func | ||
) |
Install isochronous-out (speaker) callback function. The UAC driver will call the callback function to request one audio out packet from user application. UAC driver will then send this packet to UAC device via isochronous out pipe.
[in] | audev | Audio Class device |
[in] | func | The audio out callback function. |
0 | Success |
Otherwise | Failed |
Definition at line 749 of file uac_core.c.
int32_t UAC_MuteControl | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint8_t | req, | ||
uint16_t | chn, | ||
uint8_t * | mute | ||
) |
Control Audio Class device mute on/off.
[in] | audev | UAC device |
[in] | target | Select the control target. |
[in] | req | Control request. This UAC driver supports the following request: |
[in] | chn | The requested channel. It can be one of the followings: |
[in] | mute | One byte data. If the channel is muted, then the value is 1. Otherwise, it's 0. |
0 | Success |
UAC_RET_DEV_NOT_SUPPORTED | This UAC device does not support this function. |
Otheriwse | Error occurred |
Definition at line 269 of file uac_core.c.
int32_t UAC_SamplingRateControl | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint8_t | req, | ||
uint32_t * | srate | ||
) |
Set sampling rate frequency.
[in] | audev | UAC device |
[in] | target | Select the control target. |
[in] | req | Control request. This UAC driver supports the following request: |
[in] | srate | Sampling rate frequncy to be set or get. |
0 | Success |
Otheriwse | Error occurred |
Definition at line 184 of file uac_core.c.
int32_t UAC_StartIsoInPipe | ( | UAC_DEV_T * | audev | ) |
Start to receive audio data from UAC device via isochronous in pipe.
[in] | audev | Audio Class device |
0 | Success |
Otherwise | Failed |
Definition at line 589 of file uac_core.c.
int32_t UAC_StartIsoOutPipe | ( | UAC_DEV_T * | audev | ) |
Start to send audio data to UAC device via isochronous out pipe.
[in] | audev | Audio Class device |
0 | Success |
Otherwise | Failed |
Definition at line 776 of file uac_core.c.
int32_t UAC_StopIsoInPipe | ( | UAC_DEV_T * | audev | ) |
Stop UAC device audio in data stream.
[in] | audev | Audio Class device |
0 | Success |
Otherwise | Failed |
Definition at line 674 of file uac_core.c.
int32_t UAC_StopIsoOutPipe | ( | UAC_DEV_T * | audev | ) |
Stop UAC device audio out data stream.
[in] | audev | Audio Class device |
0 | Success |
Otherwise | Failed |
Definition at line 865 of file uac_core.c.
int32_t UAC_VolumeControl | ( | UAC_DEV_T * | audev, |
uint8_t | target, | ||
uint8_t | req, | ||
uint16_t | chn, | ||
uint16_t * | volume | ||
) |
Audio Class device volume control.
[in] | audev | UAC device |
[in] | target | Select the control target. |
[in] | req | Control request. This UAC driver supports the following request: |
[in] | chn | The requested channel. It can be one of the followings: |
[in] | volume | Audio Class device volume value, which is intepreted as the following: 0x7FFF: 127.9961 dB . . . 0x0100: 1.0000 dB . . . 0x0002: 0.0078 dB 0x0001: 0.0039 dB 0x0000: 0.0000 dB 0xFFFF: -0.0039 dB 0xFFFE: -0.0078 dB . . . 0xFE00: -1.0000 dB . . . 0x8002: -127.9922 dB 0x8001: -127.9961 dB |
0 | Success |
UAC_RET_DEV_NOT_SUPPORTED | This UAC device does not support this function. |
Otheriwse | Error occurred |
Definition at line 362 of file uac_core.c.
uint8_t* uac_dev_t::au_in_buff |
Point to the user provided audio input buffer
Definition at line 125 of file usbh_uac.h.
int uac_dev_t::au_in_bufidx |
Index for Audio Class driver writing au_in_buff
Definition at line 127 of file usbh_uac.h.
int uac_dev_t::au_in_bufsz |
Size of au_in_buff
Definition at line 126 of file usbh_uac.h.
UAC_CB_FUNC* uac_dev_t::au_in_func |
Audio data input callback function
Definition at line 123 of file usbh_uac.h.
int uac_dev_t::au_in_ifnum |
Audio data-in interface numder
Definition at line 103 of file usbh_uac.h.
UAC_CB_FUNC* uac_dev_t::au_out_func |
Audio data output callback function
Definition at line 124 of file usbh_uac.h.
int uac_dev_t::au_out_ifnum |
Audio data-out interface numder
Definition at line 104 of file usbh_uac.h.
int uac_dev_t::ctrl_ifnum |
Audio control interface numder
Definition at line 102 of file usbh_uac.h.
EP_INFO_T* uac_dev_t::ep_au_in |
Audio data input endoint
Definition at line 111 of file usbh_uac.h.
EP_INFO_T* uac_dev_t::ep_au_out |
Audio data output endoint
Definition at line 112 of file usbh_uac.h.
uint8_t uac_dev_t::in_streaming |
Audio data in is streaming or not.
Definition at line 117 of file usbh_uac.h.
uint8_t uac_dev_t::iso_inbuf[ISO_IN_URB_CNT][AU_IN_MAX_PKTSZ *ISO_FRAME_COUNT] |
USB isochronous-in buffer
Definition at line 115 of file usbh_uac.h.
uint8_t uac_dev_t::iso_outbuf[ISO_OUT_URB_CNT][AU_OUT_MAX_PKTSZ *ISO_FRAME_COUNT] |
USB isochronous-out buffer
Definition at line 116 of file usbh_uac.h.
struct uac_dev_t* uac_dev_t::next |
Point to the next Audio Class device
Definition at line 106 of file usbh_uac.h.
uint8_t uac_dev_t::out_streaming |
Audio data out is streaming or not.
Definition at line 118 of file usbh_uac.h.
void* uac_dev_t::priv |
Internal used by audio class driver
Definition at line 105 of file usbh_uac.h.
USB_DEV_T* uac_dev_t::udev |
USB device pointer of UAC_DEV_T
Definition at line 101 of file usbh_uac.h.
URB_T* uac_dev_t::urbin[ISO_IN_URB_CNT] |
Audio data input URB
Definition at line 113 of file usbh_uac.h.
URB_T* uac_dev_t::urbout[ISO_OUT_URB_CNT] |
Audio data output URB
Definition at line 114 of file usbh_uac.h.