my fork
Fork of mbed by
Diff: TARGET_NUCLEO_F072RB/stm32f0xx_hal_i2s.h
- Revision:
- 92:4fc01daae5a5
- Parent:
- 85:024bf7f99721
- Child:
- 93:e188a91d3eaa
diff -r 031413cf7a89 -r 4fc01daae5a5 TARGET_NUCLEO_F072RB/stm32f0xx_hal_i2s.h --- a/TARGET_NUCLEO_F072RB/stm32f0xx_hal_i2s.h Wed Oct 29 11:02:04 2014 +0000 +++ b/TARGET_NUCLEO_F072RB/stm32f0xx_hal_i2s.h Thu Nov 27 13:33:22 2014 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f0xx_hal_i2s.h * @author MCD Application Team - * @version V1.0.0 - * @date 28-May-2014 + * @version V1.1.0 + * @date 03-Oct-2014 * @brief Header file of I2S HAL module. ****************************************************************************** * @attention @@ -43,10 +43,11 @@ extern "C" { #endif -#if defined(STM32F031x6) || defined(STM32F038xx) || \ - defined(STM32F051x8) || defined(STM32F058xx) || \ +#if defined(STM32F031x6) || defined(STM32F038xx) || \ + defined(STM32F051x8) || defined(STM32F058xx) || \ defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \ - defined(STM32F042x6) || defined(STM32F048xx) + defined(STM32F042x6) || defined(STM32F048xx) || \ + defined(STM32F091xC) || defined(STM32F098xx) /* Includes ------------------------------------------------------------------*/ #include "stm32f0xx_hal_def.h" @@ -60,32 +61,32 @@ */ /* Exported types ------------------------------------------------------------*/ +/** @defgroup I2S_Exported_Types I2S Exported Types + * @{ + */ + /** * @brief I2S Init structure definition */ typedef struct { - uint32_t Mode; /*!< Specifies the I2S operating mode. + uint32_t Mode; /*!< Specifies the I2S operating mode. This parameter can be a value of @ref I2S_Mode */ - uint32_t Standard; /*!< Specifies the standard used for the I2S communication. + uint32_t Standard; /*!< Specifies the standard used for the I2S communication. This parameter can be a value of @ref I2S_Standard */ - uint32_t DataFormat; /*!< Specifies the data format for the I2S communication. + uint32_t DataFormat; /*!< Specifies the data format for the I2S communication. This parameter can be a value of @ref I2S_Data_Format */ - uint32_t MCLKOutput; /*!< Specifies whether the I2S MCLK output is enabled or not. + uint32_t MCLKOutput; /*!< Specifies whether the I2S MCLK output is enabled or not. This parameter can be a value of @ref I2S_MCLK_Output */ uint32_t AudioFreq; /*!< Specifies the frequency selected for the I2S communication. This parameter can be a value of @ref I2S_Audio_Frequency */ - uint32_t CPOL; /*!< Specifies the idle state of the I2S clock. + uint32_t CPOL; /*!< Specifies the idle state of the I2S clock. This parameter can be a value of @ref I2S_Clock_Polarity */ - - uint32_t ClockSource; /*!< Specifies the I2S Clock Source. - This parameter can be a value of @ref I2S_Clock_Source */ - }I2S_InitTypeDef; /** @@ -99,8 +100,7 @@ HAL_I2S_STATE_BUSY_TX = 0x03, /*!< Data Transmission process is ongoing */ HAL_I2S_STATE_BUSY_RX = 0x04, /*!< Data Reception process is ongoing */ HAL_I2S_STATE_PAUSE = 0x06, /*!< I2S pause state: used in case of DMA */ - HAL_I2S_STATE_TIMEOUT = 0x07, /*!< I2S timeout state */ - HAL_I2S_STATE_ERROR = 0x08 /*!< I2S error state */ + HAL_I2S_STATE_ERROR = 0x07 /*!< I2S error state */ }HAL_I2S_StateTypeDef; /** @@ -135,7 +135,12 @@ __IO uint16_t RxXferSize; /* I2S Rx transfer size */ - __IO uint16_t RxXferCount; /* I2S Rx transfer counter */ + __IO uint16_t RxXferCount; /* I2S Rx transfer counter + (This field is initialized at the + same value as transfer size at the + beginning of the transfer and + decremented when a sample is received. + NbSamplesReceived = RxBufferSize-RxBufferCount) */ DMA_HandleTypeDef *hdmatx; /* I2S Tx DMA handle parameters */ @@ -148,26 +153,16 @@ __IO HAL_I2S_ErrorTypeDef ErrorCode; /* I2S Error code */ }I2S_HandleTypeDef; - -/* Exported constants --------------------------------------------------------*/ - -/** @defgroup I2S_Exported_Constants - * @{ - */ - -/** @defgroup I2S_Clock_Source - * @{ - */ -#define I2S_CLOCK_PLL ((uint32_t)0x00000000) -#define I2S_CLOCK_EXTERNAL ((uint32_t)0x00000001) - -#define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) || \ - ((CLOCK) == I2S_CLOCK_PLL)) /** * @} */ -/** @defgroup I2S_Mode +/* Exported constants --------------------------------------------------------*/ +/** @defgroup I2S_Exported_Constants I2S Exported Constants + * @{ + */ + +/** @defgroup I2S_Mode I2S Mode * @{ */ #define I2S_MODE_SLAVE_TX ((uint32_t)0x00000000) @@ -183,7 +178,7 @@ * @} */ -/** @defgroup I2S_Standard +/** @defgroup I2S_Standard I2S Standard * @{ */ #define I2S_STANDARD_PHILIPS ((uint32_t)0x00000000) @@ -192,7 +187,7 @@ #define I2S_STANDARD_PCM_SHORT ((uint32_t)0x00000030) #define I2S_STANDARD_PCM_LONG ((uint32_t)0x000000B0) -#define IS_I2S_STANDARD(STANDARD) (((STANDARD) == I2S_STANDARD_PHILIPS) || \ +#define IS_I2S_STANDARD(STANDARD) (((STANDARD) == I2S_STANDARD_PHILIPS) || \ ((STANDARD) == I2S_STANDARD_MSB) || \ ((STANDARD) == I2S_STANDARD_LSB) || \ ((STANDARD) == I2S_STANDARD_PCM_SHORT) || \ @@ -201,7 +196,7 @@ * @} */ -/** @defgroup I2S_Data_Format +/** @defgroup I2S_Data_Format I2S Data Format * @{ */ #define I2S_DATAFORMAT_16B ((uint32_t)0x00000000) @@ -217,7 +212,7 @@ * @} */ -/** @defgroup I2S_MCLK_Output +/** @defgroup I2S_MCLK_Output I2S MCLK Output * @{ */ #define I2S_MCLKOUTPUT_ENABLE ((uint32_t)SPI_I2SPR_MCKOE) @@ -229,7 +224,7 @@ * @} */ -/** @defgroup I2S_Audio_Frequency +/** @defgroup I2S_Audio_Frequency I2S Audio Frequency * @{ */ #define I2S_AUDIOFREQ_192K ((uint32_t)192000) @@ -250,7 +245,7 @@ * @} */ -/** @defgroup I2S_Clock_Polarity +/** @defgroup I2S_Clock_Polarity I2S Clock Polarity * @{ */ #define I2S_CPOL_LOW ((uint32_t)0x00000000) @@ -262,7 +257,7 @@ * @} */ -/** @defgroup I2S_Interrupt_configuration_definition +/** @defgroup I2S_Interrupt_configuration_definition I2S Interrupt configuration definition * @{ */ #define I2S_IT_TXE SPI_CR2_TXEIE @@ -272,7 +267,7 @@ * @} */ -/** @defgroup I2S_Flag_definition +/** @defgroup I2S_Flag_definition I2S Flag definition * @{ */ #define I2S_FLAG_TXE SPI_SR_TXE @@ -293,6 +288,9 @@ */ /* Exported macros -----------------------------------------------------------*/ +/** @defgroup I2S_Exported_macros I2S Exported Macros + * @{ + */ /** @brief Reset I2S handle state * @param __HANDLE__: I2S handle. @@ -357,15 +355,30 @@ * @retval None */ #define __HAL_I2S_CLEAR_UDRFLAG(__HANDLE__)((__HANDLE__)->Instance->SR) +/** + * @} + */ /* Exported functions --------------------------------------------------------*/ - +/** @addtogroup I2S_Exported_Functions + * @{ + */ + +/** @addtogroup I2S_Exported_Functions_Group1 + * @{ + */ /* Initialization/de-initialization functions **********************************/ -__weak HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s); +HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s); HAL_StatusTypeDef HAL_I2S_DeInit (I2S_HandleTypeDef *hi2s); void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s); void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s); +/** + * @} + */ +/** @addtogroup I2S_Exported_Functions_Group2 + * @{ + */ /* I/O operation functions ***************************************************/ /* Blocking mode: Polling */ HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout); @@ -384,29 +397,43 @@ HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s); HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s); -/* Peripheral Control and State functions **************************************/ -HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s); -HAL_I2S_ErrorTypeDef HAL_I2S_GetError(I2S_HandleTypeDef *hi2s); - /* Callbacks used in non blocking modes (Interrupt and DMA) *******************/ void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s); void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s); +/** + * @} + */ + +/** @addtogroup I2S_Exported_Functions_Group3 + * @{ + */ +/* Peripheral Control and State functions ************************************/ +HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s); +HAL_I2S_ErrorTypeDef HAL_I2S_GetError(I2S_HandleTypeDef *hi2s); +/** + * @} + */ /** * @} */ + /** * @} */ -#endif /* defined(STM32F031x6) || defined(STM32F038xx) || */ - /* defined(STM32F051x8) || defined(STM32F058xx) || */ - /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) ||*/ - /* defined(STM32F042x6) || defined(STM32F048xx) */ +/** + * @} + */ +#endif /* defined(STM32F031x6) || defined(STM32F038xx) || */ + /* defined(STM32F051x8) || defined(STM32F058xx) || */ + /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) ||*/ + /* defined(STM32F042x6) || defined(STM32F048xx) || */ + /* defined(STM32F091xC) || defined(STM32F098xx) */ #ifdef __cplusplus }