📄 codec_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>BlueLab: codec.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.8 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>codec.h File Reference</h1>Header file for the codec library. This library implements the functionality to be able to configure a stereo codec for use. Can define if the stereo inputs or outputs of the codec needs to be used, and the sample rates to be used for the ADCs and DACs. <a href="#_details">More...</a><p><h2>Data Structures</h2><ul><li>struct <a class="el" href="structcodec__config__params.html">codec_config_params</a><dl class="el"><dd class="mdescRight">The configuration used to set up the codec. <a href="structcodec__config__params.html#_details">More...</a><br></dl><li>struct <a class="el" href="structwolfson__init__params.html">wolfson_init_params</a><dl class="el"><dd class="mdescRight">The params used to initialise the Wolfson codec. <a href="structwolfson__init__params.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_c_o_d_e_c___i_n_i_t___c_f_m___t.html">CODEC_INIT_CFM_T</a><dl class="el"><dd class="mdescRight">This message returns the result of a call to CodecInitXXX. <a href="struct_c_o_d_e_c___i_n_i_t___c_f_m___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_c_o_d_e_c___c_o_n_f_i_g_u_r_e___c_f_m___t.html">CODEC_CONFIGURE_CFM_T</a><dl class="el"><dd class="mdescRight">This message returns the result of a call to CodecConfigure. <a href="struct_c_o_d_e_c___c_o_n_f_i_g_u_r_e___c_f_m___t.html#_details">More...</a><br></dl></ul><h2>Defines</h2><ul><li>#define <a class="el" href="codec_8h.html#a0">OUTPUT_NONE</a> 0x0<dl class="el"><dd class="mdescRight">Defines used to configure outputs in <a class="el" href="structcodec__config__params.html">codec_config_params</a> struct. <a href="#a0"></a><br></dl><li>#define <a class="el" href="codec_8h.html#a1">OUTPUT_DAC</a> 0x1<li>#define <a class="el" href="codec_8h.html#a2">OUTPUT_MICIN</a> 0x2<li>#define <a class="el" href="codec_8h.html#a3">OUTPUT_LINEIN</a> 0x4<li>#define <a class="el" href="codec_8h.html#a4">CODEC_MESSAGE_BASE</a> 0x6400<dl class="el"><dd class="mdescRight">The upstream codec messages. <a href="#a4"></a><br></dl></ul><h2>Typedefs</h2><ul><li>typedef __WolfsonCodecTaskData <a class="el" href="codec_8h.html#a5">WolfsonCodecTaskData</a><dl class="el"><dd class="mdescRight">The codec structures. <a href="#a5"></a><br></dl><li>typedef __CsrInternalCodecTaskData <a class="el" href="codec_8h.html#a6">CsrInternalCodecTaskData</a></ul><h2>Enumerations</h2><ul><li>enum { <br> <a class="el" href="codec_8h.html#a44a7">CODEC_INIT_CFM</a> = CODEC_MESSAGE_BASE, <br> <a class="el" href="codec_8h.html#a44a8">CODEC_CONFIGURE_CFM</a><br> }<li>enum <a class="el" href="codec_8h.html#a45">codec_channel</a> { <br> <a class="el" href="codec_8h.html#a45a9">left_ch</a>, <br> <a class="el" href="codec_8h.html#a45a10">right_ch</a>, <br> <a class="el" href="codec_8h.html#a45a11">left_and_right_ch</a><br> }<dl class="el"><dd class="mdescRight">The codecs channel being referred to, left, right or both. <a href="#a45">More...</a><br></dl><li>enum <a class="el" href="codec_8h.html#a46">codec_status_code</a> { <br> <a class="el" href="codec_8h.html#a46a12">codec_success</a> = (0), <br> <a class="el" href="codec_8h.html#a46a13">codec_fail</a>, <br> <a class="el" href="codec_8h.html#a46a14">codec_invalid_sample_rates</a>, <br> <a class="el" href="codec_8h.html#a46a15">codec_invalid_configuration</a>, <br> <a class="el" href="codec_8h.html#a46a16">codec_not_supported</a><br> }<dl class="el"><dd class="mdescRight">The status codes returned to the client application to indicate the status of a requested operation. <a href="#a46">More...</a><br></dl><li>enum <a class="el" href="codec_8h.html#a47">codec_type</a> { <br> <a class="el" href="codec_8h.html#a47a17">codec_none</a>, <br> <a class="el" href="codec_8h.html#a47a18">codec_wm8731</a>, <br> <a class="el" href="codec_8h.html#a47a19">codec_csr_internal</a><br> }<dl class="el"><dd class="mdescRight">The codec being used. <a href="#a47">More...</a><br></dl><li>enum <a class="el" href="codec_8h.html#a48">sample_freq</a> { <br> <a class="el" href="codec_8h.html#a48a20">sample8kHz</a> = (0), <br> <a class="el" href="codec_8h.html#a48a21">sample11_025kHz</a>, <br> <a class="el" href="codec_8h.html#a48a22">sample16kHz</a>, <br> <a class="el" href="codec_8h.html#a48a23">sample22_25kHz</a>, <br> <a class="el" href="codec_8h.html#a48a24">sample24kHz</a>, <br> <a class="el" href="codec_8h.html#a48a25">sample32kHz</a>, <br> <a class="el" href="codec_8h.html#a48a26">sample44_1kHz</a>, <br> <a class="el" href="codec_8h.html#a48a27">sample48kHz</a>, <br> <a class="el" href="codec_8h.html#a48a28">sample88_2kHz</a>, <br> <a class="el" href="codec_8h.html#a48a29">sample96kHz</a>, <br> <a class="el" href="codec_8h.html#a48a30">sampleNotUsed</a><br> }<dl class="el"><dd class="mdescRight">The possible sample rates that the ADCs and DACs can be configured to. <a href="#a48">More...</a><br></dl><li>enum <a class="el" href="codec_8h.html#a49">input_type</a> { <br> <a class="el" href="codec_8h.html#a49a31">mic_input</a>, <br> <a class="el" href="codec_8h.html#a49a32">line_input</a>, <br> <a class="el" href="codec_8h.html#a49a33">no_input</a><br> }<dl class="el"><dd class="mdescRight">Type of input to the codec ADCs that will be used. <a href="#a49">More...</a><br></dl></ul><h2>Functions</h2><ul><li>void <a class="el" href="codec_8h.html#a34">CodecInitWolfson</a> (<a class="el" href="struct_task_data.html">Task</a> appTask, <a class="el" href="structwolfson__init__params.html">wolfson_init_params</a> *init)<dl class="el"><dd class="mdescRight">Initialise the Wolfson Codec. <a href="#a34"></a><br></dl><li>void <a class="el" href="codec_8h.html#a35">CodecInitCsrInternal</a> (<a class="el" href="struct_task_data.html">Task</a> appTask)<dl class="el"><dd class="mdescRight">Initialise the CSR Internal Codec. <a href="#a35"></a><br></dl><li>void <a class="el" href="codec_8h.html#a36">CodecConfigure</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask, const <a class="el" href="structcodec__config__params.html">codec_config_params</a> *config)<dl class="el"><dd class="mdescRight">Configure the Codec with the supplied parameters. <a href="#a36"></a><br></dl><li>void <a class="el" href="codec_8h.html#a37">CodecSetInputGain</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask, <a class="el" href="csrtypes_8h.html#a4">uint16</a> volume, <a class="el" href="codec_8h.html#a45">codec_channel</a> channel)<dl class="el"><dd class="mdescRight">Set Codec Input Gain, left channel. <a href="#a37"></a><br></dl><li>void <a class="el" href="codec_8h.html#a38">CodecSetInputGainNow</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask, <a class="el" href="csrtypes_8h.html#a4">uint16</a> volume, <a class="el" href="codec_8h.html#a45">codec_channel</a> channel)<dl class="el"><dd class="mdescRight">Update the codec input gain immediately. <a href="#a38"></a><br></dl><li>void <a class="el" href="codec_8h.html#a39">CodecSetOutputGain</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask, <a class="el" href="csrtypes_8h.html#a4">uint16</a> volume, <a class="el" href="codec_8h.html#a45">codec_channel</a> channel)<dl class="el"><dd class="mdescRight">Set Codec Output Gain. <a href="#a39"></a><br></dl><li>void <a class="el" href="codec_8h.html#a40">CodecSetOutputGainNow</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask, <a class="el" href="csrtypes_8h.html#a4">uint16</a> volume, <a class="el" href="codec_8h.html#a45">codec_channel</a> channel)<dl class="el"><dd class="mdescRight">Update the codec output gain immediately. <a href="#a40"></a><br></dl><li>void <a class="el" href="codec_8h.html#a41">CodecEnable</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask)<dl class="el"><dd class="mdescRight">Enable the codec. <a href="#a41"></a><br></dl><li>void <a class="el" href="codec_8h.html#a42">CodecDisable</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask)<dl class="el"><dd class="mdescRight">Disable the codec. <a href="#a42"></a><br></dl><li>void <a class="el" href="codec_8h.html#a43">CodecPowerDown</a> (<a class="el" href="struct_task_data.html">Task</a> codecTask)<dl class="el"><dd class="mdescRight">Power down the codec. <a href="#a43"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Header file for the codec library. This library implements the functionality to be able to configure a stereo codec for use. Can define if the stereo inputs or outputs of the codec needs to be used, and the sample rates to be used for the ADCs and DACs. <p>The library exposes a functional downstream API and an upstream message based API.<hr><h2>Define Documentation</h2><a class="anchor" name="a0" doxytag="codec.h::OUTPUT_NONE" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define OUTPUT_NONE 0x0 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Defines used to configure outputs in <a class="el" href="structcodec__config__params.html">codec_config_params</a> struct. <p>On some codecs you can feed the input directly to the output without any digital signal processing. </td> </tr></table><a class="anchor" name="a1" doxytag="codec.h::OUTPUT_DAC" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define OUTPUT_DAC 0x1 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="a2" doxytag="codec.h::OUTPUT_MICIN" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define OUTPUT_MICIN 0x2 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="a3" doxytag="codec.h::OUTPUT_LINEIN" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define OUTPUT_LINEIN 0x4 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="a4" doxytag="codec.h::CODEC_MESSAGE_BASE" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define CODEC_MESSAGE_BASE 0x6400 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The upstream codec messages. <p> </td> </tr></table><hr><h2>Typedef Documentation</h2><a class="anchor" name="a5" doxytag="codec.h::WolfsonCodecTaskData" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef struct __WolfsonCodecTaskData <a class="el" href="codec_8h.html#a5">WolfsonCodecTaskData</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The codec structures. <p> </td> </tr></table><a class="anchor" name="a6" doxytag="codec.h::CsrInternalCodecTaskData" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef struct __CsrInternalCodecTaskData <a class="el" href="codec_8h.html#a6">CsrInternalCodecTaskData</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr><h2>Enumeration Type Documentation</h2><a class="anchor" name="a44" doxytag="codec.h::@0" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> anonymous enum </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a44a7" doxytag="CODEC_INIT_CFM" ></a>CODEC_INIT_CFM</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a44a8" doxytag="CODEC_CONFIGURE_CFM" ></a>CODEC_CONFIGURE_CFM</em> </td><td></td></tr></table></dl> </td> </tr></table><a class="anchor" name="a45" doxytag="codec.h::codec_channel" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -