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:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

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