cc y / mbed

Fork of mbed by mbed official

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