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