mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_spdifrx.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of SPDIFRX HAL module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_SPDIFRX_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_SPDIFRX_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_hal_def.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup SPDIFRX
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported types ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58 /** @defgroup SPDIFRX_Exported_Types SPDIFRX Exported Types
mbed_official 573:ad23fe03a082 59 * @{
mbed_official 573:ad23fe03a082 60 */
mbed_official 573:ad23fe03a082 61
mbed_official 573:ad23fe03a082 62 /**
mbed_official 573:ad23fe03a082 63 * @brief SPDIFRX Init structure definition
mbed_official 573:ad23fe03a082 64 */
mbed_official 573:ad23fe03a082 65 typedef struct
mbed_official 573:ad23fe03a082 66 {
mbed_official 573:ad23fe03a082 67 uint32_t InputSelection; /*!< Specifies the SPDIF input selection.
mbed_official 573:ad23fe03a082 68 This parameter can be a value of @ref SPDIFRX_Input_Selection */
mbed_official 573:ad23fe03a082 69
mbed_official 573:ad23fe03a082 70 uint32_t Retries; /*!< Specifies the Maximum allowed re-tries during synchronization phase.
mbed_official 573:ad23fe03a082 71 This parameter can be a value of @ref SPDIFRX_Max_Retries */
mbed_official 573:ad23fe03a082 72
mbed_official 573:ad23fe03a082 73 uint32_t WaitForActivity; /*!< Specifies the wait for activity on SPDIF selected input.
mbed_official 573:ad23fe03a082 74 This parameter can be a value of @ref SPDIFRX_Wait_For_Activity. */
mbed_official 573:ad23fe03a082 75
mbed_official 573:ad23fe03a082 76 uint32_t ChannelSelection; /*!< Specifies whether the control flow will take the channel status from channel A or B.
mbed_official 573:ad23fe03a082 77 This parameter can be a value of @ref SPDIFRX_Channel_Selection */
mbed_official 573:ad23fe03a082 78
mbed_official 573:ad23fe03a082 79 uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...).
mbed_official 573:ad23fe03a082 80 This parameter can be a value of @ref SPDIFRX_Data_Format */
mbed_official 573:ad23fe03a082 81
mbed_official 573:ad23fe03a082 82 uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode.
mbed_official 573:ad23fe03a082 83 This parameter can be a value of @ref SPDIFRX_Stereo_Mode */
mbed_official 573:ad23fe03a082 84
mbed_official 573:ad23fe03a082 85 uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame.
mbed_official 573:ad23fe03a082 86 This parameter can be a value of @ref SPDIFRX_PT_Mask */
mbed_official 573:ad23fe03a082 87
mbed_official 573:ad23fe03a082 88 uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame.
mbed_official 573:ad23fe03a082 89 This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */
mbed_official 573:ad23fe03a082 90
mbed_official 573:ad23fe03a082 91 uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame.
mbed_official 573:ad23fe03a082 92 This parameter can be a value of @ref SPDIFRX_V_Mask */
mbed_official 573:ad23fe03a082 93
mbed_official 573:ad23fe03a082 94 uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame.
mbed_official 573:ad23fe03a082 95 This parameter can be a value of @ref SPDIFRX_PE_Mask */
mbed_official 573:ad23fe03a082 96
mbed_official 573:ad23fe03a082 97 }SPDIFRX_InitTypeDef;
mbed_official 573:ad23fe03a082 98
mbed_official 573:ad23fe03a082 99 /**
mbed_official 573:ad23fe03a082 100 * @brief SPDIFRX SetDataFormat structure definition
mbed_official 573:ad23fe03a082 101 */
mbed_official 573:ad23fe03a082 102 typedef struct
mbed_official 573:ad23fe03a082 103 {
mbed_official 573:ad23fe03a082 104 uint32_t DataFormat; /*!< Specifies the Data samples format (LSB, MSB, ...).
mbed_official 573:ad23fe03a082 105 This parameter can be a value of @ref SPDIFRX_Data_Format */
mbed_official 573:ad23fe03a082 106
mbed_official 573:ad23fe03a082 107 uint32_t StereoMode; /*!< Specifies whether the peripheral is in stereo or mono mode.
mbed_official 573:ad23fe03a082 108 This parameter can be a value of @ref SPDIFRX_Stereo_Mode */
mbed_official 573:ad23fe03a082 109
mbed_official 573:ad23fe03a082 110 uint32_t PreambleTypeMask; /*!< Specifies whether The preamble type bits are copied or not into the received frame.
mbed_official 573:ad23fe03a082 111 This parameter can be a value of @ref SPDIFRX_PT_Mask */
mbed_official 573:ad23fe03a082 112
mbed_official 573:ad23fe03a082 113 uint32_t ChannelStatusMask; /*!< Specifies whether the channel status and user bits are copied or not into the received frame.
mbed_official 573:ad23fe03a082 114 This parameter can be a value of @ref SPDIFRX_ChannelStatus_Mask */
mbed_official 573:ad23fe03a082 115
mbed_official 573:ad23fe03a082 116 uint32_t ValidityBitMask; /*!< Specifies whether the validity bit is copied or not into the received frame.
mbed_official 573:ad23fe03a082 117 This parameter can be a value of @ref SPDIFRX_V_Mask */
mbed_official 573:ad23fe03a082 118
mbed_official 573:ad23fe03a082 119 uint32_t ParityErrorMask; /*!< Specifies whether the parity error bit is copied or not into the received frame.
mbed_official 573:ad23fe03a082 120 This parameter can be a value of @ref SPDIFRX_PE_Mask */
mbed_official 573:ad23fe03a082 121
mbed_official 573:ad23fe03a082 122 }SPDIFRX_SetDataFormatTypeDef;
mbed_official 573:ad23fe03a082 123
mbed_official 573:ad23fe03a082 124 /**
mbed_official 573:ad23fe03a082 125 * @brief HAL State structures definition
mbed_official 573:ad23fe03a082 126 */
mbed_official 573:ad23fe03a082 127 typedef enum
mbed_official 573:ad23fe03a082 128 {
mbed_official 573:ad23fe03a082 129 HAL_SPDIFRX_STATE_RESET = 0x00, /*!< SPDIFRX not yet initialized or disabled */
mbed_official 573:ad23fe03a082 130 HAL_SPDIFRX_STATE_READY = 0x01, /*!< SPDIFRX initialized and ready for use */
mbed_official 573:ad23fe03a082 131 HAL_SPDIFRX_STATE_BUSY = 0x02, /*!< SPDIFRX internal process is ongoing */
mbed_official 573:ad23fe03a082 132 HAL_SPDIFRX_STATE_BUSY_RX = 0x03, /*!< SPDIFRX internal Data Flow RX process is ongoing */
mbed_official 573:ad23fe03a082 133 HAL_SPDIFRX_STATE_BUSY_CX = 0x04, /*!< SPDIFRX internal Control Flow RX process is ongoing */
mbed_official 573:ad23fe03a082 134 HAL_SPDIFRX_STATE_ERROR = 0x07 /*!< SPDIFRX error state */
mbed_official 573:ad23fe03a082 135 }HAL_SPDIFRX_StateTypeDef;
mbed_official 573:ad23fe03a082 136
mbed_official 573:ad23fe03a082 137 /**
mbed_official 573:ad23fe03a082 138 * @brief SPDIFRX handle Structure definition
mbed_official 573:ad23fe03a082 139 */
mbed_official 573:ad23fe03a082 140 typedef struct
mbed_official 573:ad23fe03a082 141 {
mbed_official 573:ad23fe03a082 142 SPDIFRX_TypeDef *Instance; /* SPDIFRX registers base address */
mbed_official 573:ad23fe03a082 143
mbed_official 573:ad23fe03a082 144 SPDIFRX_InitTypeDef Init; /* SPDIFRX communication parameters */
mbed_official 573:ad23fe03a082 145
mbed_official 573:ad23fe03a082 146 uint32_t *pRxBuffPtr; /* Pointer to SPDIFRX Rx transfer buffer */
mbed_official 573:ad23fe03a082 147
mbed_official 573:ad23fe03a082 148 uint32_t *pCsBuffPtr; /* Pointer to SPDIFRX Cx transfer buffer */
mbed_official 573:ad23fe03a082 149
mbed_official 573:ad23fe03a082 150 __IO uint16_t RxXferSize; /* SPDIFRX Rx transfer size */
mbed_official 573:ad23fe03a082 151
mbed_official 573:ad23fe03a082 152 __IO uint16_t RxXferCount; /* SPDIFRX Rx transfer counter
mbed_official 573:ad23fe03a082 153 (This field is initialized at the
mbed_official 573:ad23fe03a082 154 same value as transfer size at the
mbed_official 573:ad23fe03a082 155 beginning of the transfer and
mbed_official 573:ad23fe03a082 156 decremented when a sample is received.
mbed_official 573:ad23fe03a082 157 NbSamplesReceived = RxBufferSize-RxBufferCount) */
mbed_official 573:ad23fe03a082 158
mbed_official 573:ad23fe03a082 159 __IO uint16_t CsXferSize; /* SPDIFRX Rx transfer size */
mbed_official 573:ad23fe03a082 160
mbed_official 573:ad23fe03a082 161 __IO uint16_t CsXferCount; /* SPDIFRX Rx transfer counter
mbed_official 573:ad23fe03a082 162 (This field is initialized at the
mbed_official 573:ad23fe03a082 163 same value as transfer size at the
mbed_official 573:ad23fe03a082 164 beginning of the transfer and
mbed_official 573:ad23fe03a082 165 decremented when a sample is received.
mbed_official 573:ad23fe03a082 166 NbSamplesReceived = RxBufferSize-RxBufferCount) */
mbed_official 573:ad23fe03a082 167
mbed_official 573:ad23fe03a082 168 DMA_HandleTypeDef *hdmaCsRx; /* SPDIFRX EC60958_channel_status and user_information DMA handle parameters */
mbed_official 573:ad23fe03a082 169
mbed_official 573:ad23fe03a082 170 DMA_HandleTypeDef *hdmaDrRx; /* SPDIFRX Rx DMA handle parameters */
mbed_official 573:ad23fe03a082 171
mbed_official 573:ad23fe03a082 172 __IO HAL_LockTypeDef Lock; /* SPDIFRX locking object */
mbed_official 573:ad23fe03a082 173
mbed_official 573:ad23fe03a082 174 __IO HAL_SPDIFRX_StateTypeDef State; /* SPDIFRX communication state */
mbed_official 573:ad23fe03a082 175
mbed_official 573:ad23fe03a082 176 __IO uint32_t ErrorCode; /* SPDIFRX Error code */
mbed_official 573:ad23fe03a082 177
mbed_official 573:ad23fe03a082 178 }SPDIFRX_HandleTypeDef;
mbed_official 573:ad23fe03a082 179 /**
mbed_official 573:ad23fe03a082 180 * @}
mbed_official 573:ad23fe03a082 181 */
mbed_official 573:ad23fe03a082 182
mbed_official 573:ad23fe03a082 183 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 184 /** @defgroup SPDIFRX_Exported_Constants SPDIFRX Exported Constants
mbed_official 573:ad23fe03a082 185 * @{
mbed_official 573:ad23fe03a082 186 */
mbed_official 573:ad23fe03a082 187 /** @defgroup SPDIFRX_ErrorCode SPDIFRX Error Code
mbed_official 573:ad23fe03a082 188 * @{
mbed_official 573:ad23fe03a082 189 */
mbed_official 573:ad23fe03a082 190 #define HAL_SPDIFRX_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
mbed_official 573:ad23fe03a082 191 #define HAL_SPDIFRX_ERROR_TIMEOUT ((uint32_t)0x00000001) /*!< Timeout error */
mbed_official 573:ad23fe03a082 192 #define HAL_SPDIFRX_ERROR_OVR ((uint32_t)0x00000002) /*!< OVR error */
mbed_official 573:ad23fe03a082 193 #define HAL_SPDIFRX_ERROR_PE ((uint32_t)0x00000004) /*!< Parity error */
mbed_official 573:ad23fe03a082 194 #define HAL_SPDIFRX_ERROR_DMA ((uint32_t)0x00000008) /*!< DMA transfer error */
mbed_official 573:ad23fe03a082 195 #define HAL_SPDIFRX_ERROR_UNKNOWN ((uint32_t)0x00000010) /*!< Unknown Error error */
mbed_official 573:ad23fe03a082 196 /**
mbed_official 573:ad23fe03a082 197 * @}
mbed_official 573:ad23fe03a082 198 */
mbed_official 573:ad23fe03a082 199
mbed_official 573:ad23fe03a082 200 /** @defgroup SPDIFRX_Input_Selection SPDIFRX Input Selection
mbed_official 573:ad23fe03a082 201 * @{
mbed_official 573:ad23fe03a082 202 */
mbed_official 573:ad23fe03a082 203 #define SPDIFRX_INPUT_IN0 ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 204 #define SPDIFRX_INPUT_IN1 ((uint32_t)0x00010000)
mbed_official 573:ad23fe03a082 205 #define SPDIFRX_INPUT_IN2 ((uint32_t)0x00020000)
mbed_official 573:ad23fe03a082 206 #define SPDIFRX_INPUT_IN3 ((uint32_t)0x00030000)
mbed_official 573:ad23fe03a082 207 /**
mbed_official 573:ad23fe03a082 208 * @}
mbed_official 573:ad23fe03a082 209 */
mbed_official 573:ad23fe03a082 210
mbed_official 573:ad23fe03a082 211 /** @defgroup SPDIFRX_Max_Retries SPDIFRX Maximum Retries
mbed_official 573:ad23fe03a082 212 * @{
mbed_official 573:ad23fe03a082 213 */
mbed_official 573:ad23fe03a082 214 #define SPDIFRX_MAXRETRIES_NONE ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 215 #define SPDIFRX_MAXRETRIES_3 ((uint32_t)0x00001000)
mbed_official 573:ad23fe03a082 216 #define SPDIFRX_MAXRETRIES_15 ((uint32_t)0x00002000)
mbed_official 573:ad23fe03a082 217 #define SPDIFRX_MAXRETRIES_63 ((uint32_t)0x00003000)
mbed_official 573:ad23fe03a082 218 /**
mbed_official 573:ad23fe03a082 219 * @}
mbed_official 573:ad23fe03a082 220 */
mbed_official 573:ad23fe03a082 221
mbed_official 573:ad23fe03a082 222 /** @defgroup SPDIFRX_Wait_For_Activity SPDIFRX Wait For Activity
mbed_official 573:ad23fe03a082 223 * @{
mbed_official 573:ad23fe03a082 224 */
mbed_official 573:ad23fe03a082 225 #define SPDIFRX_WAITFORACTIVITY_OFF ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 226 #define SPDIFRX_WAITFORACTIVITY_ON ((uint32_t)SPDIFRX_CR_WFA)
mbed_official 573:ad23fe03a082 227 /**
mbed_official 573:ad23fe03a082 228 * @}
mbed_official 573:ad23fe03a082 229 */
mbed_official 573:ad23fe03a082 230
mbed_official 573:ad23fe03a082 231 /** @defgroup SPDIFRX_PT_Mask SPDIFRX Preamble Type Mask
mbed_official 573:ad23fe03a082 232 * @{
mbed_official 573:ad23fe03a082 233 */
mbed_official 573:ad23fe03a082 234 #define SPDIFRX_PREAMBLETYPEMASK_OFF ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 235 #define SPDIFRX_PREAMBLETYPEMASK_ON ((uint32_t)SPDIFRX_CR_PTMSK)
mbed_official 573:ad23fe03a082 236 /**
mbed_official 573:ad23fe03a082 237 * @}
mbed_official 573:ad23fe03a082 238 */
mbed_official 573:ad23fe03a082 239
mbed_official 573:ad23fe03a082 240 /** @defgroup SPDIFRX_ChannelStatus_Mask SPDIFRX Channel Status Mask
mbed_official 573:ad23fe03a082 241 * @{
mbed_official 573:ad23fe03a082 242 */
mbed_official 573:ad23fe03a082 243 #define SPDIFRX_CHANNELSTATUS_OFF ((uint32_t)0x00000000) /* The channel status and user bits are copied into the SPDIF_DR */
mbed_official 573:ad23fe03a082 244 #define SPDIFRX_CHANNELSTATUS_ON ((uint32_t)SPDIFRX_CR_CUMSK) /* The channel status and user bits are not copied into the SPDIF_DR, zeros are written instead*/
mbed_official 573:ad23fe03a082 245 /**
mbed_official 573:ad23fe03a082 246 * @}
mbed_official 573:ad23fe03a082 247 */
mbed_official 573:ad23fe03a082 248
mbed_official 573:ad23fe03a082 249 /** @defgroup SPDIFRX_V_Mask SPDIFRX Validity Mask
mbed_official 573:ad23fe03a082 250 * @{
mbed_official 573:ad23fe03a082 251 */
mbed_official 573:ad23fe03a082 252 #define SPDIFRX_VALIDITYMASK_OFF ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 253 #define SPDIFRX_VALIDITYMASK_ON ((uint32_t)SPDIFRX_CR_VMSK)
mbed_official 573:ad23fe03a082 254 /**
mbed_official 573:ad23fe03a082 255 * @}
mbed_official 573:ad23fe03a082 256 */
mbed_official 573:ad23fe03a082 257
mbed_official 573:ad23fe03a082 258 /** @defgroup SPDIFRX_PE_Mask SPDIFRX Parity Error Mask
mbed_official 573:ad23fe03a082 259 * @{
mbed_official 573:ad23fe03a082 260 */
mbed_official 573:ad23fe03a082 261 #define SPDIFRX_PARITYERRORMASK_OFF ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 262 #define SPDIFRX_PARITYERRORMASK_ON ((uint32_t)SPDIFRX_CR_PMSK)
mbed_official 573:ad23fe03a082 263 /**
mbed_official 573:ad23fe03a082 264 * @}
mbed_official 573:ad23fe03a082 265 */
mbed_official 573:ad23fe03a082 266
mbed_official 573:ad23fe03a082 267 /** @defgroup SPDIFRX_Channel_Selection SPDIFRX Channel Selection
mbed_official 573:ad23fe03a082 268 * @{
mbed_official 573:ad23fe03a082 269 */
mbed_official 573:ad23fe03a082 270 #define SPDIFRX_CHANNEL_A ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 271 #define SPDIFRX_CHANNEL_B ((uint32_t)SPDIFRX_CR_CHSEL)
mbed_official 573:ad23fe03a082 272 /**
mbed_official 573:ad23fe03a082 273 * @}
mbed_official 573:ad23fe03a082 274 */
mbed_official 573:ad23fe03a082 275
mbed_official 573:ad23fe03a082 276 /** @defgroup SPDIFRX_Data_Format SPDIFRX Data Format
mbed_official 573:ad23fe03a082 277 * @{
mbed_official 573:ad23fe03a082 278 */
mbed_official 573:ad23fe03a082 279 #define SPDIFRX_DATAFORMAT_LSB ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 280 #define SPDIFRX_DATAFORMAT_MSB ((uint32_t)0x00000010)
mbed_official 573:ad23fe03a082 281 #define SPDIFRX_DATAFORMAT_32BITS ((uint32_t)0x00000020)
mbed_official 573:ad23fe03a082 282 /**
mbed_official 573:ad23fe03a082 283 * @}
mbed_official 573:ad23fe03a082 284 */
mbed_official 573:ad23fe03a082 285
mbed_official 573:ad23fe03a082 286 /** @defgroup SPDIFRX_Stereo_Mode SPDIFRX Stereo Mode
mbed_official 573:ad23fe03a082 287 * @{
mbed_official 573:ad23fe03a082 288 */
mbed_official 573:ad23fe03a082 289 #define SPDIFRX_STEREOMODE_DISABLE ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 290 #define SPDIFRX_STEREOMODE_ENABLE ((uint32_t)SPDIFRX_CR_RXSTEO)
mbed_official 573:ad23fe03a082 291 /**
mbed_official 573:ad23fe03a082 292 * @}
mbed_official 573:ad23fe03a082 293 */
mbed_official 573:ad23fe03a082 294
mbed_official 573:ad23fe03a082 295 /** @defgroup SPDIFRX_State SPDIFRX State
mbed_official 573:ad23fe03a082 296 * @{
mbed_official 573:ad23fe03a082 297 */
mbed_official 573:ad23fe03a082 298
mbed_official 573:ad23fe03a082 299 #define SPDIFRX_STATE_IDLE ((uint32_t)0xFFFFFFFC)
mbed_official 573:ad23fe03a082 300 #define SPDIFRX_STATE_SYNC ((uint32_t)0x00000001)
mbed_official 573:ad23fe03a082 301 #define SPDIFRX_STATE_RCV ((uint32_t)SPDIFRX_CR_SPDIFEN)
mbed_official 573:ad23fe03a082 302 /**
mbed_official 573:ad23fe03a082 303 * @}
mbed_official 573:ad23fe03a082 304 */
mbed_official 573:ad23fe03a082 305
mbed_official 573:ad23fe03a082 306 /** @defgroup SPDIFRX_Interrupts_Definition SPDIFRX Interrupts Definition
mbed_official 573:ad23fe03a082 307 * @{
mbed_official 573:ad23fe03a082 308 */
mbed_official 573:ad23fe03a082 309 #define SPDIFRX_IT_RXNE ((uint32_t)SPDIFRX_IMR_RXNEIE)
mbed_official 573:ad23fe03a082 310 #define SPDIFRX_IT_CSRNE ((uint32_t)SPDIFRX_IMR_CSRNEIE)
mbed_official 573:ad23fe03a082 311 #define SPDIFRX_IT_PERRIE ((uint32_t)SPDIFRX_IMR_PERRIE)
mbed_official 573:ad23fe03a082 312 #define SPDIFRX_IT_OVRIE ((uint32_t)SPDIFRX_IMR_OVRIE)
mbed_official 573:ad23fe03a082 313 #define SPDIFRX_IT_SBLKIE ((uint32_t)SPDIFRX_IMR_SBLKIE)
mbed_official 573:ad23fe03a082 314 #define SPDIFRX_IT_SYNCDIE ((uint32_t)SPDIFRX_IMR_SYNCDIE)
mbed_official 573:ad23fe03a082 315 #define SPDIFRX_IT_IFEIE ((uint32_t)SPDIFRX_IMR_IFEIE )
mbed_official 573:ad23fe03a082 316 /**
mbed_official 573:ad23fe03a082 317 * @}
mbed_official 573:ad23fe03a082 318 */
mbed_official 573:ad23fe03a082 319
mbed_official 573:ad23fe03a082 320 /** @defgroup SPDIFRX_Flags_Definition SPDIFRX Flags Definition
mbed_official 573:ad23fe03a082 321 * @{
mbed_official 573:ad23fe03a082 322 */
mbed_official 573:ad23fe03a082 323 #define SPDIFRX_FLAG_RXNE ((uint32_t)SPDIFRX_SR_RXNE)
mbed_official 573:ad23fe03a082 324 #define SPDIFRX_FLAG_CSRNE ((uint32_t)SPDIFRX_SR_CSRNE)
mbed_official 573:ad23fe03a082 325 #define SPDIFRX_FLAG_PERR ((uint32_t)SPDIFRX_SR_PERR)
mbed_official 573:ad23fe03a082 326 #define SPDIFRX_FLAG_OVR ((uint32_t)SPDIFRX_SR_OVR)
mbed_official 573:ad23fe03a082 327 #define SPDIFRX_FLAG_SBD ((uint32_t)SPDIFRX_SR_SBD)
mbed_official 573:ad23fe03a082 328 #define SPDIFRX_FLAG_SYNCD ((uint32_t)SPDIFRX_SR_SYNCD)
mbed_official 573:ad23fe03a082 329 #define SPDIFRX_FLAG_FERR ((uint32_t)SPDIFRX_SR_FERR)
mbed_official 573:ad23fe03a082 330 #define SPDIFRX_FLAG_SERR ((uint32_t)SPDIFRX_SR_SERR)
mbed_official 573:ad23fe03a082 331 #define SPDIFRX_FLAG_TERR ((uint32_t)SPDIFRX_SR_TERR)
mbed_official 573:ad23fe03a082 332 /**
mbed_official 573:ad23fe03a082 333 * @}
mbed_official 573:ad23fe03a082 334 */
mbed_official 573:ad23fe03a082 335
mbed_official 573:ad23fe03a082 336 /**
mbed_official 573:ad23fe03a082 337 * @}
mbed_official 573:ad23fe03a082 338 */
mbed_official 573:ad23fe03a082 339
mbed_official 573:ad23fe03a082 340 /* Exported macros -----------------------------------------------------------*/
mbed_official 573:ad23fe03a082 341 /** @defgroup SPDIFRX_Exported_macros SPDIFRX Exported Macros
mbed_official 573:ad23fe03a082 342 * @{
mbed_official 573:ad23fe03a082 343 */
mbed_official 573:ad23fe03a082 344
mbed_official 573:ad23fe03a082 345 /** @brief Reset SPDIFRX handle state
mbed_official 573:ad23fe03a082 346 * @param __HANDLE__: SPDIFRX handle.
mbed_official 573:ad23fe03a082 347 * @retval None
mbed_official 573:ad23fe03a082 348 */
mbed_official 573:ad23fe03a082 349 #define __HAL_SPDIFRX_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = (uint16_t)SPDIFRX_CR_SPDIFEN)
mbed_official 573:ad23fe03a082 350
mbed_official 573:ad23fe03a082 351 /** @brief Disable the specified SPDIFRX peripheral (IDLE State).
mbed_official 573:ad23fe03a082 352 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 353 * @retval None
mbed_official 573:ad23fe03a082 354 */
mbed_official 573:ad23fe03a082 355 #define __HAL_SPDIFRX_IDLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= SPDIFRX_STATE_IDLE)
mbed_official 573:ad23fe03a082 356
mbed_official 573:ad23fe03a082 357 /** @brief Enable the specified SPDIFRX peripheral (SYNC State).
mbed_official 573:ad23fe03a082 358 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 359 * @retval None
mbed_official 573:ad23fe03a082 360 */
mbed_official 573:ad23fe03a082 361 #define __HAL_SPDIFRX_SYNC(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_SYNC)
mbed_official 573:ad23fe03a082 362
mbed_official 573:ad23fe03a082 363
mbed_official 573:ad23fe03a082 364 /** @brief Enable the specified SPDIFRX peripheral (RCV State).
mbed_official 573:ad23fe03a082 365 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 366 * @retval None
mbed_official 573:ad23fe03a082 367 */
mbed_official 573:ad23fe03a082 368 #define __HAL_SPDIFRX_RCV(__HANDLE__) ((__HANDLE__)->Instance->CR |= SPDIFRX_STATE_RCV)
mbed_official 573:ad23fe03a082 369
mbed_official 573:ad23fe03a082 370
mbed_official 573:ad23fe03a082 371 /** @brief Enable or disable the specified SPDIFRX interrupts.
mbed_official 573:ad23fe03a082 372 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 373 * @param __INTERRUPT__: specifies the interrupt source to enable or disable.
mbed_official 573:ad23fe03a082 374 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 375 * @arg SPDIFRX_IT_RXNE
mbed_official 573:ad23fe03a082 376 * @arg SPDIFRX_IT_CSRNE
mbed_official 573:ad23fe03a082 377 * @arg SPDIFRX_IT_PERRIE
mbed_official 573:ad23fe03a082 378 * @arg SPDIFRX_IT_OVRIE
mbed_official 573:ad23fe03a082 379 * @arg SPDIFRX_IT_SBLKIE
mbed_official 573:ad23fe03a082 380 * @arg SPDIFRX_IT_SYNCDIE
mbed_official 573:ad23fe03a082 381 * @arg SPDIFRX_IT_IFEIE
mbed_official 573:ad23fe03a082 382 * @retval None
mbed_official 573:ad23fe03a082 383 */
mbed_official 573:ad23fe03a082 384 #define __HAL_SPDIFRX_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__))
mbed_official 573:ad23fe03a082 385 #define __HAL_SPDIFRX_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR &= (uint16_t)(~(__INTERRUPT__)))
mbed_official 573:ad23fe03a082 386
mbed_official 573:ad23fe03a082 387 /** @brief Checks if the specified SPDIFRX interrupt source is enabled or disabled.
mbed_official 573:ad23fe03a082 388 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 389 * @param __INTERRUPT__: specifies the SPDIFRX interrupt source to check.
mbed_official 573:ad23fe03a082 390 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 391 * @arg SPDIFRX_IT_RXNE
mbed_official 573:ad23fe03a082 392 * @arg SPDIFRX_IT_CSRNE
mbed_official 573:ad23fe03a082 393 * @arg SPDIFRX_IT_PERRIE
mbed_official 573:ad23fe03a082 394 * @arg SPDIFRX_IT_OVRIE
mbed_official 573:ad23fe03a082 395 * @arg SPDIFRX_IT_SBLKIE
mbed_official 573:ad23fe03a082 396 * @arg SPDIFRX_IT_SYNCDIE
mbed_official 573:ad23fe03a082 397 * @arg SPDIFRX_IT_IFEIE
mbed_official 573:ad23fe03a082 398 * @retval The new state of __IT__ (TRUE or FALSE).
mbed_official 573:ad23fe03a082 399 */
mbed_official 573:ad23fe03a082 400 #define __HAL_SPDIFRX_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
mbed_official 573:ad23fe03a082 401
mbed_official 573:ad23fe03a082 402 /** @brief Checks whether the specified SPDIFRX flag is set or not.
mbed_official 573:ad23fe03a082 403 * @param __HANDLE__: specifies the SPDIFRX Handle.
mbed_official 573:ad23fe03a082 404 * @param __FLAG__: specifies the flag to check.
mbed_official 573:ad23fe03a082 405 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 406 * @arg SPDIFRX_FLAG_RXNE
mbed_official 573:ad23fe03a082 407 * @arg SPDIFRX_FLAG_CSRNE
mbed_official 573:ad23fe03a082 408 * @arg SPDIFRX_FLAG_PERR
mbed_official 573:ad23fe03a082 409 * @arg SPDIFRX_FLAG_OVR
mbed_official 573:ad23fe03a082 410 * @arg SPDIFRX_FLAG_SBD
mbed_official 573:ad23fe03a082 411 * @arg SPDIFRX_FLAG_SYNCD
mbed_official 573:ad23fe03a082 412 * @arg SPDIFRX_FLAG_FERR
mbed_official 573:ad23fe03a082 413 * @arg SPDIFRX_FLAG_SERR
mbed_official 573:ad23fe03a082 414 * @arg SPDIFRX_FLAG_TERR
mbed_official 573:ad23fe03a082 415 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 573:ad23fe03a082 416 */
mbed_official 573:ad23fe03a082 417 #define __HAL_SPDIFRX_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
mbed_official 573:ad23fe03a082 418
mbed_official 573:ad23fe03a082 419 /** @brief Clears the specified SPDIFRX SR flag, in setting the proper IFCR register bit.
mbed_official 573:ad23fe03a082 420 * @param __HANDLE__: specifies the USART Handle.
mbed_official 573:ad23fe03a082 421 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
mbed_official 573:ad23fe03a082 422 * to clear the corresponding interrupt
mbed_official 573:ad23fe03a082 423 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 424 * @arg SPDIFRX_FLAG_PERR
mbed_official 573:ad23fe03a082 425 * @arg SPDIFRX_FLAG_OVR
mbed_official 573:ad23fe03a082 426 * @arg SPDIFRX_SR_SBD
mbed_official 573:ad23fe03a082 427 * @arg SPDIFRX_SR_SYNCD
mbed_official 573:ad23fe03a082 428 * @retval None
mbed_official 573:ad23fe03a082 429 */
mbed_official 573:ad23fe03a082 430 #define __HAL_SPDIFRX_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->IFCR = (uint32_t)(__IT_CLEAR__))
mbed_official 573:ad23fe03a082 431
mbed_official 573:ad23fe03a082 432 /**
mbed_official 573:ad23fe03a082 433 * @}
mbed_official 573:ad23fe03a082 434 */
mbed_official 573:ad23fe03a082 435
mbed_official 573:ad23fe03a082 436 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 437 /** @addtogroup SPDIFRX_Exported_Functions
mbed_official 573:ad23fe03a082 438 * @{
mbed_official 573:ad23fe03a082 439 */
mbed_official 573:ad23fe03a082 440
mbed_official 573:ad23fe03a082 441 /** @addtogroup SPDIFRX_Exported_Functions_Group1
mbed_official 573:ad23fe03a082 442 * @{
mbed_official 573:ad23fe03a082 443 */
mbed_official 573:ad23fe03a082 444 /* Initialization/de-initialization functions **********************************/
mbed_official 573:ad23fe03a082 445 HAL_StatusTypeDef HAL_SPDIFRX_Init(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 446 HAL_StatusTypeDef HAL_SPDIFRX_DeInit (SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 447 void HAL_SPDIFRX_MspInit(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 448 void HAL_SPDIFRX_MspDeInit(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 449 HAL_StatusTypeDef HAL_SPDIFRX_SetDataFormat(SPDIFRX_HandleTypeDef *hspdif, SPDIFRX_SetDataFormatTypeDef sDataFormat);
mbed_official 573:ad23fe03a082 450 /**
mbed_official 573:ad23fe03a082 451 * @}
mbed_official 573:ad23fe03a082 452 */
mbed_official 573:ad23fe03a082 453
mbed_official 573:ad23fe03a082 454 /** @addtogroup SPDIFRX_Exported_Functions_Group2
mbed_official 573:ad23fe03a082 455 * @{
mbed_official 573:ad23fe03a082 456 */
mbed_official 573:ad23fe03a082 457 /* I/O operation functions ***************************************************/
mbed_official 573:ad23fe03a082 458 /* Blocking mode: Polling */
mbed_official 573:ad23fe03a082 459 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout);
mbed_official 573:ad23fe03a082 460 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size, uint32_t Timeout);
mbed_official 573:ad23fe03a082 461
mbed_official 573:ad23fe03a082 462 /* Non-Blocking mode: Interrupt */
mbed_official 573:ad23fe03a082 463 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
mbed_official 573:ad23fe03a082 464 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_IT(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
mbed_official 573:ad23fe03a082 465 void HAL_SPDIFRX_IRQHandler(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 466
mbed_official 573:ad23fe03a082 467 /* Non-Blocking mode: DMA */
mbed_official 573:ad23fe03a082 468 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveControlFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
mbed_official 573:ad23fe03a082 469 HAL_StatusTypeDef HAL_SPDIFRX_ReceiveDataFlow_DMA(SPDIFRX_HandleTypeDef *hspdif, uint32_t *pData, uint16_t Size);
mbed_official 573:ad23fe03a082 470
mbed_official 573:ad23fe03a082 471 HAL_StatusTypeDef HAL_SPDIFRX_DMAStop(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 472
mbed_official 573:ad23fe03a082 473 /* Callbacks used in non blocking modes (Interrupt and DMA) *******************/
mbed_official 573:ad23fe03a082 474 void HAL_SPDIFRX_RxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 475 void HAL_SPDIFRX_RxCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 476 void HAL_SPDIFRX_ErrorCallback(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 477 void HAL_SPDIFRX_CxHalfCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 478 void HAL_SPDIFRX_CxCpltCallback(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 479 /**
mbed_official 573:ad23fe03a082 480 * @}
mbed_official 573:ad23fe03a082 481 */
mbed_official 573:ad23fe03a082 482
mbed_official 573:ad23fe03a082 483 /** @addtogroup SPDIFRX_Exported_Functions_Group3
mbed_official 573:ad23fe03a082 484 * @{
mbed_official 573:ad23fe03a082 485 */
mbed_official 573:ad23fe03a082 486 /* Peripheral Control and State functions ************************************/
mbed_official 573:ad23fe03a082 487 HAL_SPDIFRX_StateTypeDef HAL_SPDIFRX_GetState(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 488 uint32_t HAL_SPDIFRX_GetError(SPDIFRX_HandleTypeDef *hspdif);
mbed_official 573:ad23fe03a082 489 /**
mbed_official 573:ad23fe03a082 490 * @}
mbed_official 573:ad23fe03a082 491 */
mbed_official 573:ad23fe03a082 492
mbed_official 573:ad23fe03a082 493 /**
mbed_official 573:ad23fe03a082 494 * @}
mbed_official 573:ad23fe03a082 495 */
mbed_official 573:ad23fe03a082 496 /* Private types -------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 497 /* Private variables ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 498 /* Private constants ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 499 /* Private macros ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 500 /** @defgroup SPDIFRX_Private_Macros SPDIFRX Private Macros
mbed_official 573:ad23fe03a082 501 * @{
mbed_official 573:ad23fe03a082 502 */
mbed_official 573:ad23fe03a082 503 #define IS_SPDIFRX_INPUT_SELECT(INPUT) (((INPUT) == SPDIFRX_INPUT_IN1) || \
mbed_official 573:ad23fe03a082 504 ((INPUT) == SPDIFRX_INPUT_IN2) || \
mbed_official 573:ad23fe03a082 505 ((INPUT) == SPDIFRX_INPUT_IN3) || \
mbed_official 573:ad23fe03a082 506 ((INPUT) == SPDIFRX_INPUT_IN0))
mbed_official 573:ad23fe03a082 507 #define IS_SPDIFRX_MAX_RETRIES(RET) (((RET) == SPDIFRX_MAXRETRIES_NONE) || \
mbed_official 573:ad23fe03a082 508 ((RET) == SPDIFRX_MAXRETRIES_3) || \
mbed_official 573:ad23fe03a082 509 ((RET) == SPDIFRX_MAXRETRIES_15) || \
mbed_official 573:ad23fe03a082 510 ((RET) == SPDIFRX_MAXRETRIES_63))
mbed_official 573:ad23fe03a082 511 #define IS_SPDIFRX_WAIT_FOR_ACTIVITY(VAL) (((VAL) == SPDIFRX_WAITFORACTIVITY_ON) || \
mbed_official 573:ad23fe03a082 512 ((VAL) == SPDIFRX_WAITFORACTIVITY_OFF))
mbed_official 573:ad23fe03a082 513 #define IS_PREAMBLE_TYPE_MASK(VAL) (((VAL) == SPDIFRX_PREAMBLETYPEMASK_ON) || \
mbed_official 573:ad23fe03a082 514 ((VAL) == SPDIFRX_PREAMBLETYPEMASK_OFF))
mbed_official 573:ad23fe03a082 515 #define IS_VALIDITY_MASK(VAL) (((VAL) == SPDIFRX_VALIDITYMASK_OFF) || \
mbed_official 573:ad23fe03a082 516 ((VAL) == SPDIFRX_VALIDITYMASK_ON))
mbed_official 573:ad23fe03a082 517 #define IS_PARITY_ERROR_MASK(VAL) (((VAL) == SPDIFRX_PARITYERRORMASK_OFF) || \
mbed_official 573:ad23fe03a082 518 ((VAL) == SPDIFRX_PARITYERRORMASK_ON))
mbed_official 573:ad23fe03a082 519 #define IS_SPDIFRX_CHANNEL(CHANNEL) (((CHANNEL) == SPDIFRX_CHANNEL_A) || \
mbed_official 573:ad23fe03a082 520 ((CHANNEL) == SPDIFRX_CHANNEL_B))
mbed_official 573:ad23fe03a082 521 #define IS_SPDIFRX_DATA_FORMAT(FORMAT) (((FORMAT) == SPDIFRX_DATAFORMAT_LSB) || \
mbed_official 573:ad23fe03a082 522 ((FORMAT) == SPDIFRX_DATAFORMAT_MSB) || \
mbed_official 573:ad23fe03a082 523 ((FORMAT) == SPDIFRX_DATAFORMAT_32BITS))
mbed_official 573:ad23fe03a082 524 #define IS_STEREO_MODE(MODE) (((MODE) == SPDIFRX_STEREOMODE_DISABLE) || \
mbed_official 573:ad23fe03a082 525 ((MODE) == SPDIFRX_STEREOMODE_ENABLE))
mbed_official 573:ad23fe03a082 526
mbed_official 573:ad23fe03a082 527 #define IS_CHANNEL_STATUS_MASK(VAL) (((VAL) == SPDIFRX_CHANNELSTATUS_ON) || \
mbed_official 573:ad23fe03a082 528 ((VAL) == SPDIFRX_CHANNELSTATUS_OFF))
mbed_official 573:ad23fe03a082 529 /**
mbed_official 573:ad23fe03a082 530 * @}
mbed_official 573:ad23fe03a082 531 */
mbed_official 573:ad23fe03a082 532
mbed_official 573:ad23fe03a082 533 /* Private functions ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 534 /** @defgroup SPDIFRX_Private_Functions SPDIFRX Private Functions
mbed_official 573:ad23fe03a082 535 * @{
mbed_official 573:ad23fe03a082 536 */
mbed_official 573:ad23fe03a082 537 /**
mbed_official 573:ad23fe03a082 538 * @}
mbed_official 573:ad23fe03a082 539 */
mbed_official 573:ad23fe03a082 540
mbed_official 573:ad23fe03a082 541 /**
mbed_official 573:ad23fe03a082 542 * @}
mbed_official 573:ad23fe03a082 543 */
mbed_official 573:ad23fe03a082 544
mbed_official 573:ad23fe03a082 545 /**
mbed_official 573:ad23fe03a082 546 * @}
mbed_official 573:ad23fe03a082 547 */
mbed_official 573:ad23fe03a082 548
mbed_official 573:ad23fe03a082 549 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 550 }
mbed_official 573:ad23fe03a082 551 #endif
mbed_official 573:ad23fe03a082 552
mbed_official 573:ad23fe03a082 553
mbed_official 573:ad23fe03a082 554 #endif /* __STM32F7xx_HAL_SPDIFRX_H */
mbed_official 573:ad23fe03a082 555
mbed_official 573:ad23fe03a082 556 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/