Documentation updates

This commit is contained in:
Ross Owen
2023-07-14 11:54:58 +01:00
parent b6972295e9
commit 2228575e09
2 changed files with 23 additions and 38 deletions

View File

@@ -67,20 +67,17 @@ void SpdifTxWrapper(chanend c_spdif_tx);
* Note, default (empty) implementations of these are provided in audiohub_user.c * Note, default (empty) implementations of these are provided in audiohub_user.c
*/ */
/** User code for any required audio hardwarte initialisation - run once at start up */ /** This function is called when the device starts up and should contain user code to perform any required audio hardware initialisation */
void AudioHwInit(void); void AudioHwInit(void);
/** User code to mute audio hardware before a sample rate change - run every sample frequency change */
void AudioHwConfig_Mute(void);
/** User code to un-mute audio hardware after a sample rate change - run every sample frequency change */
void AudioHwConfig_UnMute(void);
/** User code Configure audio hardware (clocking, CODECs etc) for a specific mClk/Sample frquency - run on every sample frequency change /** This function is called when on sample rate change and should contain user code to configure audio hardware
* (clocking, CODECs etc) for a specific mClk/Sample frequency
* *
* \param samFreq The new sample frequency (in Hz) * \param samFreq The new sample frequency (in Hz)
* *
* \param mclk The new master clock frequency (in Hz) * \param mClk The new master clock frequency (in Hz)
* *
* \param dsdMode DSD mode, DSD_MODE_NATIVE, DSD_MODE_DOP or DSD_MODE_OFF * \param dsdMode DSD mode, DSD_MODE_NATIVE, DSD_MODE_DOP or DSD_MODE_OFF
* *
@@ -90,6 +87,19 @@ void AudioHwConfig_UnMute(void);
*/ */
void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC); void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC);
/** This function is called before AudioHwConfig() and should contain user code to mute audio hardware before a
* sample rate change in order to reduced audible pops/clicks
*
* Note, if using the application PLL of a xcore.ai device this function will be called before the master-clock is
* changed
*/
void AudioHwConfig_Mute(void);
/** This function is called after AudioHwConfig() and should contain user code to un-mute audio hardware after a
* sample rate change
*/
void AudioHwConfig_UnMute(void);
#endif // __XC__ #endif // __XC__
void UserBufferManagementInit(); void UserBufferManagementInit();

View File

@@ -1,40 +1,15 @@
Required User Function Definitions Required User Function Definitions
================================== ==================================
The following functions need to be defined by an application using the XMOS USB Audio framework. The following functions need to be defined by an application using `lib_xua`.
External Audio Hardware Configuration Functions External Audio Hardware Configuration Functions
----------------------------------------------- -----------------------------------------------
.. c:function:: void AudioHwInit(chanend ?c_codec) .. doxygenfunction:: AudioHwInit
.. doxygenfunction:: AudioHwConfig
This function is called when the audio core starts after the .. doxygenfunction:: AudioHwConfig_Mute
device boots up and should initialize the external audio harware e.g. clocking, DAC, ADC etc .. doxygenfunction:: AudioHwConfig_UnMute
:param c_codec: An optional chanend that was original passed into
:c:func:`audio` that can be used to communicate
with other cores.
.. c:function:: void AudioHwConfig(unsigned samFreq, unsigned mclk, chanend ?c_codec, unsigned dsdMode, unsigned sampRes_DAC, unsigned sampRes_ADC)
This function is called when the audio core starts or changes
sample rate. It should configure the extenal audio hardware to run at the specified
sample rate given the supplied master clock frequency.
:param samFreq: The sample frequency in Hz that the hardware should be configured to (in Hz).
:param mclk: The master clock frequency that is required in Hz.
:param c_codec: An optional chanend that was original passed into
:c:func:`audio` that can be used to communicate
with other cores.
:param dsdMode: Signifies if the audio hardware should be configured for DSD operation
:param sampRes_DAC: The sample resolution of the DAC stream
:param sampRes_ADC: The sample resolution of the ADC stream
Audio Streaming Functions Audio Streaming Functions