Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Jun 09 14:29:26 2015 +0100
Revision:
101:7cff1c4259d7
Child:
106:ba1f97679dad
Release 101 of the mbed library

Changes:
- new platform: APPNEARME_MICRONFCBOARD, MTS_DRAGONFLY_F411RE, MAX32600MBED, WIZwiki_W7500
- Silabs memory optimization in gpio, pwm fixes
- SPI - ssel documentation fixes and its use

Who changed what in which revision?

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