******************************************************************************\r
* @file stm32f7xx_hal_i2s.c\r
* @author MCD Application Team\r
- * @version V1.0.0RC1\r
- * @date 24-March-2015\r
+ * @version V1.0.0\r
+ * @date 12-May-2015\r
* @brief I2S HAL module driver.\r
* This file provides firmware functions to manage the following \r
* functionalities of the Integrated Interchip Sound (I2S) peripheral:\r
/* Includes ------------------------------------------------------------------*/\r
#include "stm32f7xx_hal.h"\r
\r
-/** @addtogroup STM32F3xx_HAL_Driver\r
+/** @addtogroup STM32F7xx_HAL_Driver\r
* @{\r
*/\r
\r
-/** @defgroup I2S I2S HAL module driver\r
+/** @defgroup I2S I2S\r
* @brief I2S HAL module driver\r
* @{\r
*/\r
assert_param(IS_I2S_CPOL(hi2s->Init.CPOL)); \r
assert_param(IS_I2S_CLOCKSOURCE(hi2s->Init.ClockSource));\r
\r
- hi2s->State = HAL_I2S_STATE_BUSY;\r
- \r
- /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */\r
- HAL_I2S_MspInit(hi2s);\r
+ if(hi2s->State == HAL_I2S_STATE_RESET)\r
+ {\r
+ /* Allocate lock resource and initialize it */\r
+ hi2s->Lock = HAL_UNLOCKED;\r
+ /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */\r
+ HAL_I2S_MspInit(hi2s);\r
+ }\r
\r
+ hi2s->State = HAL_I2S_STATE_BUSY;\r
+ \r
/*----------------------- SPIx I2SCFGR & I2SPR Configuration -----------------*/\r
/* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */\r
hi2s->Instance->I2SCFGR &= ~(SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CKPOL | \\r
\r
/**\r
* @brief Get I2S Input Clock based on I2S source clock selection\r
- * @param hsai: pointer to a I2S_HandleTypeDef structure that contains\r
+ * @param hi2s: pointer to a I2S_HandleTypeDef structure that contains\r
* the configuration information for I2S module. \r
* @retval I2S Clock Input \r
*/\r