Files
discoverpixy/stm32f4xx__sai_8c.html
2015-05-12 11:12:43 +02:00

309 lines
39 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>discoverpixy: discovery/libs/StmCoreNPheriph/src/stm32f4xx_sai.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">discoverpixy
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_84db96586f7d962b526d6d9627d831c2.html">discovery</a></li><li class="navelem"><a class="el" href="dir_07523c13f04fd35d8848cb17a371cb5b.html">libs</a></li><li class="navelem"><a class="el" href="dir_1d60ba7d807ff336a2be2f2de640bf2b.html">StmCoreNPheriph</a></li><li class="navelem"><a class="el" href="dir_12f7a99b9d2a0e5955a2ac990af20021.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">stm32f4xx_sai.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This file provides firmware functions to manage the following functionalities of the Serial Audio Interface (SAI):
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="stm32f4xx__sai_8h_source.html">stm32f4xx_sai.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stm32f4xx__rcc_8h_source.html">stm32f4xx_rcc.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for stm32f4xx_sai.c:</div>
<div class="dyncontent">
<div class="center"><img src="stm32f4xx__sai_8c__incl.png" border="0" usemap="#discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__sai_8c" alt=""/></div>
<map name="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__sai_8c" id="discovery_2libs_2_stm_core_n_pheriph_2src_2stm32f4xx__sai_8c">
<area shape="rect" id="node2" href="stm32f4xx__sai_8h.html" title="This file contains all the functions prototypes for the SAI firmware library. " alt="" coords="1109,95,1226,121"/><area shape="rect" id="node21" href="stm32f4xx__rcc_8h.html" title="This file contains all the functions prototypes for the RCC firmware library. " alt="" coords="5,319,124,345"/><area shape="rect" id="node3" href="stm32f4xx_8h.html" title="CMSIS Cortex&#45;M4 Device Peripheral Access Layer Header File. This file contains all the peripheral reg..." alt="" coords="1891,169,1985,196"/><area shape="rect" id="node4" href="core__cm4_8h.html" title="CMSIS Cortex&#45;M4 Core Peripheral Access Layer Header File. " alt="" coords="3914,244,4005,271"/><area shape="rect" id="node9" href="system__stm32f4xx_8h.html" title="CMSIS Cortex&#45;M4 Device System Source File for STM32F4xx devices. " alt="" coords="1100,244,1243,271"/><area shape="rect" id="node10" href="stm32f4xx__conf_8h_source.html" title="stm32f4xx_conf.h" alt="" coords="1876,244,2000,271"/><area shape="rect" id="node6" href="core__cm_instr_8h.html" title="CMSIS Cortex&#45;M Core Instruction Access Header File. " alt="" coords="4046,319,4153,345"/><area shape="rect" id="node7" href="core__cm_func_8h.html" title="CMSIS Cortex&#45;M Core Function Access Header File. " alt="" coords="4177,319,4289,345"/><area shape="rect" id="node8" href="core__cm4__simd_8h.html" title="CMSIS Cortex&#45;M4 SIMD Header File. " alt="" coords="3897,319,4022,345"/><area shape="rect" id="node11" href="stm32f4xx__adc_8h.html" title="This file contains all the functions prototypes for the ADC firmware library. " alt="" coords="148,319,269,345"/><area shape="rect" id="node12" href="stm32f4xx__crc_8h.html" title="This file contains all the functions prototypes for the CRC firmware library. " alt="" coords="293,319,412,345"/><area shape="rect" id="node13" href="stm32f4xx__dbgmcu_8h.html" title="This file contains all the functions prototypes for the DBGMCU firmware library. " alt="" coords="437,319,583,345"/><area shape="rect" id="node14" href="stm32f4xx__dma_8h.html" title="This file contains all the functions prototypes for the DMA firmware library. " alt="" coords="607,319,733,345"/><area shape="rect" id="node15" href="stm32f4xx__exti_8h.html" title="This file contains all the functions prototypes for the EXTI firmware library. " alt="" coords="757,319,879,345"/><area shape="rect" id="node16" href="stm32f4xx__flash_8h.html" title="This file contains all the functions prototypes for the FLASH firmware library. " alt="" coords="903,319,1029,345"/><area shape="rect" id="node17" href="stm32f4xx__gpio_8h.html" title="This file contains all the functions prototypes for the GPIO firmware library. " alt="" coords="1053,319,1177,345"/><area shape="rect" id="node18" href="stm32f4xx__i2c_8h.html" title="This file contains all the functions prototypes for the I2C firmware library. " alt="" coords="1201,319,1318,345"/><area shape="rect" id="node19" href="stm32f4xx__iwdg_8h.html" title="This file contains all the functions prototypes for the IWDG firmware library. " alt="" coords="1343,319,1469,345"/><area shape="rect" id="node20" href="stm32f4xx__pwr_8h.html" title="This file contains all the functions prototypes for the PWR firmware library. " alt="" coords="1493,319,1612,345"/><area shape="rect" id="node22" href="stm32f4xx__rtc_8h.html" title="This file contains all the functions prototypes for the RTC firmware library. " alt="" coords="1637,319,1751,345"/><area shape="rect" id="node23" href="stm32f4xx__sdio_8h.html" title="This file contains all the functions prototypes for the SDIO firmware library. " alt="" coords="1776,319,1900,345"/><area shape="rect" id="node24" href="stm32f4xx__spi_8h.html" title="This file contains all the functions prototypes for the SPI firmware library. " alt="" coords="1923,319,2041,345"/><area shape="rect" id="node25" href="stm32f4xx__syscfg_8h.html" title="This file contains all the functions prototypes for the SYSCFG firmware library. " alt="" coords="2065,319,2203,345"/><area shape="rect" id="node26" href="stm32f4xx__tim_8h.html" title="This file contains all the functions prototypes for the TIM firmware library. " alt="" coords="2228,319,2347,345"/><area shape="rect" id="node27" href="stm32f4xx__usart_8h.html" title="This file contains all the functions prototypes for the USART firmware library. " alt="" coords="2371,319,2500,345"/><area shape="rect" id="node28" href="stm32f4xx__wwdg_8h.html" title="This file contains all the functions prototypes for the WWDG firmware library. " alt="" coords="2524,319,2656,345"/><area shape="rect" id="node29" href="misc_8h.html" title="This file contains all the functions prototypes for the miscellaneous firmware library functions (add..." alt="" coords="2681,319,2742,345"/><area shape="rect" id="node30" href="stm32f4xx__cryp_8h.html" title="This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware librar..." alt="" coords="2766,319,2891,345"/><area shape="rect" id="node31" href="stm32f4xx__hash_8h.html" title="This file contains all the functions prototypes for the HASH firmware library. " alt="" coords="2915,319,3043,345"/><area shape="rect" id="node32" href="stm32f4xx__rng_8h.html" title="This file contains all the functions prototypes for the Random Number Generator(RNG) firmware library..." alt="" coords="3068,319,3187,345"/><area shape="rect" id="node33" href="stm32f4xx__can_8h.html" title="This file contains all the functions prototypes for the CAN firmware library. " alt="" coords="3211,319,3332,345"/><area shape="rect" id="node34" href="stm32f4xx__dac_8h.html" title="This file contains all the functions prototypes for the DAC firmware library. " alt="" coords="3356,319,3477,345"/><area shape="rect" id="node35" href="stm32f4xx__dcmi_8h.html" title="This file contains all the functions prototypes for the DCMI firmware library. " alt="" coords="3502,319,3630,345"/><area shape="rect" id="node36" href="stm32f4xx__fsmc_8h.html" title="This file contains all the functions prototypes for the FSMC firmware library. " alt="" coords="3654,319,3782,345"/></map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga8d425258898b4af4ebc820f52635fad8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8d425258898b4af4ebc820f52635fad8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CR1_CLEAR_MASK</b>&#160;&#160;&#160;((uint32_t)0xFF07C010)</td></tr>
<tr class="separator:ga8d425258898b4af4ebc820f52635fad8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5faf6cf5d2301a9a983aa7eceb47bb87"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5faf6cf5d2301a9a983aa7eceb47bb87"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>FRCR_CLEAR_MASK</b>&#160;&#160;&#160;((uint32_t)0xFFF88000)</td></tr>
<tr class="separator:ga5faf6cf5d2301a9a983aa7eceb47bb87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb66fbd819193484edca3f37d4dd085c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacb66fbd819193484edca3f37d4dd085c"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SLOTR_CLEAR_MASK</b>&#160;&#160;&#160;((uint32_t)0x0000F020)</td></tr>
<tr class="separator:gacb66fbd819193484edca3f37d4dd085c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gadcef52be2d2792a70f67b6e7872b334e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gadcef52be2d2792a70f67b6e7872b334e">SAI_DeInit</a> (<a class="el" href="struct_s_a_i___type_def.html">SAI_TypeDef</a> *SAIx)</td></tr>
<tr class="memdesc:gadcef52be2d2792a70f67b6e7872b334e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the SAIx peripheral registers to their default reset values. <a href="group___s_a_i___group1.html#gadcef52be2d2792a70f67b6e7872b334e">More...</a><br /></td></tr>
<tr class="separator:gadcef52be2d2792a70f67b6e7872b334e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga691f0efcdbf335df101c52bacb22c0c8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga691f0efcdbf335df101c52bacb22c0c8">SAI_Init</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, <a class="el" href="struct_s_a_i___init_type_def.html">SAI_InitTypeDef</a> *SAI_InitStruct)</td></tr>
<tr class="memdesc:ga691f0efcdbf335df101c52bacb22c0c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SAI <a class="el" href="struct_block.html">Block</a> x peripheral according to the specified parameters in the SAI_InitStruct. <a href="group___s_a_i___group1.html#ga691f0efcdbf335df101c52bacb22c0c8">More...</a><br /></td></tr>
<tr class="separator:ga691f0efcdbf335df101c52bacb22c0c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6aa8c14b58a574974e43ab98e1d17713"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga6aa8c14b58a574974e43ab98e1d17713">SAI_FrameInit</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, <a class="el" href="struct_s_a_i___frame_init_type_def.html">SAI_FrameInitTypeDef</a> *SAI_FrameInitStruct)</td></tr>
<tr class="memdesc:ga6aa8c14b58a574974e43ab98e1d17713"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SAI <a class="el" href="struct_block.html">Block</a> Audio frame according to the specified parameters in the SAI_FrameInitStruct. <a href="group___s_a_i___group1.html#ga6aa8c14b58a574974e43ab98e1d17713">More...</a><br /></td></tr>
<tr class="separator:ga6aa8c14b58a574974e43ab98e1d17713"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac8d5348bb79f75884e52866883891e95"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gac8d5348bb79f75884e52866883891e95">SAI_SlotInit</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, <a class="el" href="struct_s_a_i___slot_init_type_def.html">SAI_SlotInitTypeDef</a> *SAI_SlotInitStruct)</td></tr>
<tr class="memdesc:gac8d5348bb79f75884e52866883891e95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SAI <a class="el" href="struct_block.html">Block</a> audio Slot according to the specified parameters in the SAI_SlotInitStruct. <a href="group___s_a_i___group1.html#gac8d5348bb79f75884e52866883891e95">More...</a><br /></td></tr>
<tr class="separator:gac8d5348bb79f75884e52866883891e95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b7ca40703634d2e3bf5c00201006a94"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga6b7ca40703634d2e3bf5c00201006a94">SAI_StructInit</a> (<a class="el" href="struct_s_a_i___init_type_def.html">SAI_InitTypeDef</a> *SAI_InitStruct)</td></tr>
<tr class="memdesc:ga6b7ca40703634d2e3bf5c00201006a94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills each SAI_InitStruct member with its default value. <a href="group___s_a_i___group1.html#ga6b7ca40703634d2e3bf5c00201006a94">More...</a><br /></td></tr>
<tr class="separator:ga6b7ca40703634d2e3bf5c00201006a94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff2daf4640fb7204fc9eabeda8a6d381"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gaff2daf4640fb7204fc9eabeda8a6d381">SAI_FrameStructInit</a> (<a class="el" href="struct_s_a_i___frame_init_type_def.html">SAI_FrameInitTypeDef</a> *SAI_FrameInitStruct)</td></tr>
<tr class="memdesc:gaff2daf4640fb7204fc9eabeda8a6d381"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills each SAI_FrameInitStruct member with its default value. <a href="group___s_a_i___group1.html#gaff2daf4640fb7204fc9eabeda8a6d381">More...</a><br /></td></tr>
<tr class="separator:gaff2daf4640fb7204fc9eabeda8a6d381"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a86dde0514e7e8d0fd11b327b304e81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga0a86dde0514e7e8d0fd11b327b304e81">SAI_SlotStructInit</a> (<a class="el" href="struct_s_a_i___slot_init_type_def.html">SAI_SlotInitTypeDef</a> *SAI_SlotInitStruct)</td></tr>
<tr class="memdesc:ga0a86dde0514e7e8d0fd11b327b304e81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills each SAI_SlotInitStruct member with its default value. <a href="group___s_a_i___group1.html#ga0a86dde0514e7e8d0fd11b327b304e81">More...</a><br /></td></tr>
<tr class="separator:ga0a86dde0514e7e8d0fd11b327b304e81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac565e4e94f3b4242e2fb02ae917a3a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gaac565e4e94f3b4242e2fb02ae917a3a6">SAI_Cmd</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, FunctionalState NewState)</td></tr>
<tr class="memdesc:gaac565e4e94f3b4242e2fb02ae917a3a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables the specified SAI <a class="el" href="struct_block.html">Block</a> peripheral. <a href="group___s_a_i___group1.html#gaac565e4e94f3b4242e2fb02ae917a3a6">More...</a><br /></td></tr>
<tr class="separator:gaac565e4e94f3b4242e2fb02ae917a3a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e770be163845d4d15907df2ebed387e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga5e770be163845d4d15907df2ebed387e">SAI_MonoModeConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_Mono_StreoMode)</td></tr>
<tr class="memdesc:ga5e770be163845d4d15907df2ebed387e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures the mono mode for the selected SAI block. <a href="group___s_a_i___group1.html#ga5e770be163845d4d15907df2ebed387e">More...</a><br /></td></tr>
<tr class="separator:ga5e770be163845d4d15907df2ebed387e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33f1dc1098182a0d262199eb377857e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga33f1dc1098182a0d262199eb377857e3">SAI_TRIStateConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_TRIState)</td></tr>
<tr class="memdesc:ga33f1dc1098182a0d262199eb377857e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures the TRIState managment on data line for the selected SAI block. <a href="group___s_a_i___group1.html#ga33f1dc1098182a0d262199eb377857e3">More...</a><br /></td></tr>
<tr class="separator:ga33f1dc1098182a0d262199eb377857e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8f7784717ee1e44faf638e58bcc4deea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga8f7784717ee1e44faf638e58bcc4deea">SAI_CompandingModeConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_CompandingMode)</td></tr>
<tr class="memdesc:ga8f7784717ee1e44faf638e58bcc4deea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures the companding mode for the selected SAI block. <a href="group___s_a_i___group1.html#ga8f7784717ee1e44faf638e58bcc4deea">More...</a><br /></td></tr>
<tr class="separator:ga8f7784717ee1e44faf638e58bcc4deea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf438564ee4cce7a5ab3fa2364f6512a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gaf438564ee4cce7a5ab3fa2364f6512a0">SAI_MuteModeCmd</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, FunctionalState NewState)</td></tr>
<tr class="memdesc:gaf438564ee4cce7a5ab3fa2364f6512a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables the Mute mode for the selected SAI block. <a href="group___s_a_i___group1.html#gaf438564ee4cce7a5ab3fa2364f6512a0">More...</a><br /></td></tr>
<tr class="separator:gaf438564ee4cce7a5ab3fa2364f6512a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8b9a38f8201fef64dde06d2402f9d32e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga8b9a38f8201fef64dde06d2402f9d32e">SAI_MuteValueConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_MuteValue)</td></tr>
<tr class="memdesc:ga8b9a38f8201fef64dde06d2402f9d32e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the mute value for the selected SAI block. <a href="group___s_a_i___group1.html#ga8b9a38f8201fef64dde06d2402f9d32e">More...</a><br /></td></tr>
<tr class="separator:ga8b9a38f8201fef64dde06d2402f9d32e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadfdef0e5fbbc6ed6b3c9a750e3b87613"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#gadfdef0e5fbbc6ed6b3c9a750e3b87613">SAI_MuteFrameCounterConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_MuteCounter)</td></tr>
<tr class="memdesc:gadfdef0e5fbbc6ed6b3c9a750e3b87613"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables the Mute mode for the selected SAI block. <a href="group___s_a_i___group1.html#gadfdef0e5fbbc6ed6b3c9a750e3b87613">More...</a><br /></td></tr>
<tr class="separator:gadfdef0e5fbbc6ed6b3c9a750e3b87613"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9451d32f12114ef02c2a4e8e921abcd8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group1.html#ga9451d32f12114ef02c2a4e8e921abcd8">SAI_FlushFIFO</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x)</td></tr>
<tr class="memdesc:ga9451d32f12114ef02c2a4e8e921abcd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reinitialize the FIFO pointer. <a href="group___s_a_i___group1.html#ga9451d32f12114ef02c2a4e8e921abcd8">More...</a><br /></td></tr>
<tr class="separator:ga9451d32f12114ef02c2a4e8e921abcd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d2c4b069ea32a288cde7ab4bbda0b0f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group2.html#ga6d2c4b069ea32a288cde7ab4bbda0b0f">SAI_ReceiveData</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x)</td></tr>
<tr class="memdesc:ga6d2c4b069ea32a288cde7ab4bbda0b0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the most recent received data by the SAI block x peripheral. <a href="group___s_a_i___group2.html#ga6d2c4b069ea32a288cde7ab4bbda0b0f">More...</a><br /></td></tr>
<tr class="separator:ga6d2c4b069ea32a288cde7ab4bbda0b0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga57f0cc79e2e4058638db1a8783072ad4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group2.html#ga57f0cc79e2e4058638db1a8783072ad4">SAI_SendData</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t Data)</td></tr>
<tr class="memdesc:ga57f0cc79e2e4058638db1a8783072ad4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transmits a Data through the SAI block x peripheral. <a href="group___s_a_i___group2.html#ga57f0cc79e2e4058638db1a8783072ad4">More...</a><br /></td></tr>
<tr class="separator:ga57f0cc79e2e4058638db1a8783072ad4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac1ec1aa3ec5a1f3053a8e30253434aee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group3.html#gac1ec1aa3ec5a1f3053a8e30253434aee">SAI_DMACmd</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, FunctionalState NewState)</td></tr>
<tr class="memdesc:gac1ec1aa3ec5a1f3053a8e30253434aee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables the SAI <a class="el" href="struct_block.html">Block</a> x DMA interface. <a href="group___s_a_i___group3.html#gac1ec1aa3ec5a1f3053a8e30253434aee">More...</a><br /></td></tr>
<tr class="separator:gac1ec1aa3ec5a1f3053a8e30253434aee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77597e3c2eb2613de8c79f72d2f10929"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#ga77597e3c2eb2613de8c79f72d2f10929">SAI_ITConfig</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_IT, FunctionalState NewState)</td></tr>
<tr class="memdesc:ga77597e3c2eb2613de8c79f72d2f10929"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables the specified SAI <a class="el" href="struct_block.html">Block</a> interrupts. <a href="group___s_a_i___group4.html#ga77597e3c2eb2613de8c79f72d2f10929">More...</a><br /></td></tr>
<tr class="separator:ga77597e3c2eb2613de8c79f72d2f10929"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga538f303601c97a0ef68817ac2d7d9fd4"><td class="memItemLeft" align="right" valign="top">FlagStatus&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#ga538f303601c97a0ef68817ac2d7d9fd4">SAI_GetFlagStatus</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_FLAG)</td></tr>
<tr class="memdesc:ga538f303601c97a0ef68817ac2d7d9fd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the specified SAI block x flag is set or not. <a href="group___s_a_i___group4.html#ga538f303601c97a0ef68817ac2d7d9fd4">More...</a><br /></td></tr>
<tr class="separator:ga538f303601c97a0ef68817ac2d7d9fd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf860a01907d09f518de3bee94f85e3f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#gaf860a01907d09f518de3bee94f85e3f9">SAI_ClearFlag</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_FLAG)</td></tr>
<tr class="memdesc:gaf860a01907d09f518de3bee94f85e3f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the specified SAI <a class="el" href="struct_block.html">Block</a> x flag. <a href="group___s_a_i___group4.html#gaf860a01907d09f518de3bee94f85e3f9">More...</a><br /></td></tr>
<tr class="separator:gaf860a01907d09f518de3bee94f85e3f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga59e69b3e20a327395bc89b5e643c3e9a"><td class="memItemLeft" align="right" valign="top">ITStatus&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#ga59e69b3e20a327395bc89b5e643c3e9a">SAI_GetITStatus</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_IT)</td></tr>
<tr class="memdesc:ga59e69b3e20a327395bc89b5e643c3e9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the specified SAI <a class="el" href="struct_block.html">Block</a> x interrupt has occurred or not. <a href="group___s_a_i___group4.html#ga59e69b3e20a327395bc89b5e643c3e9a">More...</a><br /></td></tr>
<tr class="separator:ga59e69b3e20a327395bc89b5e643c3e9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4aa9cc16b2722d001540a4c7fd278efd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#ga4aa9cc16b2722d001540a4c7fd278efd">SAI_ClearITPendingBit</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x, uint32_t SAI_IT)</td></tr>
<tr class="memdesc:ga4aa9cc16b2722d001540a4c7fd278efd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the SAI <a class="el" href="struct_block.html">Block</a> x interrupt pending bit. <a href="group___s_a_i___group4.html#ga4aa9cc16b2722d001540a4c7fd278efd">More...</a><br /></td></tr>
<tr class="separator:ga4aa9cc16b2722d001540a4c7fd278efd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabe56cd82fe1137249f5acb8907d28fd3"><td class="memItemLeft" align="right" valign="top">FunctionalState&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#gabe56cd82fe1137249f5acb8907d28fd3">SAI_GetCmdStatus</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x)</td></tr>
<tr class="memdesc:gabe56cd82fe1137249f5acb8907d28fd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the status of EN bit for the specified SAI <a class="el" href="struct_block.html">Block</a> x. <a href="group___s_a_i___group4.html#gabe56cd82fe1137249f5acb8907d28fd3">More...</a><br /></td></tr>
<tr class="separator:gabe56cd82fe1137249f5acb8907d28fd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga03d763ba656a9eec5dd5e7b83b8ee361"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_a_i___group4.html#ga03d763ba656a9eec5dd5e7b83b8ee361">SAI_GetFIFOStatus</a> (<a class="el" href="struct_s_a_i___block___type_def.html">SAI_Block_TypeDef</a> *SAI_Block_x)</td></tr>
<tr class="memdesc:ga03d763ba656a9eec5dd5e7b83b8ee361"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current SAI <a class="el" href="struct_block.html">Block</a> x FIFO filled level. <a href="group___s_a_i___group4.html#ga03d763ba656a9eec5dd5e7b83b8ee361">More...</a><br /></td></tr>
<tr class="separator:ga03d763ba656a9eec5dd5e7b83b8ee361"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This file provides firmware functions to manage the following functionalities of the Serial Audio Interface (SAI): </p>
<dl class="section author"><dt>Author</dt><dd>MCD Application Team </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.4.0 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>04-August-2014<ul>
<li>Initialization and Configuration</li>
<li>Data transfers functions</li>
<li>DMA transfers management</li>
<li>Interrupts and flags management</li>
</ul>
</dd></dl>
<pre class="fragment">===============================================================================
##### How to use this driver #####
===============================================================================
[..]
(#) Enable peripheral clock using the following functions
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SAI1, ENABLE) for SAI1
(#) For each SAI Block A/B enable SCK, SD, FS and MCLK GPIO clocks
using RCC_AHB1PeriphClockCmd() function.
(#) Peripherals alternate function:
(++) Connect the pin to the desired peripherals' Alternate
Function (AF) using GPIO_PinAFConfig() function.
(++) Configure the desired pin in alternate function by:
GPIO_InitStruct-&gt;GPIO_Mode = GPIO_Mode_AF
(++) Select the type, pull-up/pull-down and output speed via
GPIO_PuPd, GPIO_OType and GPIO_Speed members
(++) Call GPIO_Init() function
-@@- If an external clock source is used then the I2S CKIN pin should be
also configured in Alternate function Push-pull pull-up mode.
(#) The SAI clock can be generated from different clock source :
PLL I2S, PLL SAI or external clock source.
(++) The PLL I2S is configured using the following functions RCC_PLLI2SConfig(),
RCC_PLLI2SCmd(ENABLE), RCC_GetFlagStatus(RCC_FLAG_PLLI2SRDY) and
RCC_SAIPLLI2SClkDivConfig() or;
(++) The PLL SAI is configured using the following functions RCC_PLLSAIConfig(),
RCC_PLLSAICmd(ENABLE), RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) and
RCC_SAIPLLSAIClkDivConfig()or;
(++) External clock source is configured using the function
RCC_I2SCLKConfig(RCC_I2S2CLKSource_Ext) and after setting correctly the
define constant I2S_EXTERNAL_CLOCK_VAL in the stm32f4xx_conf.h file.
(#) Each SAI Block A or B has its own clock generator to make these two blocks
completely independent. The Clock generator is configured using RCC_SAIBlockACLKConfig() and
RCC_SAIBlockBCLKConfig() functions.
(#) Each SAI Block A or B can be configured separetely :
(++) Program the Master clock divider, Audio mode, Protocol, Data Length, Clock Strobing Edge,
Synchronous mode, Output drive and FIFO Thresold using SAI_Init() function.
In case of master mode, program the Master clock divider (MCKDIV) using
the following formula :
(+++) MCLK_x = SAI_CK_x / (MCKDIV * 2) with MCLK_x = 256 * FS
(+++) FS = SAI_CK_x / (MCKDIV * 2) * 256
(+++) MCKDIV = SAI_CK_x / FS * 512
(++) Program the Frame Length, Frame active Length, FS Definition, FS Polarity,
FS Offset using SAI_FrameInit() function.
(++) Program the Slot First Bit Offset, Slot Size, Slot Number, Slot Active
using SAI_SlotInit() function.
(#) Enable the NVIC and the corresponding interrupt using the function
SAI_ITConfig() if you need to use interrupt mode.
(#) When using the DMA mode
(++) Configure the DMA using DMA_Init() function
(++) Active the needed channel Request using SAI_DMACmd() function
(#) Enable the SAI using the SAI_Cmd() function.
(#) Enable the DMA using the DMA_Cmd() function when using DMA mode.
(#) The SAI has some specific functions which can be useful depending
on the audio protocol selected.
(++) Enable Mute mode when the audio block is a transmitter using SAI_MuteModeCmd()
function and configure the value transmitted during mute using SAI_MuteValueConfig().
(++) Detect the Mute mode when audio block is a receiver using SAI_MuteFrameCounterConfig().
(++) Enable the MONO mode without any data preprocessing in memory when the number
of slot is equal to 2 using SAI_MonoModeConfig() function.
(++) Enable data companding algorithm (U law and A law) using SAI_CompandingModeConfig().
(++) Choose the behavior of the SD line in output when an inactive slot is sent
on the data line using SAI_TRIStateConfig() function.
[..]
(@) In master TX mode: enabling the audio block immediately generates the bit clock
for the external slaves even if there is no data in the FIFO, However FS signal
generation is conditioned by the presence of data in the FIFO.
(@) In master RX mode: enabling the audio block immediately generates the bit clock
and FS signal for the external slaves.
(@) It is mandatory to respect the following conditions in order to avoid bad SAI behavior:
(+@) First bit Offset &lt;= (SLOT size - Data size)
(+@) Data size &lt;= SLOT size
(+@) Number of SLOT x SLOT size = Frame length
(+@) The number of slots should be even when bit FSDEF in the SAI_xFRCR is set. </pre><dl class="section attention"><dt>Attention</dt><dd></dd></dl>
<h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
<p>Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at: </p><pre class="fragment"> http://www.st.com/software_license_agreement_liberty_v2
</pre><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun May 10 2015 15:15:18 for discoverpixy by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>