Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Release 93 of the mbed library

Main changes:

- Renesas RZ_A1H bugfixes - i2c, ticker
- new targets - Nucleo F303RE, Nucleo F070RB, BLE SMURFS,
Dragonfly 411RE,
- BusXXX - is connected method, plus operators addition
- LPC8xx - I2c fixes
- timestamp_t reverted to uint32_t
- RTX - fixes regarding stack (alignment, magic word)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 93:e188a91d3eaa 1 /**
Kojto 93:e188a91d3eaa 2 ******************************************************************************
Kojto 93:e188a91d3eaa 3 * @file stm32f3xx_hal_i2s_ex.h
Kojto 93:e188a91d3eaa 4 * @author MCD Application Team
Kojto 93:e188a91d3eaa 5 * @version V1.1.0
Kojto 93:e188a91d3eaa 6 * @date 12-Sept-2014
Kojto 93:e188a91d3eaa 7 * @brief Header file of I2S HAL Extended module.
Kojto 93:e188a91d3eaa 8 ******************************************************************************
Kojto 93:e188a91d3eaa 9 * @attention
Kojto 93:e188a91d3eaa 10 *
Kojto 93:e188a91d3eaa 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 93:e188a91d3eaa 12 *
Kojto 93:e188a91d3eaa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 93:e188a91d3eaa 14 * are permitted provided that the following conditions are met:
Kojto 93:e188a91d3eaa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 93:e188a91d3eaa 16 * this list of conditions and the following disclaimer.
Kojto 93:e188a91d3eaa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 93:e188a91d3eaa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 93:e188a91d3eaa 19 * and/or other materials provided with the distribution.
Kojto 93:e188a91d3eaa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 93:e188a91d3eaa 21 * may be used to endorse or promote products derived from this software
Kojto 93:e188a91d3eaa 22 * without specific prior written permission.
Kojto 93:e188a91d3eaa 23 *
Kojto 93:e188a91d3eaa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 93:e188a91d3eaa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 93:e188a91d3eaa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 93:e188a91d3eaa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 93:e188a91d3eaa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 93:e188a91d3eaa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 93:e188a91d3eaa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 93:e188a91d3eaa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 93:e188a91d3eaa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 93:e188a91d3eaa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 93:e188a91d3eaa 34 *
Kojto 93:e188a91d3eaa 35 ******************************************************************************
Kojto 93:e188a91d3eaa 36 */
Kojto 93:e188a91d3eaa 37
Kojto 93:e188a91d3eaa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 93:e188a91d3eaa 39 #ifndef __STM32F3xx_HAL_I2S_EX_H
Kojto 93:e188a91d3eaa 40 #define __STM32F3xx_HAL_I2S_EX_H
Kojto 93:e188a91d3eaa 41
Kojto 93:e188a91d3eaa 42 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 43 extern "C" {
Kojto 93:e188a91d3eaa 44 #endif
Kojto 93:e188a91d3eaa 45
Kojto 93:e188a91d3eaa 46 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 93:e188a91d3eaa 47 defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
Kojto 93:e188a91d3eaa 48 defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
Kojto 93:e188a91d3eaa 49 defined(STM32F373xC) || defined(STM32F378xx)
Kojto 93:e188a91d3eaa 50
Kojto 93:e188a91d3eaa 51 /* Includes ------------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 52 #include "stm32f3xx_hal_def.h"
Kojto 93:e188a91d3eaa 53
Kojto 93:e188a91d3eaa 54 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 93:e188a91d3eaa 55 * @{
Kojto 93:e188a91d3eaa 56 */
Kojto 93:e188a91d3eaa 57
Kojto 93:e188a91d3eaa 58 /** @addtogroup I2SEx I2S Extended HAL module driver
Kojto 93:e188a91d3eaa 59 * @{
Kojto 93:e188a91d3eaa 60 */
Kojto 93:e188a91d3eaa 61
Kojto 93:e188a91d3eaa 62 /* Exported types ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 63 /* Exported constants --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 64 /* Exported macros ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 65 /** @defgroup I2SEx_Exported_Macros I2S Extended Exported Macros
Kojto 93:e188a91d3eaa 66 * @{
Kojto 93:e188a91d3eaa 67 */
Kojto 93:e188a91d3eaa 68 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 93:e188a91d3eaa 69 defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 93:e188a91d3eaa 70 #define I2SxEXT(__INSTANCE__) ((__INSTANCE__) == (SPI2)? (SPI_TypeDef *)(I2S2ext_BASE): (SPI_TypeDef *)(I2S3ext_BASE))
Kojto 93:e188a91d3eaa 71
Kojto 93:e188a91d3eaa 72 /** @brief Enable or disable the specified I2SExt peripheral.
Kojto 93:e188a91d3eaa 73 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 74 * @retval None
Kojto 93:e188a91d3eaa 75 */
Kojto 93:e188a91d3eaa 76 #define __HAL_I2SEXT_ENABLE(__HANDLE__) (I2SxEXT((__HANDLE__)->Instance)->I2SCFGR |= SPI_I2SCFGR_I2SE)
Kojto 93:e188a91d3eaa 77 #define __HAL_I2SEXT_DISABLE(__HANDLE__) (I2SxEXT((__HANDLE__)->Instance)->I2SCFGR &= ~SPI_I2SCFGR_I2SE)
Kojto 93:e188a91d3eaa 78
Kojto 93:e188a91d3eaa 79 /** @brief Enable or disable the specified I2SExt interrupts.
Kojto 93:e188a91d3eaa 80 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 81 * @param __INTERRUPT__: specifies the interrupt source to enable or disable.
Kojto 93:e188a91d3eaa 82 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 83 * @arg I2S_IT_TXE: Tx buffer empty interrupt enable
Kojto 93:e188a91d3eaa 84 * @arg I2S_IT_RXNE: RX buffer not empty interrupt enable
Kojto 93:e188a91d3eaa 85 * @arg I2S_IT_ERR: Error interrupt enable
Kojto 93:e188a91d3eaa 86 * @retval None
Kojto 93:e188a91d3eaa 87 */
Kojto 93:e188a91d3eaa 88 #define __HAL_I2SEXT_ENABLE_IT(__HANDLE__, __INTERRUPT__) (I2SxEXT((__HANDLE__)->Instance)->CR2 |= (__INTERRUPT__))
Kojto 93:e188a91d3eaa 89 #define __HAL_I2SEXT_DISABLE_IT(__HANDLE__, __INTERRUPT__) (I2SxEXT((__HANDLE__)->Instance)->CR2 &= ~(__INTERRUPT__))
Kojto 93:e188a91d3eaa 90
Kojto 93:e188a91d3eaa 91 /** @brief Checks if the specified I2SExt interrupt source is enabled or disabled.
Kojto 93:e188a91d3eaa 92 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 93 * This parameter can be I2S where x: 1, 2, or 3 to select the I2S peripheral.
Kojto 93:e188a91d3eaa 94 * @param __INTERRUPT__: specifies the I2S interrupt source to check.
Kojto 93:e188a91d3eaa 95 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 96 * @arg I2S_IT_TXE: Tx buffer empty interrupt enable
Kojto 93:e188a91d3eaa 97 * @arg I2S_IT_RXNE: RX buffer not empty interrupt enable
Kojto 93:e188a91d3eaa 98 * @arg I2S_IT_ERR: Error interrupt enable
Kojto 93:e188a91d3eaa 99 * @retval The new state of __IT__ (TRUE or FALSE).
Kojto 93:e188a91d3eaa 100 */
Kojto 93:e188a91d3eaa 101 #define __HAL_I2SEXT_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((I2SxEXT((__HANDLE__)->Instance)->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
Kojto 93:e188a91d3eaa 102
Kojto 93:e188a91d3eaa 103 /** @brief Checks whether the specified I2SExt flag is set or not.
Kojto 93:e188a91d3eaa 104 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 105 * @param __FLAG__: specifies the flag to check.
Kojto 93:e188a91d3eaa 106 * This parameter can be one of the following values:
Kojto 93:e188a91d3eaa 107 * @arg I2S_FLAG_RXNE: Receive buffer not empty flag
Kojto 93:e188a91d3eaa 108 * @arg I2S_FLAG_TXE: Transmit buffer empty flag
Kojto 93:e188a91d3eaa 109 * @arg I2S_FLAG_UDR: Underrun flag
Kojto 93:e188a91d3eaa 110 * @arg I2S_FLAG_OVR: Overrun flag
Kojto 93:e188a91d3eaa 111 * @arg I2S_FLAG_FRE: Frame error flag
Kojto 93:e188a91d3eaa 112 * @arg I2S_FLAG_CHSIDE: Channel Side flag
Kojto 93:e188a91d3eaa 113 * @arg I2S_FLAG_BSY: Busy flag
Kojto 93:e188a91d3eaa 114 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 93:e188a91d3eaa 115 */
Kojto 93:e188a91d3eaa 116 #define __HAL_I2SEXT_GET_FLAG(__HANDLE__, __FLAG__) (((I2SxEXT((__HANDLE__)->Instance)->SR) & (__FLAG__)) == (__FLAG__))
Kojto 93:e188a91d3eaa 117
Kojto 93:e188a91d3eaa 118 /** @brief Clears the I2SExt OVR pending flag.
Kojto 93:e188a91d3eaa 119 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 120 * @retval None
Kojto 93:e188a91d3eaa 121 */
Kojto 93:e188a91d3eaa 122 #define __HAL_I2SEXT_CLEAR_OVRFLAG(__HANDLE__) do{(I2SxEXT((__HANDLE__)->Instance)->DR;\
Kojto 93:e188a91d3eaa 123 (I2SxEXT((__HANDLE__)->Instance)->SR;}while(0)
Kojto 93:e188a91d3eaa 124 /** @brief Clears the I2SExt UDR pending flag.
Kojto 93:e188a91d3eaa 125 * @param __HANDLE__: specifies the I2S Handle.
Kojto 93:e188a91d3eaa 126 * @retval None
Kojto 93:e188a91d3eaa 127 */
Kojto 93:e188a91d3eaa 128 #define __HAL_I2SEXT_CLEAR_UDRFLAG(__HANDLE__)(I2SxEXT((__HANDLE__)->Instance)->SR)
Kojto 93:e188a91d3eaa 129 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
Kojto 93:e188a91d3eaa 130 /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 93:e188a91d3eaa 131 /**
Kojto 93:e188a91d3eaa 132 * @}
Kojto 93:e188a91d3eaa 133 */
Kojto 93:e188a91d3eaa 134
Kojto 93:e188a91d3eaa 135
Kojto 93:e188a91d3eaa 136 /* Exported functions --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 137 /* Initialization/de-initialization functions ********************************/
Kojto 93:e188a91d3eaa 138 /** @addtogroup I2SEx_Exported_Functions I2S Extended Exported Functions
Kojto 93:e188a91d3eaa 139 * @{
Kojto 93:e188a91d3eaa 140 */
Kojto 93:e188a91d3eaa 141
Kojto 93:e188a91d3eaa 142 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 93:e188a91d3eaa 143 defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 93:e188a91d3eaa 144 /** @addtogroup I2SEx_Exported_Functions_Group1 Extended features functions
Kojto 93:e188a91d3eaa 145 * @{
Kojto 93:e188a91d3eaa 146 */
Kojto 93:e188a91d3eaa 147
Kojto 93:e188a91d3eaa 148 /* Extended features functions ************************************************/
Kojto 93:e188a91d3eaa 149 /* Blocking mode: Polling */
Kojto 93:e188a91d3eaa 150 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size, uint32_t Timeout);
Kojto 93:e188a91d3eaa 151 /* Non-Blocking mode: Interrupt */
Kojto 93:e188a91d3eaa 152 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size);
Kojto 93:e188a91d3eaa 153 /* Non-Blocking mode: DMA */
Kojto 93:e188a91d3eaa 154 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size);
Kojto 93:e188a91d3eaa 155 /**
Kojto 93:e188a91d3eaa 156 * @}
Kojto 93:e188a91d3eaa 157 */
Kojto 93:e188a91d3eaa 158 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
Kojto 93:e188a91d3eaa 159 /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 93:e188a91d3eaa 160
Kojto 93:e188a91d3eaa 161 /**
Kojto 93:e188a91d3eaa 162 * @}
Kojto 93:e188a91d3eaa 163 */
Kojto 93:e188a91d3eaa 164
Kojto 93:e188a91d3eaa 165 /**
Kojto 93:e188a91d3eaa 166 * @}
Kojto 93:e188a91d3eaa 167 */
Kojto 93:e188a91d3eaa 168
Kojto 93:e188a91d3eaa 169 /** @addtogroup I2S I2S HAL module driver
Kojto 93:e188a91d3eaa 170 * @{
Kojto 93:e188a91d3eaa 171 */
Kojto 93:e188a91d3eaa 172
Kojto 93:e188a91d3eaa 173 /** @addtogroup I2S_Exported_Functions I2S Exported Functions
Kojto 93:e188a91d3eaa 174 * @{
Kojto 93:e188a91d3eaa 175 */
Kojto 93:e188a91d3eaa 176 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 93:e188a91d3eaa 177 defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 93:e188a91d3eaa 178 /** @addtogroup I2S_Exported_Functions_Group2 Input and Output operation functions
Kojto 93:e188a91d3eaa 179 * @{
Kojto 93:e188a91d3eaa 180 */
Kojto 93:e188a91d3eaa 181 /* I2S IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
Kojto 93:e188a91d3eaa 182 void HAL_I2S_FullDuplex_IRQHandler(I2S_HandleTypeDef *hi2s);
Kojto 93:e188a91d3eaa 183 void HAL_I2S_TxRxCpltCallback(I2S_HandleTypeDef *hi2s);
Kojto 93:e188a91d3eaa 184 /**
Kojto 93:e188a91d3eaa 185 * @}
Kojto 93:e188a91d3eaa 186 */
Kojto 93:e188a91d3eaa 187 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
Kojto 93:e188a91d3eaa 188 /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 93:e188a91d3eaa 189
Kojto 93:e188a91d3eaa 190 /** @addtogroup I2S_Exported_Functions_Group3 Peripheral State and Errors functions
Kojto 93:e188a91d3eaa 191 * @{
Kojto 93:e188a91d3eaa 192 */
Kojto 93:e188a91d3eaa 193 /* Peripheral Control and State functions ************************************/
Kojto 93:e188a91d3eaa 194 HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s);
Kojto 93:e188a91d3eaa 195 HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s);
Kojto 93:e188a91d3eaa 196 HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s);
Kojto 93:e188a91d3eaa 197
Kojto 93:e188a91d3eaa 198 /**
Kojto 93:e188a91d3eaa 199 * @}
Kojto 93:e188a91d3eaa 200 */
Kojto 93:e188a91d3eaa 201
Kojto 93:e188a91d3eaa 202 /**
Kojto 93:e188a91d3eaa 203 * @}
Kojto 93:e188a91d3eaa 204 */
Kojto 93:e188a91d3eaa 205
Kojto 93:e188a91d3eaa 206 /**
Kojto 93:e188a91d3eaa 207 * @}
Kojto 93:e188a91d3eaa 208 */
Kojto 93:e188a91d3eaa 209
Kojto 93:e188a91d3eaa 210 /**
Kojto 93:e188a91d3eaa 211 * @}
Kojto 93:e188a91d3eaa 212 */
Kojto 93:e188a91d3eaa 213 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
Kojto 93:e188a91d3eaa 214 /* STM32F302xC || STM32F303xC || STM32F358xx || */
Kojto 93:e188a91d3eaa 215 /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
Kojto 93:e188a91d3eaa 216 /* STM32F373xC || STM32F378xx */
Kojto 93:e188a91d3eaa 217
Kojto 93:e188a91d3eaa 218 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 219 }
Kojto 93:e188a91d3eaa 220 #endif
Kojto 93:e188a91d3eaa 221
Kojto 93:e188a91d3eaa 222
Kojto 93:e188a91d3eaa 223 #endif /* __STM32F3xx_HAL_I2S_EX_H */
Kojto 93:e188a91d3eaa 224
Kojto 93:e188a91d3eaa 225 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/