mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
116:c0f6e94411f5
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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