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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Thu Oct 27 16:45:56 2016 +0100
Revision:
128:9bcdf88f62b0
Parent:
TARGET_NUCLEO_F429ZI/stm32f4xx_hal_spdifrx.h@122:f9eeca106725
Child:
145:64910690c574
Release 128 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

2966: Add kw24 support https://github.com/ARMmbed/mbed-os/pull/2966
3068: MultiTech mDot - clean up PeripheralPins.c and add new pin names https://github.com/ARMmbed/mbed-os/pull/3068
3089: Kinetis HAL: Remove clock initialization code from serial and ticker https://github.com/ARMmbed/mbed-os/pull/3089
2943: [NRF5] NVIC_SetVector functionality https://github.com/ARMmbed/mbed-os/pull/2943
2938: InterruptIn changes in NCS36510 HAL. https://github.com/ARMmbed/mbed-os/pull/2938
3108: Fix sleep function for NRF52. https://github.com/ARMmbed/mbed-os/pull/3108
3076: STM32F1: Correct timer master value reading https://github.com/ARMmbed/mbed-os/pull/3076
3085: Add LOWPOWERTIMER capability for NUCLEO_F303ZE https://github.com/ARMmbed/mbed-os/pull/3085
3046: [BEETLE] Update BLE stack on Beetle board https://github.com/ARMmbed/mbed-os/pull/3046
3122: [Silicon Labs] Update of Silicon Labs HAL https://github.com/ARMmbed/mbed-os/pull/3122
3022: OnSemi RAM usage fix https://github.com/ARMmbed/mbed-os/pull/3022
3121: STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH https://github.com/ARMmbed/mbed-os/pull/3121
3142: Targets- NUMAKER_PFM_NUC47216 remove mbed 2 https://github.com/ARMmbed/mbed-os/pull/3142

Who changed what in which revision?

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